/* ═══════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════ */
:root {
    --bg-900: #07090f;
    --bg-800: #0d1017;
    --bg-700: #111521;
    --bg-600: #161b2b;
    --bg-500: #1c2238;
    --surface-1: rgba(255, 255, 255, .03);
    --surface-2: rgba(255, 255, 255, .055);
    --surface-3: rgba(255, 255, 255, .085);
    --glass-border: rgba(255, 255, 255, .09);
    --glass-border-hover: rgba(255, 255, 255, .18);
    --glass-shine: rgba(255, 255, 255, .06);
    --accent: #5b8dee;
    --accent-glow: rgba(91, 141, 238, .25);
    --accent-soft: rgba(91, 141, 238, .12);
    --accent-2: #a78bfa;
    --accent-2-glow: rgba(167, 139, 250, .2);
    --present: #34d399;
    --present-bg: rgba(52, 211, 153, .1);
    --absent: #f87171;
    --absent-bg: rgba(248, 113, 113, .1);
    --vr: #fbbf24;
    --vr-bg: rgba(251, 191, 36, .1);
    --text-primary: rgba(255, 255, 255, .93);
    --text-secondary: rgba(255, 255, 255, .55);
    --text-muted: rgba(255, 255, 255, .3);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, .45), inset 0 1px 0 var(--glass-shine);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, .35);
    --shadow-accent: 0 0 30px var(--accent-glow);
    --t: .22s cubic-bezier(.4, 0, .2, 1);
}

[data-theme="light"] {
    --bg-900: #eef1f8;
    --bg-800: #e5e9f3;
    --bg-700: #dce2ef;
    --bg-600: #d2d9eb;
    --bg-500: #c8d0e7;
    --surface-1: rgba(255, 255, 255, .55);
    --surface-2: rgba(255, 255, 255, .72);
    --surface-3: rgba(255, 255, 255, .88);
    --glass-border: rgba(91, 141, 238, .15);
    --glass-border-hover: rgba(91, 141, 238, .32);
    --glass-shine: rgba(255, 255, 255, .7);
    --accent: #3b6fd4;
    --accent-glow: rgba(59, 111, 212, .2);
    --accent-soft: rgba(59, 111, 212, .1);
    --accent-2: #7c3aed;
    --present: #059669;
    --present-bg: rgba(5, 150, 105, .1);
    --absent: #dc2626;
    --absent-bg: rgba(220, 38, 38, .09);
    --vr: #d97706;
    --vr-bg: rgba(217, 119, 6, .1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-glass: 0 8px 32px rgba(91, 141, 238, .1), inset 0 1px 0 var(--glass-shine);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, .08);
}

/* ═══════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-900);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--t), color var(--t);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-hover);
}

/* ═══════════════════════════════════════════════════
   BACKGROUND MESH
═══════════════════════════════════════════════════ */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;

    .mesh-orb {
        position: absolute;
        border-radius: 50%;
        filter: blur(90px);
        opacity: .18;
        animation: orbDrift 18s ease-in-out infinite alternate;

        &:nth-child(1) {
            width: 600px;
            height: 600px;
            background: var(--accent);
            top: -200px;
            left: -150px;
        }

        &:nth-child(2) {
            width: 500px;
            height: 500px;
            background: var(--accent-2);
            bottom: -100px;
            right: -100px;
            animation-delay: -6s;
        }

        &:nth-child(3) {
            width: 350px;
            height: 350px;
            background: #34d399;
            top: 40%;
            left: 40%;
            animation-delay: -12s;
            opacity: .08;
        }
    }
}

[data-theme="light"] .bg-mesh .mesh-orb {
    opacity: .12;
}

@keyframes orbDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 50px) scale(.97);
    }

    100% {
        transform: translate(30px, 20px) scale(1.03);
    }
}

/* ═══════════════════════════════════════════════════
   APP WRAPPER
═══════════════════════════════════════════════════ */
.app-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass {
    background: var(--surface-2);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

/* ═══════════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════════ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface-1);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: background var(--t), border-color var(--t);

    .navbar-brand {
        display: flex;
        align-items: center;
        gap: 14px;
        flex-shrink: 0;

        .logo-slot {
            width: 44px;
            height: 44px;
            border-radius: var(--radius-sm);
            background: var(--surface-3);
            border: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            box-shadow: var(--shadow-glass);
            position: relative;
            cursor: pointer;
            flex-shrink: 0;

            &::after {
                content: '';
                position: absolute;
                inset: 0;
                background: linear-gradient(135deg, var(--glass-shine), transparent);
                pointer-events: none;
            }

            i {
                font-size: 1.4rem;
                color: var(--accent);
            }

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: none;
            }
        }

        .brand-text {
            h1 {
                font-size: 1.05rem;
                font-weight: 700;
                letter-spacing: -.01em;
                line-height: 1;
                color: var(--text-primary);
            }

            span {
                font-size: .72rem;
                color: var(--text-muted);
                font-weight: 400;
                letter-spacing: .04em;
                text-transform: uppercase;
            }
        }
    }

    .navbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════════
   SYNC BADGE
═══════════════════════════════════════════════════ */
.sync-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-muted);
    transition: all var(--t);
    white-space: nowrap;

    .sync-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--text-muted);
        flex-shrink: 0;
        transition: background var(--t);
    }

    &.syncing {
        color: var(--accent);

        .sync-dot {
            background: var(--accent);
            animation: pulse 1s infinite;
        }
    }

    &.synced {
        color: var(--present);

        .sync-dot {
            background: var(--present);
            animation: syncPulse 2s ease-in-out infinite;
        }
    }

    &.error {
        color: var(--absent);

        .sync-dot {
            background: var(--absent);
        }
    }

    &.offline {
        color: var(--vr);

        .sync-dot {
            background: var(--vr);
        }
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

@keyframes syncPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(52, 211, 153, .5);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(52, 211, 153, 0);
    }
}

