/* IAMastery - Main CSS */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --primary: #1B2A4A;
    --primary-light: #243660;
    --primary-dark: #111c33;
    --accent: #F47C3F;
    --accent-light: #f6935f;
    --accent-dark: #d4632a;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;

    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);

    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --sidebar-width: 240px;
    --sidebar-width-collapsed: 76px;
    --header-height: 64px;
    --transition: all 0.2s ease;
}

@media (min-width: 769px) {
    html.sidebar-collapsed { --sidebar-width: var(--sidebar-width-collapsed); }
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--neutral-800);
    background: var(--neutral-50);
    -webkit-font-smoothing: antialiased;
}

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

a:hover { color: var(--accent-dark); }

img { max-width: 100%; height: auto; }

ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { line-height: 1.6; color: var(--neutral-600); }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--neutral-500); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ============================================================
   LAYOUT - PUBLIC
   ============================================================ */
.public-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   LAYOUT - DASHBOARD (SIDEBAR + MAIN)
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--neutral-50);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease, width 0.2s ease;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-collapse-item {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.sidebar-collapse-item:hover {
    color: var(--white);
    background: rgba(255,255,255,0.08);
}

.sidebar-collapse-item .collapse-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

html.sidebar-collapsed .sidebar-collapse-item .collapse-chevron { transform: rotate(180deg); }

@media (min-width: 769px) {
    .sidebar-collapse-item { display: flex; }
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
}

.sidebar-logo .logo-text span {
    color: var(--accent);
}

.sidebar-logo .logo-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    padding: 8px 20px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.65);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.nav-item.active {
    color: var(--white);
    background: rgba(244,124,63,0.15);
    border-left-color: var(--accent);
}

.nav-item .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

/* Badge compteur dans la sidebar (missions, sessions, messages, support) */
.nav-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.nav-item.active .nav-badge {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Menu à 2 niveaux (parents pliables façon WordPress) ── */
.nav-group { position: relative; }

/* Parent : bouton stylé comme un nav-item */
.nav-parent {
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    font: inherit;
    text-align: left;
}

.nav-caret {
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.2s ease;
}
/* Quand un badge est présent, il pousse à droite ; le caret le suit */
.nav-parent .nav-badge + .nav-caret { margin-left: 8px; }
.nav-group.open > .nav-parent .nav-caret { transform: rotate(180deg); }
.nav-group.open > .nav-parent { color: var(--white); }

/* Sous-menu : accordéon inline par défaut (barre dépliée, au clic) */
.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}
.nav-group.open > .nav-submenu { max-height: 600px; }
/* En mode rétracté, jamais d'accordéon inline : c'est le flyout qui affiche */
html.sidebar-collapsed .nav-group.open > .nav-submenu { max-height: 0; }

.nav-submenu .nav-item {
    padding-left: 49px;
    font-size: 0.83rem;
}
.nav-submenu-label { display: none; }

/* Flyout flottant au survol (desktop) — position calculée en JS via --flyout-*.
   Fonctionne barre dépliée ET rétractée ; en position:fixed pour ne pas être
   coupé par l'overflow de la barre. */
@media (min-width: 769px) {
    html.sidebar-collapsed .nav-parent .nav-caret { display: none; }

    .nav-submenu.is-flyout {
        position: fixed;
        left: var(--flyout-left, 100%);
        top: var(--flyout-top, 0);
        min-width: 220px;
        max-height: none;
        overflow: visible;
        padding: 6px 0;
        background: var(--primary-dark);
        border-radius: 0 var(--radius) var(--radius) 0;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }
    .nav-submenu.is-flyout .nav-item {
        padding-left: 20px;
        justify-content: flex-start;
    }
    .nav-submenu.is-flyout .nav-item span:not(.nav-badge) { display: inline; }
    .nav-submenu.is-flyout .nav-item .nav-icon { margin-right: 10px; margin-left: 0; }
    .nav-submenu.is-flyout .nav-submenu-label {
        display: block;
        padding: 8px 20px 6px;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: rgba(255,255,255,0.45);
    }
}

