@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════
   1ST ACADEMY — Black & Gold Premium Theme
   ══════════════════════════════════════════ */

/* ─ Font loading note ─
   Single canonical @import (top of file) loads Noto Sans Thai + Inter
   for the entire site. Public pages may omit the per-file <link> tags
   in <head>. Admin/IB pages still use their own <link> for legacy compat.
   --font-mono falls back to system monospace (SF Mono, ui-monospace) — no
   external mono font load. */

/* ─ CSS Variables (Dark default) ─ */
:root, [data-theme="dark"] {
  --bg:         #09090B;
  --bg2:        #111113;
  --bg3:        #18181B;
  --bg4:        #27272A;
  --fg:         #FAFAF9;
  --fg2:        #A8A29E;
  --fg3:        #57534E;
  --gold:       #D4A843;
  --gold-l:     #E8C36A;
  --gold-d:     #B8922F;
  --gold-bg:    rgba(212,168,67,.1);
  --gold-glow:  rgba(212,168,67,.25);
  --accent:     var(--gold);
  --accent-l:   var(--gold-l);
  --accent-d:   var(--gold-d);
  --accent-bg:  var(--gold-bg);
  --green:      #22C55E;
  --green-bg:   rgba(34,197,94,.1);
  --red:        #EF4444;
  --red-bg:     rgba(239,68,68,.1);
  --blue:       #60A5FA;
  --blue-bg:    rgba(96,165,250,.1);
  --border:     rgba(212,168,67,.1);
  --border-s:   rgba(212,168,67,.22);
  --shadow-sm:  0 1px 2px rgba(0,0,0,.3);
  --shadow:     0 2px 8px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.5);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.6);
  --shadow-gold: 0 4px 20px rgba(212,168,67,.15);
  --r:          10px;
  --r-sm:       8px;
  --r-lg:       16px;
  --r-xl:       20px;
  /* ── Font system ──
     Noto Sans Thai (Thai) + Inter (Latin) for everything.
     --font-sans is the canonical name; --font-body kept as alias. */
  --font-sans:  "Noto Sans Thai", "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body:  var(--font-sans);     /* alias kept for compat */
  --font-mono:  'JetBrains Mono', 'SF Mono', ui-monospace, monospace;
  --font-display: var(--font-sans);   /* alias kept for compat */
  --font-feature-settings: 'cv11','ss01','ss03';  /* Inter stylistic sets */
  /* ── Typography scale (reference values) ── */
  --fw-hero:    900;
  --fw-heading: 800;
  --fw-card:    700;
  --fw-body:    400;
  --lh-hero:    1.08;
  --lh-heading: 1.2;
  --lh-body:    1.7;
  --sidebar-w:  260px;
  --nav-h:      64px;
  --transition: .2s cubic-bezier(.4,0,.2,1);
}

/* ─ Light theme ─ */
[data-theme="light"] {
  --bg:         #FDFCF9;
  --bg2:        #FFFFFF;
  --bg3:        #F8F6F0;
  --bg4:        #EDE8DA;
  --fg:         #1C1917;
  --fg2:        #78716C;
  --fg3:        #A8A29E;
  --border:     rgba(140,110,40,.12);
  --border-s:   rgba(140,110,40,.22);
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 2px 8px rgba(0,0,0,.06);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.08);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.1);
}

/* ─ Reset ─ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-feature-settings: var(--font-feature-settings);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Premium heading scale ──
   All h1–h6 inherit body font but with tighter letter-spacing +
   compact line-height. Larger hero overrides come from page styles.  */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  letter-spacing: -.02em;
  line-height: 1.2;
  font-weight: 800;
}
h1 { letter-spacing: -.035em; line-height: 1.08; }
h2 { letter-spacing: -.028em; line-height: 1.15; }
h3 { letter-spacing: -.02em; }