/* ═══════════════════════════════════════════════════
   ICON BUTTON
═══════════════════════════════════════════════════ */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t);
    font-size: 1.1rem;
    position: relative;

    &[data-tip]::before {
        content: attr(data-tip);
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-600);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        font-size: .72rem;
        padding: 4px 10px;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity .18s;
        z-index: 200;
    }

    &[data-tip]:hover::before {
        opacity: 1;
    }

    &:hover {
        background: var(--surface-3);
        border-color: var(--glass-border-hover);
        color: var(--text-primary);
        transform: translateY(-1px);
        box-shadow: var(--shadow-card);
    }

    &.active {
        background: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
    }
}

[data-tip]:not(.icon-btn) {
    position: relative;

    &::before {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-600);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        font-size: .72rem;
        padding: 4px 10px;
        border-radius: var(--radius-sm);
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        transition: opacity .18s;
        z-index: 100;
    }

    &:hover::before {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════
   THEME TOGGLE
═══════════════════════════════════════════════════ */
.theme-toggle {
    width: 72px;
    height: 36px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    position: relative;
    cursor: pointer;
    transition: all var(--t);
    display: flex;
    align-items: center;
    padding: 4px;

    &::after {
        content: '';
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        box-shadow: 0 2px 8px var(--accent-glow);
        transition: transform var(--t);
        transform: translateX(0);
    }

    i {
        position: absolute;
        font-size: .85rem;
        transition: opacity var(--t);

        &.icon-moon {
            right: 8px;
            color: var(--text-muted);
        }

        &.icon-sun {
            left: 8px;
            color: var(--text-muted);
        }
    }
}

[data-theme="light"] {
    .theme-toggle::after {
        transform: translateX(36px);
    }

    .theme-toggle .icon-moon {
        opacity: 0;
    }
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
}

/* ═══════════════════════════════════════════════════
   MAIN
═══════════════════════════════════════════════════ */
.main {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;

    .page-header {
        margin-bottom: 2.5rem;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1.5rem;

        .page-header-left {
            h2 {
                font-size: 2rem;
                font-weight: 800;
                letter-spacing: -.04em;
                line-height: 1.1;
                background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent));
                -webkit-background-clip: text;
                -webkit-text-fill-color: transparent;
                background-clip: text;
            }

            p {
                margin-top: .4rem;
                font-size: .88rem;
                color: var(--text-muted);
            }
        }

        .page-header-right {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
    }
}

/* ═══════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════ */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
    box-shadow: 0 4px 16px var(--accent-glow);
    white-space: nowrap;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 24px var(--accent-glow);
    }

    &:active {
        transform: translateY(0);
    }

    &:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
    }
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;

    &:hover {
        border-color: var(--glass-border-hover);
        color: var(--text-primary);
        background: var(--surface-3);
        transform: translateY(-1px);
    }
}

