/* ================================================================
   FamVoice Web Dashboard — app.css
   Design System: inherits from index.css variables
   ================================================================ */

/* ---------- CSS Variables (App-specific) ---------- */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --voice-gradient: linear-gradient(135deg, #fcd34d 0%, #f472b6 50%, #6366f1 100%);
    --emergency-gradient: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    --secondary: #10b981;
    --secondary-light: #34d399;
    --dark: #0f172a;
    --dark-surface: #1e293b;
    --dark-card: #253148;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);

    /* Sidebar */
    --sidebar-w: 260px;
    --sidebar-collapsed-w: 72px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 24px rgba(99,102,241,0.18);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    /* Theme Tokens (Default Dark) */
    --theme-bg: #0f172a;
    --theme-surface: rgba(30, 41, 59, 0.7);
    --theme-sidebar: rgba(15, 23, 42, 0.95);
    --theme-topbar: rgba(15, 23, 42, 0.6);
    --theme-border: rgba(255, 255, 255, 0.06);
    --theme-border-subtle: rgba(255, 255, 255, 0.04);
    --theme-text: #f1f5f9;
    --theme-text-secondary: #94a3b8;
    --theme-text-muted: #64748b;
    --theme-input-bg: rgba(15, 23, 42, 0.6);
    --theme-input-border: rgba(255, 255, 255, 0.08);
}

/* ---------- Light Theme Overrides ---------- */
[data-theme="light"] {
    --theme-bg: #f8fafc;
    --theme-surface: #ffffff;
    --theme-sidebar: rgba(255, 255, 255, 0.96);
    --theme-topbar: rgba(255, 255, 255, 0.88);
    --theme-border: #e2e8f0;
    --theme-border-subtle: #f1f5f9;
    --theme-text: #0f172a;
    --theme-text-secondary: #475569;
    --theme-text-muted: #64748b;
    --theme-input-bg: #ffffff;
    --theme-input-border: #cbd5e1;
}

[data-theme="light"] body {
    background: var(--theme-bg);
    color: var(--theme-text);
}

[data-theme="light"] .sidebar {
    background: var(--theme-sidebar);
    border-right-color: var(--theme-border);
}

[data-theme="light"] .sidebar-header {
    border-bottom-color: var(--theme-border);
}

[data-theme="light"] .sidebar-footer {
    border-top-color: var(--theme-border);
}

[data-theme="light"] .nav-item {
    color: var(--theme-text-secondary);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(99, 102, 241, 0.06);
    color: var(--primary-dark);
}

[data-theme="light"] .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

[data-theme="light"] .nav-section-label {
    color: var(--theme-text-muted);
}

[data-theme="light"] .user-name {
    color: var(--theme-text);
}

[data-theme="light"] .topbar {
    background: var(--theme-topbar);
    border-bottom-color: var(--theme-border);
}

[data-theme="light"] .topbar-title {
    color: var(--theme-text);
}

[data-theme="light"] .topbar-btn {
    background: #ffffff;
    border-color: var(--theme-border);
    color: var(--theme-text-secondary);
}

[data-theme="light"] .topbar-btn:hover {
    background: #f1f5f9;
    color: var(--primary-dark);
    border-color: var(--primary-light);
}

[data-theme="light"] .dash-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .dash-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .dash-card-value {
    color: var(--theme-text);
}

[data-theme="light"] .content-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

[data-theme="light"] .content-card-header {
    border-bottom-color: var(--theme-border);
}

[data-theme="light"] .content-card-title {
    color: var(--theme-text);
}