.cohort-switcher {
    padding: 4px 16px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 4px;
}
.cohort-select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.07);
    color: inherit;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
.cohort-select:hover, .cohort-select:focus { border-color: rgba(255,255,255,0.3); }
.cohort-select option { background: #1e2a3a; color: #fff; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    transition: var(--transition);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-decoration: none;
}

.logout-btn:hover {
    color: var(--error);
    background: rgba(239,68,68,0.1);
    text-decoration: none;
}

/* Sidebar retractee (desktop) */
@media (min-width: 769px) {
    html.sidebar-collapsed .sidebar-logo .logo-text span,
    html.sidebar-collapsed .sidebar-logo .logo-sub,
    html.sidebar-collapsed .nav-section-title,
    html.sidebar-collapsed .cohort-switcher,
    html.sidebar-collapsed .nav-item span:not(.nav-badge),
    html.sidebar-collapsed .sidebar-user .user-info,
    html.sidebar-collapsed .logout-btn span,
    html.sidebar-collapsed .sidebar-collapse-item span {
        display: none;
    }

    html.sidebar-collapsed .nav-item {
        justify-content: center;
        padding: 10px 0;
        position: relative;
    }

    html.sidebar-collapsed .nav-item .nav-icon { margin: 0; }

    html.sidebar-collapsed .nav-item .nav-badge {
        position: absolute;
        top: 6px;
        right: 18px;
        min-width: 8px;
        width: 8px;
        height: 8px;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
    }

    html.sidebar-collapsed .sidebar-user { justify-content: center; }

    html.sidebar-collapsed .logout-btn { justify-content: center; }

    html.sidebar-collapsed .sidebar-collapse-item { justify-content: center; }
}

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

/* Top bar */
.topbar {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    padding: 0 32px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--primary);
}

/* Page content */
.page-content {
    padding: 32px;
    flex: 1;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--neutral-500);
    font-size: 0.875rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.card-body { padding: 24px; }

.card-footer {
    padding: 16px 24px;
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-100);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; color: var(--info); }
.stat-icon.orange { background: #fed7aa; color: var(--accent); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red { background: var(--error-light); color: var(--error); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }

.stat-icon svg { width: 24px; height: 24px; }

.stat-info { flex: 1; min-width: 0; }
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    font-weight: 500;
}
.stat-change {
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: 500;
}
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }

/* ============================================================
   GRID & LAYOUT UTILITIES
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

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

thead {
    background: var(--neutral-50);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--neutral-200);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--neutral-100);
    color: var(--neutral-700);
    vertical-align: middle;
}

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

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover { background: var(--neutral-50); }

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Actions compactes sous le nom (lignes de tableau) — révélées au survol de la ligne */
.row-actions {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
    row-gap: 2px;
}
tr:hover .row-actions,
tr:focus-within .row-actions {
    display: flex;
}
/* Écrans tactiles (pas de survol possible) : toujours visibles */
@media (hover: none) {
    .row-actions { display: flex; }
}
.row-actions > * {
    display: inline-flex;
    align-items: center;
    margin: 0;
}
.row-actions > *:not(:first-child)::before {
    content: "·";
    margin: 0 7px;
    color: var(--neutral-300);
    font-weight: 400;
}
.ra-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    line-height: 1.5;
    white-space: nowrap;
}
.ra-link:hover { text-decoration: underline; }
.ra-link.ra-danger { color: var(--error); }
.ra-link.ra-warn { color: #92400e; }
.ra-link.ra-muted { color: var(--neutral-600); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--accent);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--accent-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244,124,63,0.35);
}

.btn-secondary {
    background: var(--primary);
    color: var(--white);
}
.btn-secondary:hover {
    background: var(--primary-light);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--neutral-300);
}
.btn-outline:hover {
    border-color: var(--primary);
    background: var(--neutral-50);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-600);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--neutral-100);
    color: var(--primary);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}