/* ═══════════════════════════════════════════════════
   STATS ROW
═══════════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.4rem 1.6rem;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
    transition: all var(--t);
    cursor: default;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(90deg, transparent, var(--accent-clr, var(--accent)), transparent);
        opacity: .7;
    }

    &::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--glass-shine), transparent 60%);
        pointer-events: none;
    }

    &:hover {
        transform: translateY(-3px);
        border-color: var(--glass-border-hover);
        box-shadow: var(--shadow-glass), var(--shadow-accent);

        .stat-icon {
            background: var(--accent);
            color: #fff;
            box-shadow: 0 4px 14px var(--accent-glow);
        }
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        border-radius: var(--radius-sm);
        background: var(--accent-soft);
        border: 1px solid var(--glass-border);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: var(--accent);
        margin-bottom: 1rem;
        transition: all var(--t);
    }

    .stat-value {
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: -.04em;
        line-height: 1;
        color: var(--text-primary);
    }

    .stat-label {
        font-size: .78rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .06em;
        margin-top: .3rem;
        font-weight: 500;
    }

    .stat-badge {
        position: absolute;
        top: 1.2rem;
        right: 1.2rem;
        padding: 3px 9px;
        border-radius: 20px;
        font-size: .7rem;
        font-weight: 600;
        background: var(--accent-soft);
        color: var(--accent);
        border: 1px solid var(--glass-border);
    }

    &.soprano {
        --accent-clr: #f472b6;

        .stat-icon {
            background: rgba(244, 114, 182, .12);
            border-color: rgba(244, 114, 182, .2);
            color: #f472b6;
        }

        &:hover .stat-icon {
            background: #f472b6;
            box-shadow: 0 4px 14px rgba(244, 114, 182, .35);
        }
    }

    &.alto {
        --accent-clr: #a78bfa;

        .stat-icon {
            background: rgba(167, 139, 250, .12);
            border-color: rgba(167, 139, 250, .2);
            color: #a78bfa;
        }

        &:hover .stat-icon {
            background: #a78bfa;
            box-shadow: 0 4px 14px rgba(167, 139, 250, .35);
        }
    }

    &.tenor {
        --accent-clr: #60a5fa;

        .stat-icon {
            background: rgba(96, 165, 250, .12);
            border-color: rgba(96, 165, 250, .2);
            color: #60a5fa;
        }

        &:hover .stat-icon {
            background: #60a5fa;
            box-shadow: 0 4px 14px rgba(96, 165, 250, .35);
        }
    }

    &.bass {
        --accent-clr: #34d399;

        .stat-icon {
            background: rgba(52, 211, 153, .12);
            border-color: rgba(52, 211, 153, .2);
            color: #34d399;
        }

        &:hover .stat-icon {
            background: #34d399;
            box-shadow: 0 4px 14px rgba(52, 211, 153, .35);
        }
    }
}

/* ═══════════════════════════════════════════════════
   CONTROL BAR
═══════════════════════════════════════════════════ */
.control-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;

    .search-wrap {
        flex: 1;
        min-width: 200px;
        position: relative;

        i {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 1.05rem;
            color: var(--text-muted);
            pointer-events: none;
            transition: color var(--t);
        }

        &:focus-within i {
            color: var(--accent);
        }
    }

    .filter-group {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: .9rem;
    outline: none;
    transition: all var(--t);
    box-shadow: var(--shadow-glass);

    &::placeholder {
        color: var(--text-muted);
    }

    &:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-glass);
    }
}

.sort-select {
    padding: 10px 36px 10px 14px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: .88rem;
    outline: none;
    cursor: pointer;
    transition: all var(--t);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;

    &:focus {
        border-color: var(--accent);
        color: var(--text-primary);
    }
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 30px;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;

    &:hover {
        border-color: var(--glass-border-hover);
        color: var(--text-primary);
    }

    &.active {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
        box-shadow: 0 3px 12px var(--accent-glow);
    }

    &.s-pill.active {
        background: #f472b6;
        border-color: #f472b6;
        box-shadow: 0 3px 12px rgba(244, 114, 182, .35);
    }

    &.a-pill.active {
        background: #a78bfa;
        border-color: #a78bfa;
        box-shadow: 0 3px 12px rgba(167, 139, 250, .35);
    }

    &.t-pill.active {
        background: #60a5fa;
        border-color: #60a5fa;
        box-shadow: 0 3px 12px rgba(96, 165, 250, .35);
    }

    &.b-pill.active {
        background: #34d399;
        border-color: #34d399;
        box-shadow: 0 3px 12px rgba(52, 211, 153, .35);
    }
}

/* ═══════════════════════════════════════════════════
   SECTION HEADERS
═══════════════════════════════════════════════════ */
.section-block {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 0 .8rem;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;

    .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--accent);
        display: inline-block;
    }

    &.soprano-title .dot {
        background: #f472b6;
    }

    &.alto-title .dot {
        background: #a78bfa;
    }

    &.tenor-title .dot {
        background: #60a5fa;
    }

    &.bass-title .dot {
        background: #34d399;
    }
}

/* ═══════════════════════════════════════════════════
   MEMBER GRID & CARDS
═══════════════════════════════════════════════════ */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1rem;
}