[data-theme="light"] .auth-card {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

[data-theme="light"] .auth-title {
    color: var(--theme-text);
}

[data-theme="light"] .auth-subtitle {
    color: var(--theme-text-secondary);
}

[data-theme="light"] .form-group label {
    color: var(--theme-text-secondary);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group select {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-text);
}

[data-theme="light"] .voice-assistant-area {
    color: var(--theme-text);
}

[data-theme="light"] .voice-transcript {
    color: var(--theme-text-secondary);
    background: #ffffff;
    border-color: var(--theme-border);
}

[data-theme="light"] .voice-response {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

[data-theme="light"] .empty-state h3 {
    color: var(--theme-text);
}

[data-theme="light"] .empty-state p {
    color: var(--theme-text-secondary);
}

[data-theme="light"] .modal-box {
    background: var(--theme-surface);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

[data-theme="light"] .table th {
    background: #f8fafc;
    color: var(--theme-text-secondary);
    border-bottom-color: var(--theme-border);
}

[data-theme="light"] .table td {
    border-bottom-color: var(--theme-border);
    color: var(--theme-text);
}

/* ---------- Logo Styles ---------- */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-decoration: none;
}

.logo-icon-img {
    height: 38px;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.logo-link:hover .logo-icon-img,
.logo-container:hover .logo-icon-img {
    transform: scale(1.05);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: #e2e8f0;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ---------- Utility Classes ---------- */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

/* ================================================================
   AUTH SCREENS (Login / Register / Verify / Reset)
   ================================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(99,102,241,0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168,85,247,0.08) 0%, transparent 50%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    top: -200px; left: -200px;
    border-radius: 50%;
    animation: float-blob 15s ease-in-out infinite;
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, transparent 70%);
    bottom: -100px; right: -100px;
    border-radius: 50%;
    animation: float-blob 18s ease-in-out infinite reverse;
}

@keyframes float-blob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    position: relative;
    z-index: 1;
    animation: card-entrance 0.5s var(--ease-out) both;
}

@keyframes card-entrance {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
}

.auth-logo img {
    height: 42px;
}

.auth-title {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    color: #f1f5f9;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--gray-light);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ---------- Form Group ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: #f1f5f9;
    font-size: 15px;
    transition: all 0.25s ease;
    outline: none;
}

.form-group input::placeholder {
    color: #475569;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: rgba(15, 23, 42, 0.8);
}

.form-group input.input-error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248,113,113,0.15);
}

.form-group .input-icon {
    position: absolute;
    right: 14px;
    top: 38px;
    color: #475569;
    font-size: 14px;
    pointer-events: none;
}

.form-group .toggle-password {
    pointer-events: all;
    cursor: pointer;
    transition: color 0.2s;
}

.form-group .toggle-password:hover {
    color: var(--primary-light);
}

.form-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 4px;
    display: none;
}

.form-error.visible {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ---------- Form Row (2-col) ---------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ---------- Auth Buttons ---------- */
.btn-auth {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    background: var(--primary-gradient);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.btn-auth:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}

.btn-auth:active:not(:disabled) {
    transform: translateY(0);
}

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-auth .spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.btn-auth.loading .btn-text { visibility: hidden; }
.btn-auth.loading .spinner { display: inline-block; }

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

/* ---------- Auth Links ---------- */
.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--gray-light);
}

.auth-links a {
    color: var(--primary-light);
    font-weight: 600;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* ---------- Password Strength ---------- */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.password-strength .bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    transition: background 0.3s ease;
}

.password-strength .bar.weak { background: #f87171; }
.password-strength .bar.medium { background: #fbbf24; }
.password-strength .bar.strong { background: #34d399; }

.password-strength-text {
    font-size: 11px;
    margin-top: 4px;
    color: var(--gray-light);
}

/* ---------- Alert Box ---------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    animation: card-entrance 0.3s ease;
}

.alert.visible { display: flex; }

.alert-error {
    background: rgba(248,113,113,0.12);
    color: #fca5a5;
    border: 1px solid rgba(248,113,113,0.2);
}

.alert-success {
    background: rgba(52,211,153,0.12);
    color: #6ee7b7;
    border: 1px solid rgba(52,211,153,0.2);
}

.alert-info {
    background: rgba(99,102,241,0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.2);
}

/* ---------- MFA Input ---------- */
.mfa-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.mfa-inputs input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.6);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: #f1f5f9;
    transition: all 0.25s ease;
    outline: none;
}

.mfa-inputs input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

/* ================================================================
   DASHBOARD LAYOUT
   ================================================================ */
.dashboard {
    display: none;
    min-height: 100vh;
}

.dashboard.active {
    display: flex;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s var(--ease-out);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
    height: 34px;
    width: 34px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-header span {
    font-size: 18px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

/* Nav Menu */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 12px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: rgba(99,102,241,0.08);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(99,102,241,0.15);
    color: var(--primary-light);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-item.sos-btn {
    color: #f87171;
    margin-top: 8px;
}

.nav-item.sos-btn:hover {
    background: rgba(248,113,113,0.1);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile-mini:hover {
    background: rgba(255,255,255,0.04);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-info-text {
    overflow: hidden;
}

.user-info-text .user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-text .user-plan {
    font-size: 11px;
    color: #64748b;
}

.user-plan.premium {
    color: #fbbf24;
    font-weight: 600;
}

/* ---------- Main Content Area ---------- */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    padding: 0;
    transition: margin-left 0.3s var(--ease-out);
}

/* ---------- Top Bar ---------- */
.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.topbar-btn:hover {
    background: rgba(99,102,241,0.1);
    color: var(--primary-light);
    border-color: rgba(99,102,241,0.2);
}

.topbar-btn .notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: #f87171;
    border-radius: 50%;
    border: 2px solid var(--dark);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
}

/* ---------- Page Content ---------- */
.page-content {
    padding: 28px 32px;
}

/* ---------- Module Panels ---------- */
.module-panel {
    display: none;
    animation: fade-in 0.35s ease;
}

.module-panel.active {
    display: block;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Dashboard Cards ---------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.dash-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.dash-card:hover {
    border-color: rgba(99,102,241,0.2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dash-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.dash-card-icon.purple { background: var(--primary-gradient); }
.dash-card-icon.green { background: linear-gradient(135deg, #10b981, #34d399); }
.dash-card-icon.orange { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.dash-card-icon.red { background: var(--emergency-gradient); }
.dash-card-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.dash-card-value {
    font-size: 32px;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1;
    margin-bottom: 4px;
}

.dash-card-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* ---------- Content Cards ---------- */
.content-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.content-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card-title i {
    color: var(--primary-light);
}

.content-card-body {
    padding: 20px 24px;
}

/* ---------- List Items (for events, tasks, chores, etc.) ---------- */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}

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

.list-item:hover {
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    margin: 0 -8px;
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(99,102,241,0.1);
    color: var(--primary-light);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.list-item-action {
    flex-shrink: 0;
}

.list-item-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.list-item-badge.pending {
    background: rgba(251,191,36,0.12);
    color: #fbbf24;
}

.list-item-badge.done {
    background: rgba(52,211,153,0.12);
    color: #34d399;
}

.list-item-badge.urgent {
    background: rgba(248,113,113,0.12);
    color: #f87171;
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #475569;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* ---------- FAB (Floating Action Button) ---------- */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-gradient);
    color: white;
    font-size: 22px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 28px rgba(99,102,241,0.4);
    transition: all 0.3s var(--ease-spring);
    z-index: 60;
}

.fab:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 36px rgba(99,102,241,0.5);
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.25s ease;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--dark-surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    animation: card-entrance 0.35s var(--ease-out);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
}

/* ---------- Voice Assistant Pulsing ---------- */
.voice-assistant-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

/* Restyled voice-orb placeholder to prevent duplicate styles */
.voice-orb {
    /* Styles are defined in the global voice section at the bottom of this file */
}

.voice-orb::after {
    content: '';
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.voice-orb.listening::after {
    opacity: 1;
    animation: ripple 1.5s ease-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 40px rgba(99,102,241,0.3); }
    50% { box-shadow: 0 0 80px rgba(99,102,241,0.5), 0 0 120px rgba(168,85,247,0.2); }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.6); opacity: 0; }
}

.voice-status {
    margin-top: 24px;
    font-size: 16px;
    font-weight: 600;
    color: #94a3b8;
}

.voice-transcript {
    margin-top: 16px;
    padding: 16px 24px;
    background: rgba(15,23,42,0.5);
    border-radius: var(--radius-md);
    color: #e2e8f0;
    font-size: 15px;
    min-height: 48px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.04);
}

.voice-response {
    margin-top: 20px;
    padding: 20px 24px;
    background: rgba(99,102,241,0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99,102,241,0.15);
    color: #c7d2fe;
    font-size: 14px;
    max-width: 500px;
    width: 100%;
    line-height: 1.6;
    display: none;
}

.voice-response.visible {
    display: block;
    animation: fade-in 0.4s ease;
}

/* ---------- Chat Area ---------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.chat-messages {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: fade-in 0.3s ease;
}

.chat-bubble.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-bubble.received {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    color: #e2e8f0;
    border-bottom-left-radius: 6px;
}

.chat-bubble .meta {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.chat-input-area {
    padding: 16px 24px;
    background: rgba(15,23,42,0.8);
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    gap: 12px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(30,41,59,0.8);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--primary);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease-out);
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

/* ---------- Premium Lock Screen ---------- */
.premium-lock {
    text-align: center;
    padding: 80px 24px;
}

.premium-lock .lock-icon {
    font-size: 56px;
    background: var(--voice-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

.premium-lock h2 {
    font-size: 28px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 12px;
}

.premium-lock p {
    color: #64748b;
    font-size: 15px;
    max-width: 400px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--voice-gradient);
    color: var(--dark);
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(168,85,247,0.3);
}

/* ---------- Settings Page ---------- */
.settings-section {
    margin-bottom: 28px;
}

.settings-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(30,41,59,0.5);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: background 0.2s;
}

.setting-row:hover {
    background: rgba(30,41,59,0.8);
}

.setting-label {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
}

.setting-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #94a3b8;
    border-radius: 50%;
    transition: transform 0.3s var(--ease-spring), background 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.45);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #10b981;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: toast-in 0.4s var(--ease-spring);
    cursor: pointer;
}

.toast.success {
    background: rgba(16,185,129,0.95);
    color: white;
}

.toast.error {
    background: rgba(239,68,68,0.95);
    color: white;
}

.toast.info {
    background: rgba(99,102,241,0.95);
    color: white;
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(100px); }
}

/* ---------- Loading Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
        display: none;
    }
    .sidebar-overlay.visible {
        display: block;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 36px 24px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 20px 16px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 18px;
        border-radius: var(--radius-md);
    }
    .auth-title {
        font-size: 22px;
    }
    .mfa-inputs input {
        width: 40px;
        height: 48px;
        font-size: 18px;
    }
    .voice-orb {
        width: 110px;
        height: 110px;
    }
    .voice-orb i {
        font-size: 32px;
    }
}

/* ---------- Scrollbar Global ---------- */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}

/* ================================================================
   AGENDA, BUDGET & SETTINGS MODULES STYLES
   ================================================================ */

/* Agenda Controls & Tabs */
.agenda-controls button:hover, .budget-header-bar button:hover {
    filter: brightness(1.2);
}
.agenda-current-period {
    font-weight: 700;
    font-size: 16px;
    color: #f1f5f9;
    margin-left: 8px;
}
.view-tab, .btn-period {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--gray-light) !important;
    transition: all 0.2s ease;
}
.view-tab.active, .btn-period.active {
    background: var(--primary) !important;
    color: var(--white) !important;
    box-shadow: var(--shadow-sm);
}

/* Month view styles */
.calendar-day-cell {
    min-height: 90px;
    min-width: 0;
    background: var(--dark-card);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s ease;
    overflow: hidden;
}
.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.02);
}
.calendar-day-cell.other-month {
    opacity: 0.35;
    background: rgba(0,0,0,0.1);
}
.calendar-day-cell.today {
    background: rgba(99, 102, 241, 0.1);
}
.calendar-day-cell.today::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-gradient);
}
.day-number {
    font-size: 13px;
    font-weight: 700;
    color: #f1f5f9;
    align-self: flex-end;
}
.calendar-day-cell.today .day-number {
    color: var(--primary-light);
}
.day-events-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: 60px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.agenda-event-bar {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.15s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.agenda-event-bar:hover {
    transform: scale(1.02);
}

/* Week grid styling */
.week-time-row {
    display: contents;
}
.week-time-label {
    grid-column: 1;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    border-right: 1px solid rgba(255,255,255,0.05);
    text-align: right;
    padding-right: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    box-sizing: border-box;
}
.week-day-col {
    background: var(--dark-card);
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.03);
    min-height: 48px;
}
.week-day-col:hover {
    background: rgba(255,255,255,0.01);
}
.week-event-card {
    position: absolute;
    left: 4px;
    right: 4px;
    padding: 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.week-event-card .event-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.week-event-card .event-time {
    font-size: 10px;
    opacity: 0.8;
}

/* Day timeline styling */
.day-timeline-hour {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    min-height: 70px;
}
.day-hour-label {
    width: 80px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-align: right;
    border-right: 1px solid rgba(255,255,255,0.05);
    padding-right: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    box-sizing: border-box;
}
.day-hour-events {
    flex: 1;
    position: relative;
    padding: 8px 16px;
    display: flex;
    gap: 12px;
}
.day-event-card {
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}
.day-event-card .event-time {
    font-size: 11px;
    opacity: 0.8;
}

/* Budget specific styles */
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.03);
}
.balance-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.balance-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
}
.balance-username {
    font-weight: 600;
    font-size: 14px;
    color: #e2e8f0;
}
.balance-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}
.balance-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}
.balance-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    transition: transform 0.2s ease, border-color 0.2s ease;
    margin-bottom: 10px;
}
.expense-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.08);
}
.expense-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.expense-title {
    font-weight: 600;
    font-size: 14px;
    color: #f1f5f9;
}
.expense-meta {
    font-size: 11px;
    color: #64748b;
}
.expense-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.expense-amount {
    font-size: 15px;
    font-weight: 800;
    color: #f1f5f9;
}
.expense-delete-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: color 0.15s ease;
    padding: 4px;
}
.expense-delete-btn:hover {
    color: #ef4444;
}

