/* ============================================================
   Worklino Design System
   Prefix: wl-
   Base: Bootstrap 5
   ============================================================ */

/* ----- CSS Variables ----- */
:root {
    --wl-primary:       #1565C0;
    --wl-primary-light: #1E88E5;
    --wl-primary-dark:  #0D47A1;
    --wl-accent:        #00BCD4;
    --wl-accent-light:  #26C6DA;
    --wl-text-dark:     #1A2B4A;
    --wl-text-muted:    #6B7A90;
    --wl-gradient:      linear-gradient(135deg, #1565C0, #00BCD4);
    --wl-bg:            #F5F7FA;
    --wl-surface:       #FFFFFF;
    --wl-border:        #E0E7EF;
    --wl-success:       #2E7D32;
    --wl-warning:       #F57C00;
    --wl-danger:        #C62828;

    --wl-sidebar-width: 220px;
    --wl-header-height: 56px;
    --wl-bottombar-height: 64px;
    --wl-card-radius: 12px;
    --wl-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ----- Base ----- */
html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--wl-text-dark);
    background-color: var(--wl-bg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ----- Loading Screen ----- */
.wl-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--wl-bg);
}

.wl-loading-logo {
    width: 120px;
    height: auto;
}

/* ----- App Shell ----- */
.wl-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ----- Header ----- */
.wl-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--wl-header-height);
    background: var(--wl-surface);
    border-bottom: 1px solid var(--wl-border);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1030;
}

.wl-header-logo {
    height: 32px;
    width: auto;
}

.wl-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--wl-text-dark);
    margin-left: 0.75rem;
}

.wl-header-org {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin-left: auto;
    margin-right: 0.5rem;
    font-weight: 500;
}

/* ----- Desktop Sidebar ----- */
.wl-sidebar {
    position: fixed;
    top: var(--wl-header-height);
    left: 0;
    bottom: 0;
    width: var(--wl-sidebar-width);
    background: var(--wl-surface);
    border-right: 1px solid var(--wl-border);
    padding: 1rem 0;
    overflow-y: auto;
    z-index: 1020;
    display: none;
}

.wl-sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wl-sidebar-item {
    display: block;
}

.wl-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: var(--wl-text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.wl-sidebar-link:hover {
    background: var(--wl-bg);
    color: var(--wl-primary);
}

.wl-sidebar-link.active {
    color: var(--wl-primary);
    background: rgba(21, 101, 192, 0.08);
    border-right: 3px solid var(--wl-primary);
    font-weight: 600;
}

.wl-sidebar-link i {
    font-size: 1.2rem;
    width: 1.5rem;
    text-align: center;
}

.wl-sidebar-org {
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wl-text-muted);
    border-bottom: 1px solid var(--wl-border);
    margin-bottom: 0.5rem;
}

.wl-sidebar-section {
    padding: 1.25rem 1.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wl-text-muted);
}

/* ----- Main Content ----- */
.wl-main {
    margin-top: var(--wl-header-height);
    padding: 1rem;
    padding-bottom: calc(var(--wl-bottombar-height) + 1.5rem);
    min-height: calc(100vh - var(--wl-header-height));
    display: flex;
    flex-direction: column;
}

/* ----- Mobile Bottom Tab Bar ----- */
.wl-bottombar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--wl-bottombar-height);
    background: var(--wl-surface);
    border-top: 1px solid var(--wl-border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.wl-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--wl-text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    flex: 1;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.wl-tab i {
    font-size: 1.35rem;
    margin-bottom: 0.15rem;
}

.wl-tab:hover,
.wl-tab.active {
    color: var(--wl-primary);
}

.wl-tab.active i {
    font-weight: 700;
}

/* ----- FAB (center tab) ----- */
.wl-fab-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wl-fab {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--wl-gradient);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.35);
    margin-top: -20px;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.wl-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(21, 101, 192, 0.45);
}

.wl-fab:active {
    transform: scale(0.95);
}

/* ----- Action Sheet (Offcanvas bottom) ----- */
.wl-action-sheet .offcanvas-body {
    padding: 0.5rem 0 1rem;
}

.wl-action-sheet .offcanvas-header {
    border-bottom: 1px solid var(--wl-border);
    padding: 1rem 1.25rem;
}