.member-card {
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: all var(--t);
    position: relative;
    cursor: pointer;
    min-width: 0;
    animation: cardFadeIn .35s ease both;
    animation-delay: calc(var(--i, 0) * .03s);

    &::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, var(--glass-shine), transparent 50%);
        pointer-events: none;
    }

    &:hover {
        transform: translateY(-4px) scale(1.01);
        border-color: var(--glass-border-hover);
        box-shadow: var(--shadow-glass), 0 0 0 1px var(--accent-soft);
    }

    &.hidden {
        display: none;
    }

    .card-top {
        padding: 1.1rem 1.2rem 1rem;
        display: flex;
        align-items: flex-start;
        gap: 1rem;
        min-width: 0;

        .card-info {
            flex: 1;
            min-width: 0;

            .card-name {
                font-size: .97rem;
                font-weight: 700;
                color: var(--text-primary);
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .card-meta {
                display: flex;
                align-items: center;
                gap: 6px;
                margin-top: 3px;
                flex-wrap: wrap;

                .card-phone {
                    font-size: .75rem;
                    color: var(--text-muted);
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    max-width: 100%;
                }
            }
        }
    }

    .card-score-wrap {
        padding: 0 1.2rem 1rem;

        .score-bar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;

            .score-pct {
                font-family: 'Space Mono', monospace;
                font-size: .85rem;
                font-weight: 700;
            }

            .score-label {
                font-size: .72rem;
                color: var(--text-muted);
            }
        }

        .progress-track {
            height: 5px;
            border-radius: 10px;
            background: var(--surface-3);
            overflow: hidden;

            .progress-fill {
                height: 100%;
                border-radius: 10px;
                transition: width 1s cubic-bezier(.4, 0, .2, 1);
                position: relative;

                &::after {
                    content: '';
                    position: absolute;
                    inset: 0;
                    background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, .35));
                }

                &.pf-excellent {
                    background: linear-gradient(90deg, #34d399, #10b981);
                }

                &.pf-good {
                    background: linear-gradient(90deg, #60a5fa, #3b82f6);
                }

                &.pf-fair {
                    background: linear-gradient(90deg, #fbbf24, #f59e0b);
                }

                &.pf-poor {
                    background: linear-gradient(90deg, #f87171, #ef4444);
                }
            }
        }
    }

    .card-sessions {
        padding: 0 1.2rem 1.1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .card-footer {
        padding: .7rem 1.2rem;
        border-top: 1px solid var(--glass-border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--surface-1);
        flex-wrap: wrap;
        gap: 4px;

        .card-footer-stat {
            display: flex;
            align-items: center;
            gap: 5px;
            font-size: .75rem;
            color: var(--text-muted);

            i {
                font-size: .85rem;
            }

            span {
                font-weight: 600;
                color: var(--text-secondary);
            }
        }

        .card-action-btn {
            width: 30px;
            height: 30px;
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            border: 1px solid var(--glass-border);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: .9rem;
            cursor: pointer;
            transition: all var(--t);

            &:hover {
                border-color: var(--accent);
                color: var(--accent);
                background: var(--accent-soft);
            }
        }
    }
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   AVATAR
═══════════════════════════════════════════════════ */
.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    border: 2px solid var(--glass-border);
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);

    &::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: 50%;
        background: linear-gradient(135deg, rgba(255, 255, 255, .2), transparent);
    }

    &.avatar-s {
        background: linear-gradient(135deg, rgba(244, 114, 182, .35), rgba(244, 114, 182, .1));
        color: #f9a8d4;
        border-color: rgba(244, 114, 182, .25);
    }

    &.avatar-a {
        background: linear-gradient(135deg, rgba(167, 139, 250, .35), rgba(167, 139, 250, .1));
        color: #c4b5fd;
        border-color: rgba(167, 139, 250, .25);
    }

    &.avatar-t {
        background: linear-gradient(135deg, rgba(96, 165, 250, .35), rgba(96, 165, 250, .1));
        color: #93c5fd;
        border-color: rgba(96, 165, 250, .25);
    }

    &.avatar-b {
        background: linear-gradient(135deg, rgba(52, 211, 153, .35), rgba(52, 211, 153, .1));
        color: #6ee7b7;
        border-color: rgba(52, 211, 153, .25);
    }

    &.avatar-u {
        background: linear-gradient(135deg, rgba(251, 191, 36, .2), rgba(251, 191, 36, .05));
        color: #fcd34d;
        border-color: rgba(251, 191, 36, .2);
    }
}

/* ═══════════════════════════════════════════════════
   VOICE BADGE
═══════════════════════════════════════════════════ */
.voice-badge {
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .03em;
    text-transform: uppercase;

    &.vb-s {
        background: rgba(244, 114, 182, .15);
        color: #f472b6;
        border: 1px solid rgba(244, 114, 182, .25);
    }

    &.vb-a {
        background: rgba(167, 139, 250, .15);
        color: #a78bfa;
        border: 1px solid rgba(167, 139, 250, .25);
    }

    &.vb-t {
        background: rgba(96, 165, 250, .15);
        color: #60a5fa;
        border: 1px solid rgba(96, 165, 250, .25);
    }

    &.vb-b {
        background: rgba(52, 211, 153, .15);
        color: #34d399;
        border: 1px solid rgba(52, 211, 153, .25);
    }

    &.vb-u {
        background: rgba(251, 191, 36, .12);
        color: #fbbf24;
        border: 1px solid rgba(251, 191, 36, .2);
    }
}

/* ═══════════════════════════════════════════════════
   SESSION DOTS
═══════════════════════════════════════════════════ */
.session-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: transform .12s;

    &:hover {
        transform: scale(1.4);
    }

    &.sd-present {
        background: var(--present);
    }

    &.sd-absent {
        background: var(--absent);
        opacity: .7;
    }

    &.sd-vr {
        background: var(--vr);
    }

    &.sd-dash {
        background: var(--surface-3);
        border: 1px solid var(--glass-border);
    }
}

