/** TalkToText Pro Dashboard - Glass UI refresh */
         :root {
    --primary: #5b7cfa;
    --primary-dark: #4256ff;
    --accent: #38bdf8;
    --success: #34d399;
    --warning: #f9a826;
    --danger: #f87171;
    --surface-dark: rgba(15, 23, 42, 0.65);
    --surface-light: rgba(255, 255, 255, 0.85);
    --border-radius-sm: 12px;
    --border-radius-md: 18px;
    --border-radius-lg: 28px;
            --sidebar-width: 280px;
    --header-height: 74px;
    --transition: all 0.25s ease;
    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.35);
    --shadow-strong: 0 28px 80px rgba(15, 23, 42, 0.45);
    --backdrop-blur: blur(18px);
        }

        .dark-mode {
    --base-bg: radial-gradient(140% 200% at 10% -20%, rgba(99, 102, 241, 0.35), transparent 55%),
                radial-gradient(120% 160% at 90% 0%, rgba(56, 189, 248, 0.18), transparent 60%),
                #0f1729;
    --sidebar-bg: rgba(12, 18, 33, 0.82);
    --sidebar-border: rgba(148, 163, 184, 0.18);
    --text-primary: #f8fafc;
    --text-secondary: rgba(226, 232, 240, 0.75);
    --card-border: rgba(148, 163, 184, 0.16);
        }

        .light-mode {
    --base-bg: linear-gradient(135deg, #eef2ff, #f8fafc);
    --sidebar-bg: rgba(255, 255, 255, 0.92);
    --sidebar-border: rgba(119, 127, 238, 0.16);
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.6);
    --card-border: rgba(119, 127, 238, 0.16);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: var(--base-bg);
            color: var(--text-primary);
    transition: background 0.35s ease, color 0.35s ease;
            overflow-x: hidden;
        }

        .app-container {
            display: flex;
            min-height: 100vh;
    position: relative;
        }

/* Sidebar */
        .sidebar {
            width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    backdrop-filter: var(--backdrop-blur);
            display: flex;
            flex-direction: column;
    padding: 28px 26px;
            position: fixed;
    inset: 0 auto 0 0;
    z-index: 120;
    transition: transform 0.3s ease;
}

.sidebar-brand {
            display: flex;
            align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.9), rgba(56, 189, 248, 0.85));
            display: flex;
            align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    box-shadow: 0 15px 35px rgba(91, 124, 250, 0.35);
}

.brand-label {
    display: block;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.25px;
}

.brand-sub {
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.sidebar-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.25), transparent);
    margin-bottom: 24px;
}

.sidebar-menu {
    flex: 1;
            display: flex;
    flex-direction: column;
    gap: 18px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-group-title {
    font-size: 0.7rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
        }

        .nav-item {
            display: flex;
            align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-secondary);
            cursor: pointer;
            transition: var(--transition);
        }

        .nav-item:hover {
    background: rgba(91, 124, 250, 0.16);
    color: #fff;
        }

        .nav-item.active {
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.9), rgba(56, 189, 248, 0.82));
    color: #fff;
    box-shadow: 0 18px 40px rgba(91, 124, 250, 0.35);
        }

        .nav-icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
        }

        .nav-text {
            font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
}

.logout-button {
            width: 100%;
            display: flex;
            align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
            cursor: pointer;
            transition: var(--transition);
        }

.logout-button:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #fee2e2;
}

.light-mode .logout-button {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.4);
    color: #b91c1c;
}

.light-mode .logout-button:hover {
    background: rgba(248, 113, 113, 0.18);
    color: #7f1d1d;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
            transition: var(--transition);
    z-index: 110;
        }