.wl-action-sheet .offcanvas-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.wl-action-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wl-action-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    color: var(--wl-text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.12s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.wl-action-item:hover {
    background: var(--wl-bg);
}

.wl-action-item i {
    font-size: 1.3rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
}

.wl-action-icon-photo    { background: var(--wl-primary); }
.wl-action-icon-note     { background: var(--wl-accent); }
.wl-action-icon-voice    { background: var(--wl-warning); }
.wl-action-icon-file     { background: var(--wl-success); }
.wl-action-icon-offer    { background: var(--wl-primary-dark); }

/* ----- Cards ----- */
.wl-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    padding: 1.25rem;
    box-shadow: var(--wl-shadow);
}

/* ----- List Cards (clickable items) ----- */
.wl-list-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    box-shadow: var(--wl-shadow);
    text-decoration: none;
    color: var(--wl-text-dark);
    transition: box-shadow 0.15s, border-color 0.15s;
    cursor: pointer;
    margin-bottom: 0.6rem;
}

.wl-list-card:hover {
    border-color: var(--wl-primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    color: var(--wl-text-dark);
}

/* Avatar initials circle */
.wl-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wl-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.wl-list-card-body {
    flex: 1;
    min-width: 0;
}

.wl-list-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-list-card-sub {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wl-list-card-chevron {
    color: var(--wl-border);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ----- Search bar ----- */
.wl-search {
    position: relative;
    margin-bottom: 1rem;
}

.wl-search input {
    padding-left: 2.5rem;
    border-radius: var(--wl-card-radius);
    border: 1px solid var(--wl-border);
    background: var(--wl-surface);
    height: 42px;
}

.wl-search input:focus {
    border-color: var(--wl-primary-light);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.wl-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wl-text-muted);
}

/* ----- Page header with action ----- */
.wl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.wl-page-header .btn {
    white-space: nowrap;
}

/* ----- Page header ----- */
.wl-page-header {
    margin-bottom: 1.25rem;
}

.wl-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--wl-text-dark);
    margin: 0;
}

/* ----- Badges ----- */
.wl-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.wl-badge-primary {
    background: rgba(21, 101, 192, 0.1);
    color: var(--wl-primary);
}

.wl-badge-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--wl-success);
}

.wl-badge-warning {
    background: rgba(245, 124, 0, 0.1);
    color: var(--wl-warning);
}

.wl-badge-danger {
    background: rgba(198, 40, 40, 0.1);
    color: var(--wl-danger);
}

/* ----- Empty State ----- */
.wl-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--wl-text-muted);
}

.wl-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.wl-empty-state p {
    font-size: 0.95rem;
}

/* ----- Auth Layout (no nav, centered) ----- */
.wl-auth-shell {
    min-height: 100vh;
    background: var(--wl-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.wl-auth-logo {
    display: block;
    margin: 0 auto 1rem;
    width: 72px;
    height: auto;
}

.wl-auth-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wl-text-dark);
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.wl-auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--wl-text-muted);
    margin-bottom: 1.5rem;
}

.wl-auth-card {
    background: var(--wl-surface);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    width: 100%;
    min-width: 400px;
    max-width: 460px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.wl-auth-card .form-label {
    white-space: nowrap;
    font-weight: 500;
    font-size: 0.9rem;
}

.wl-auth-card .form-control {
    width: 100%;
}

.wl-auth-card .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.wl-auth-card .form-check-input {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.wl-auth-card .form-check-label {
    font-size: 0.88rem;
    line-height: 1.4;
}

.wl-auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.88rem;
}

.wl-auth-footer a {
    color: var(--wl-primary);
    font-weight: 500;
}

/* ----- Blazor Error UI ----- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ----- Form validation (Blazor) ----- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--wl-success);
}

.invalid {
    outline: 1px solid var(--wl-danger);
}

.validation-message {
    color: var(--wl-danger);
}

/* ============================================================
   Desktop breakpoint (>= 768px)
   ============================================================ */
@media (min-width: 768px) {
    .wl-sidebar {
        display: block;
    }

    .wl-main {
        margin-left: var(--wl-sidebar-width);
        padding: 1.5rem 2rem;
        padding-bottom: 2rem;
    }

    .wl-bottombar {
        display: none;
    }

    .wl-header {
        padding-left: 1.25rem;
    }
}

/* ============================================================
   Dashboard
   ============================================================ */

.wl-dashboard {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.wl-dashboard-header {
    margin-bottom: 1.5rem;
}

.wl-dashboard-greeting {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wl-text-dark);
    margin: 0 0 0.25rem 0;
}

.wl-dashboard-org {
    font-size: 1rem;
    color: var(--wl-text-muted);
    margin: 0;
}

.wl-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .wl-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wl-dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wl-card-activity {
        grid-column: span 2;
    }
}