/* ═══════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    display: none;

    &.show {
        display: block;
    }

    i {
        font-size: 3rem;
        display: block;
        margin-bottom: 1rem;
        opacity: .4;
    }

    p {
        font-size: .95rem;
    }
}

/* ═══════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;

    &.open {
        opacity: 1;
        pointer-events: all;

        .modal {
            transform: translateY(0) scale(1);
        }
    }
}

.modal {
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: var(--radius-xl);
    background: var(--bg-800);
    border: 1px solid var(--glass-border);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .6), inset 0 1px 0 var(--glass-shine);
    transform: translateY(20px) scale(.97);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;

    .modal-header {
        padding: 1.6rem 1.8rem 1.2rem;
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        border-bottom: 1px solid var(--glass-border);
        position: sticky;
        top: 0;
        background: var(--bg-800);
        z-index: 2;

        .modal-title {
            h3 {
                font-size: 1.2rem;
                font-weight: 700;
                letter-spacing: -.02em;
            }

            p {
                font-size: .8rem;
                color: var(--text-muted);
                margin-top: 3px;
            }
        }

        .modal-close {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            border: 1px solid var(--glass-border);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.1rem;
            transition: all var(--t);

            &:hover {
                background: rgba(248, 113, 113, .15);
                border-color: rgba(248, 113, 113, .3);
                color: #f87171;
            }
        }
    }

    .modal-body {
        padding: 1.8rem;
    }

    .modal-footer {
        padding: 1.2rem 1.8rem;
        border-top: 1px solid var(--glass-border);
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }

    .modal-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 1.8rem;

        .modal-stat {
            padding: 1rem;
            border-radius: var(--radius-md);
            background: var(--surface-1);
            border: 1px solid var(--glass-border);
            text-align: center;

            .modal-stat-val {
                font-family: 'Space Mono', monospace;
                font-size: 1.3rem;
                font-weight: 700;
            }

            .modal-stat-lbl {
                font-size: .7rem;
                color: var(--text-muted);
                text-transform: uppercase;
                letter-spacing: .06em;
                margin-top: 3px;
            }
        }
    }
}

.modal-sessions-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 1rem;
}

.modal-sessions-grid {
    display: grid;
    gap: 6px;
}

.session-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    transition: all var(--t);

    &:hover {
        border-color: var(--glass-border-hover);
        background: var(--surface-2);
    }

    .session-row-date {
        font-size: .8rem;
        color: var(--text-muted);
        min-width: 80px;
        font-family: 'Space Mono', monospace;
    }

    .session-row-label {
        flex: 1;
        font-size: .83rem;
        color: var(--text-secondary);
    }
}

.status-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;

    i {
        font-size: .75rem;
    }

    &.chip-present {
        background: var(--present-bg);
        color: var(--present);
        border: 1px solid rgba(52, 211, 153, .2);
    }

    &.chip-absent {
        background: var(--absent-bg);
        color: var(--absent);
        border: 1px solid rgba(248, 113, 113, .2);
    }

    &.chip-vr {
        background: var(--vr-bg);
        color: var(--vr);
        border: 1px solid rgba(251, 191, 36, .2);
    }

    &.chip-dash {
        background: var(--surface-2);
        color: var(--text-muted);
        border: 1px solid var(--glass-border);
    }
}

.modal-contact {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;

    .contact-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        border-radius: var(--radius-md);
        background: var(--surface-1);
        border: 1px solid var(--glass-border);

        i {
            font-size: 1rem;
            color: var(--accent);
        }

        span {
            font-size: .85rem;
            color: var(--text-secondary);
        }
    }
}

/* ═══════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.2rem;

    .form-label {
        font-size: .78rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .06em;
    }
}

.form-input,
.form-select {
    padding: 11px 15px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: .9rem;
    outline: none;
    transition: all var(--t);

    &::placeholder {
        color: var(--text-muted);
    }

    &:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-soft);
    }
}

.form-select {
    appearance: none;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.new-session-preview {
    margin-top: 1rem;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid rgba(91, 141, 238, .25);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--accent);

    i {
        font-size: 1.1rem;
        flex-shrink: 0;
    }
}

.session-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1rem;

    .session-info-card {
        padding: 12px 14px;
        border-radius: var(--radius-md);
        background: var(--surface-1);
        border: 1px solid var(--glass-border);
        text-align: center;

        .val {
            font-family: 'Space Mono', monospace;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .lbl {
            font-size: .7rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: .05em;
            margin-top: 2px;
        }
    }
}

.session-selector {
    margin-bottom: 1.5rem;

    .session-selector-label {
        font-size: .78rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .06em;
        margin-bottom: .6rem;
        display: block;
    }

    .session-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
}

.session-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .8rem;
    font-family: 'Space Mono', monospace;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t);

    &:hover {
        border-color: var(--glass-border-hover);
        color: var(--text-primary);
    }

    &.selected {
        background: var(--accent-soft);
        border-color: var(--accent);
        color: var(--accent);
    }
}

.bulk-table {
    width: 100%;
    border-collapse: collapse;

    th {
        font-size: .72rem;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: .07em;
        padding: 8px 10px;
        text-align: left;
        border-bottom: 1px solid var(--glass-border);
    }

    td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--glass-border);
        font-size: .85rem;
    }

    tr:last-child td {
        border-bottom: none;
    }

    tr:hover td {
        background: var(--surface-1);
    }
}

.status-btn-group {
    display: flex;
    gap: 4px;
}

.status-btn {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t);

    &.sel-present {
        background: var(--present-bg);
        color: var(--present);
        border-color: rgba(52, 211, 153, .3);
    }

    &.sel-absent {
        background: var(--absent-bg);
        color: var(--absent);
        border-color: rgba(248, 113, 113, .3);
    }

    &.sel-vr {
        background: var(--vr-bg);
        color: var(--vr);
        border-color: rgba(251, 191, 36, .3);
    }
}

/* ═══════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-700);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    color: var(--text-primary);
    font-size: .875rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 380px;
    pointer-events: all;
    animation: toastIn .3s cubic-bezier(.4, 0, .2, 1) forwards;

    &.leaving {
        animation: toastOut .25s ease forwards;
    }

    i {
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    &.toast-success {
        border-color: rgba(52, 211, 153, .3);

        i {
            color: var(--present);
        }
    }

    &.toast-error {
        border-color: rgba(248, 113, 113, .3);

        i {
            color: var(--absent);
        }
    }

    &.toast-info {
        border-color: rgba(91, 141, 238, .3);

        i {
            color: var(--accent);
        }
    }
}

@keyframes toastIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════
   LOADING OVERLAY
═══════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: var(--bg-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: opacity .5s ease;

    &.hidden {
        opacity: 0;
        pointer-events: none;
    }

    .loading-spinner {
        width: 48px;
        height: 48px;
        border: 3px solid var(--surface-3);
        border-top-color: var(--accent);
        border-radius: 50%;
        animation: spin .8s linear infinite;
    }

    .loading-text {
        font-size: .95rem;
        color: var(--text-muted);
        font-weight: 500;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.footer {
    padding: 1.4rem 2rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: .5rem;

    a {
        color: var(--accent);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* ═══════════════════════════════════════════════════
   AI CHAT FAB
═══════════════════════════════════════════════════ */
.ai-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 24px var(--accent-glow);
    z-index: 990;
    transition: transform var(--t), box-shadow var(--t);
    animation: fabBounce 1.8s cubic-bezier(.4, 0, .2, 1) infinite;

    &:hover {
        animation: none;
        transform: scale(1.1);
        box-shadow: 0 6px 32px var(--accent-glow);
    }

    .fab-badge {
        position: absolute;
        top: -3px;
        right: -3px;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: var(--present);
        border: 2px solid var(--bg-900);
        font-size: .62rem;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 700;
    }

    .ai-fab-tooltip {
        position: absolute;
        bottom: 68px;
        right: 0;
        background: var(--bg-700);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        font-size: .75rem;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: var(--radius-md);
        white-space: nowrap;
        box-shadow: var(--shadow-card);
        animation: tooltipPop 3s ease-in-out infinite;
        pointer-events: none;

        &::after {
            content: '';
            position: absolute;
            top: 100%;
            right: 18px;
            border: 6px solid transparent;
            border-top-color: var(--glass-border);
        }
    }
}