/* ── Gold accent word (.gold-accent / .accent / h1 .gold) ──
   Single-font policy: accent uses the SAME font as body (LINE Seed
   Sans TH / Inter), upright (NOT italic). Thai script doesn't have
   real italic glyphs — browsers fake it by slanting upright forms,
   which looks awkward on Thai diacritics. Just the gold gradient
   alone is plenty of visual differentiation.
   No display:inline-block, no filter — Thai diacritics need to stay
   on their base character.                                             */
.gold-accent, h1 .gold, h2 .accent, h1 .accent {
  background: linear-gradient(135deg, #f7d978 0%, #e0b94a 45%, #b88f2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
}

/* Buttons + form controls inherit body font with tighter spacing */
button, input, select, textarea {
  font-family: inherit;
  letter-spacing: -.005em;
}

a { color: var(--gold); text-decoration: none; transition: all var(--transition); }
a:hover { color: var(--gold-l); }
img { max-width: 100%; display: block; }

/* ─ Scrollbar ─ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-d); }

/* ═══ SKELETON LOADING (shown while fetching data) ═══ */
.skel {
  background: linear-gradient(90deg,
    var(--bg3) 0%,
    var(--bg4) 50%,
    var(--bg3) 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
  display: inline-block;
}
.skel-line  { height: 12px; border-radius: 4px; }
.skel-line-lg { height: 18px; border-radius: 4px; }
.skel-block { height: 80px; border-radius: var(--r-sm); }
.skel-card  { padding: 16px; background: var(--bg2); border: 1px solid var(--border);
              border-radius: var(--r-lg); }
@keyframes skel-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══ EMPTY STATE ═══ */
.empty-state-v2 {
  text-align: center; padding: 60px 20px; color: var(--fg3);
}
.empty-state-v2 .icon { font-size: 2.6rem; margin-bottom: 12px; opacity: .6; }
.empty-state-v2 .title { font-size: 1.05rem; font-weight: 700; color: var(--fg); margin-bottom: 6px; }
.empty-state-v2 .desc  { font-size: .86rem; line-height: 1.6; max-width: 360px; margin: 0 auto; }
.empty-state-v2 .desc a { color: var(--gold); font-weight: 600; }

/* ═══ NAVBAR ═══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; gap: 8px;
  background: rgba(9,9,11,.88);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
  overflow: hidden;
}
[data-theme="light"] .navbar {
  background: rgba(253,252,249,.9);
}

.nav-brand {
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--fg); display: flex; align-items: center; gap: 10px;
}
.nav-brand .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 900; font-size: .8rem; letter-spacing: -.03em;
  box-shadow: 0 2px 8px rgba(212,168,67,.3);
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav-brand-text .brand-main { font-weight: 800; font-size: 1.05rem; color: var(--gold); }
.nav-brand-text .brand-sub { font-size: .62rem; font-weight: 500; color: var(--fg3); letter-spacing: .08em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-links a:not(.btn) {
  padding: 7px 14px; border-radius: var(--r-sm); font-size: .88rem;
  font-weight: 500; color: var(--fg2); transition: all var(--transition);
  white-space: nowrap;
}
.nav-links a:not(.btn):hover { color: var(--gold); background: var(--gold-bg); }

/* ─ Buttons ─ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none; line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-gold, .btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-d));
  color: #000; font-weight: 700;
}
.btn-gold:hover, .btn-primary:hover { box-shadow: var(--shadow-gold); color: #000; }

.btn-secondary {
  background: transparent; color: var(--fg);
  border: 1.5px solid var(--border-s);
}
.btn-secondary:hover { border-color: var(--gold); background: var(--gold-bg); color: var(--gold); }

.btn-ghost {
  background: transparent; color: var(--fg2); padding: 8px 14px;
}
.btn-ghost:hover { color: var(--gold); background: var(--gold-bg); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,.3); }

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

.btn-outline-gold {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline-gold:hover { background: var(--gold-bg); box-shadow: var(--shadow-gold); }

.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-xs { padding: 4px 10px; font-size: .78rem; border-radius: 6px; }
.btn-lg { padding: 14px 36px; font-size: 1rem; border-radius: var(--r); }

/* ─ Input ─ */
.inp {
  width: 100%; padding: 11px 14px;
  background: var(--bg3); border: 1.5px solid var(--border);
  border-radius: var(--r-sm); font-family: var(--font-body);
  font-size: .9rem; color: var(--fg);
  transition: all var(--transition); outline: none;
}
.inp:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-bg); }
.inp::placeholder { color: var(--fg3); }
.inp[readonly] { opacity: .7; cursor: default; }