/* Settings additions */
.lang-selector {
    margin-top: 6px;
}
.lang-btn {
    border: 1px solid rgba(255,255,255,0.05) !important;
}
.lang-btn.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
}
.family-card {
    padding: 16px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
    margin-bottom: 12px;
}
.family-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.family-name {
    font-weight: 700;
    font-size: 14px;
    color: #f1f5f9;
}
.family-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5e1;
}
.member-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}
.member-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.member-role.admin {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}
.member-role.member {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
.member-role.child {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.invite-code-display {
    background: rgba(0,0,0,0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    color: #34d399;
    border: 1px dashed rgba(52, 211, 153, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

#mod-budget {
    position: relative;
}

/* ---------- LIGHT THEME OVERRIDES ---------- */
body.light-theme {
    --dark: #f4f5f8;
    --dark-surface: #ffffff;
    --dark-card: #f8fafc;
    --light: #0f172a;
    background: #f4f5f8;
    color: #334155;
}

/* Global Headings Overrides in Light Theme */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6 {
    color: #0f172a !important;
}

/* Card titles and headers */
body.light-theme .content-card-title {
    color: #0f172a !important;
}
body.light-theme .content-card-header {
    border-bottom-color: rgba(0, 0, 0, 0.06) !important;
}
body.light-theme .settings-section-title {
    color: #64748b !important;
}

body.light-theme .topbar,
body.light-theme .content-card,
body.light-theme .agenda-controls,
body.light-theme .agenda-container-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: var(--shadow-sm);
}
body.light-theme .sidebar {
    background: #1e293b;
    color: white;
}
body.light-theme .sidebar .nav-item {
    color: #cbd5e1;
}
body.light-theme .sidebar .nav-item.active {
    color: white;
    background: rgba(255,255,255,0.08);
}
body.light-theme .dash-card {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: var(--shadow-sm);
}
body.light-theme .dash-card-label {
    color: #64748b;
}
body.light-theme .dash-card-value {
    color: #0f172a;
}
body.light-theme .list-item {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
}
body.light-theme .list-item-title {
    color: #0f172a;
}
body.light-theme .list-item-sub {
    color: #64748b;
}
body.light-theme .topbar-title {
    color: #0f172a;
}
body.light-theme .topbar-btn {
    color: #64748b;
}
body.light-theme .topbar-btn:hover {
    background: rgba(0,0,0,0.05);
}

/* Settings Rows Overrides (Fixing Dark Grey blocks) */
body.light-theme .setting-row {
    background: #f8fafc !important;
    border-color: rgba(0,0,0,0.06) !important;
    color: #1e293b !important;
}
body.light-theme .setting-row:hover {
    background: #f1f5f9 !important;
}
body.light-theme .setting-row:has(input:checked) {
    background: rgba(16, 185, 129, 0.06) !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
}
body.light-theme .setting-label {
    color: #0f172a !important;
}
body.light-theme .setting-desc {
    color: #64748b !important;
}

/* Modals & Premium Lock Overrides */
body.light-theme .modal {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: var(--shadow-lg) !important;
}
body.light-theme .modal-title {
    color: #0f172a !important;
}
body.light-theme .premium-lock-overlay {
    background: rgba(244, 245, 248, 0.85) !important;
    backdrop-filter: blur(8px) !important;
}
body.light-theme .lock-card {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.08) !important;
    box-shadow: var(--shadow-lg) !important;
}
body.light-theme .lock-card h3 {
    color: #0f172a !important;
}
body.light-theme .lock-card p {
    color: #475569 !important;
}

/* Input / Select / Textarea with Depth */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
    color: #94a3b8 !important;
}
body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15) !important;
}