@keyframes fabBounce {
    0% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }

    12% {
        transform: translateY(-4px) scaleX(0.97) scaleY(1.03);
    }

    25% {
        transform: translateY(-44px) scaleX(0.92) scaleY(1.1);
    }

    40% {
        transform: translateY(0) scaleX(1.18) scaleY(0.82);
    }

    52% {
        transform: translateY(-20px) scaleX(0.96) scaleY(1.06);
    }

    63% {
        transform: translateY(0) scaleX(1.08) scaleY(0.93);
    }

    73% {
        transform: translateY(-9px) scaleX(0.99) scaleY(1.02);
    }

    82% {
        transform: translateY(0) scaleX(1.02) scaleY(0.99);
    }

    90% {
        transform: translateY(-3px) scaleX(1) scaleY(1);
    }

    100% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }
}

@keyframes tooltipPop {

    0%,
    100% {
        opacity: 0;
        transform: translateY(4px);
    }

    20%,
    80% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   AI PANEL
═══════════════════════════════════════════════════ */
.ai-panel {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 400px;
    height: 580px;
    border-radius: var(--radius-xl);
    background: var(--bg-800);
    border: 1px solid var(--glass-border);
    box-shadow: 0 32px 80px rgba(0, 0, 0, .6), inset 0 1px 0 var(--glass-shine);
    z-index: 991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);

    &.open {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: all;
    }

    /* ── Expanded / fullscreen ── */
    &.expanded {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
        z-index: 9999;

        .ai-messages {
            padding: 2rem max(2rem, calc(50vw - 380px));
        }

        .ai-input-area {
            border-top: none;
            background: transparent;
            padding: 0 0 2.5rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;

            .ai-suggestions {
                justify-content: center;
                max-width: 720px;
                width: 100%;
            }

            .ai-input-row {
                max-width: 720px;
                width: 100%;
                background: var(--surface-2);
                border: 1px solid var(--glass-border);
                border-radius: 30px;
                padding: 8px 8px 8px 20px;
                box-shadow: 0 4px 32px rgba(0, 0, 0, .3);
                align-items: center;
                display: flex;
                gap: 8px;
            }

            .ai-textarea {
                border: none;
                background: transparent;
                box-shadow: none;
                padding: 6px 0;
                font-size: 1rem;
                margin-inline: 0;
                min-height: 36px;

                &:focus {
                    border: none;
                    box-shadow: none;
                }
            }

            .ai-send-btn {
                width: 44px;
                height: 44px;
                border-radius: 50%;
                flex-shrink: 0;
            }

            .ai-key-banner {
                max-width: 720px;
                width: 100%;
            }
        }

        .ai-msg .ai-msg-bubble {
            max-width: 600px;
        }
    }

    /* ── Header ── */
    .ai-panel-header {
        padding: 1rem 1.2rem;
        border-bottom: 1px solid var(--glass-border);
        display: flex;
        align-items: center;
        gap: 10px;
        background: var(--surface-1);
        flex-shrink: 0;

        .ai-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), var(--accent-2));
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            color: #fff;
            flex-shrink: 0;
            box-shadow: 0 2px 10px var(--accent-glow);
        }

        .ai-panel-info {
            flex: 1;

            h4 {
                font-size: .9rem;
                font-weight: 700;
                color: var(--text-primary);
            }

            span {
                font-size: .72rem;
                color: var(--present);
                display: flex;
                align-items: center;
                gap: 4px;

                &::before {
                    content: '';
                    width: 6px;
                    height: 6px;
                    border-radius: 50%;
                    background: var(--present);
                    display: inline-block;
                }
            }
        }

        .ai-expand-btn,
        .ai-panel-close {
            width: 30px;
            height: 30px;
            border-radius: var(--radius-sm);
            background: var(--surface-2);
            border: 1px solid var(--glass-border);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1rem;
            transition: all var(--t);
        }

        .ai-expand-btn:hover {
            background: var(--accent-soft);
            border-color: var(--accent);
            color: var(--accent);
        }

        .ai-panel-close:hover {
            background: rgba(248, 113, 113, .15);
            border-color: rgba(248, 113, 113, .3);
            color: #f87171;
        }
    }

    /* ── Messages ── */
    .ai-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: .75rem;
        scrollbar-width: thin;
        scrollbar-color: var(--glass-border) transparent;
    }

    /* ── Input area (default / mini panel) ── */
    .ai-input-area {
        padding: .75rem 1rem;
        border-top: 1px solid var(--glass-border);
        background: var(--surface-1);
        flex-shrink: 0;

        .ai-input-row {
            display: flex;
            gap: 8px;
            align-items: center;
            background: var(--surface-2);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-lg);
            padding: 4px 4px 4px 12px;
            transition: border-color var(--t);

            &:focus-within {
                border-color: var(--accent);
                box-shadow: 0 0 0 3px var(--accent-soft);
            }
        }
    }
}