/* --- Dashboard Cards --- */

.wl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.wl-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--wl-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.wl-card-link {
    font-size: 0.875rem;
    color: var(--wl-primary);
    text-decoration: none;
    font-weight: 500;
}

.wl-card-link:hover {
    text-decoration: underline;
}

.wl-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wl-card-stat {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--wl-text-dark);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.wl-card-sub {
    font-size: 1rem;
    color: var(--wl-text-muted);
    margin-bottom: 0.5rem;
}

.wl-card-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    width: fit-content;
}

.wl-card-badge-warning {
    background: #FFF4E5;
    color: var(--wl-warning);
}

/* --- Project List --- */

.wl-card-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.wl-card-list-item a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--wl-border);
    text-decoration: none;
    color: var(--wl-text-dark);
}

.wl-card-list-item:last-child a {
    border-bottom: none;
}

.wl-card-list-title {
    display: block;
    font-weight: 500;
}

.wl-card-list-sub {
    display: block;
    font-size: 0.875rem;
    color: var(--wl-text-muted);
}

/* --- Activity Feed --- */

.wl-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wl-activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--wl-border);
}

.wl-activity-item:last-child {
    border-bottom: none;
}

.wl-activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.wl-activity-content {
    flex: 1;
    min-width: 0;
}

.wl-activity-title {
    font-weight: 500;
    color: var(--wl-text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-activity-time {
    font-size: 0.75rem;
    color: var(--wl-text-muted);
}

/* --- Empty State --- */

.wl-empty-state {
    text-align: center;
    padding: 1rem 0;
    color: var(--wl-text-muted);
}

.wl-empty-state p {
    margin: 0 0 0.75rem 0;
}

/* --- Buttons --- */

.wl-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.wl-btn-primary {
    background: var(--wl-gradient);
    color: white;
}

.wl-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.2);
}

/* --- Skeleton --- */

.wl-skeleton-header {
    height: 2rem;
    width: 60%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: wl-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
}

.wl-skeleton-card {
    min-height: 180px;
    background: linear-gradient(90deg, #f8f9fa 25%, #e9ecef 50%, #f8f9fa 75%);
    background-size: 200% 100%;
    animation: wl-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes wl-skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Error Box --- */

.wl-error-box {
    text-align: center;
    padding: 2rem;
    background: #FFF4E5;
    border: 1px solid var(--wl-warning);
    border-radius: var(--wl-card-radius);
    color: var(--wl-text-dark);
}

/* ============================================================
   Settings Hub
   ============================================================ */

.wl-settings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--wl-border);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    overflow: hidden;
}

.wl-settings-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--wl-surface);
    text-decoration: none;
    color: var(--wl-text-dark);
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s;
}

.wl-settings-item:hover { background: #f8f9fa; }

.wl-settings-icon {
    font-size: 1.25rem;
    color: var(--wl-text-muted);
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wl-settings-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wl-settings-chevron {
    flex-shrink: 0;
    color: var(--wl-text-muted);
    font-size: 0.875rem;
}

.wl-settings-item-title { font-weight: 500; }

.wl-settings-item-sub {
    font-size: 0.8125rem;
    color: var(--wl-text-muted);
    margin-top: 0.125rem;
}

.wl-settings-item-danger { color: var(--wl-danger); }
.wl-settings-item-danger .wl-settings-icon { color: var(--wl-danger); }

/* ============================================================
   Forms
   ============================================================ */

.wl-form-group { margin-bottom: 1.25rem; }

.wl-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wl-text-dark);
    margin-bottom: 0.375rem;
}

.wl-form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    color: var(--wl-text-dark);
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: 0.5rem;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.wl-form-control:focus {
    outline: none;
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.1);
}

.wl-form-disabled {
    background: #f8f9fa;
    color: var(--wl-text-muted);
    cursor: not-allowed;
}