/* View Selector & Period Selector (Fixing dark background) */
body.light-theme .agenda-view-tabs,
body.light-theme .period-selector {
    background: #f1f5f9 !important;
    border-color: rgba(0,0,0,0.08) !important;
}

/* Language Buttons Overrides */
body.light-theme .lang-btn {
    background: #f1f5f9 !important;
    border-color: rgba(0,0,0,0.08) !important;
    color: #475569 !important;
}
body.light-theme .lang-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .lang-btn.active {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
    color: var(--primary-dark) !important;
    font-weight: 700;
}

/* AI Logs Table Overrides */
body.light-theme thead tr {
    background: rgba(0,0,0,0.01) !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}
body.light-theme th {
    color: #64748b !important;
}
body.light-theme .ai-log-row {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}
body.light-theme .ai-log-date {
    color: #64748b !important;
}
body.light-theme .ai-log-input {
    color: #0f172a !important;
}
body.light-theme .ai-log-response {
    color: #1d4ed8 !important; /* High-contrast blue for light mode */
}
body.light-theme .ai-log-action-badge {
    background: rgba(99,102,241,0.12) !important;
    color: #4f46e5 !important;
}
body.light-theme .btn-correct {
    background: rgba(99, 102, 241, 0.08) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    color: #4f46e5 !important;
}
body.light-theme .btn-correct:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #4f46e5 !important;
}