label.field-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--fg2); margin-bottom: 6px; letter-spacing: .03em;
}

select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23A8A29E' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 32px;
}

textarea.inp { resize: vertical; min-height: 80px; }

/* ─ Cards ─ */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-s); box-shadow: var(--shadow); }
.card-gold { border-color: var(--gold-d); }
.card-gold:hover { box-shadow: var(--shadow-gold); }
.card-title { font-size: .78rem; font-weight: 600; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.card-value { font-size: 1.8rem; font-weight: 700; color: var(--fg); letter-spacing: -.02em; }
.card-sub { font-size: .82rem; color: var(--fg3); margin-top: 4px; }

/* ─ Stats Grid ─ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ─ Table ─ */
.tbl-wrap { overflow-x: auto; border-radius: var(--r); border: 1px solid var(--border); }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl thead { background: var(--bg3); }
.tbl th {
  padding: 11px 16px; text-align: left; font-size: .74rem;
  font-weight: 700; color: var(--gold); text-transform: uppercase;
  letter-spacing: .08em; border-bottom: 1px solid var(--border);
}
.tbl td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background var(--transition); }
.tbl tbody tr:hover { background: var(--gold-bg); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ─ Status badges ─ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red   { background: var(--red-bg);   color: var(--red); }
.badge-gold  { background: var(--gold-bg);  color: var(--gold); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue); }
.badge-gray  { background: rgba(255,255,255,.05); color: var(--fg3); }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-red   { background: var(--red); }
.dot-gray  { background: var(--fg3); }
.dot-gold  { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ─ Modal ─ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg2); border-radius: var(--r-xl);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl); border: 1px solid var(--border-s);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { 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: 10px; justify-content: flex-end; }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  border: none; background: var(--gold-bg); color: var(--fg2);
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }

/* ─ Toast ─ */
.toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: var(--r-sm);
  font-size: .86rem; font-weight: 500;
  background: var(--bg2); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); color: var(--fg);
  animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.warn { border-left: 3px solid var(--gold); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ─ Sidebar (Dashboard) ─ */
.layout { display: flex; min-height: 100vh; padding-top: var(--nav-h); }
.sidebar {
  width: var(--sidebar-w); position: fixed; top: var(--nav-h); left: 0; bottom: 0;
  background: var(--bg2); border-right: 1px solid var(--border);
  padding: 20px 12px; overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-section { margin-bottom: 24px; }
.sidebar-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--gold-d); padding: 0 12px; margin-bottom: 8px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 500; color: var(--fg2);
  cursor: pointer; transition: all var(--transition);
}
.sb-item:hover { background: var(--gold-bg); color: var(--gold); }
.sb-item.active { background: var(--gold-bg); color: var(--gold); font-weight: 600; }
.sb-icon { font-size: 1rem; width: 22px; text-align: center; }

.main-content {
  flex: 1; margin-left: var(--sidebar-w); padding: 28px 32px;
  max-width: calc(100% - var(--sidebar-w));
}

/* ─ Section ─ */
.section { display: none; }
.section.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.section-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }

/* ─ Form ─ */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 12px; }
.form-row > * { flex: 1; }
.form-error { color: var(--red); font-size: .82rem; margin-top: 10px; min-height: 1.2em; }