.wl-btn-outline {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--wl-border);
    border-radius: 0.5rem;
    background: var(--wl-surface);
    color: var(--wl-text-dark);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.wl-btn-outline:hover {
    border-color: var(--wl-primary);
    color: var(--wl-primary);
}

/* ============================================================
   Toasts
   ============================================================ */

.wl-toast-success {
    padding: 0.75rem 1rem;
    background: #E8F5E9;
    border: 1px solid var(--wl-success);
    border-radius: 0.5rem;
    color: var(--wl-success);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.wl-toast-error {
    padding: 0.75rem 1rem;
    background: #FFEBEE;
    border: 1px solid var(--wl-danger);
    border-radius: 0.5rem;
    color: var(--wl-danger);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ============================================================
   Profile
   ============================================================ */

.wl-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--wl-border);
}

.wl-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--wl-text-muted);
    border: 2px solid var(--wl-border);
}

.wl-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--wl-primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.wl-back-link:hover { text-decoration: underline; }

/* ============================================================
   Breadcrumb
   ============================================================ */

.wl-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--wl-text-muted);
    margin-bottom: 1rem;
}

.wl-breadcrumb-link {
    color: var(--wl-primary);
    text-decoration: none;
}

.wl-breadcrumb-link:hover { text-decoration: underline; }

.wl-breadcrumb-current {
    color: var(--wl-text-dark);
    font-weight: 500;
}

.wl-breadcrumb-separator { color: #adb5bd; }

/* ============================================================
   Members
   ============================================================ */

.wl-member-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wl-member-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
}

.wl-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wl-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wl-avatar-initials {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.wl-member-info {
    flex: 1;
    min-width: 0;
}

.wl-member-name {
    font-weight: 500;
    color: var(--wl-text-dark);
}

.wl-member-email {
    font-size: 0.8125rem;
    color: var(--wl-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-role-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    background: #E3F2FD;
    color: var(--wl-primary);
    margin-top: 0.25rem;
}

.wl-member-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.wl-role-select {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--wl-border);
    border-radius: 0.375rem;
    background: var(--wl-surface);
    color: var(--wl-text-dark);
    max-width: 140px;
}

.wl-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    cursor: pointer;
    color: var(--wl-text-muted);
    transition: all 0.15s;
}

.wl-btn-icon:hover { background: #f0f2f5; }

.wl-btn-icon-danger:hover {
    background: #FFEBEE;
    color: var(--wl-danger);
}

/* Responsive: stack member card on mobile */
@media (max-width: 639px) {
    .wl-member-card { flex-wrap: wrap; }
    .wl-member-actions { width: 100%; justify-content: flex-end; margin-top: 0.5rem; }
}

/* ============================================================
   Confirm Modal
   ============================================================ */

.wl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.wl-modal-card {
    background: var(--wl-surface);
    border-radius: var(--wl-card-radius);
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.wl-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.wl-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

.wl-btn-danger {
    background: var(--wl-danger);
    color: white;
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
}

.wl-btn-danger:hover {
    opacity: 0.9;
}

/* ─── Invitations ──────────────────────────────── */

.wl-invitation-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wl-invitation-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    padding: 16px 20px;
}

.wl-invitation-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wl-invitation-email {
    font-weight: 600;
    color: var(--wl-text-dark);
    font-size: 0.95rem;
}

.wl-invitation-meta {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin-top: 6px;
}

.wl-invitation-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.wl-invitation-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    display: inline-block;
}

.wl-invitation-status-aktiv {
    background: #E8F5E9;
    color: var(--wl-success);
}

.wl-invitation-status-verwendet {
    background: #E3F2FD;
    color: var(--wl-primary);
}

.wl-invitation-status-widerrufen {
    background: #FFF3E0;
    color: var(--wl-warning);
}

.wl-invitation-status-abgelaufen {
    background: #FAFAFA;
    color: #999;
}

.wl-btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.wl-btn-lg {
    padding: 12px 32px;
    font-size: 1rem;
}

/* Invitation accept page */

.wl-invitation-accept-wrapper {
    max-width: 560px;
    margin: 40px auto;
    padding: 0 16px;
}

.wl-invitation-accept {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    padding: 40px 32px;
}

.wl-invitation-message-box {
    background: var(--wl-bg);
    border-left: 4px solid var(--wl-primary);
    padding: 14px 18px;
    margin: 16px auto;
    max-width: 400px;
    text-align: left;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--wl-text-dark);
}