.btn-danger:hover {
    background: #dc2626;
    color: var(--white);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}
.btn-success:hover { background: #059669; color: var(--white); }

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-sm);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--neutral-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: 'Inter', sans-serif;
    color: var(--neutral-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(244,124,63,0.12);
}

.form-control::placeholder { color: var(--neutral-400); }

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
}

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

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 40px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-400);
    width: 18px;
    height: 18px;
}

.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 40px; }
.pw-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neutral-400);
    padding: 2px;
    display: flex;
    align-items: center;
    line-height: 0;
    transition: color .15s;
}
.pw-toggle:hover { color: var(--neutral-600); }
.pw-toggle svg { width: 17px; height: 17px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-error { background: var(--error-light); color: #991b1b; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-neutral { background: var(--neutral-100); color: var(--neutral-600); }
.badge-primary { background: rgba(27,42,74,0.1); color: var(--primary); }
.badge-accent { background: rgba(244,124,63,0.12); color: var(--accent-dark); }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--error-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid #93c5fd; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1.125rem; font-weight: 600; color: var(--primary); }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neutral-400);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover { color: var(--neutral-700); background: var(--neutral-100); }
.modal-close svg { width: 20px; height: 20px; }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================================
   MOTIVATION BAR
   ============================================================ */
.motivation-bar {
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.motivation-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent), #f9a268);
    transition: width 0.5s ease;
}

.motivation-section {
    margin-bottom: 24px;
}

.motivation-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
    height: 6px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--success);
    transition: width 0.4s ease;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--neutral-500);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--neutral-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--neutral-600);
    margin-bottom: 8px;
}

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

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    max-width: 420px;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: all;
    animation: toastIn 0.25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.hiding { animation: toastOut 0.25s ease forwards; }

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

.toast-success { background: #022c22; color: #a7f3d0; }
.toast-error { background: #450a0a; color: #fca5a5; }
.toast-info { background: #0c1a3d; color: #93c5fd; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-200);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

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

/* ============================================================
   PUBLIC NAVBAR
   ============================================================ */
.public-nav {
    background: var(--white);
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
    text-decoration: none;
}

.nav-logo span { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    color: var(--neutral-600);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--neutral-100);
    text-decoration: none;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    background: var(--primary);
    color: var(--white);
    padding: 96px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(244,124,63,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: 760px;
    margin: 0 auto;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(244,124,63,0.15);
    border: 1px solid rgba(244,124,63,0.3);
    color: var(--accent-light);
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero h1 span { color: var(--accent); }

.hero p {
    font-size: 1.125rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 40px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    padding: 14px 32px;
    background: var(--accent);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-hero-primary:hover {
    background: var(--accent-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244,124,63,0.4);
    text-decoration: none;
}

.btn-hero-outline {
    padding: 14px 32px;
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.btn-hero-outline:hover {
    border-color: var(--white);
    background: rgba(255,255,255,0.08);
    color: var(--white);
    text-decoration: none;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--primary);
}

.auth-left {
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-left::before {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(244,124,63,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    margin-bottom: 48px;
    position: relative;
}

.auth-logo span { color: var(--accent); }

.auth-hero-text h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 16px;
    position: relative;
}

.auth-hero-text h2 em {
    font-style: normal;
    color: var(--accent);
}

.auth-hero-text p {
    color: rgba(255,255,255,0.6);
    font-size: 1.0625rem;
    line-height: 1.7;
    position: relative;
}

.auth-features {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
}

.auth-feature-icon {
    width: 28px;
    height: 28px;
    background: rgba(244,124,63,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}

.auth-feature-icon svg { width: 14px; height: 14px; }

.auth-right {
    background: var(--white);
    border-radius: 24px 0 0 24px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 32px;
}

.auth-form-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-form-header p {
    color: var(--neutral-500);
}

.auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--neutral-200);
}

.auth-divider span {
    position: relative;
    background: var(--white);
    padding: 0 12px;
    color: var(--neutral-400);
    font-size: 0.8125rem;
}

/* ============================================================
   SESSION & MISSION ITEMS
   ============================================================ */
.session-item, .mission-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-100);
}

.session-item:last-child, .mission-item:last-child { border-bottom: none; }

.session-date {
    width: 52px;
    text-align: center;
    flex-shrink: 0;
}

.session-date .day {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.session-date .month {
    font-size: 0.7rem;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.session-info { flex: 1; }
.session-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}
.session-meta {
    font-size: 0.8rem;
    color: var(--neutral-500);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============================================================
   PROGRAM CARD
   ============================================================ */
.program-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.program-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.program-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.program-card-body { padding: 20px; }
.program-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}
.program-card-desc {
    font-size: 0.8125rem;
    color: var(--neutral-500);
    line-height: 1.5;
    margin-bottom: 16px;
}
.program-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.program-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
}

/* ============================================================
   TICKET
   ============================================================ */
.ticket-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--neutral-200);
    margin-bottom: 12px;
    transition: var(--transition);
}

.ticket-item:hover { border-color: var(--neutral-300); background: var(--neutral-50); }
.ticket-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}
.ticket-dot.open { background: var(--error); }
.ticket-dot.in_progress { background: var(--warning); }
.ticket-dot.resolved { background: var(--success); }

