/* ============================================================
   AssetLog — Shared Stylesheet
   Brand: Saudi Aramco Corporate Identity
   Green #006633 · Gold #FFCC00 · Sky Blue #0099E5
   Dark #231F20 · Bg #F4F7F9
   ============================================================ */

/*
 * OFFLINE MODE — zero external network calls.
 * English: Segoe UI (Windows built-in) → system-ui → Helvetica Neue → Arial
 * Arabic:  Segoe UI Arabic (Windows built-in) → Noto Sans Arabic → Arial
 * No Google Fonts or CDN required.
 */

/* ── variables ──────────────────────────────────────────────── */
:root {
  /* ── Aramco Corporate Palette ── */
  --primary:       #231F20;           /* Neutral Dark — sidebar, nav, dark surfaces  */
  --green:         #006633;           /* Brand Green  — primary buttons & highlights */
  --green-dark:    #004d26;           /* Brand Green hover                           */
  --green-light:   #E6F2EC;           /* Brand Green tint                            */
  --gold:          #FFCC00;           /* Brand Gold   — CTAs & active states         */
  --gold-dark:     #D4A800;           /* Gold hover                                  */
  --gold-light:    #FFFBE6;           /* Gold tint                                   */
  --blue:          #0099E5;           /* Corporate Sky Blue — links & system accents */
  --blue-dark:     #007BB8;           /* Sky Blue hover                              */
  --blue-light:    #E6F5FC;           /* Sky Blue tint                               */
  --bg:            #F4F7F9;           /* Section background                          */
  --white:         #FFFFFF;
  --text:          #231F20;           /* Body text — professional dark               */
  --muted:         #4A4A4A;           /* Secondary text                              */
  --border:        #DDE3E8;
  --danger:        #C0392B;
  --danger-light:  #FDECEA;
  --warning:       #E67E22;
  --warning-light: #FEF3E7;
  --shadow-sm:     0 1px 3px rgba(35,31,32,.09), 0 1px 2px rgba(35,31,32,.06);
  --shadow:        0 4px 12px rgba(35,31,32,.10);
  --shadow-lg:     0 8px 24px rgba(35,31,32,.13);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    0.2s ease;

  /* ── English font stack (Aramco corporate fallback) ── */
  --font-en: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter',
             'Helvetica Neue', Arial, sans-serif;

  /* ── Arabic font stack ── */
  --font-ar: 'Cairo', 'Noto Sans Arabic', 'Segoe UI Arabic',
             'Helvetica Neue', Arial, sans-serif;
}

/* ── reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-en);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Arabic language support */
:lang(ar), [dir="rtl"] {
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ── typography ─────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: 0.8rem; }
.text-xs     { font-size: 0.72rem; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ── logo ───────────────────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 22px; height: 22px; }
.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
}
.logo-text .asset { color: var(--primary); }
.logo-text .log   { color: var(--green); }
.logo-tag {
  font-size: 0.65rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 2px;
}

/* large centered logo variant */
.logo-lg .logo-icon { width: 52px; height: 52px; border-radius: 14px; }
.logo-lg .logo-icon svg { width: 30px; height: 30px; }
.logo-lg .logo-text { font-size: 1.75rem; }