/* ── Greeting (expanded empty state) ── */
.sopra-greeting {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 1rem;
    padding-bottom: 2rem;

    &.show {
        display: flex;
    }

    .greeting-avatar {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.8rem;
        color: #fff;
        box-shadow: 0 4px 24px var(--accent-glow);
    }

    h2 {
        font-size: 2rem;
        font-weight: 800;
        letter-spacing: -.04em;
        background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    p {
        font-size: .95rem;
        color: var(--text-muted);
    }
}

/* ── AI Messages ── */
.ai-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    animation: msgIn .2s ease both;

    &.user {
        flex-direction: row-reverse;
    }

    .ai-msg-avatar {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: .8rem;
    }

    &.bot .ai-msg-avatar {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: #fff;
    }

    &.user .ai-msg-avatar {
        background: var(--surface-3);
        color: var(--text-secondary);
        border: 1px solid var(--glass-border);
    }

    .ai-msg-bubble {
        max-width: 78%;
        padding: .6rem .9rem;
        border-radius: 16px;
        font-size: .84rem;
        line-height: 1.55;

        strong {
            font-weight: 700;
        }

        .action-tag {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 8px;
            border-radius: 20px;
            font-size: .7rem;
            font-weight: 600;
            margin-top: 6px;
            margin-right: 4px;

            &.done {
                background: var(--present-bg);
                color: var(--present);
                border: 1px solid rgba(52, 211, 153, .2);
            }

            &.working {
                background: var(--accent-soft);
                color: var(--accent);
                border: 1px solid rgba(91, 141, 238, .2);
            }
        }
    }

    &.bot .ai-msg-bubble {
        background: var(--surface-2);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        border-bottom-left-radius: 4px;
    }

    &.user .ai-msg-bubble {
        background: linear-gradient(135deg, var(--accent), var(--accent-2));
        color: #fff;
        border-bottom-right-radius: 4px;
    }
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Typing ── */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: .6rem .9rem;
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;

    span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--text-muted);
        animation: typingDot 1.2s ease-in-out infinite;

        &:nth-child(2) {
            animation-delay: .2s;
        }

        &:nth-child(3) {
            animation-delay: .4s;
        }
    }
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* ── Textarea & Send ── */
.ai-textarea {
    flex: 1;
    padding: 7px 10px;
    border-radius: 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: .88rem;
    outline: none;
    resize: none;
    min-height: 36px;
    max-height: 120px;
    transition: none;
    line-height: 1.45;
    overflow-y: hidden;

    &::placeholder {
        color: var(--text-muted);
    }

    &:focus {
        border: none;
        box-shadow: none;
    }
}