/* Global Voice Assistant Card Overrides */
body.light-theme #globalVoiceCard {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: var(--shadow-md) !important;
}
body.light-theme #globalVoiceStatus {
    color: #64748b !important;
}
body.light-theme #globalVoiceTranscript {
    background: rgba(0, 0, 0, 0.03) !important;
    color: #334155 !important;
}
body.light-theme #globalVoiceResponse {
    background: rgba(99, 102, 241, 0.05) !important;
    border-color: rgba(99, 102, 241, 0.15) !important;
    color: #1d4ed8 !important;
}

/* Chat Module Overrides in Light Theme */
body.light-theme .chat-bubble.sent {
    background: var(--primary) !important;
    color: #ffffff !important;
}
body.light-theme .chat-bubble.sent .meta {
    color: rgba(255, 255, 255, 0.75) !important;
}
body.light-theme .chat-bubble.received {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}
body.light-theme .chat-bubble.received .meta {
    color: #64748b !important;
}
body.light-theme .chat-input-area {
    background: #ffffff !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Event Details Modal Content Overrides */
body.light-theme .event-det-meta {
    color: #475569 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}
body.light-theme #detEventCreator {
    color: #0f172a !important;
}
body.light-theme #detEventGroupBadge.badge-group {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #059669 !important;
}
body.light-theme #detEventGroupBadge.badge-personal {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #4f46e5 !important;
}

body.light-theme .list-item.active {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

body.light-theme .btn-ctrl {
    background: #f8fafc !important;
    border-color: rgba(0,0,0,0.12) !important;
    color: #0f172a !important;
}
body.light-theme .btn-ctrl:hover {
    background: #e2e8f0 !important;
}
body.light-theme .btn-ctrl#detDeleteBtn {
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}
body.light-theme .btn-ctrl#detDeleteBtn:hover {
    background: rgba(239, 68, 68, 0.05) !important;
}