.wl-invitation-warning {
    background: #FFF3E0;
    border: 1px solid #FFE0B2;
    color: #E65100;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 16px;
}

/* ─── Projects ─────────────────────────────────── */

.wl-project-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .wl-project-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .wl-project-list-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.wl-project-card {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    padding: 18px 20px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.wl-project-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-color: var(--wl-primary-light);
}

.wl-project-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--wl-text-dark);
    margin-top: 10px;
}

.wl-project-card-customer {
    font-size: 0.85rem;
    color: var(--wl-text-muted);
    margin-top: 2px;
}

.wl-project-card-footer {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin-top: 14px;
    border-top: 1px solid var(--wl-border);
    padding-top: 10px;
}

/* Project status badges */

.wl-project-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wl-project-status-active {
    background: #E8F5E9;
    color: var(--wl-success);
}

.wl-project-status-draft {
    background: #FFF3E0;
    color: var(--wl-warning);
}

.wl-project-status-submitted {
    background: #E3F2FD;
    color: var(--wl-primary);
}

.wl-project-status-closed {
    background: #FAFAFA;
    color: #999;
}

/* Skeleton loading cards */

.wl-skeleton-card {
    cursor: default;
    pointer-events: none;
}

.wl-skeleton-line {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: wl-skeleton-shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes wl-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Filter bar */

.wl-filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.wl-filter-input {
    flex: 1;
    min-width: 160px;
    max-width: 280px;
    padding: 8px 12px;
    border: 1px solid var(--wl-border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--wl-surface);
    color: var(--wl-text-dark);
}

.wl-filter-input:focus {
    outline: none;
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.1);
}

.wl-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--wl-border);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--wl-surface);
    color: var(--wl-text-dark);
    min-width: 140px;
}

.wl-filter-select:focus {
    outline: none;
    border-color: var(--wl-primary);
}

.wl-filter-reset {
    background: none;
    border: none;
    color: var(--wl-primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    font-weight: 500;
}

.wl-filter-reset:hover {
    text-decoration: underline;
}

/* View mode toggle */

.wl-view-toggle {
    display: none;
    border: 1px solid var(--wl-border);
    border-radius: 8px;
    overflow: hidden;
}

@media (min-width: 768px) {
    .wl-view-toggle {
        display: flex;
    }
}

.wl-view-toggle-btn {
    border: none;
    background: var(--wl-surface);
    padding: 6px 12px;
    cursor: pointer;
    color: var(--wl-text-muted);
    font-size: 1rem;
    transition: background 0.15s, color 0.15s;
}

.wl-view-toggle-btn.active {
    background: var(--wl-primary);
    color: #fff;
}

.wl-view-toggle-btn:not(.active):hover {
    background: var(--wl-bg);
}

/* Table view */

.wl-project-table-wrap {
    display: none;
    overflow-x: auto;
}

@media (min-width: 768px) {
    .wl-project-table-wrap {
        display: block;
    }
}

.wl-project-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.wl-project-table th {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--wl-border);
    color: var(--wl-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wl-project-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--wl-border);
    vertical-align: middle;
}

.wl-project-table-row {
    cursor: pointer;
    transition: background 0.1s;
}

.wl-project-table-row:hover {
    background: var(--wl-bg);
}

.wl-project-table-title {
    font-weight: 600;
    color: var(--wl-text-dark);
}

/* Detail page */

.wl-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.wl-detail-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.wl-detail-meta {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin-top: 16px;
}

/* Edit form */

.wl-edit-form {
    max-width: 600px;
    margin-top: 16px;
}

/* ─── Modal extensions ─────────────────────────── */

.wl-modal-card-lg {
    max-width: 500px;
    padding: 0;
    max-height: 90vh;
    overflow-y: auto;
}

.wl-modal-header {
    padding: 1.25rem 1.5rem 0.5rem;
}

.wl-modal-hint {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin: 0.25rem 0 0;
}

.wl-modal-body {
    padding: 0.75rem 1.5rem;
}

.wl-modal-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Form row: PLZ + Ort side by side */

.wl-form-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0.75rem;
}

@media (max-width: 480px) {
    .wl-form-row {
        grid-template-columns: 1fr;
    }
}

/* Input + action button combo */