.ai-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    transition: all var(--t);
    flex-shrink: 0;
    box-shadow: 0 2px 10px var(--accent-glow);

    &:hover {
        transform: scale(1.1);
        box-shadow: 0 4px 16px var(--accent-glow);
    }

    &:disabled {
        opacity: .5;
        cursor: not-allowed;
        transform: none;
    }
}

/* ── Suggestions ── */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: .6rem;

    .ai-suggestion {
        padding: 4px 10px;
        border-radius: 20px;
        font-size: .72rem;
        font-weight: 500;
        background: var(--surface-2);
        border: 1px solid var(--glass-border);
        color: var(--text-secondary);
        cursor: pointer;
        transition: all var(--t);
        white-space: nowrap;

        &:hover {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-soft);
        }
    }
}

/* ── Key banner ── */
.ai-key-banner {
    padding: .6rem .9rem;
    background: rgba(251, 191, 36, .08);
    border: 1px solid rgba(251, 191, 36, .2);
    border-radius: var(--radius-md);
    font-size: .75rem;
    color: var(--vr);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: .6rem;

    i {
        font-size: .9rem;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 900px)
═══════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .navbar {
        padding: 0 1.2rem;
    }

    .navbar .navbar-actions {
        gap: 7px;
    }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 640px)
═══════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .navbar {
        padding: 0 .9rem;
        height: auto;
        min-height: 60px;

        .navbar-brand .brand-text {
            span {
                display: none;
            }

            h1 {
                font-size: .9rem;
            }
        }

        .navbar-actions {
            gap: 5px;

            /* Hide text in sync badge, keep dot only */
            .sync-badge span {
                display: none;
            }

            .sync-badge {
                padding: 5px 6px;
            }
        }
    }

    .main {
        padding: .9rem;
    }

    .main .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .9rem;
        margin-bottom: 1.3rem;

        .page-header-left h2 {
            font-size: 1.45rem;
        }

        .page-header-right {
            width: 100%;

            .btn-ghost,
            .btn-primary {
                flex: 1;
                justify-content: center;
                font-size: .82rem;
                padding: 9px 10px;
            }
        }
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }

    .stat-card {
        padding: 1rem 1.1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .control-bar {
        gap: 8px;
    }

    .control-bar .search-wrap {
        min-width: 0;
    }

    .control-bar .filter-group {
        width: 100%;
    }

    .control-bar .filter-group .filter-pill {
        padding: 6px 11px;
        font-size: .78rem;
    }

    .sort-select {
        width: 100%;
    }

    .member-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .member-card .card-top {
        padding: .9rem 1rem .8rem;
    }

    .member-card .card-score-wrap {
        padding: 0 1rem .8rem;
    }

    .member-card .card-sessions {
        padding: 0 1rem .9rem;
    }

    .member-card .card-footer {
        padding: .6rem 1rem;
        gap: 6px;
    }

    .member-card .card-footer .card-footer-stat {
        font-size: .71rem;
    }

    .modal {
        border-radius: var(--radius-lg);
    }

    .modal .modal-header {
        padding: 1.1rem 1.1rem .9rem;
    }

    .modal .modal-body {
        padding: 1.1rem;
    }

    .modal .modal-footer {
        padding: .9rem 1.1rem;
        flex-wrap: wrap;
    }

    .modal .modal-footer .btn-ghost,
    .modal .modal-footer .btn-primary {
        flex: 1;
        justify-content: center;
    }

    .modal .modal-stats {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .ai-panel {
        width: calc(100vw - 1.6rem);
        right: .8rem;
        bottom: .8rem;
        height: 72vh;
        border-radius: var(--radius-lg);
    }

    .ai-fab {
        bottom: .8rem;
        right: .8rem;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .toast-container {
        right: .8rem;
        bottom: 4.5rem;
        left: .8rem;
    }

    .toast-container .toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .footer {
        padding: 1rem .9rem;
        flex-direction: column;
        text-align: center;
        gap: .2rem;
    }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — TINY (≤ 380px)
═══════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .member-card .card-top .avatar {
        width: 36px;
        height: 36px;
        font-size: .8rem;
    }

    .navbar .navbar-actions .icon-btn:nth-child(4) {
        display: none;
    }
}