body.light-theme .family-card {
    background: #f8fafc;
    border-color: rgba(0,0,0,0.06);
}
body.light-theme .family-name {
    color: #0f172a;
}
body.light-theme .member-info {
    color: #334155;
}
body.light-theme .member-avatar {
    background: rgba(0,0,0,0.05);
    color: #0f172a;
}
body.light-theme .month-grid-body,
body.light-theme .week-grid-body {
    background: #cbd5e1 !important;
    border-color: #cbd5e1 !important;
}
body.light-theme .calendar-day-cell,
body.light-theme .week-day-col {
    background: #ffffff !important;
}
body.light-theme .calendar-day-cell:hover,
body.light-theme .week-day-col:hover {
    background: #f1f5f9 !important;
}
body.light-theme .calendar-day-cell.other-month {
    background: #f8fafc !important;
    color: #94a3b8 !important;
}
body.light-theme .day-number {
    color: #334155 !important;
}
body.light-theme .week-time-label {
    color: #475569 !important;
    border-right-color: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .day-hour-label {
    color: #475569 !important;
    border-right-color: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .day-timeline-hour {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .week-day-col {
    border-color: #e2e8f0 !important;
}
body.light-theme .week-grid-header span,
body.light-theme .month-grid-header span {
    color: #0f172a !important;
}
body.light-theme .week-event-card .event-title {
    color: white;
}
body.light-theme .week-event-card .event-time {
    color: rgba(255,255,255,0.9);
}

/* Budget Light Theme Overrides */
body.light-theme .total-value {
    color: #0f172a !important;
}
body.light-theme .total-label {
    color: #475569 !important;
}
body.light-theme .btn-period {
    color: #475569 !important;
}
body.light-theme .btn-period.active {
    color: #ffffff !important;
    background: var(--primary) !important;
}
body.light-theme .balance-row {
    background: #f8fafc !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}
body.light-theme .balance-name {
    color: #0f172a !important;
}
body.light-theme .balance-paid {
    color: #475569 !important;
}
body.light-theme .expense-amount {
    color: #0f172a !important;
}
body.light-theme .budget-header-bar {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* ---------- Event Details Bubble Styles ---------- */
#modalEventDetails.modal-overlay {
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

#modalEventDetails .modal {
    max-width: 360px;
    width: 90%;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(30, 41, 59, 0.85) !important;
    backdrop-filter: blur(20px);
    position: relative;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 20px -3px rgba(99, 102, 241, 0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
    animation: popover-entrance 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.light-theme #modalEventDetails .modal {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 20px -3px rgba(99, 102, 241, 0.1);
}

@keyframes popover-entrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.btn-ctrl {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ctrl:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}

#detEventTitle {
    font-size: 18px;
    font-weight: 800;
    color: #f1f5f9;
    margin-bottom: 12px;
    line-height: 1.4;
}

body.light-theme #detEventTitle {
    color: #0f172a;
}

#detEventDescription {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 24px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.light-theme #detEventDescription {
    color: #334155;
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.04);
}

.clickable-address {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
    cursor: pointer;
}

.clickable-address:hover {
    color: var(--primary);
    text-decoration: underline;
}

body.light-theme .clickable-address {
    color: #334155;
}

body.light-theme .clickable-address:hover {
    color: var(--primary);
}

/* ---------- Chat Panel Layout Improvements ---------- */
#conversationsList {
    max-height: 280px;
    overflow-y: auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .chat-container {
        flex-direction: row !important;
        gap: 20px;
        align-items: stretch;
        height: calc(100vh - 148px) !important;
        min-height: 500px;
    }

    .chat-container > .content-card:first-child {
        width: 320px;
        flex-shrink: 0;
        margin-bottom: 0 !important;
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .chat-container > .content-card:first-child #conversationsList {
        flex: 1;
        max-height: none !important;
        overflow-y: auto;
    }

    .chat-container > .content-card:last-child {
        flex: 1;
        margin-bottom: 0 !important;
        height: 100%;
        min-height: 0 !important;
        display: flex;
        flex-direction: column;
    }
}
/* Light theme toggle override */
body.light-theme .toggle-slider {
    background: rgba(15, 23, 42, 0.08) !important;
    border-color: rgba(15, 23, 42, 0.15) !important;
}

body.light-theme .toggle-slider::before {
    background: #64748b !important;
}

body.light-theme .toggle input:checked + .toggle-slider {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
}

body.light-theme .toggle input:checked + .toggle-slider::before {
    background: #10b981 !important;
}

/* Setting row highlight on active */
.setting-row {
    transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.setting-row:has(input:checked) {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
}
body.light-theme .setting-row:has(input:checked) {
    background: rgba(16, 185, 129, 0.02);
    border-color: rgba(16, 185, 129, 0.2);
}

/* School Schedule Light Theme */
body.light-theme .agenda-current-period {
    color: #0f172a !important;
}

body.light-theme .agenda-controls {
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    box-shadow: var(--shadow-sm);
}

body.light-theme .school-grid-container {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: var(--shadow-sm);
}

body.light-theme .school-grid-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    color: #475569;
}

body.light-theme .school-hour-label {
    color: #475569;
}

body.light-theme .school-day-col {
    border-left: 1px dashed rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .school-grid-lines {
    background-image: 
        /* Hour lines: 1px line every 60px */
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.08) 0px,
            rgba(0, 0, 0, 0.08) 1px,
            transparent 1px,
            transparent 60px
        ),
        /* Quarter-hour lines: 1px light line every 15px */
        repeating-linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.02) 0px,
            rgba(0, 0, 0, 0.02) 1px,
            transparent 1px,
            transparent 15px
        );
}

body.light-theme .school-children-bar {
    background: #ffffff;
    border-color: rgba(0,0,0,0.06);
    box-shadow: var(--shadow-sm);
}

body.light-theme .school-child-card {
    background: #f1f5f9;
    border-color: rgba(0,0,0,0.06);
    color: #475569;
}

body.light-theme .school-child-card:hover {
    background: #e2e8f0;
    color: #0f172a;
}

body.light-theme .school-child-card.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

body.light-theme .school-child-avatar {
    background: rgba(0,0,0,0.05);
    color: #0f172a;
}

body.light-theme .school-child-card.active .school-child-avatar {
    background: rgba(255,255,255,0.2);
    color: white;
}

body.light-theme .school-child-add {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

body.light-theme .school-child-add:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-dark);
}

body.light-theme .school-copy-banner {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-lg);
    color: #0f172a;
}