/* ─ Empty state ─ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--fg3); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .92rem; }

/* ─ Divider ─ */
.divider-gold {
  height: 1px; border: none; margin: 32px 0;
  background: linear-gradient(90deg, transparent, var(--gold-d), transparent);
}

/* ─ Gold gradient text ─ */
.text-gold-gradient {
  background: linear-gradient(135deg, var(--gold-l), var(--gold), var(--gold-d));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─ Glow effects ─ */
.glow-gold { box-shadow: 0 0 30px rgba(212,168,67,.12); }
.glow-gold-strong { box-shadow: 0 0 40px rgba(212,168,67,.2); }

/* ─ Helpers ─ */
.v-green { color: var(--green) !important; }
.v-red   { color: var(--red) !important; }
.v-gold  { color: var(--gold) !important; }
.v-blue  { color: var(--blue) !important; }
.mono    { font-family: var(--font-mono); }
.text-sm { font-size: .85rem; }
.text-xs { font-size: .78rem; }
.text-center { text-align: center; }
.mt-1  { margin-top: 8px; }
.mt-2  { margin-top: 16px; }
.mt-3  { margin-top: 24px; }
.mb-1  { margin-bottom: 8px; }
.mb-2  { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─ Theme toggle ─ */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--fg2); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--gold-bg); color: var(--gold); border-color: var(--gold); }

/* ─ Mobile hamburger ─ */
.hamburger {
  display: none; width: 36px; height: 36px; border: none;
  background: none; cursor: pointer; color: var(--fg);
  font-size: 1.3rem; align-items: center; justify-content: center;
}

/* ─ Search bar ─ */
.search-bar { position: relative; max-width: 280px; }
.search-bar .inp { padding-left: 36px; }
.search-bar .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--fg3); font-size: .9rem; pointer-events: none;
}

/* ─ Action buttons in tables ─ */
.action-btn {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg3); color: var(--fg2); font-size: .78rem;
  cursor: pointer; transition: all var(--transition); font-family: var(--font-body);
}
.action-btn:hover { border-color: var(--gold); color: var(--gold); }
.action-btn.danger { border-color: rgba(239,68,68,.3); color: var(--red); }
.action-btn.danger:hover { background: var(--red-bg); }
.action-btn.success { border-color: rgba(34,197,94,.3); color: var(--green); }
.action-btn.success:hover { background: var(--green-bg); }

/* ─ Raw data viewer ─ */
.raw-data {
  background: var(--bg3); border-radius: var(--r-sm); padding: 12px;
  font-family: var(--font-mono); font-size: .74rem; color: var(--fg2);
  max-height: 200px; overflow-y: auto; white-space: pre-wrap;
  border: 1px solid var(--border);
}

/* ─ Password toggle ─ */
.password-wrap { position: relative; }
.password-wrap .inp { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--fg3); cursor: pointer;
  font-size: 1rem; padding: 4px; transition: color var(--transition);
}
.password-toggle:hover { color: var(--gold); }

/* ═══ EA GRID + CARD (for downloads) ═══ */
.ea-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.ea-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  transition: all var(--transition); position: relative; overflow: visible;
  display: flex; flex-direction: column;
}
.ea-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-d));
  opacity: 0; transition: opacity var(--transition);
}
.ea-card:hover { border-color: var(--gold-d); box-shadow: var(--shadow-gold); }
.ea-card:hover::before { opacity: 1; }
.ea-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.ea-card-name { font-size: 1.1rem; font-weight: 700; color: var(--fg); }
.ea-card-version { font-size: .72rem; color: var(--gold); font-weight: 600; background: var(--gold-bg); padding: 2px 8px; border-radius: 99px; }
.ea-card-desc { font-size: .86rem; color: var(--fg2); margin-bottom: 16px; line-height: 1.7; flex: 1; }
.ea-card-desc strong { color: var(--fg); font-weight: 600; }
.ea-card-desc ul { margin: 6px 0 8px 8px; padding-left: 16px; list-style: disc; }
.ea-card-desc li { margin-bottom: 3px; font-size: .84rem; }
.ea-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ea-meta-tag {
  font-size: .72rem; padding: 3px 10px; border-radius: 99px;
  background: var(--bg3); color: var(--fg2); border: 1px solid var(--border);
}
.ea-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.ea-stat { text-align: center; padding: 10px; background: var(--bg3); border-radius: var(--r-sm); }
.ea-stat .label { font-size: .68rem; color: var(--fg3); text-transform: uppercase; letter-spacing: .05em; }
.ea-stat .value { font-size: .95rem; font-weight: 700; margin-top: 2px; font-family: var(--font-mono); }
.ea-card-footer { display: flex; gap: 8px; }

