: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;
      --orange: #f59623;
      --orange-light: #fff3e0;
      --purple: #7c3aed;
      --purple-light: #ede9fe;
      --bg: #e8eff8;
      --bg2: #dde8f5;
      --card: #f4f9ff;
      --text: #0d1f35;
      --muted: #5a7490;
      --border: rgba(11, 34, 64, 0.09);
      --border2: rgba(11, 34, 64, 0.14);
      --shadow-sm: 0 2px 12px rgba(11, 34, 64, 0.07);
      --shadow-md: 0 6px 28px rgba(11, 34, 64, 0.11);
      --shadow-lg: 0 16px 56px rgba(11, 34, 64, 0.16);
      --input-bg: #e8eff8;
      --sidebar-w: 272px;
      --font-display: 'Playfair Display', Georgia, serif;
      --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
    }

    [data-theme="dark"] {
      --navy: #e2eaf8;
      --navy-mid: #c5d5ee;
      --blue: #5ba8f5;
      --blue-light: #7dbfff;
      --sky: #1a2a3f;
      --sky-mid: #1e3250;
      --gold: #f5a623;
      --gold-light: #2e2000;
      --green: #2fd98a;
      --green-light: #0a2a1c;
      --red: #ff6b6b;
      --red-light: #2a0a0a;
      --orange: #ffb347;
      --orange-light: #2a1500;
      --purple: #a78bfa;
      --purple-light: #1e1040;
      --bg: #0d1826;
      --bg2: #111f33;
      --card: #152035;
      --text: #dce8f8;
      --muted: #7a9bbb;
      --border: rgba(255, 255, 255, 0.07);
      --border2: rgba(255, 255, 255, 0.13);
      --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.3);
      --shadow-md: 0 6px 28px rgba(0, 0, 0, 0.4);
      --shadow-lg: 0 16px 56px rgba(0, 0, 0, 0.5);
      --input-bg: #0a1525;
    }

    *,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      transition: background-color .35s ease, border-color .35s ease, color .2s ease;
    }

    html {
      scroll-behavior: smooth;
      height: 100%;
    }
    
    body {
      font-family: var(--font-body);
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      min-height: 100dvh;
      display: flex;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
      -webkit-overflow-scrolling: touch;
    }

    /* 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;
    }

    a {
      color: var(--blue);
      text-decoration: none;
      transition: color .2s;
    }

    a:hover {
      color: var(--blue-light);
      text-decoration: underline;
    }

    [data-theme="dark"] a {
      color: var(--blue-light);
    }

    [data-theme="dark"] a:hover {
      color: var(--sky);
    }

    /* ══ SIDEBAR ══ */
    .sidebar {
      width: var(--sidebar-w);
      min-height: 100vh;
      background: linear-gradient(180deg, #0b2240 0%, #123460 60%, #0a3d6b 100%);
      display: flex;
      flex-direction: column;
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      z-index: 300;
      overflow-y: auto;
      transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    }

    .sidebar-brand {
      display: flex;
      align-items: center;
      gap: .75rem;
      padding: 1.6rem 1.4rem 1.2rem;
      text-decoration: none;
      border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .sidebar-brand img {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      object-fit: cover;
      border: 2px solid rgba(255, 255, 255, .22);
    }

    .sidebar-brand-name {
      font-family: var(--font-display);
      font-size: 1rem;
      color: #fff;
      line-height: 1.25;
    }

    .sidebar-brand-sub {
      font-size: .64rem;
      color: rgba(255, 255, 255, .4);
      font-weight: 500;
      letter-spacing: .06em;
      margin-top: .1rem;
    }

    .sidebar-section-label {
      font-size: .6rem;
      font-weight: 700;
      letter-spacing: .13em;
      text-transform: uppercase;
      color: rgba(255, 255, 255, .28);
      padding: .9rem 1.4rem .3rem;
      display: block;
    }

    .sidebar-nav {
      padding: .5rem .7rem;
      flex: 1;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: .7rem;
      padding: .62rem 1rem;
      border-radius: 10px;
      color: rgba(255, 255, 255, .62);
      text-decoration: none;
      font-size: .86rem;
      font-weight: 500;
      cursor: pointer;
      border: none;
      background: none;
      width: 100%;
      text-align: left;
      font-family: var(--font-body);
      transition: background .18s, color .18s;
      margin-bottom: 2px;
    }

    .nav-item i {
      width: 17px;
      text-align: center;
      font-size: .875rem;
      flex-shrink: 0;
    }

    .nav-item:hover {
      background: rgba(255, 255, 255, .1);
      color: #fff;
    }

    .nav-item.active {
      background: rgba(245, 166, 35, .18);
      color: var(--gold);
      font-weight: 700;
    }

    .nav-item.active i {
      color: var(--gold);
    }

    .sidebar-divider {
      border: none;
      border-top: 1px solid rgba(255, 255, 255, .08);
      margin: .4rem .7rem;
    }

    .sidebar-footer {
      padding: .7rem;
      border-top: 1px solid rgba(255, 255, 255, .08);
    }

    .sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(7, 22, 42, 0.4);
      z-index: 299;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      animation: fadeIn 0.3s ease;
    }

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

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

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

    /* ══ TOPBAR ══ */
    .topbar {
      position: sticky;
      top: 0;
      z-index: 200;
      height: 66px;
      background: var(--card);
      border-bottom: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      display: flex;
      align-items: center;
      padding: 0 2rem;
      gap: 1rem;
    }

    .menu-toggle {
      display: none;
      background: none;
      border: 1.5px solid var(--border2);
      border-radius: 9px;
      width: 38px;
      height: 38px;
      color: var(--text);
      font-size: 1rem;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      transition: background .2s;
    }

    .menu-toggle:hover {
      background: var(--sky);
    }

    .topbar-title {
      font-family: var(--font-display);
      font-size: 1.2rem;
      color: var(--navy);
      flex: 1;
      letter-spacing: -.01em;
    }

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

    .topbar-right {
      display: flex;
      align-items: center;
      gap: .65rem;
    }

    .theme-toggle {
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: var(--sky);
      border: 1.5px solid var(--border2);
      color: var(--blue);
      font-size: .95rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .2s, transform .2s;
    }

    [data-theme="dark"] .theme-toggle {
      background: var(--sky-mid);
      color: var(--gold);
    }

    .theme-toggle:hover {
      transform: rotate(20deg) scale(1.1);
    }

    .admin-badge {
      font-size: .7rem;
      padding: .22rem .75rem;
      border-radius: 50px;
      background: rgba(245, 166, 35, .15);
      color: var(--gold);
      font-weight: 700;
      border: 1px solid rgba(245, 166, 35, .3);
    }

    .logout-btn {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      background: none;
      border: 1.5px solid var(--border2);
      border-radius: 9px;
      padding: .38rem .9rem;
      font-size: .8rem;
      font-weight: 700;
      color: var(--red);
      cursor: pointer;
      font-family: var(--font-body);
      transition: all .18s;
    }

    .logout-btn:hover {
      background: var(--red-light);
      border-color: var(--red);
    }

    /* ══ PAGE ══ */
    .page-content {
      padding: 2rem 2rem 4rem;
      flex: 1;
    }

    .pane {
      display: none;
    }

    .pane.active {
      display: block;
    }

    /* ══ OVERVIEW HERO ══ */
    .overview-hero {
      background: linear-gradient(135deg, #0b2240 0%, #123460 55%, #0f4d8a 100%);
      border-radius: 20px;
      padding: 2.5rem 2.5rem 2rem;
      margin-bottom: 1.8rem;
      position: relative;
      overflow: hidden;
    }

    .overview-hero::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
      background-size: 42px 42px;
      pointer-events: none;
    }

    .overview-hero-inner {
      position: relative;
      z-index: 1;
    }

    .overview-hero h2 {
      font-family: var(--font-display);
      font-size: 1.85rem;
      color: #fff;
      margin-bottom: .3rem;
    }

    .overview-hero h2 em {
      font-style: italic;
      color: var(--gold);
    }

    .overview-hero p {
      color: rgba(255, 255, 255, .65);
      font-size: .9rem;
      font-weight: 300;
    }

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

    .stat-card {
      background: var(--card);
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border);
      padding: 1.2rem 1.3rem;
      display: flex;
      align-items: center;
      gap: .85rem;
      transition: transform .2s, box-shadow .2s;
    }

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

    .stat-ic {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      flex-shrink: 0;
    }


    .ic-b {
      background: var(--sky);
      color: var(--blue);
    }

    .ic-g {
      background: var(--green-light);
      color: var(--green);
    }

    .ic-gold {
      background: var(--gold-light);
      color: var(--orange);
    }

    .ic-r {
      background: var(--red-light);
      color: var(--red);
    }

    .ic-o {
      background: var(--orange-light);
      color: var(--orange);
    }

    .ic-p {
      background: var(--purple-light);
      color: var(--purple);
    }

    [data-theme="dark"] .ic-b {
      background: rgba(91, 168, 245, .15);
    }

    [data-theme="dark"] .ic-g {
      background: rgba(47, 217, 138, .15);
    }

    [data-theme="dark"] .ic-gold {
      background: rgba(245, 166, 35, .15);
    }

    [data-theme="dark"] .ic-r {
      background: rgba(255, 107, 107, .15);
    }

    [data-theme="dark"] .ic-o {
      background: rgba(255, 179, 71, .15);
    }

    [data-theme="dark"] .ic-p {
      background: rgba(167, 139, 250, .15);
    }

    .stat-num {
      font-family: var(--font-display);
      font-size: 1.6rem;
      color: var(--navy);
      line-height: 1;
    }

    [data-theme="dark"] .stat-num {
      color: var(--text);
    }

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

    /* ══ CARD ══ */
    .card {
      background: var(--card);
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border);
      padding: 1.6rem;
      margin-bottom: 1.4rem;
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: .75rem;
      margin-bottom: 1.2rem;
    }

    .card-title {
      font-family: var(--font-display);
      font-size: 1.25rem;
      color: var(--navy);
      letter-spacing: -.01em;
    }

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

    .card-sub {
      font-size: .82rem;
      color: var(--muted);
      margin-top: .15rem;
      line-height: 1.5;
    }

    /* ══ TABLE ══ */
    .table-wrap {
      position: relative;
      overflow-x: auto;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: var(--bg);
    }
    
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: .855rem;
      min-width: 900px;
    }

    thead th {
      background: var(--bg2);
      color: var(--muted);
      font-weight: 700;
      font-size: .68rem;
      text-transform: uppercase;
      letter-spacing: .07em;
      padding: 1rem;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
      text-align: left;
    }

    tbody td {
      padding: .78rem 1rem;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
      color: var(--text);
      white-space: nowrap;
    }
    .table-wrap::after {
      content: 'Scroll →';
      position: absolute;
      bottom: 0.5rem;
      right: 0.5rem;
      font-size: 0.6rem;
      color: var(--muted);
      background: var(--bg);
      padding: 2px 6px;
      border-radius: 4px;
      opacity: 0.5;
      pointer-events: none;
      display: none;
    }
    @media (max-width: 768px) {
      .table-wrap::after { display: block; }
    }
    
    .table-input {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: var(--text);
      padding: 0.35rem 0.5rem;
      border-radius: 6px;
      font-size: 0.8rem;
      width: 100%;
      transition: all 0.2s;
    }
    .table-input:focus {
      background: rgba(255, 255, 255, 0.07);
      border-color: var(--gold);
      outline: none;
      box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.1);
    }
    [data-theme="dark"] .table-input {
      background: rgba(0, 0, 0, 0.2);
    }

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

    @media (max-width: 900px) {
      #usersTable { min-width: 1100px; }
      
      #usersTable th:first-child,
      #usersTable td:first-child {
        position: sticky; left: 0; z-index: 10;
        background: var(--bg2) !important;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
      }
      #usersTable td:first-child { background: var(--bg) !important; }
      
      #usersTable th:last-child,
      #usersTable td:last-child {
        position: sticky; right: 0; z-index: 10;
        background: var(--bg2) !important;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
      }
      #usersTable td:last-child { background: var(--bg) !important; }
      
      #usersTable td, #usersTable th { padding: 0.7rem 0.5rem; }
      
      .table-wrap::after {
        content: 'Swipe to view all columns ↔';
        display: block; text-align: center; font-size: 0.65rem;
        color: var(--gold); padding: 8px; background: var(--bg2);
        border-top: 1px solid var(--border); font-weight: 600;
      }
    }

    tbody tr:hover {
      background: rgba(var(--blue-rgb), 0.03);
    }

    [data-theme="dark"] tbody tr:hover {
      background: rgba(255, 255, 255, 0.03);
    }

    /* Action Buttons in Table */
    .btn-sm.save-user-btn {
      padding: 0.35rem 0.8rem;
      background: var(--green);
      color: white;
      border-radius: 6px;
      font-size: 0.75rem;
      box-shadow: 0 2px 6px rgba(22, 169, 107, 0.2);
    }

    .btn-sm.save-user-btn:hover {
      background: #0f8455;
      transform: translateY(-1px);
    }

    .btn-sm.del-user-btn {
      padding: 0.35rem 0.6rem;
      background: var(--red);
      color: white;
      border-radius: 6px;
      font-size: 0.75rem;
      box-shadow: 0 2px 6px rgba(232, 64, 64, 0.2);
    }

    .btn-sm.del-user-btn:hover {
      background: #b71c1c;
      transform: translateY(-1px);
    }

    .empty-row td {
      text-align: center;
      padding: 3rem !important;
      color: var(--muted);
    }

    /* ══ FORM ══ */
    .form-group {
      margin-bottom: 1.05rem;
    }

    .form-group label {
      display: block;
      font-size: .72rem;
      font-weight: 700;
      color: var(--navy-mid);
      text-transform: uppercase;
      letter-spacing: .07em;
      margin-bottom: .35rem;
    }

    [data-theme="dark"] .form-group label {
      color: var(--muted);
    }

    .form-group label .req {
      color: var(--red);
      font-weight: 700;
      margin-left: 2px;
    }

    .fg-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
    }

    .fg-row-3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 1rem;
    }

    input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=submit]):not([type=button]):not([type=reset]):not([type=image]),
    input[type=text],
    input[type=url],
    input[type=email],
    input[type=tel],
    input[type=date],
    input[type=number],
    select,
    textarea {
      width: 100%;
      padding: .7rem 1rem;
      border: 1.5px solid var(--border2);
      border-radius: 10px;
      font-family: var(--font-body);
      font-size: .9rem;
      color: var(--text);
      background: var(--input-bg);
      outline: none;
      transition: border-color .2s, box-shadow .2s, background .2s;
      -webkit-appearance: none;
      appearance: none;
      box-sizing: border-box;
    }

    /* Light mode: subtle inset depth */
    input:not([data-theme="dark"] *),
    select:not([data-theme="dark"] *),
    textarea:not([data-theme="dark"] *) {
      box-shadow: inset 0 1px 3px rgba(11, 34, 64, 0.07);
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: var(--blue-light);
      box-shadow: 0 0 0 3px rgba(45, 141, 217, .12);
    }

    /* Dark mode: glass inputs — broad selector catches ALL inputs
       (incl. those without explicit type="text" attribute) */
    [data-theme="dark"] input,
    [data-theme="dark"] select,
    [data-theme="dark"] textarea {
      background: var(--input-bg) !important;
      border-color: var(--border2) !important;
      color: var(--text) !important;
      box-shadow: inset 0 1px 4px rgba(0,0,0,0.3) !important;
    }

    [data-theme="dark"] select option {
      background-color: var(--card) !important;
      color: var(--text) !important;
    }

    .search-row {
      display: flex;
      gap: 1rem;
      margin-bottom: 1.5rem;
      align-items: center;
      flex-wrap: wrap;
    }

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

    .search-wrap i {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-size: .9rem;
      pointer-events: none;
    }

    .search-wrap input {
      padding-left: 2.6rem !important;
    }

    [data-theme="dark"] input:focus,
    [data-theme="dark"] select:focus,
    [data-theme="dark"] textarea:focus {
      border-color: #5ba8f5;
      box-shadow: 0 0 0 3px rgba(91, 168, 245, 0.15), inset 0 1px 4px rgba(0, 0, 0, 0.2);
      background: rgba(255, 255, 255, 0.07);
    }

    input::placeholder,
    textarea::placeholder {
      color: var(--muted);
      opacity: .6;
    }

    [data-theme="dark"] input::placeholder,
    [data-theme="dark"] textarea::placeholder {
      color: #5a7a99;
      opacity: 1;
    }

    textarea {
      resize: vertical;
      min-height: 90px;
    }

    /* Custom select arrow */
    select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235a7490' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 0.9rem center;
      background-size: 12px;
      padding-right: 2.4rem;
      cursor: pointer;
    }

    [data-theme="dark"] select {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237a9bbb' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    }

    /* Date picker icon color in dark mode */
    [data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator {
      filter: invert(0.7) sepia(0.3) saturate(2) hue-rotate(185deg);
      opacity: 0.7;
      cursor: pointer;
    }

    .table-input {
      width: 100%;
      padding: .42rem .65rem;
      border: 1.5px solid var(--border);
      border-radius: 8px;
      font-family: var(--font-body);
      font-size: .8rem;
      color: var(--text);
      background: var(--input-bg);
      outline: none;
      transition: border-color .2s;
    }

    [data-theme="dark"] .table-input {
      background: rgba(255, 255, 255, 0.04);
      border-color: rgba(255, 255, 255, 0.09);
    }

    .table-input:focus {
      border-color: var(--blue-light);
    }



    /* ══ BUTTONS ══ */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      padding: .55rem 1.1rem;
      border-radius: 9px;
      border: none;
      font-weight: 700;
      font-family: var(--font-body);
      font-size: .82rem;
      cursor: pointer;
      transition: all .18s;
      white-space: nowrap;
    }
    tbody td {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
      white-space: nowrap; /* Prevent wrapping to keep row height consistent */
    }
    
    /* Scroll indicator hint */
    .table-wrap::after {
      content: 'Scroll →';
      position: absolute;
      bottom: 0.5rem;
      right: 0.5rem;
      font-size: 0.6rem;
      color: var(--muted);
      background: var(--bg);
      padding: 2px 6px;
      border-radius: 4px;
      opacity: 0.5;
      pointer-events: none;
      display: none;
    }
    @media (max-width: 768px) {
      .table-wrap::after { display: block; }
    }

    .btn-primary {
      background: #0b2240;
      color: #fff;
    }

    .btn-primary:hover {
      background: var(--blue);
    }

    [data-theme="dark"] .btn-primary {
      background: var(--blue);
      color: #fff !important;
    }

    [data-theme="dark"] .btn-primary:hover {
      background: var(--blue-light);
      color: #fff !important;
      transform: translateY(-1px);
    }

    .btn-success {
      background: var(--green);
      color: #fff;
    }

    .btn-success:hover {
      background: #0f8455;
    }

    .btn-danger {
      background: var(--red);
      color: #fff;
    }

    .btn-danger:hover {
      background: #b71c1c;
    }

    .btn-warn {
      background: var(--orange);
      color: #fff;
    }

    .btn-warn:hover {
      background: #c97a10;
    }

    .btn-ghost {
      background: none;
      border: 1.5px solid var(--border2);
      color: var(--muted);
    }

    [data-theme="dark"] .btn-ghost {
      border-color: rgba(255, 255, 255, 0.15);
      color: var(--muted);
      background: rgba(255, 255, 255, 0.02);
    }

    .btn-ghost:hover {
      border-color: var(--blue);
      color: var(--blue);
    }

    [data-theme="dark"] .btn-ghost:hover {
      border-color: var(--blue-light);
      color: var(--blue-light);
      background: rgba(255, 255, 255, 0.05);
    }

    .btn-gold {
      background: var(--gold);
      color: var(--navy);
    }

    .btn-gold:hover {
      background: #e09318;
    }

    .btn-sm {
      padding: .32rem .7rem;
      font-size: .75rem;
      border-radius: 7px;
    }

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

    /* ══ BADGES ══ */
    .badge {
      display: inline-block;
      padding: .2rem .6rem;
      border-radius: 50px;
      font-size: .67rem;
      font-weight: 700;
    }

    .badge-blue {
      background: var(--sky);
      color: var(--blue);
    }

    .badge-green {
      background: var(--green-light);
      color: var(--green);
    }

    .badge-gold {
      background: rgba(245, 166, 35, 0.12);
      color: var(--gold);
      border: 1px solid rgba(245, 166, 35, 0.2);
    }

    .badge-red {
      background: var(--red-light);
      color: var(--red);
    }

    .badge-muted {
      background: var(--bg2);
      color: var(--muted);
    }

    .badge-purple {
      background: var(--purple-light);
      color: var(--purple);
    }

    [data-theme="dark"] .badge-blue {
      background: rgba(91, 168, 245, .15);
      color: var(--blue);
    }

    [data-theme="dark"] .badge-green {
      background: rgba(47, 217, 138, .15);
      color: var(--green);
    }

    [data-theme="dark"] .badge-gold {
      background: rgba(245, 166, 35, .15);
      color: var(--gold);
    }

    [data-theme="dark"] .badge-red {
      background: rgba(255, 107, 107, .15);
      color: var(--red);
    }

    [data-theme="dark"] .badge-muted {
      background: rgba(255, 255, 255, .07);
      color: var(--muted);
    }

    [data-theme="dark"] .badge-purple {
      background: rgba(167, 139, 250, .15);
      color: var(--purple);
    }

    /* ══ SEARCH ROW ══ */
    .search-row {
      display: flex;
      gap: .75rem;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 1.2rem;
    }

    .search-wrap {
      position: relative;
      flex: 1;
      min-width: 190px;
      max-width: 310px;
    }

    .search-wrap i {
      position: absolute;
      left: .85rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--muted);
      font-size: .82rem;
      pointer-events: none;
    }

    .search-wrap input {
      padding: .62rem .9rem .62rem 2.35rem;
    }

    /* ══ PENDING RESOURCE ══ */
    .pending-item {
      background: var(--card);
      border-radius: 16px;
      border: 1px solid var(--border);
      border-left: 5px solid var(--gold);
      padding: 1.4rem;
      margin-bottom: 1rem;
      box-shadow: var(--shadow-sm);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .pending-item:hover {
      transform: translateX(4px);
      box-shadow: var(--shadow-md);
    }

    .pending-item h4 {
      font-weight: 700;
      color: var(--navy);
      margin-bottom: .28rem;
      font-size: .94rem;
    }

    [data-theme="dark"] .pending-item h4 {
      color: var(--text);
    }

    .pending-item .meta {
      font-size: .78rem;
      color: var(--muted);
      margin-bottom: .6rem;
    }

    .pending-link {
      display: block;
      background: var(--bg2);
      border-radius: 9px;
      padding: .45rem .8rem;
      font-size: .78rem;
      color: var(--blue);
      margin-bottom: .8rem;
      word-break: break-all;
      text-decoration: none;
      border: 1px solid var(--border);
    }

    .pending-link:hover {
      border-color: var(--blue);
    }

    .pending-actions {
      display: flex;
      gap: .55rem;
    }

    /* ══ TOAST ══ */
    #toast {
      position: fixed;
      bottom: 1.5rem;
      right: 1.5rem;
      background: #0b2240;
      color: #fff;
      padding: .85rem 1.4rem;
      border-radius: 14px;
      font-size: .88rem;
      font-weight: 600;
      z-index: 9000;
      transform: translateY(20px);
      opacity: 0;
      transition: transform .3s ease, opacity .3s ease;
      pointer-events: none;
      box-shadow: var(--shadow-lg);
      display: flex;
      align-items: center;
      gap: .6rem;
      max-width: 350px;
    }

    #toast.show {
      transform: none;
      opacity: 1;
    }

    #toast.ok {
      background: var(--green);
    }

    #toast.err {
      background: var(--red);
    }

    #toast.info {
      background: var(--blue);
    }

    /* ══ MODAL ══ */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(11, 34, 64, .55);
      backdrop-filter: blur(5px);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 1rem;
      transition: background .3s ease;
    }

    [data-theme="dark"] .modal-overlay {
      background: rgba(0, 0, 0, .7);
    }

    .modal-overlay.open {
      display: flex;
      animation: fadeIn .25s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    .modal-box {
      background: var(--card);
      border-radius: 20px;
      width: 100%;
      max-width: 620px;
      box-shadow: var(--shadow-lg);
      max-height: 93vh;
      overflow-y: auto;
      animation: modalUp .35s cubic-bezier(.2, .8, .3, 1);
    }

    @keyframes modalUp {
      from {
        opacity: 0;
        transform: translateY(30px) scale(.97)
      }

      to {
        opacity: 1;
        transform: none
      }
    }

    .modal-header {
      padding: 1.6rem 2rem 1.2rem;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: linear-gradient(135deg, #0b2240, #123460);
      border-radius: 20px 20px 0 0;
    }

    .modal-close {
      width: 34px;
      height: 34px;
      border-radius: 8px;
      background: rgba(255, 255, 255, .1);
      border: 1px solid rgba(255, 255, 255, .2);
      color: rgba(255, 255, 255, .8);
      font-size: 1rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .2s, color .2s;
    }

    .modal-close:hover {
      background: rgba(232, 64, 64, .3);
      color: #fff;
    }


    /* ── EVENT DETAIL DRAWER (ADMIN PREVIEW) ── */
    .detail-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 2000;
      background: rgba(7, 22, 42, 0.4);
      backdrop-filter: blur(8px);
      justify-content: flex-end;
      align-items: stretch;
    }

    .detail-overlay.open {
      display: flex;
      animation: fadeIn .3s ease;
    }

    .detail-box {
      background: var(--card);
      width: 100%;
      max-width: 480px;
      height: 100vh;
      overflow-y: auto;
      position: relative;
      border-left: 1px solid var(--border);
      box-shadow: -20px 0 60px rgba(0, 0, 0, 0.4);
      animation: slideInRight .4s cubic-bezier(.16, 1, .3, 1);
      display: flex;
      flex-direction: column;
    }

    @keyframes slideInRight {
      from {
        transform: translateX(100%);
      }

      to {
        transform: translateX(0);
      }
    }

    .detail-close {
      position: absolute;
      top: 1.2rem;
      right: 1.2rem;
      z-index: 10;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.4);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #fff;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      backdrop-filter: blur(4px);
    }

    .detail-close:hover {
      background: var(--red);
      border-color: var(--red);
      transform: rotate(90deg);
    }

    .detail-img-wrap {
      width: 100%;
      background: #000;
      position: relative;
      min-height: 250px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
    }

    .detail-img-wrap img { 
      width: 100%; 
      height: 100%; 
      object-fit: contain; 
      display: block; 
    }

    .detail-fallback {
      font-size: 3rem;
      color: rgba(255, 255, 255, 0.2);
    }

    .detail-body {
      padding: 2.2rem;
      flex: 1;
    }

    .detail-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 0.6rem;
      margin-bottom: 1.2rem;
    }

    .detail-badge {
      padding: 0.4rem 1rem;
      border-radius: 50px;
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .detail-title {
      font-family: var(--font-display);
      font-size: 1.8rem;
      color: var(--text);
      line-height: 1.3;
      margin-bottom: 1.8rem;
      letter-spacing: -0.01em;
    }

    .detail-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 1.2rem;
      margin-bottom: 2.2rem;
      padding: 1.4rem;
      background: rgba(255, 255, 255, 0.03);
      border-radius: 18px;
      border: 1px solid var(--border);
    }

    .detail-item {
      display: flex;
      align-items: flex-start;
      gap: 0.9rem;
    }

    .detail-item i {
      font-size: 1.1rem;
      color: var(--gold);
      margin-top: 0.2rem;
      width: 22px;
      text-align: center;
    }

    .detail-item-content strong {
      display: block;
      font-size: 0.68rem;
      text-transform: uppercase;
      color: var(--muted);
      letter-spacing: 0.08em;
      margin-bottom: 0.25rem;
    }

    .detail-item-content span {
      font-size: 0.92rem;
      color: var(--text);
      font-weight: 500;
    }

    .detail-desc {
      line-height: 1.7;
      color: var(--text);
      opacity: 0.85;
      font-size: 0.98rem;
      white-space: pre-wrap;
      margin-bottom: 2.5rem;
    }

    .detail-footer {
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
      border-top: 1px solid var(--border);
      padding-top: 1.5rem;
      margin-top: auto;
    }

    .detail-reg-btn {
      background: var(--gold);
      color: var(--navy);
      padding: 0.9rem 1.5rem;
      border-radius: 12px;
      text-decoration: none;
      font-weight: 700;
      font-size: 0.95rem;
      text-align: center;
      transition: all 0.2s;
      box-shadow: 0 4px 15px rgba(245, 166, 35, 0.25);
      opacity: 0.7;
      pointer-events: none;
    }


    .modal-body {
      padding: 1.5rem 2rem 2rem;
      background: var(--card);
    }

    /* ══ DARK MODE: modal gets a deeper inset look ══ */
    [data-theme="dark"] .modal-box {
      background: #0f1e30;
      border: 1px solid rgba(255, 255, 255, 0.07);
    }

    [data-theme="dark"] .modal-body {
      background: #0f1e30;
    }

    [data-theme="dark"] .modal-footer {
      background: #0f1e30;
      border-top-color: rgba(255, 255, 255, 0.07);
    }



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

    /* ══ DATE MODE FIELDS ══ */
    .date-mode-fields {
      display: none;
    }

    .date-mode-fields.active {
      display: block;
    }

    /* ══ ANN CARDS ══ */
    .ann-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
      gap: 1.1rem;
      margin-top: 1rem;
    }

    .ann-card {
      background: var(--card);
      border-radius: 16px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: transform .2s, box-shadow .2s;
    }

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

    .ann-card-img {
      width: 100%;
      height: 148px;
      object-fit: cover;
      display: block;
    }

    .ann-card-img-placeholder {
      width: 100%;
      height: 148px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.8rem;
      background: linear-gradient(135deg, #0b2240, #1a5fa8);
    }

    .ann-card-body {
      padding: 1.1rem 1.2rem;
      flex: 1;
    }

    .ann-type-badge {
      display: inline-flex;
      align-items: center;
      gap: .3rem;
      padding: .22rem .7rem;
      border-radius: 50px;
      font-size: .67rem;
      font-weight: 700;
      margin-bottom: .55rem;
    }

    .ann-type-info {
      background: var(--sky);
      color: var(--blue);
    }

    .ann-type-event {
      background: var(--gold-light);
      color: #b07d00;
    }

    .ann-type-urgent {
      background: var(--red-light);
      color: var(--red);
    }

    [data-theme="dark"] .ann-type-info {
      background: rgba(91, 168, 245, .15);
      color: var(--blue);
    }

    [data-theme="dark"] .ann-type-event {
      background: rgba(245, 166, 35, .15);
      color: var(--gold);
    }

    [data-theme="dark"] .ann-type-urgent {
      background: rgba(255, 107, 107, .15);
      color: var(--red);
    }

    .ann-title {
      font-family: var(--font-display);
      font-weight: 700;
      font-size: 1.05rem;
      color: var(--navy);
      margin-bottom: .3rem;
      line-height: 1.3;
    }

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

    .ann-msg {
      font-size: .83rem;
      color: var(--muted);
      line-height: 1.6;
      margin-bottom: .7rem;
      display: -webkit-box;
      line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .ann-meta {
      font-size: .72rem;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: .65rem;
      flex-wrap: wrap;
    }

    .ann-actions {
      display: flex;
      gap: .5rem;
      padding: .85rem 1.2rem;
      border-top: 1px solid var(--border);
      background: var(--bg2);
    }

    /* ══ EVENT ADMIN CARDS ══ */
    .events-admin-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 1.1rem;
      margin-top: 1rem;
    }

    .event-admin-card {
      background: var(--card);
      border-radius: 24px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-sm);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
      position: relative;
    }

    .event-admin-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--shadow-lg);
      border-color: var(--blue-light);
    }

    /* Event card image */
    .event-admin-img-wrap {
      width: 100%;
      aspect-ratio: 4 / 3;
      position: relative;
      overflow: hidden;
      background: #000;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .event-admin-img-wrap img {
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    .event-admin-card:hover .event-admin-img-wrap img {
      transform: scale(1.15);
    }

    .event-admin-img-placeholder {
      width: 100%;
      height: 148px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: .5rem;
      position: relative;
      overflow: hidden;
    }

    .event-admin-img-placeholder::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, #0b2240 0%, #1a5fa8 100%);
    }

    .event-admin-img-placeholder>* {
      position: relative;
      z-index: 1;
    }

    .event-admin-img-placeholder i {
      font-size: 2rem;
      color: rgba(255, 255, 255, .45);
    }

    .event-admin-img-placeholder span {
      font-size: .78rem;
      font-weight: 600;
      color: rgba(255, 255, 255, .7);
      text-align: center;
      padding: 0 .75rem;
    }

    /* Fallback color variants by category with premium gradients */
    .fallback-hackathon::before  { background: radial-gradient(circle at top left, #4f46e5, #0b2240) !important; }
    .fallback-workshop::before   { background: radial-gradient(circle at top left, #059669, #0b2240) !important; }
    .fallback-webinar::before    { background: radial-gradient(circle at top left, #2563eb, #123460) !important; }
    .fallback-competition::before{ background: radial-gradient(circle at top left, #ca8a04, #0b2240) !important; }
    .fallback-seminar::before    { background: radial-gradient(circle at top left, #d97706, #123460) !important; }
    .fallback-collab::before     { background: radial-gradient(circle at top left, #dc2626, #0b2240) !important; }

    .event-admin-body {
      padding: 1.5rem;
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    .event-admin-title {
      font-family: var(--font-body);
      font-weight: 800;
      font-size: 1.15rem;
      color: var(--navy);
      margin-bottom: 0.8rem;
      line-height: 1.3;
      letter-spacing: -0.01em;
    }

    [data-theme="dark"] .event-admin-title {
      color: var(--text);
    }

    .event-admin-meta {
      font-size: 0.85rem;
      color: var(--muted);
      margin-top: 0.4rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      font-weight: 500;
    }

    .event-admin-meta i {
      width: 16px;
      color: var(--blue-light);
      font-size: 0.9rem;
      opacity: 0.8;
    }

    .event-admin-actions {
      padding: 1.2rem 1.5rem;
      border-top: 1px solid var(--border);
      background: var(--bg2);
      display: flex;
      gap: 0.8rem;
      justify-content: flex-end;
    }

    /* Image map info box */
    .img-map-box {
      background: var(--bg2);
      border: 1px solid var(--border2);
      border-radius: 12px;
      padding: 1rem 1.2rem;
      margin-top: .75rem;
    }

    .img-map-box h4 {
      font-size: .8rem;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: .6rem;
      display: flex;
      align-items: center;
      gap: .4rem;
    }

    [data-theme="dark"] .img-map-box h4 {
      color: var(--text);
    }

    .img-map-row {
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: .5rem;
      align-items: center;
      margin-bottom: .5rem;
    }

    .img-map-row input {
      font-size: .8rem;
      padding: .45rem .7rem;
    }

    .img-map-add {
      font-size: .75rem;
    }

    /* Image path preview */
    .img-path-preview-wrap {
      margin-top: .65rem;
      display: none;
    }

    .img-path-preview-wrap img {
      width: 100%;
      max-height: 160px;
      object-fit: cover;
      border-radius: 10px;
      border: 1.5px solid var(--border2);
    }

    .img-path-preview-wrap .img-path-error {
      padding: .5rem .8rem;
      background: var(--red-light);
      color: var(--red);
      border-radius: 8px;
      font-size: .78rem;
      font-weight: 600;
    }

    /* Ann color theme swatches */
    .color-swatches {
      display: flex;
      gap: .5rem;
      flex-wrap: wrap;
      margin-top: .35rem;
    }

    .color-swatch {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      transition: transform .18s, border-color .18s;
      flex-shrink: 0;
    }

    .color-swatch:hover {
      transform: scale(1.15);
    }

    .color-swatch.selected {
      border-color: var(--text);
      transform: scale(1.15);
    }

    /* Preview modal */
    .preview-modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(11, 34, 64, .65);
      backdrop-filter: blur(6px);
      z-index: 2000;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }

    .preview-modal-overlay.open {
      display: flex;
    }

    .preview-popup {
      background: var(--card);
      border-radius: 20px;
      padding: 2.5rem;
      max-width: 480px;
      width: 90%;
      box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
      position: relative;
      text-align: center;
    }

    .preview-popup .ann-banner-img {
      width: 100%;
      max-height: 180px;
      object-fit: cover;
      border-radius: 12px;
      margin-bottom: 1rem;
      display: none;
    }

    .preview-popup .ann-icon-preview {
      font-size: 2.2rem;
      margin-bottom: .75rem;
    }

    .preview-popup .ann-title-preview {
      font-family: var(--font-display);
      font-size: 1.45rem;
      color: var(--navy);
      margin-bottom: .5rem;
    }

    [data-theme="dark"] .preview-popup .ann-title-preview {
      color: var(--text);
    }

    .preview-popup .ann-msg-preview {
      font-size: .93rem;
      color: var(--muted);
      line-height: 1.7;
      margin-bottom: 1.2rem;
    }

    .preview-popup .ann-cta-preview {
      display: inline-flex;
      align-items: center;
      gap: .5rem;
      background: #0b2240;
      color: #fff;
      padding: .7rem 1.8rem;
      border-radius: 999px;
      font-weight: 700;
      font-size: .9rem;
      text-decoration: none;
      margin-bottom: 1rem;
    }

    .preview-popup .close-preview {
      position: absolute;
      top: .9rem;
      right: .9rem;
      background: var(--bg2);
      border: 1px solid var(--border);
      color: var(--muted);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: .9rem;
      transition: background .2s;
    }

    .preview-popup .close-preview:hover {
      background: var(--red-light);
      color: var(--red);
    }

    /* Audience badge */
    .audience-badge {
      display: inline-flex;
      align-items: center;
      gap: .25rem;
      padding: .18rem .55rem;
      border-radius: 50px;
      font-size: .65rem;
      font-weight: 700;
      margin-left: .3rem;
    }

    .aud-all {
      background: var(--sky);
      color: var(--blue);
    }

    .aud-1st {
      background: var(--green-light);
      color: var(--green);
    }

    .aud-2nd {
      background: var(--gold-light);
      color: var(--orange);
    }

    .aud-3rd {
      background: var(--purple-light);
      color: var(--purple);
    }

    .aud-4th {
      background: var(--red-light);
      color: var(--red);
    }

    [data-theme="dark"] .aud-all {
      background: rgba(91, 168, 245, .15);
      color: var(--blue);
    }

    [data-theme="dark"] .aud-1st {
      background: rgba(47, 217, 138, .15);
      color: var(--green);
    }

    [data-theme="dark"] .aud-2nd {
      background: rgba(245, 166, 35, .15);
      color: var(--gold);
    }

    [data-theme="dark"] .aud-3rd {
      background: rgba(167, 139, 250, .15);
      color: var(--purple);
    }

    [data-theme="dark"] .aud-4th {
      background: rgba(255, 107, 107, .15);
      color: var(--red);
    }

    /* Read stats */
    .read-stats {
      font-size: .7rem;
      color: var(--muted);
      display: flex;
      align-items: center;
      gap: .4rem;
    }

    .read-stats i {
      color: var(--blue-light);
    }

    /* Info note */
    .info-note {
      display: flex;
      align-items: flex-start;
      gap: .5rem;
      background: var(--sky);
      border-radius: 10px;
      padding: .8rem 1rem;
      margin-bottom: 1rem;
    }

    [data-theme="dark"] .info-note {
      background: rgba(91, 168, 245, .1);
    }

    .info-note i {
      color: var(--blue);
      flex-shrink: 0;
      margin-top: 2px;
    }

    .info-note p {
      font-size: .8rem;
      color: var(--muted);
      line-height: 1.5;
    }

    /* Spin */
    .spin {
      display: inline-block;
      animation: spin 1s linear infinite;
    }

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

    /* ══ RESPONSIVE ══ */
    @media(max-width:900px) {
      .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
      }

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

      .main {
        margin-left: 0;
        width: 100%;
      }

      /* Show hamburger button on mobile */
      .menu-toggle {
        display: flex;
      }

      .topbar {
        padding: 0 1rem;
        gap: 0.5rem;
        height: 60px;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
        background: var(--card);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border2);
      }

      .page-content {
        margin-top: 60px; /* Offset for fixed topbar */
        padding: 1.2rem 1rem 1.5rem;
      }

      .topbar-title {
        font-size: 0.95rem;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .logout-btn {
        font-size: 0; /* Hide text */
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 50%;
      }
      
      .logout-btn i {
        font-size: 1rem;
        margin: 0;
      }

      .admin-badge {
        display: none;
      }
      
      /* Force tables to scroll */
      .table-responsive,
      .pane {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      
      table {
        min-width: 600px; /* Minimum width to prevent crushing columns */
      }
    }
    
    /* Small phone adjustment */
    @media (max-width: 400px) {
      .topbar-right {
        gap: 0.4rem;
      }
      .theme-toggle, .menu-toggle, .logout-btn {
        width: 34px;
        height: 34px;
      }
    }

    @media(max-width:480px) {
      .stats-row {
        grid-template-columns: 1fr 1fr;
      }
    }
    /* ─── MODALS ─── */
    .modal {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(7, 22, 42, 0.4);
      backdrop-filter: blur(8px);
      display: none; align-items: center; justify-content: flex-end;
      padding: 0; animation: fadeIn 0.3s ease;
    }
    .modal.open { display: flex; }
    .modal-box {
      background: var(--card);
      border-left: 1px solid var(--border);
      width: 100%; max-width: 600px;
      height: 100%; overflow-y: auto;
      box-shadow: -20px 0 60px rgba(0,0,0,0.3);
      animation: adminDrawerIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }
    @keyframes adminDrawerIn { from{transform:translateX(100%)} to{transform:translateX(0)} }
    @keyframes fadeIn { from{opacity:0} to{opacity:1} }
    
    .modal-header { padding: 1.5rem 2rem; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: space-between; }
    .modal-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--gold); }
    .modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; transition: color 0.2s; }
    .modal-close:hover { color: var(--red); }
    .modal-body { padding: 2rem; }
    .modal-footer { padding: 1.2rem 2rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: flex-end; gap: 1rem; }

    /* ─── BADGES ─── */
    .badge {
      display: inline-flex; align-items: center; padding: 0.25rem 0.75rem;
      border-radius: 50px; font-size: 0.65rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.05em;
    }
    .badge-primary { background: rgba(91, 168, 245, 0.15); color: var(--blue); }
    .badge-warning { background: rgba(245, 166, 35, 0.15); color: var(--gold); }
    .badge-danger  { background: rgba(232, 64, 64, 0.15); color: var(--red); }

    .btn-xs {
      padding: 0.15rem 0.4rem;
      font-size: 0.65rem;
      border-radius: 4px;
    }
    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
    }
    @media (max-width: 992px) {
      .grid-2 { grid-template-columns: 1fr; }
    }

    /* ─── ACTION BUTTONS ─── */
    .action-btn {
      min-width: 32px;
      width: auto;
      height: 32px;
      padding: 0 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.05);
      color: var(--text);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      font-size: 0.85rem;
      text-decoration: none;
      outline: none;
      gap: 6px;
    }

    .action-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
      border-color: rgba(255,255,255,0.2);
    }

    .action-btn.view { 
      color: #7ab8ff; 
      background: rgba(91, 168, 245, 0.1); 
    }
    .action-btn.view:hover { 
      background: var(--blue); 
      color: #fff;
    }

    .action-btn.save { 
      color: #5effa8; 
      background: rgba(22, 169, 107, 0.1); 
    }
    .action-btn.save:hover { 
      background: var(--green); 
      color: #fff;
    }

    .action-btn.delete { 
      color: #ff7a7a; 
      background: rgba(232, 64, 64, 0.1); 
    }
    .action-btn.delete:hover { 
      background: var(--red); 
      color: #fff;
    }

    .action-btn i {
      transition: transform 0.2s;
    }
    .action-btn:active i {
      transform: scale(0.9);
    }
/* -- AUTH MANAGER -- */
#authTbody tr { transition: transform 0.2s ease, background-color 0.2s ease; }
#authTbody tr:hover { background: var(--bg) !important; transform: scale(1.002); }
.badge-missing { background: var(--red-light); color: var(--red); border: 1px solid var(--red); }
.auth-btn-group { display: flex; gap: 0.4rem; justify-content: center; }
.auth-btn-group .btn-ghost:hover { background: var(--blue-light); color: white; }
.auth-btn-group .btn-danger:hover { background: var(--red); color: white; box-shadow: 0 4px 12px rgba(232, 64, 64, 0.3); }
@media (max-width: 900px) { .table-wrap { overflow-x: auto; } }