/* List Item Checklist style */
.list-item-check-input {
    accent-color: var(--primary);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.list-item-text.checked {
    text-decoration: line-through;
    opacity: 0.5;
    color: #94a3b8;
}

.item-delete-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-delete-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 768px) {
    .lists-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Notification Item style */
.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    transition: all 0.2s;
    align-items: flex-start;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notification-icon.info {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.notification-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.notification-icon.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.notification-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

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

.notification-title {
    font-weight: 700;
    font-size: 13px;
    color: #f1f5f9;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 10px;
    color: #64748b;
}

.notification-actions {
    display: flex;
    align-items: center;
    align-self: center;
    margin-left: 8px;
}

.notification-read-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.notification-read-btn:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.light-theme .notification-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

.light-theme .notification-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.light-theme .notification-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.light-theme .notification-title {
    color: #0f172a;
}

.light-theme .notification-message {
    color: #475569;
}

/* ================================================================
   GLOBAL FLOATING VOICE ASSISTANT
   ================================================================ */
#globalVoiceCard {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#globalVoiceCard.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

#globalVoiceOrb {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- VOICE ORB STYLING (MOBILE ACCORDANCE) --- */
.voice-orb, #globalVoiceOrb {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    outline: none;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.voice-orb:hover, #globalVoiceOrb:hover {
    transform: scale(1.05);
}

.voice-orb:active, #globalVoiceOrb:active {
    transform: scale(0.95);
}

/* Base ring settings */
#globalVoiceOrb {
    width: 70px;
    height: 70px;
}
.voice-orb {
    width: 140px;
    height: 140px;
    margin: 0 auto;
}

/* Outer ring base */
.voice-orb .orb-base, #globalVoiceOrb .orb-base {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 4px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

#globalVoiceOrb .orb-base {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

.voice-orb .orb-base {
    width: 120px;
    height: 120px;
    border-width: 8px;
}

.voice-orb.listening .orb-base, #globalVoiceOrb.listening .orb-base {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Inner gradient circle */
.voice-orb .orb-inner, #globalVoiceOrb .orb-inner {
    border-radius: 50%;
    background: linear-gradient(135deg, #FCD34D, #F472B6, #6366F1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#globalVoiceOrb .orb-inner {
    width: 44px;
    height: 44px;
}

.voice-orb .orb-inner {
    width: 90px;
    height: 90px;
}

.voice-orb.listening .orb-inner, #globalVoiceOrb.listening .orb-inner {
    background: linear-gradient(135deg, #EF4444, #B91C1C);
}

/* Icons */
.voice-orb .orb-icon, #globalVoiceOrb .orb-icon {
    color: white;
    transition: transform 0.2s ease;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
}

#globalVoiceOrb .orb-icon {
    font-size: 20px;
}

.voice-orb .orb-icon {
    font-size: 40px;
}

/* Pulsing waves behind */
.voice-orb .orb-waves, #globalVoiceOrb .orb-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    display: none;
}

#globalVoiceOrb .orb-waves {
    width: 44px;
    height: 44px;
}

.voice-orb .orb-waves {
    width: 90px;
    height: 90px;
}

.voice-orb.listening .orb-waves, #globalVoiceOrb.listening .orb-waves,
.voice-orb.processing .orb-waves, #globalVoiceOrb.processing .orb-waves {
    display: block;
}

.voice-orb .orb-wave, #globalVoiceOrb .orb-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
}

.voice-orb.listening .orb-wave, #globalVoiceOrb.listening .orb-wave {
    background: #EF4444;
}

.voice-orb.processing .orb-wave, #globalVoiceOrb.processing .orb-wave {
    background: var(--primary);
}

/* Pulsing animation for waves */
.voice-orb .orb-wave:nth-child(1), #globalVoiceOrb .orb-wave:nth-child(1) {
    animation: orb-wave-pulse 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 0s;
}

.voice-orb .orb-wave:nth-child(2), #globalVoiceOrb .orb-wave:nth-child(2) {
    animation: orb-wave-pulse 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 0.8s;
}

.voice-orb .orb-wave:nth-child(3), #globalVoiceOrb .orb-wave:nth-child(3) {
    animation: orb-wave-pulse 2.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
    animation-delay: 1.6s;
}

@keyframes orb-wave-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}


/* ---------- Language Buttons Base Styles ---------- */
.lang-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    color: #94a3b8;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}
.lang-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}
.lang-btn.active {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

/* ---------- AI Logs Table Base Styles ---------- */
.ai-log-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.ai-log-date {
    padding: 12px 16px;
    color: #94a3b8;
    font-size: 12px;
}
.ai-log-input {
    padding: 12px 16px;
    font-weight: 500;
    color: #e2e8f0;
}
.ai-log-response {
    color: #38bdf8;
    margin-bottom: 6px;
    line-height: 1.4;
}
.ai-log-action-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    margin-right: 4px;
}

/* ---------- AI Log Correction Button ---------- */
.btn-correct {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #818cf8;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-correct:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
}

/* ---------- Event Details Meta Base Style ---------- */
.event-det-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

/* Active List Items (Conversations) Base Style */
.list-item.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

/* ================================================================
   SCHOOL MODULE (PLANNING SCOLAIRE)
   ================================================================ */
.school-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.school-children-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--dark-surface);
    padding: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
}