/* ── layout utilities ───────────────────────────────────────── */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4  { gap: 16px; }
.gap-2  { gap: 8px; }
.gap-1  { gap: 4px; }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ── header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── badge / pill ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.badge-green   { background: var(--green-light);   color: var(--green); }
.badge-red     { background: var(--danger-light);  color: var(--danger); }
.badge-amber   { background: var(--gold-light);    color: #7A6000; }
.badge-gold    { background: var(--gold);          color: var(--primary); font-weight: 700; }
.badge-blue    { background: var(--blue-light);    color: var(--blue); }
.badge-gray    { background: var(--bg);            color: var(--muted); }

/* ── buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
/* Primary = Aramco Green */
.btn-primary         { background: var(--green);   color: var(--white); letter-spacing: .2px; }
.btn-primary:hover   { background: var(--green-dark); box-shadow: 0 4px 12px rgba(0,102,51,.25); }

/* Gold = Aramco Gold CTA — use sparingly */
.btn-gold            { background: var(--gold);    color: var(--primary); font-weight: 700; }
.btn-gold:hover      { background: var(--gold-dark); box-shadow: 0 4px 12px rgba(255,204,0,.30); }

/* Blue = Corporate Sky Blue */
.btn-blue            { background: var(--blue);    color: var(--white); }
.btn-blue:hover      { background: var(--blue-dark); }

/* Dark = Neutral Dark */
.btn-dark            { background: var(--primary); color: var(--white); }
.btn-dark:hover      { background: #3a3437; }

.btn-outline         { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover   { border-color: var(--green); color: var(--green); background: var(--green-light); }

.btn-danger          { background: var(--danger);  color: var(--white); }
.btn-danger:hover    { background: #96281B; }

.btn-ghost           { background: transparent; color: var(--muted); }
.btn-ghost:hover     { background: var(--bg); color: var(--text); }

.btn-sm   { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg   { padding: 14px 28px; font-size: 1rem; letter-spacing: .3px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--border);
}
.card-hover {
  cursor: pointer;
  transition: all var(--transition);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--green);
}

/* ── forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-en);
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,102,51,.12);
}
.form-control::placeholder { color: #9BA8B4; }
.form-hint { font-size: 0.75rem; color: var(--muted); }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* autocomplete wrapper */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--blue-light); }
.autocomplete-item .ac-name { font-weight: 600; }
.autocomplete-item .ac-sub  { font-size: 0.75rem; color: var(--muted); }

/* ── modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,42,.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-lg { max-width: 720px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  background: none; border: none;
  font-size: 1.2rem;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* ── table ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
tbody td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  vertical-align: middle;
}
tbody tr:hover { background: var(--bg); }
.table-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.table-empty .empty-icon { font-size: 2.5rem; margin-bottom: 8px; }

/* ── stat cards ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.stat-value { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ── admin sidebar layout ───────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--primary);
  color: var(--white);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo .logo-text .asset { color: var(--white); }
.sidebar-logo .logo-icon { background: rgba(255,255,255,.12); }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  padding: 6px 10px 4px;
  margin-top: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: rgba(255,255,255,.75);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover   { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active  { background: var(--green); color: var(--white); border-left: 3px solid var(--gold); padding-left: 9px; }
.nav-item svg     { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.admin-content {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--green);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}
.admin-page { padding: 28px; flex: 1; }
.page-header { margin-bottom: 24px; }
.page-header h2 { margin-bottom: 4px; }

/* ── tabs ───────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 8px 18px 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: 6px 6px 0 0;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel      { display: none; }
.tab-panel.active { display: block; }

/* ── filters bar ────────────────────────────────────────────── */
.filters-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 140px; flex: 1; }
.filter-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }

/* ── asset grid (user page) ─────────────────────────────────── */
.asset-type-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.asset-type-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  /* fixed width so cards stay uniform and centre correctly */
  width: 260px;
  flex: 0 0 260px;
}
.asset-type-card:hover {
  border-color: var(--green);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.asset-type-icon {
  width: 72px; height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}
.asset-type-name { font-size: 1.15rem; font-weight: 700; }
.asset-type-desc { font-size: 0.8rem; color: var(--muted); }
.asset-type-counts { display: flex; gap: 12px; }

/* individual asset cards in modal */
.asset-list { display: flex; flex-direction: column; gap: 10px; }
.asset-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  background: var(--white);
}
.asset-item.available { cursor: pointer; }
.asset-item.available:hover { border-color: var(--green); background: var(--green-light); }
.asset-item.checked-out { opacity: .9; border-color: #FECACA; background: var(--danger-light); }
.asset-photo {
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}
.asset-photo img { width: 100%; height: 100%; object-fit: cover; }
.asset-info  { flex: 1; min-width: 0; }
.asset-name  { font-weight: 600; font-size: 0.95rem; }
.asset-id    { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.asset-user  { font-size: 0.78rem; color: var(--danger); margin-top: 3px; font-weight: 500; }

/* ── hero banner (user page) ────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--green) 100%);
  color: var(--white);
  padding: 44px 0 40px;
  text-align: center;
  border-bottom: 3px solid var(--gold);
}
.hero h1 { font-size: 1.8rem; margin-bottom: 8px; }
.hero p   { color: rgba(255,255,255,.75); font-size: 0.95rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ── success state ──────────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 32px 24px;
}
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 16px;
}
.success-screen h3 { margin-bottom: 8px; }

/* ── login page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--primary) 0%, var(--green-dark) 60%, var(--green) 100%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-card .logo { justify-content: center; margin-bottom: 28px; }
.login-error {
  background: var(--danger-light);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ── settings item ──────────────────────────────────────────── */
.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--white);
}
.settings-item-info { flex: 1; min-width: 0; }
.settings-item-name { font-weight: 600; }
.settings-item-sub  { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.settings-item-actions { display: flex; gap: 8px; flex-shrink: 0; }
.toggle {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: #CBD5E1;
  border-radius: 999px;
  transition: var(--transition);
}
.toggle-slider:before {
  position: absolute; content: '';
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ── pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
}
.page-btn {
  min-width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover   { border-color: var(--green); color: var(--green); }
.page-btn.active  { background: var(--green); color: var(--white); border-color: var(--green); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--primary);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideLeft .2s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--danger); }

/* ── misc ───────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: var(--transition);
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 49;
}

/* ── animations ─────────────────────────────────────────────── */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════ */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px; height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 98;
}
.sidebar-overlay.open { display: block; }

/* ── Tablet & Mobile ≤ 900px ── */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .sidebar { transform: translateX(-100%); z-index: 99; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: 6px 0 24px rgba(0,0,0,.3); }
  .admin-content { margin-left: 0; overflow-x: hidden; }
  .admin-topbar { padding: 10px 16px; }
  .topbar-title { font-size: 0.9rem; }
  .admin-page { padding: 14px; overflow-x: hidden; }
  .page-header { margin-bottom: 14px; }
  .page-header h2 { font-size: 1.2rem; }

  /* Stat cards: 2 columns, compact */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-icon { width: 36px; height: 36px; font-size: 1.1rem; margin-bottom: 8px; }
  .stat-value { font-size: 1.5rem; }
  .stat-label { font-size: 0.75rem; }

  /* Tables */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table { min-width: 520px; font-size: 0.82rem; }
  th, td { padding: 10px 10px; }

  /* Filters */
  .filters-bar { padding: 10px; gap: 8px; }
  .filter-group { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .form-row { grid-template-columns: 1fr; gap: 10px; }

  /* Modals */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 14px 14px 0 0 !important; max-width: 100% !important; width: 100%; max-height: 90vh; overflow-y: auto; margin: 0; }
  .modal-body { padding: 14px; }
  .modal-footer { padding: 10px 14px; flex-direction: column-reverse; gap: 8px; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Settings */
  .settings-item { flex-wrap: wrap; gap: 8px; }
  .settings-item-actions { width: 100%; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); }

  /* Tabs scroll */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; padding: 8px 12px 10px; font-size: 0.8rem; flex-shrink: 0; }

  /* Cards */
  .card { padding: 14px; }
  .section-header { flex-wrap: wrap; gap: 8px; }
  .login-card { padding: 24px 18px; }
}

/* ── Small Mobile ≤ 480px ── */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 1.3rem; }

  .filter-group { min-width: 100%; flex: 1 1 100%; }
  .filters-bar { flex-direction: column; }

  #adminName { display: none; }

  .admin-page { padding: 10px; }
  .admin-topbar { padding: 8px 12px; }
  .hero { padding: 24px 14px; }
  .hero h1 { font-size: 1.25rem; }
  .container { padding: 0 10px; }
  .btn-sm { padding: 5px 10px; font-size: 0.75rem; }
}

/* ── Very small ≤ 360px ── */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.1rem; }
}