/* ═══ FOOTER (sticky bottom) ═══ */
.footer { padding: 28px 24px; border-top: 1px solid var(--border); text-align: center; margin-top: auto; }
.footer p { color: var(--fg3); font-size: .8rem; }
.footer a { color: var(--gold-d); }

/* ═══ RESPONSIVE ═══ */

/* Tablet — hide some nav links to prevent overflow */
@media (max-width: 1024px) {
  .nav-links { gap: 4px; }
  .nav-links a:not(.btn) { padding: 6px 10px; font-size: .82rem; }
}

/* Mobile */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; overflow: visible; }
  .nav-links a:not(.btn) { display: none; }
  .nav-links .theme-toggle { display: none; }
  .nav-links .btn { padding: 7px 14px; font-size: .82rem; white-space: nowrap; }
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%); z-index: 150;
    width: 280px; top: 0; padding-top: calc(var(--nav-h) + 16px);
    background: var(--bg2);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }

  .main-content { margin-left: 0; padding: 20px 16px; max-width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .grid-2 { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .ea-card-stats { grid-template-columns: 1fr 1fr; }
  .ea-grid { grid-template-columns: 1fr; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .modal { margin: 10px; border-radius: var(--r-lg); }
  .ea-card-stats { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   UNIVERSAL CONTACT POPUP (FAB)
   ══════════════════════════════════════ */
.contact-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8922e);
  color: #fff; border: none; cursor: pointer;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(212,168,67,.4);
  transition: transform .2s, box-shadow .2s;
}
.contact-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(212,168,67,.5); }
.contact-fab.active { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.contact-fab .fab-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 99px; background: #e74c3c; color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 20px; text-align: center;
  animation: fabBounce 1.5s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(231,76,60,.5);
  pointer-events: none;
}
@keyframes fabBounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(1); }
  75% { transform: scale(1.2); }
}
.contact-popup {
  position: fixed; bottom: 90px; right: 24px; z-index: 998;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 16px; padding: 0; width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(20px) scale(.95);
  pointer-events: none; transition: opacity .25s, transform .25s;
}
.contact-popup.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.contact-popup-header {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .92rem; color: var(--fg);
}
.contact-popup-list { padding: 8px 0; }
.contact-popup-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; color: var(--fg2); text-decoration: none;
  font-size: .88rem; transition: background .15s;
}
.contact-popup-item:hover { background: var(--gold-bg); color: var(--gold); }
.contact-popup-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.contact-popup-icon.line { background: #06c755; color: #fff; }
.contact-popup-icon.facebook { background: #1877f2; color: #fff; }
.contact-popup-icon.messenger { background: #0084ff; color: #fff; }
.contact-popup-icon.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.contact-popup-icon.telegram { background: #0088cc; color: #fff; }
.contact-popup-icon.tiktok { background: #010101; color: #fff; }
.contact-popup-icon.tel { background: #27ae60; color: #fff; }
.contact-popup-icon.other { background: var(--gold); color: #fff; }

@media (max-width: 600px) {
  .contact-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 1.3rem; }
  .contact-popup { bottom: 76px; right: 16px; width: 240px; }
}
