 :root {
      --navy:        #0b2240;
      --navy-mid:    #123460;
      --blue:        #1a5fa8;
      --blue-light:  #2d8dd9;
      --sky:         #e8f4ff;
      --sky-mid:     #d0e8fa;
      --gold:        #f5a623;
      --gold-light:  #fef3dc;
      --green:       #16a96b;
      --green-light: #d4f5e8;
      --red:         #e84040;
      --red-light:   #fde8e8;
      --amber:       #f59f0b;
      --amber-light: #fef3c7;
      --bg:          #e8eff8;
      --bg2:         #dde8f5;
      --white:       #f4f9ff;
      --card:        #f4f9ff;
      --text:        #0d1f35;
      --muted:       #5a7490;
      --border:      rgba(11,34,64,0.08);
      --border2:     rgba(11,34,64,0.14);
      --shadow-sm:   0 2px 12px rgba(11,34,64,0.07);
      --shadow-md:   0 8px 30px rgba(11,34,64,0.12);
      --shadow-lg:   0 16px 56px rgba(11,34,64,0.18);
      --sidebar-w:   265px;
      --f-display: 'Playfair Display', Georgia, serif;
      --f-body:    'Plus Jakarta Sans', system-ui, sans-serif;
    }
    :root[data-theme="dark"] {
      --navy:        #b8d0ee;
      --navy-mid:    #a5c5f0;
      --blue:        #5baaf5;
      --blue-light:  #7dbfff;
      --sky:         #1a2a3f;
      --sky-mid:     #1e3250;
      --gold:        #f5a623;
      --gold-light:  #2e2000;
      --green:       #2fd98a;
      --green-light: #0a2a1c;
      --red:         #ff6b6b;
      --red-light:   #2a0a0a;
      --amber:       #fbbf24;
      --amber-light: #2a1e00;
      --bg:          #0d1826;
      --bg2:         #111f33;
      --white:       #0d1826;
      --card:        #152035;
      --text:        #dce8f8;
      --muted:       #7a9bbb;
      --border:      rgba(255,255,255,0.07);
      --border2:     rgba(255,255,255,0.12);
      --shadow-sm:   0 2px 12px rgba(0,0,0,0.3);
      --shadow-md:   0 8px 30px rgba(0,0,0,0.4);
      --shadow-lg:   0 16px 56px rgba(0,0,0,0.5);
    }
    /* Dark mode overrides for elements that use navy as TEXT (not background) */
    [data-theme="dark"] .card-title { color: #dce8f8; }
    [data-theme="dark"] .qna-question { color: #dce8f8; }
    [data-theme="dark"] .stat-num { color: #dce8f8; }
    [data-theme="dark"] .analytics-num { color: var(--blue); }
    [data-theme="dark"] .topbar-title { color: #dce8f8; }
    [data-theme="dark"] .account-info-val { color: #dce8f8; }
    [data-theme="dark"] .notice-banner { background: #1e1a00; border-color: rgba(245,166,35,0.25); }
    [data-theme="dark"] .contrib-info { background: #1a2a3f; color: var(--blue-light); }
    [data-theme="dark"] .contrib-info strong { color: #dce8f8; }
    [data-theme="dark"] .query-h-q { color: #dce8f8; }
    [data-theme="dark"] .topbar { background: #0f1e30; border-color: rgba(255,255,255,0.07); }
    [data-theme="dark"] select option { background-color: #152035; color: #dce8f8; }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: var(--f-body);
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      opacity: 0;
      transition: opacity .4s, background-color .35s, color .2s;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
    }
    body.loaded { opacity: 1; }

    /* ─── LOADER ─── */
    #page-loader {
      position: fixed; inset: 0; z-index: 9999;
      background: #0b2240;
      display: flex; align-items: center; justify-content: center;
      transition: opacity 0.5s ease, visibility 0.5s ease;
    }
    #page-loader.hide { opacity: 0; visibility: hidden; }
    .loader-inner { text-align: center; animation: loaderPulse 1.4s ease-in-out infinite; }
    .loader-logo { width: 68px; height: 68px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.15); padding: 4px; margin: 0 auto 1rem; }
    .loader-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
    .loader-text { color: rgba(255,255,255,0.7); font-size: 0.82rem; letter-spacing: 0.15em; text-transform: uppercase; }
    .loader-bar { width: 120px; height: 2px; background: rgba(255,255,255,0.1); border-radius: 2px; margin: 0.8rem auto 0; overflow: hidden; }
    .loader-bar-fill { height: 100%; background: var(--gold); border-radius: 2px; animation: loadBar 1.1s ease forwards; }
    @keyframes loadBar { from{width:0} to{width:100%} }
    @keyframes loaderPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

    /* AUTOFILL FIX */
    input:-webkit-autofill,
    input:-webkit-autofill:hover,
    input:-webkit-autofill:focus,
    textarea:-webkit-autofill,
    textarea:-webkit-autofill:hover,
    textarea:-webkit-autofill:focus,
    select:-webkit-autofill,
    select:-webkit-autofill:hover,
    select:-webkit-autofill:focus {
      -webkit-text-fill-color: var(--text) !important;
      -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset !important;
      transition: background-color 5000s ease-in-out 0s;
    }

    /* ══════════════════════════════════════
       SIDEBAR
    ══════════════════════════════════════ */
    .sidebar {
      width: var(--sidebar-w);
      min-height: 100vh;
      background: #0f2444;
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0; left: 0; bottom: 0;
      z-index: 300;
      transition: transform 0.3s cubic-bezier(.2,.8,.3,1);
      overflow-y: auto;
      scrollbar-width: none;
    }
    [data-theme="dark"] .sidebar { background: #07131f; border-right: 1px solid var(--border); }

    .sidebar-brand {
      padding: 1.4rem 1.3rem 1rem;
      display: flex; align-items: center; gap: 0.65rem;
      text-decoration: none;
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .sidebar-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.18); }
    .sidebar-brand span { font-family: var(--f-display); font-size: 1rem; color: #fff; line-height: 1.2; }

    .sidebar-user {
      padding: 1rem 1.3rem;
      display: flex; align-items: center; gap: 0.75rem;
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .user-avatar-wrap { position: relative; flex-shrink: 0; }
    .user-avatar {
      width: 42px; height: 42px; border-radius: 50%;
      object-fit: cover; border: 2px solid rgba(255,255,255,0.2);
      display: block;
    }
    .user-avatar-fallback {
      width: 42px; height: 42px; border-radius: 50%;
      background: linear-gradient(135deg, var(--gold), #e09318);
      display: flex; align-items: center; justify-content: center;
      font-weight: 700; font-size: 1rem; color: #0b2240;
    }
    .user-info-name { font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
    .role-badge {
      display: inline-block; font-size: 0.65rem; font-weight: 700;
      padding: 0.12rem 0.55rem; border-radius: 50px;
      background: rgba(245,166,35,0.2); color: var(--gold);
      text-transform: uppercase; letter-spacing: 0.06em;
      cursor: pointer; border: none; font-family: var(--f-body);
      transition: background 0.2s;
    }
    .role-badge:hover { background: rgba(245,166,35,0.35); }
    .role-admin { background: var(--blue) !important; color: #fff !important; }
    .role-team  { background: var(--green-light) !important; color: var(--green) !important; }

    .sidebar-nav { flex: 1; padding: 0.8rem; }
    .nav-section-label {
      font-size: 0.63rem; font-weight: 700; letter-spacing: 0.12em;
      text-transform: uppercase; color: rgba(255,255,255,0.35);
      padding: 0.6rem 0.5rem 0.3rem; margin-top: 0.4rem;
    }
    .sidebar-link {
      display: flex; align-items: center; gap: 0.75rem;
      padding: 0.65rem 0.85rem; border-radius: 10px;
      color: rgba(255,255,255,0.65); font-size: 0.88rem; font-weight: 500;
      cursor: pointer; text-decoration: none;
      transition: background 0.2s, color 0.2s;
      border: none; background: none; width: 100%;
      text-align: left; font-family: var(--f-body);
      margin-bottom: 2px;
    }
    .sidebar-link i { width: 18px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
    .sidebar-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
    .sidebar-link.active {
      background: rgba(255,255,255,0.15); color: #fff; font-weight: 700;
      border-left: 3px solid var(--gold); padding-left: calc(0.85rem - 3px);
    }
    .sidebar-link.active i { color: var(--gold); }
    .sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.07); margin: 0.6rem 0.8rem; }

    .sidebar-footer { padding: 0.8rem; border-top: 1px solid rgba(255,255,255,0.07); }
    .logout-link {
      display: flex; align-items: center; gap: 0.75rem;
      width: 100%; padding: 0.65rem 0.85rem; border-radius: 10px;
      background: rgba(232,64,64,0.12); color: #ff8080;
      border: none; cursor: pointer; font-family: var(--f-body);
      font-size: 0.88rem; font-weight: 600;
      transition: background 0.2s;
    }
    .logout-link:hover { background: rgba(232,64,64,0.22); }

    /* ══════════════════════════════════════
       MAIN
    ══════════════════════════════════════ */
    .main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

    /* TOPBAR */
    .topbar {
      position: sticky; top: 0; z-index: 200;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      height: 64px; padding: 0 1.8rem;
      display: flex; align-items: center; justify-content: space-between;
      box-shadow: var(--shadow-sm);
      transition: background 0.35s;
    }
    .topbar-left { display: flex; align-items: center; gap: 1rem; }
    .menu-toggle {
      display: none; background: none; border: none;
      font-size: 1.2rem; color: var(--text); cursor: pointer;
      width: 36px; height: 36px; border-radius: 8px;
      align-items: center; justify-content: center; transition: background 0.2s;
    }
    .menu-toggle:hover { background: var(--sky); }
    .topbar-title { font-family: var(--f-display); font-size: 1.25rem; color: var(--navy); }
    .topbar-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.1rem; }
    .topbar-right { display: flex; align-items: center; gap: 0.6rem; }
    .icon-btn {
      position: relative; background: var(--sky); border: 1.5px solid var(--border2);
      color: var(--blue); font-size: 0.95rem; cursor: pointer;
      width: 38px; height: 38px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.2s, transform 0.2s;
    }
    .icon-btn:hover { background: var(--sky-mid); transform: scale(1.05); }
    .notif-dot {
      position: absolute; top: 5px; right: 5px;
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--red); border: 2px solid var(--card); display: none;
    }
    .notif-dot.visible { display: block; }

    /* PAGE CONTENT */
    .page-content { padding: 1.8rem 2rem 3rem; flex: 1; }
    .dash-pane { display: none; }
    .dash-pane.active { display: block; animation: paneIn 0.35s cubic-bezier(.2,.8,.3,1); }
    @keyframes paneIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

    /* NOTICE BANNER */
    .notice-banner {
      display: flex; align-items: flex-start; gap: 0.75rem;
      background: var(--gold-light); border: 1px solid rgba(245,166,35,0.3);
      border-left: 4px solid var(--gold); border-radius: 12px;
      padding: 1rem 1.2rem; font-size: 0.85rem;
      color: #7a5c00; line-height: 1.65; margin-bottom: 1.8rem;
      transition: background 0.35s;
    }
    [data-theme="dark"] .notice-banner { color: #f5c542; }
    .notice-banner i { color: var(--gold); flex-shrink: 0; margin-top: 2px; }

    /* STATS ROW */
    .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; margin-bottom: 1.8rem; }
    .stat-card {
      background: var(--card); border: 1px solid var(--border);
      border-radius: 16px; padding: 1.3rem 1.2rem;
      display: flex; align-items: center; gap: 1rem;
      transition: box-shadow 0.25s, transform 0.25s;
    }
    .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
    .stat-icon {
      width: 46px; height: 46px; border-radius: 12px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.15rem; flex-shrink: 0;
    }
    .si-blue   { background: var(--sky); color: var(--blue); }
    .si-gold   { background: var(--gold-light); color: #8a5e00; }
    .si-green  { background: var(--green-light); color: var(--green); }
    .si-navy   { background: var(--sky-mid); color: var(--blue); }
    .stat-num { font-family: var(--f-display); font-size: clamp(1.4rem, 4vw, 1.75rem); color: var(--navy); line-height: 1; font-weight: 700; }
    .stat-lbl { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; margin-top: 0.2rem; }

    /* CARD */
    .card {
      background: var(--card); border: 1px solid var(--border);
      border-radius: 18px; padding: 1.6rem; margin-bottom: 1.4rem;
      box-shadow: var(--shadow-sm); transition: background 0.35s;
    }
    .card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; flex-wrap: wrap; }
    .card-title { font-family: var(--f-display); font-size: 1.15rem; color: var(--navy); }
    .card-sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; }

    /* TWO COL */
    .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }

    /* WHATSAPP CARD */
    .wa-card {
      background: linear-gradient(135deg, #065f46, #047857);
      border-radius: 18px; padding: 1.6rem; color: #fff;
      display: flex; align-items: center; gap: 1.3rem;
      margin-bottom: 1.4rem; box-shadow: var(--shadow-sm);
    }
    .wa-icon { font-size: 2.4rem; opacity: 0.9; flex-shrink: 0; }
    .wa-title { font-family: var(--f-display); font-size: 1.1rem; margin-bottom: 0.3rem; }
    .wa-sub { font-size: 0.82rem; opacity: 0.8; margin-bottom: 0.9rem; }
    .wa-btn {
      display: inline-flex; align-items: center; gap: 0.45rem;
      background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
      color: #fff; padding: 0.55rem 1.1rem; border-radius: 8px;
      font-weight: 600; font-size: 0.88rem; text-decoration: none;
      transition: background 0.2s;
    }
    .wa-btn:hover { background: rgba(255,255,255,0.28); }

    /* NOTES SHORTCUT */
    .notes-shortcut {
      background: linear-gradient(135deg, #123460, #0b2240);
      border-radius: 18px; padding: 1.6rem;
      display: flex; align-items: center; gap: 1.2rem;
      color: #fff; text-decoration: none; margin-bottom: 1.4rem;
      transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--shadow-sm);
    }
    .notes-shortcut:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .notes-sc-icon { width: 52px; height: 52px; border-radius: 12px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
    .notes-sc-title { font-family: var(--f-display); font-size: 1.1rem; margin-bottom: 0.2rem; }
    .notes-sc-sub { font-size: 0.82rem; opacity: 0.72; }
    .notes-sc-arrow { margin-left: auto; opacity: 0.6; font-size: 1rem; }

    /* LEADERBOARD */
    .lb-list { list-style: none; }
    .lb-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
    .lb-item:last-child { border-bottom: none; }
    .lb-rank { font-family: var(--f-display); font-size: 1.1rem; width: 26px; text-align: center; flex-shrink: 0; }
    .lb-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
    .lb-pts { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
    .lb-wof { font-size: 0.68rem; padding: 0.18rem 0.5rem; border-radius: 50px; background: var(--sky); color: var(--blue); font-weight: 700; }

    /* ANALYTICS */
    .analytics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
    .analytics-card {
      background: var(--card); border: 1px solid var(--border); border-radius: 16px;
      padding: 1.4rem; text-align: center; box-shadow: var(--shadow-sm);
      transition: box-shadow 0.25s, transform 0.25s;
    }
    .analytics-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
    .analytics-num { font-family: var(--f-display); font-size: 2.1rem; color: var(--blue); }
    .analytics-lbl { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; font-weight: 600; }

    /* Q&A */
    .qna-notice {
      background: var(--sky); border-left: 3px solid var(--blue-light);
      border-radius: 0 10px 10px 0; padding: 0.8rem 1rem;
      font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem;
      transition: background 0.35s;
    }
    .qna-form { display: flex; gap: 0.6rem; margin-bottom: 1.4rem; }
    .qna-input {
      flex: 1; padding: 0.72rem 1rem;
      border: 1.5px solid var(--border2); border-radius: 10px;
      font-family: var(--f-body); font-size: 0.9rem;
      outline: none; background: var(--bg); color: var(--text);
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .qna-input:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(45,141,217,0.12); }
    .qna-submit-btn {
      background: #1a5fa8; color: #fff; border: none;
      border-radius: 10px; padding: 0 1.1rem; font-size: 1rem;
      cursor: pointer; transition: background 0.2s;
    }
    .qna-submit-btn:hover { background: #123460; }
    .qna-list { list-style: none; }
    .qna-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
    .qna-item:last-child { border-bottom: none; }
    .qna-question {
      font-weight: 600; font-size: 0.9rem; color: var(--navy);
      display: flex; align-items: flex-start; gap: 0.5rem; flex-wrap: wrap;
      margin-bottom: 0.3rem;
    }
    .qna-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }
    .reply-list { list-style: none; padding-left: 1rem; margin-bottom: 0.5rem; }
    .reply-list li { font-size: 0.86rem; padding: 0.3rem 0; color: var(--text); }
    .reply-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
    .reply-form input {
      flex: 1; padding: 0.5rem 0.75rem;
      border: 1.5px solid var(--border2); border-radius: 8px;
      font-family: var(--f-body); font-size: 0.84rem;
      background: var(--bg); color: var(--text); outline: none;
      transition: border-color 0.2s;
    }
    .reply-form input:focus { border-color: var(--blue-light); }
    .reply-form button {
      background: var(--blue); color: #fff; border: none;
      border-radius: 8px; padding: 0.5rem 0.8rem; cursor: pointer; font-size: 0.85rem;
      transition: background 0.2s;
    }
    .reply-form button:hover { background: #1a5fa8; }
    .delete-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 0.8rem; padding: 0 0.3rem; opacity: 0.7; }
    .delete-btn:hover { opacity: 1; }

    /* FORMS */
    .form-group { margin-bottom: 1rem; }
    .form-group label {
      display: block; font-size: 0.74rem; font-weight: 700;
      color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.4rem;
    }
    .form-group input,
    .form-group select,
    .form-group textarea {
      width: 100%; padding: 0.72rem 1rem;
      border: 1.5px solid var(--border2); border-radius: 10px;
      font-family: var(--f-body); font-size: 0.9rem;
      color: var(--text); background: var(--bg); outline: none;
      transition: border-color 0.2s, box-shadow 0.2s, background 0.35s;
    }
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
      border-color: var(--blue-light);
      box-shadow: 0 0 0 3px rgba(45,141,217,0.1);
    }
    .form-group textarea { resize: vertical; min-height: 110px; }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .btn-primary {
      display: inline-flex; align-items: center; gap: 0.5rem;
      background: #1a5fa8; color: #fff; border: none;
      border-radius: 10px; padding: 0.78rem 1.5rem;
      font-size: 0.9rem; font-weight: 700; font-family: var(--f-body);
      cursor: pointer; transition: background 0.2s, transform 0.15s;
    }
    .btn-primary:hover { background: #0b2240; transform: translateY(-1px); }
    .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
    .btn-full { width: 100%; justify-content: center; }
    .form-message { display: none; margin-top: 0.75rem; padding: 0.65rem 0.9rem; border-radius: 10px; font-size: 0.88rem; font-weight: 600; }
    .form-message.success { display: block; background: var(--green-light); color: var(--green); }
    .form-message.error { display: block; background: var(--red-light); color: var(--red); }
    .form-message.info { display: block; background: var(--gold-light); color: var(--gold); }

    /* SETTINGS GRID */
    .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
    .account-info-row { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
    .account-info-row:last-child { border-bottom: none; }
    .account-info-label { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
    .account-info-val { color: var(--text); font-weight: 500; }

    /* CONTRIB INFO */
    .contrib-info {
      background: var(--sky); border-radius: 12px; padding: 1.2rem 1.3rem;
      margin-bottom: 1.2rem; font-size: 0.88rem; color: var(--blue); line-height: 1.8;
      transition: background 0.35s;
    }
    .contrib-info strong { color: var(--navy); }

    /* QUERY HISTORY */
    .query-h-item { padding: 0.9rem 0; border-bottom: 1px solid var(--border); }
    .query-h-item:last-child { border-bottom: none; }
    .query-h-q { font-weight: 700; font-size: 0.88rem; color: var(--navy); margin-bottom: 0.25rem; }
    .query-h-ts { font-size: 0.74rem; color: var(--muted); margin-bottom: 0.35rem; }
    .query-h-reply { background: var(--sky); border-radius: 8px; padding: 0.45rem 0.8rem; font-size: 0.84rem; color: var(--blue); margin-top: 0.3rem; transition: background 0.35s; }
    .query-h-pending { font-size: 0.8rem; color: var(--amber); font-weight: 600; margin-top: 0.25rem; }

    /* NOTIFICATION PANEL */
    .notif-overlay { display: none; position: fixed; inset: 0; z-index: 400; background: rgba(11,34,64,0.3); backdrop-filter: blur(3px); }
    .notif-overlay.open { display: block; }
    .notif-panel {
      position: fixed; top: 0; right: 0; width: 360px; max-width: 100vw;
      height: 100vh; background: var(--card);
      box-shadow: -4px 0 32px rgba(11,34,64,0.14);
      z-index: 500; display: flex; flex-direction: column;
      transform: translateX(100%);
      transition: transform 0.3s cubic-bezier(.2,.8,.3,1), background 0.35s;
    }
    .notif-panel.open { transform: none; }
    .notif-panel-header { padding: 1.4rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
    .notif-panel-title { font-family: var(--f-display); font-size: 1.15rem; color: var(--navy); }
    .notif-close-btn { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 0.4rem; border-radius: 8px; transition: background 0.2s; }
    .notif-close-btn:hover { background: var(--bg); }
    .notif-list { flex: 1; overflow-y: auto; padding: 0.5rem; list-style: none; }
    .notif-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.85rem; border-radius: 10px; margin-bottom: 0.2rem; transition: background 0.15s; }
    .notif-item:hover { background: var(--bg); }
    .notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--sky); display: flex; align-items: center; justify-content: center; font-size: 0.88rem; color: var(--blue); flex-shrink: 0; }
    .notif-text { font-size: 0.86rem; color: var(--text); flex: 1; line-height: 1.5; }
    .notif-time { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }
    .notif-del { background: none; border: none; color: var(--red); cursor: pointer; padding: 0.2rem; font-size: 0.8rem; opacity: 0.6; }
    .notif-del:hover { opacity: 1; }
    .notif-empty { text-align: center; padding: 2.5rem; color: var(--muted); font-size: 0.9rem; }

    /* SIDEBAR OVERLAY */
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(11,34,64,0.4); z-index: 250; }
    .sidebar-overlay.open { display: block; }

    /* RESPONSIVE */
    @media (max-width: 1100px) { .stats-row { grid-template-columns: repeat(2, 1fr); } .analytics-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 900px)  { .settings-grid { grid-template-columns: 1fr; } .two-col { grid-template-columns: 1fr; } }
    @media (max-width: 768px)  {
      .sidebar { transform: translateX(-100%); }
      .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
      .main { margin-left: 0; }
      .menu-toggle { display: flex; }
      .page-content { padding: 1.2rem 1rem 2.5rem; }
      .wa-card { flex-direction: column; text-align: center; }
      
      /* Mobile Topbar Fixes */
      .topbar { padding: 0 1rem; height: 64px; }
      .topbar-left { gap: 0.7rem; overflow: hidden; }
      .topbar-title { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; font-weight: 700; }
      .topbar-sub { font-size: 0.68rem; opacity: 0.8; }
      .icon-btn { width: 36px; height: 36px; font-size: 0.9rem; }
    }
    @media (max-width: 520px) { .stats-row { grid-template-columns: 1fr 1fr; } .form-row { grid-template-columns: 1fr; } .analytics-grid { grid-template-columns: 1fr 1fr; } }

    /* transitions */
    *, *::before, *::after { transition: background-color 0.35s ease, border-color 0.35s ease, color 0.2s ease; }
    .dash-pane { transition: none; }

    /* GPA CALCULATOR */
    .gpa-container { max-width: 900px; margin: 0 auto; }
    .gpa-header { margin-bottom: 1.5rem; display: flex; justify-content: center; }
    .gpa-tabs {
      display: flex; background: var(--bg2); padding: 0.4rem; border-radius: 12px;
      gap: 0.4rem; border: 1px solid var(--border);
    }
    .gpa-tab-btn {
      padding: 0.6rem 1.2rem; border: none; background: none; color: var(--muted);
      font-family: var(--f-body); font-weight: 600; font-size: 0.88rem;
      border-radius: 8px; cursor: pointer; transition: all 0.2s;
    }
    .gpa-tab-btn.active { background: var(--card); color: var(--blue); box-shadow: var(--shadow-sm); }
    
    .gpa-tab-content { display: none; }
    .gpa-tab-content.active { display: block; animation: paneIn 0.3s ease; }

    .gpa-table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
    .gpa-table { width: 100%; border-collapse: collapse; min-width: 500px; }
    .gpa-table th { text-align: left; padding: 1rem 0.5rem; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid var(--border); }
    .gpa-table td { padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border); }
    
    .gpa-input {
      width: 100%; padding: 0.65rem 0.9rem; border: 1.5px solid var(--border2);
      border-radius: 8px; background: var(--bg); color: var(--text);
      font-family: var(--f-body); font-size: 0.9rem; outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .gpa-input:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(45,141,217,0.1); }
    
    .gpa-del-btn {
      width: 32px; height: 32px; border-radius: 6px; border: none;
      background: var(--red-light); color: var(--red); cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.2s; opacity: 0.7;
    }
    .gpa-del-btn:hover { opacity: 1; transform: scale(1.1); }
    
    .gpa-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
    .btn-secondary {
      background: var(--sky); color: var(--blue); border: 1.5px solid var(--border2);
      padding: 0.7rem 1.2rem; border-radius: 10px; font-weight: 600;
      font-family: var(--f-body); cursor: pointer; display: flex; align-items: center; gap: 0.5rem;
      transition: all 0.2s;
    }
    .btn-secondary:hover { background: var(--sky-mid); border-color: var(--blue-light); }
    
    .gpa-result-box {
      background: linear-gradient(135deg, var(--blue), var(--navy-mid));
      padding: 1rem 2rem; border-radius: 16px; color: #fff; text-align: center;
      box-shadow: var(--shadow-md); min-width: 150px;
    }
    .gpa-result-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.8; margin-bottom: 0.2rem; }
    .gpa-result-num { font-family: var(--f-display); font-size: 2.2rem; line-height: 1; }

    .sem-label { font-weight: 700; color: var(--navy); font-size: 0.9rem; padding-left: 0.5rem; }
    [data-theme="dark"] .sem-label { color: var(--blue-light); }

    /* ══════════════════════════════════════
       OTHER SERVICES
    ══════════════════════════════════════ */
    .services-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1.3rem;
    }
    @media (max-width: 1100px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 600px)  { .services-grid { grid-template-columns: 1fr; } }

    .service-card {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 18px;
      padding: 1.4rem 1.3rem;
      text-decoration: none;
      color: inherit;
      box-shadow: var(--shadow-sm);
      transition: transform 0.22s cubic-bezier(.2,.8,.3,1),
                  box-shadow 0.22s cubic-bezier(.2,.8,.3,1),
                  border-color 0.22s;
      position: relative;
      overflow: hidden;
    }
    .service-card::after {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: 18px;
      opacity: 0;
      transition: opacity 0.22s;
      background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
      pointer-events: none;
    }
    .service-card:hover {
      transform: translateY(-5px);
      box-shadow: var(--shadow-md);
      border-color: var(--border2);
    }
    .service-card:hover::after { opacity: 1; }

    .service-icon-wrap {
      width: 50px; height: 50px; border-radius: 14px; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.25rem;
      transition: transform 0.22s;
    }
    .service-card:hover .service-icon-wrap { transform: scale(1.1) rotate(-4deg); }

    /* Icon colour variants */
    .sc-blue   { background: var(--sky);         color: var(--blue); }
    .sc-gold   { background: var(--gold-light);   color: #8a5e00; }
    .sc-green  { background: var(--green-light);  color: var(--green); }
    .sc-purple { background: rgba(120,60,220,.1); color: #8b5cf6; }
    .sc-red    { background: var(--red-light);    color: var(--red); }
    .sc-teal   { background: rgba(20,180,170,.12);color: #0d9488; }

    [data-theme="dark"] .sc-gold { color: var(--gold); }

    .service-body { flex: 1; min-width: 0; }

    .service-name {
      font-family: var(--f-display);
      font-size: 1.05rem;
      color: var(--navy);
      margin-bottom: 0.3rem;
      line-height: 1.2;
    }
    [data-theme="dark"] .service-name { color: #dce8f8; }

    .service-desc {
      font-size: 0.82rem;
      color: var(--muted);
      line-height: 1.6;
      margin-bottom: 0.9rem;
    }

    .service-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .service-creator {
      display: inline-flex; align-items: center; gap: 0.35rem;
      font-size: 0.74rem; font-weight: 600;
      color: var(--muted);
    }
    .service-creator i { font-size: 0.68rem; }

    .service-visit {
      display: inline-flex; align-items: center; gap: 0.35rem;
      font-size: 0.78rem; font-weight: 700;
      color: var(--blue);
      background: var(--sky);
      padding: 0.28rem 0.75rem;
      border-radius: 50px;
      transition: background 0.2s, color 0.2s;
    }
    .service-card:hover .service-visit {
      background: var(--blue);
      color: #fff;
    }
    .service-visit i { font-size: 0.65rem; transition: transform 0.2s; }
    .service-card:hover .service-visit i { transform: translateX(3px); }