.school-child-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.school-child-card:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.school-child-card.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.school-child-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.school-child-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed var(--primary);
    color: var(--primary-light);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.school-child-add:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

/* Grid layout */
.school-grid-container {
    overflow-x: auto;
    background: var(--dark-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.05);
}

.school-grid-header {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    text-align: center;
    font-weight: 700;
    color: #64748b;
    font-size: 13px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
    min-width: 800px;
}

.school-grid-body {
    display: grid;
    grid-template-columns: 80px repeat(6, 1fr);
    min-width: 800px;
    height: 660px; /* 11 hours * 60px = 660px */
    position: relative;
    background: rgba(255,255,255,0.01);
    border-radius: 8px;
    overflow: visible;
}

.school-hour-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    padding-right: 12px;
    box-sizing: border-box;
    pointer-events: none;
}

.school-hour-label {
    position: absolute;
    right: 12px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    transform: translateY(-50%);
}

.school-hour-label:nth-child(1) { top: 0px; }
.school-hour-label:nth-child(2) { top: 60px; }
.school-hour-label:nth-child(3) { top: 120px; }
.school-hour-label:nth-child(4) { top: 180px; }
.school-hour-label:nth-child(5) { top: 240px; }
.school-hour-label:nth-child(6) { top: 300px; }
.school-hour-label:nth-child(7) { top: 360px; }
.school-hour-label:nth-child(8) { top: 420px; }
.school-hour-label:nth-child(9) { top: 480px; }
.school-hour-label:nth-child(10) { top: 540px; }
.school-hour-label:nth-child(11) { top: 600px; }
.school-hour-label:nth-child(12) { top: 660px; }

.school-day-col {
    position: relative;
    height: 100%;
    border-left: 1px dashed rgba(255,255,255,0.05);
}

/* Hourly background lines & Quarter hour lines */
.school-grid-lines {
    position: absolute;
    top: 0;
    left: 80px;
    right: 0;
    height: 100%;
    pointer-events: none;
    background-image: 
        /* Hour lines: 1px line every 60px */
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.08) 0px,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px,
            transparent 60px
        ),
        /* Quarter-hour lines: 1px light line every 15px */
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.02) 0px,
            rgba(255, 255, 255, 0.02) 1px,
            transparent 1px,
            transparent 15px
        );
}

.school-grid-line {
    display: none;
}

/* Event cards */
.school-class-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
    border-left: 4px solid rgba(255,255,255,0.4);
    box-sizing: border-box;
}

.school-class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    filter: brightness(1.1);
}

.school-class-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.school-class-time {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 500;
}

.school-class-pause {
    background: rgba(71, 85, 105, 0.2) !important;
    border: 1px dashed rgba(148, 163, 184, 0.3) !important;
    border-left: 4px solid #64748b !important;
    color: #94a3b8 !important;
}

.school-class-pause .school-class-title {
    color: #cbd5e1;
    font-style: italic;
}

/* School Schedule Interaction Styles */
.school-class-card.dragging,
.school-class-card.resizing {
    transition: none !important;
}

.school-class-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
}

.school-class-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    cursor: ns-resize;
    background: transparent;
    z-index: 10;
}

.school-class-resize-handle::after {
    content: '';
    position: absolute;
    left: 30%;
    right: 30%;
    bottom: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 1px;
    transition: background 0.2s;
}

.school-class-card:hover .school-class-resize-handle::after {
    background: rgba(255, 255, 255, 0.7);
}

.school-class-copy-btn,
.school-class-edit-btn {
    position: absolute;
    top: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    z-index: 9;
}

.school-class-copy-btn {
    right: 8px;
}

.school-class-edit-btn {
    right: 8px;
}

.school-class-card:has(.school-class-copy-btn) .school-class-edit-btn {
    right: 34px;
}

.school-class-card:hover .school-class-copy-btn,
.school-class-card:hover .school-class-edit-btn {
    opacity: 1;
}

.school-class-copy-btn:hover,
.school-class-edit-btn:hover {
    background: rgba(99, 102, 241, 0.8);
    color: white;
}

.school-day-col.copy-active {
    outline: 2px dashed rgba(99, 102, 241, 0.6);
    outline-offset: -2px;
    background: rgba(99, 102, 241, 0.05);
    cursor: cell;
}

.school-copy-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #1e293b;
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 10px;
    margin-top: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
    font-size: 13px;
    animation: fadeIn 0.3s ease-out;
}

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

/* ==========================================================================
   ADMIN PRO CONSOLE STYLING
   ========================================================================== */
.admin-tab-btn {
    transition: all 0.2s ease;
}
.admin-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}
.admin-tab-btn.active {
    background: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.admin-pill-radio {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.admin-pill-radio input {
    display: none;
}
.admin-pill-radio span {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    user-select: none;
}
.admin-pill-radio input:checked + span {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.admin-action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.admin-action-btn.btn-gift {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.admin-action-btn.btn-gift:hover {
    background: #10b981;
    color: #ffffff;
}
.admin-action-btn.btn-credits {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}
.admin-action-btn.btn-credits:hover {
    background: #38bdf8;
    color: #0f172a;
}
.admin-action-btn.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}
.admin-action-btn.btn-logout:hover {
    background: #ef4444;
    color: #ffffff;
}