/* ============================================================
   FOOTER (public)
   ============================================================ */
.public-footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 24px;
    font-size: 0.875rem;
    margin-top: auto;
}

.public-footer a { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

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

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }

    .sidebar-overlay.active { display: block; }

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

    .hamburger { display: flex; }

    .page-content { padding: 20px 16px; }

    .topbar { padding: 0 16px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

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

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

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-left { display: none; }

    .auth-right {
        border-radius: 0;
        padding: 32px 24px;
        justify-content: flex-start;
        padding-top: 48px;
    }

    .hero h1 { font-size: 2rem; }

    .hero { padding: 64px 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.75rem; }
}

/* ============================================================
   COHORT CALENDAR
   ============================================================ */
.cohort-cal-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: var(--neutral-200);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
}

.cohort-cal-month {
    background: var(--white);
    padding: 12px 10px;
}

.cohort-cal-month-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--white);
    background: var(--primary);
    text-align: center;
    padding: 6px 4px;
    letter-spacing: .06em;
    border-radius: 4px;
    margin-bottom: 8px;
}

.cohort-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 4px;
}

.cohort-cal-dow span {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--neutral-400);
    text-align: center;
    padding: 2px 0;
}

.cohort-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.cohort-cal-days span {
    font-size: 0.65rem;
    color: var(--primary);
    text-align: center;
    padding: 3px 1px;
    line-height: 1.4;
    border-radius: 50%;
}

.cohort-cal-days span.cohort-cal-hl {
    background: var(--accent);
    color: var(--white);
    font-weight: 700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    font-size: 0.6rem;
}

.cohort-events-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
}

.cohort-events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.cohort-events-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cohort-event-row {
    display: grid;
    grid-template-columns: 90px 3px 1fr;
    gap: 0 12px;
    align-items: stretch;
    padding: 12px 0;
    border-bottom: 1px solid var(--neutral-100);
}

.cohort-event-row:last-child {
    border-bottom: none;
}

.cohort-event-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    padding-top: 2px;
    white-space: nowrap;
}

.cohort-event-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    align-self: stretch;
    min-height: 32px;
}

.cohort-event-body {
    padding-left: 0;
}

.cohort-event-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.cohort-event-desc {
    font-size: 0.75rem;
    color: var(--neutral-500);
    font-style: italic;
}