.wl-input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.wl-input-with-action .wl-form-control {
    flex: 1;
}

.wl-input-with-action .wl-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .wl-input-with-action {
        flex-direction: column;
    }
    .wl-input-with-action .wl-btn {
        align-self: flex-end;
    }
}

/* ─── Action Sheet ─────────────────────────────── */

.wl-action-sheet {
    background: var(--wl-surface);
    border-radius: var(--wl-card-radius);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

@media (max-width: 767px) {
    .wl-action-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        animation: wl-slide-up 0.25s ease-out;
    }
}

@keyframes wl-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.wl-action-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--wl-text-dark);
}

.wl-action-sheet-close {
    background: none;
    border: none;
    color: var(--wl-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}

.wl-action-sheet-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
    min-height: 56px;
}

.wl-action-sheet-item:hover {
    background: var(--wl-bg);
}

.wl-action-sheet-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.wl-action-sheet-label {
    display: flex;
    flex-direction: column;
}

.wl-action-sheet-label-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--wl-text-dark);
}

.wl-action-sheet-label-desc {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
}

/* ─── Timeline ─────────────────────────────────── */

.wl-timeline {
    margin-top: 24px;
}

.wl-timeline-empty {
    text-align: center;
    padding: 40px 16px;
    background: var(--wl-bg);
    border-radius: var(--wl-card-radius);
    border: 1px dashed var(--wl-border);
}

.wl-timeline-section {
    margin-bottom: 16px;
}

.wl-timeline-section-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--wl-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--wl-border);
}

.wl-timeline-entry {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-card-radius);
    padding: 16px;
    margin-bottom: 12px;
}

.wl-timeline-entry-pinned {
    border-left: 3px solid var(--wl-primary);
}

.wl-timeline-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.wl-timeline-entry-date {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
}

.wl-timeline-entry-author {
    margin-left: 8px;
    font-weight: 500;
}

.wl-timeline-entry-actions {
    display: flex;
    gap: 4px;
}

.wl-timeline-action-btn {
    background: none;
    border: none;
    color: var(--wl-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: color 0.15s, background 0.15s;
}

.wl-timeline-action-btn:hover {
    background: var(--wl-bg);
    color: var(--wl-text-dark);
}

.wl-timeline-action-btn.active {
    color: var(--wl-primary);
}

.wl-pin-icon {
    transition: transform 0.2s ease;
}

.wl-timeline-action-btn.active .wl-pin-icon {
    transform: rotate(45deg);
}

.wl-timeline-action-danger:hover {
    color: var(--wl-danger);
}

/* Timeline content types */

.wl-timeline-text-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.wl-timeline-text-body {
    line-height: 1.6;
    color: var(--wl-text-dark);
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.wl-timeline-toggle {
    background: none;
    border: none;
    color: var(--wl-primary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 0;
    font-weight: 500;
}

.wl-timeline-toggle:hover {
    text-decoration: underline;
}

/* Image */

.wl-timeline-image-preview {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.wl-timeline-image-preview:hover {
    opacity: 0.9;
}

.wl-timeline-image-caption {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
    margin-top: 6px;
}

/* Lightbox */

.wl-image-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 16px;
    cursor: pointer;
}

.wl-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.wl-lightbox-image {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

/* File */

.wl-timeline-file {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wl-timeline-file-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.wl-timeline-file-info {
    flex: 1;
    min-width: 0;
}

.wl-timeline-file-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wl-timeline-file-size {
    font-size: 0.8rem;
    color: var(--wl-text-muted);
}

/* Audio */

.wl-timeline-audio audio {
    width: 100%;
    max-width: 100%;
}

.wl-timeline-audio-transcription {
    margin-top: 10px;
}

/* Voice recorder */

.wl-voice-record-btn,
.wl-voice-stop-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.1s;
}

.wl-voice-record-btn {
    background: var(--wl-primary);
}

.wl-voice-stop-btn {
    background: var(--wl-danger);
    animation: wl-pulse 1.5s infinite;
}

.wl-voice-record-btn:hover,
.wl-voice-stop-btn:hover {
    transform: scale(1.05);
}

@keyframes wl-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(198,40,40,0); }
}

.wl-voice-duration {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--wl-danger);
    font-variant-numeric: tabular-nums;
    margin-bottom: 16px;
}