.overlay.open {
            opacity: 1;
    visibility: visible;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
            display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.app-header {
    height: var(--header-height);
    padding: 0 32px;
            display: flex;
            align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: var(--backdrop-blur);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.light-mode .app-header {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(119, 127, 238, 0.16);
}

.menu-toggle {
    font-size: 1.3rem;
    cursor: pointer;
    display: none;
            color: var(--text-secondary);
        }

.header-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-sub {
    font-size: 0.75rem;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.header-heading {
    font-size: 1.2rem;
    font-weight: 600;
        }

        .header-actions {
            display: flex;
            align-items: center;
    gap: 18px;
        }

        .theme-toggle {
    width: 54px;
    height: 28px;
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    padding: 4px;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
        }

        .theme-toggle-handle {
    width: 20px;
    height: 20px;
            border-radius: 50%;
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.95), rgba(56, 189, 248, 0.9));
    box-shadow: 0 10px 20px rgba(91, 124, 250, 0.35);
    transform: translateX(0);
    transition: transform 0.25s ease;
        }

        .theme-toggle.dark .theme-toggle-handle {
    transform: translateX(26px);
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
    padding: 6px 10px;
    border-radius: 14px;
    background: rgba(91, 124, 250, 0.12);
    border: 1px solid rgba(91, 124, 250, 0.22);
        }

        .user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.95), rgba(56, 189, 248, 0.9));
            display: flex;
            align-items: center;
            justify-content: center;
    color: #fff;
            font-weight: 600;
        }

        .user-info {
            display: flex;
            flex-direction: column;
    line-height: 1.1;
        }

        .user-name {
            font-weight: 600;
    font-size: 0.95rem;
        }

        .user-role {
    font-size: 0.75rem;
            color: var(--text-secondary);
        }

.dashboard-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.card-glass {
    background: var(--surface-dark);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    backdrop-filter: var(--backdrop-blur);
}

.light-mode .card-glass {
    background: var(--surface-light);
    box-shadow: 0 20px 45px rgba(91, 124, 250, 0.15);
}

.dashboard-hero {
    padding: 34px;
            display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
    gap: 36px;
    align-items: center;
}

.hero-copy {
            display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-copy h2 {
    font-size: 2rem;
    font-weight: 600;
}

.hero-copy p {
    color: var(--text-secondary);
    max-width: 520px;
    font-size: 0.95rem;
}

.hero-actions {
            display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.primary-pill,
.ghost-pill {
    display: inline-flex;
            align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
            font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-pill {
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.95), rgba(56, 189, 248, 0.9));
    color: #fff;
    box-shadow: 0 18px 35px rgba(91, 124, 250, 0.35);
}

.primary-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(91, 124, 250, 0.45);
}

.ghost-pill {
    background: transparent;
    border: 1px solid rgba(91, 124, 250, 0.32);
            color: var(--text-primary);
        }

.ghost-pill:hover {
    transform: translateY(-2px);
    background: rgba(91, 124, 250, 0.12);
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 16px;
}

.stat-card,
.hero-metric {
    padding: 20px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(148, 163, 184, 0.16);
            display: flex;
    flex-direction: column;
    gap: 10px;
}

.light-mode .stat-card,
.light-mode .hero-metric {
    background: rgba(255, 255, 255, 0.9);
}

.metric-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.8rem;
            font-weight: 600;
}

.metric-trend {
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-flex;
            align-items: center;
    gap: 6px;
}

.metric-trend.positive {
    color: #4ade80;
}

.metric-trend.neutral {
            color: var(--text-secondary);
        }

.analytics-grid {
            display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 24px;
        }

.analytics-grid .span-2 {
    grid-column: span 2;
}

.chart-card,
.progress-card {
    padding: 26px;
            display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
        }

.card-header h3 {
    font-size: 1.05rem;
            font-weight: 600;
        }

.card-header p {
    font-size: 0.85rem;
            color: var(--text-secondary);
        }

.badge {
    background: rgba(91, 124, 250, 0.2);
    border: 1px solid rgba(91, 124, 250, 0.35);
    color: #c7d2fe;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.light-mode .badge {
    color: var(--primary-dark);
}

.chart-wrapper {
    height: 260px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.progress-card .badge {
    align-self: flex-start;
}

.pipeline {
            display: flex;
            flex-direction: column;
    gap: 18px;
        }

.pipeline-item {
            display: flex;
            gap: 16px;
}

.pipeline-item .icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
    font-size: 1rem;
    color: #fff;
}