.cohort-cal-footer {
    margin-top: 20px;
    font-size: 0.7rem;
    color: var(--neutral-400);
    font-style: italic;
}

@media (max-width: 1100px) {
    .cohort-cal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .cohort-cal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cohort-events-grid {
        grid-template-columns: 1fr;
    }
    .cohort-event-row {
        grid-template-columns: 80px 3px 1fr;
    }
}

@media (max-width: 480px) {
    .cohort-cal-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   NOTIFICATION BELL & PANEL
   ============================================================ */

.notif-wrap {
    position: relative;
}

.notif-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.notif-bell:hover,
.notif-bell.active {
    background: var(--neutral-100);
    color: var(--primary);
}
.notif-bell svg { width: 18px; height: 18px; }

.notif-badge {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 17px;
    height: 17px;
    border-radius: 10px;
    background: var(--error);
    color: #fff;
    font-size: 9.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
    pointer-events: none;
    border: 2px solid var(--white);
    box-sizing: content-box;
}

/* Panel */
.notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 520px;
    background: var(--white);
    border: 1px solid var(--neutral-200);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
    z-index: 300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: notif-in .15s ease;
}
@keyframes notif-in {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-panel-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--neutral-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.notif-panel-title {
    font-size: .875rem;
    font-weight: 700;
    color: var(--neutral-900, #0f172a);
}
.notif-mark-all {
    font-size: .72rem;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    transition: background .12s, color .12s;
}
.notif-mark-all:hover:not(:disabled) { background: var(--neutral-100); }
.notif-mark-all:disabled { color: var(--neutral-300); cursor: default; }

/* List */
.notif-list {
    flex: 1;
    overflow-y: auto;
    min-height: 60px;
}
.notif-loading,
.notif-empty {
    padding: 32px 16px;
    text-align: center;
    font-size: .82rem;
    color: var(--neutral-400);
}
.notif-empty svg {
    width: 32px;
    height: 32px;
    margin: 0 auto 10px;
    display: block;
    opacity: .35;
}

/* Item */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid var(--neutral-50);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--neutral-50); }
.notif-item.notif-unread { background: rgba(27,42,74,.03); }
.notif-item.notif-unread:hover { background: rgba(27,42,74,.06); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.notif-icon svg { width: 15px; height: 15px; }

/* Type colors */
.notif-icon-ticket_new       { background: #fee2e2; color: #dc2626; }
.notif-icon-ticket_reply     { background: #dbeafe; color: #2563eb; }
.notif-icon-enrollment_new   { background: #d1fae5; color: #059669; }
.notif-icon-mission_submitted { background: #fef3c7; color: #d97706; }
.notif-icon-mission_new       { background: #dbeafe; color: #2563eb; }
.notif-icon-mission_graded   { background: #fef9c3; color: #ca8a04; }
.notif-icon-group_email      { background: var(--neutral-100); color: var(--neutral-600); }
.notif-icon-synthesis_submitted { background: #e0f2fe; color: #0369a1; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--neutral-700);
    line-height: 1.35;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.notif-item.notif-unread .notif-title { color: var(--neutral-900, #0f172a); }
.notif-body {
    font-size: .73rem;
    color: var(--neutral-500);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.notif-time {
    font-size: .68rem;
    color: var(--neutral-400);
    font-weight: 500;
}
.notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 7px;
}

@media (max-width: 600px) {
    .notif-panel {
        width: calc(100vw - 32px);
        right: -8px;
    }
}

/* ── Toggle switch ─────────────────────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--neutral-200);
    border-radius: 24px;
    cursor: pointer;
    transition: background .2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Notification email preferences ───────────────────────────────────────── */
.notif-pref-list {
    display: flex;
    flex-direction: column;
}
.notif-pref-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--neutral-100);
    cursor: pointer;
}
.notif-pref-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.notif-pref-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-800);
}
.notif-pref-desc {
    font-size: 12px;
    color: var(--neutral-400);
    line-height: 1.5;
}