.state-success { background: linear-gradient(135deg, #34d399, #059669); }
.state-primary { background: linear-gradient(135deg, #5b7cfa, #4256ff); }
.state-neutral { background: linear-gradient(135deg, #94a3b8, #64748b); }

.pipeline-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-top {
            display: flex;
    align-items: center;
            justify-content: space-between;
    gap: 10px;
        }

.pipeline-percent {
    font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

.pipeline-description {
    font-size: 0.8rem;
            color: var(--text-secondary);
}

.pipeline-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.pipeline-info p {
    font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .progress-bar {
    width: 100%;
            height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
}

.notes-section {
    padding: 30px;
            display: flex;
            flex-direction: column;
    gap: 22px;
}

.notes-header {
            display: flex;
            align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.notes-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.notes-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.view-all-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
        }

        .notes-grid {
            display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
        }

        .note-card {
    background: rgba(15, 23, 42, 0.45);
    border-radius: var(--border-radius-md);
            padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
            cursor: pointer;
        }

        .note-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.light-mode .note-card {
    background: rgba(255, 255, 255, 0.9);
        }

        .note-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
    gap: 14px;
        }

        .note-title {
    font-size: 1rem;
            font-weight: 600;
        }

        .note-date {
    font-size: 0.75rem;
            color: var(--text-secondary);
        }

.note-text {
    font-size: 0.85rem;
    line-height: 1.6;
            color: var(--text-secondary);
    white-space: pre-line;
    word-break: break-word;
        }

        .note-content {
    max-height: 160px;
    overflow-y: auto;
    padding-right: 6px;
    white-space: normal;
}

.note-content::-webkit-scrollbar {
    width: 6px;
}

.note-content::-webkit-scrollbar-track {
    background: transparent;
}

.note-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.note-menu {
    color: var(--text-secondary);
        }

        .floating-btn {
            position: fixed;
    bottom: 28px;
    right: 28px;
    width: 58px;
    height: 58px;
            border-radius: 50%;
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.95), rgba(56, 189, 248, 0.9));
            display: flex;
            align-items: center;
            justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 20px 40px rgba(91, 124, 250, 0.35);
            cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 105;
        }

        .floating-btn:hover {
    transform: translateY(-4px);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
            align-items: center;
            justify-content: center;
    z-index: 400;
}

.modal.open {
    display: flex;
}

.modal-content {
    width: min(640px, 92%);
    background: rgba(15, 23, 42, 0.92);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    position: relative;
    box-shadow: var(--shadow-strong);
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 88vh;
}

.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.95);
}

.modal .close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
}

#modalHistory {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    max-height: 60vh;
    font-size: 0.92rem;
    line-height: 1.6;
            color: var(--text-secondary);
        }

#modalHistory::-webkit-scrollbar {
    width: 6px;
}

#modalHistory::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 999px;
}

.btn-download {
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, rgba(91, 124, 250, 0.95), rgba(56, 189, 248, 0.9));
    color: #fff;
    font-weight: 600;
            cursor: pointer;
    margin-left: 8px;
}

@media (max-width: 1200px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-grid .span-2 {
        grid-column: span 1;
    }
}

        @media (max-width: 992px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .menu-toggle {
                display: block;
            }

    .dashboard-content {
        padding: 26px;
    }

    .hero-metrics {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 20px;
        gap: 16px;
        flex-wrap: wrap;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-content {
        padding: 22px;
        gap: 24px;
    }

    .hero-copy h2 {
        font-size: 1.65rem;
    }

    .hero-metrics {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .analytics-grid {
        gap: 20px;
    }
}

@media (max-width: 576px) {
    :root {
        --sidebar-width: 260px;
    }

    .dashboard-content {
        padding: 18px;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }

    .notes-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .floating-btn {
        right: 18px;
        bottom: 18px;
    }
}

.card-glass,
.hero-metric,
.note-card {
    animation: fadeUp 0.45s ease forwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}