/* ============================================================
   admin.css — FlipBook 3D Admin Panel
   Design: Refined dark with amber accents — Cormorant + Outfit
   Clean, modern, fully responsive
============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --bg0:     #0d0d14;
  --bg1:     #111119;
  --bg2:     #16161f;
  --bg3:     #1c1c27;
  --line:    rgba(255,255,255,.07);
  --line2:   rgba(255,255,255,.04);

  --amber:   #d4a843;
  --amber2:  #f0c35a;
  --amber-a: rgba(212,168,67,.12);
  --amber-b: rgba(212,168,67,.22);

  --txt:     #e8e5df;
  --txt2:    #8a8a9e;
  --txt3:    #3e3e52;

  --blue:    #5b9cf6;
  --green:   #4dd9ac;
  --red:     #f07167;

  --r:       10px;
  --r2:      14px;
  --ease:    .22s cubic-bezier(.4,0,.2,1);

  --sidebar: 232px;
  --topbar:  58px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.admin-body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg0);
  color: var(--txt);
  height: 100vh;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

/* ── Layout ─────────────────────────────────────────────── */
.admin-layout {
  display: flex;
  height: 100vh;
}

/* ── Overlay (mobile) ───────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.admin-sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--bg1);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width var(--ease);
  overflow: hidden;
  position: relative;
  z-index: 10;
}

.admin-sidebar.collapsed {
  width: 60px;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--amber-a);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
}

.brand-text {
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
}

.brand-name {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--txt);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: .68rem;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 500;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  font-size: .62rem;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 12px 10px 5px;
  white-space: nowrap;
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 400;
  color: var(--txt2);
  white-space: nowrap;
  transition: all var(--ease);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  background: var(--bg3);
  color: var(--txt);
}

.nav-link.active {
  background: var(--amber-a);
  color: var(--amber);
  font-weight: 500;
}

.nav-link.active .ni { opacity: 1; }

.ni {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--ease);
  fill: none;
  stroke: currentColor;
  stroke-width: 0;
  /* icons use fill and stroke internally */
}

.nav-link:hover .ni { opacity: .85; }

/* Footer */
.sidebar-footer {
  padding: 10px 10px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-footer-link {
  color: var(--txt3);
}

.nav-footer-link:hover {
  color: var(--txt2);
  background: var(--bg2);
}

.nav-logout { color: rgba(240,113,103,.5); }
.nav-logout:hover {
  background: rgba(240,113,103,.07);
  color: var(--red);
}

/* Collapsed state — hide text */
.admin-sidebar.collapsed .brand-text,
.admin-sidebar.collapsed .nav-section,
.admin-sidebar.collapsed .nav-link span:not(.ni) {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}

.admin-sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 9px;
}

.admin-sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 22px 14px 20px;
}

/* ══════════════════════════════════════════════════════════
   MAIN
══════════════════════════════════════════════════════════ */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar);
  flex-shrink: 0;
  background: rgba(13,13,20,.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 18px;
  backdrop-filter: blur(16px);
  gap: 16px;
}

.topbar-l {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-r {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.menu-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: none;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  transition: all var(--ease);
}

.menu-btn span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--txt2);
  border-radius: 1px;
  transition: background var(--ease);
}

.menu-btn:hover {
  border-color: var(--amber);
  background: var(--amber-a);
}

.menu-btn:hover span { background: var(--amber); }

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 14px 5px 5px;
}

.user-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7a5010, var(--amber));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 600;
  color: #0d0d14;
}

.user-nm {
  font-size: .82rem;
  color: var(--txt2);
  font-weight: 500;
}

/* ── Sections ───────────────────────────────────────────── */
.a-section {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  flex-direction: column;
  gap: 22px;
}

.a-section.active {
  display: flex;
}

/* ══════════════════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--ease), box-shadow var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: hsl(var(--hue, 43) 70% 58%);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.stat-glyph {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: hsl(var(--hue, 43) 70% 58% / .1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: hsl(var(--hue, 43) 70% 58%);
}

.stat-glyph svg {
  width: 22px;
  height: 22px;
}

.stat-val {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: hsl(var(--hue, 43) 70% 58%);
  line-height: 1;
  margin-bottom: 3px;
}

.stat-lbl {
  font-size: .73rem;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════
   PANELS
══════════════════════════════════════════════════════════ */
.panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line2);
}

.panel-ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--txt);
  letter-spacing: .02em;
}

.ghost-btn {
  font-size: .78rem;
  color: var(--amber);
  background: none;
  border: none;
  transition: opacity var(--ease);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
}

.ghost-btn:hover { opacity: .7; }

.panel-bd {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ══════════════════════════════════════════════════════════
   TOOLBAR / BAR
══════════════════════════════════════════════════════════ */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0 14px;
  height: 40px;
  flex: 1;
  max-width: 340px;
  transition: border-color var(--ease);
}

.search-field:focus-within {
  border-color: var(--amber);
}

.search-field svg {
  width: 16px;
  height: 16px;
  color: var(--txt3);
  flex-shrink: 0;
}

.search-field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--txt);
  font-size: .85rem;
}

.search-field input::placeholder { color: var(--txt3); }

.add-btn {
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r);
  background: var(--amber-a);
  border: 1px solid rgba(212,168,67,.3);
  color: var(--amber);
  font-size: .84rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: all var(--ease);
}

.add-btn:hover {
  background: var(--amber-b);
  border-color: rgba(212,168,67,.5);
}

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

.tbl th {
  padding: 11px 18px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--line2);
  background: rgba(255,255,255,.01);
  white-space: nowrap;
}

.tbl td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line2);
  color: var(--txt2);
  vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--ease); }
.tbl tbody tr:hover td { background: rgba(255,255,255,.02); }

.tbl .c-id {
  color: var(--txt3);
  font-size: .78rem;
}

.tbl .c-title {
  color: var(--txt);
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  white-space: nowrap;
}

.b-active  { background: rgba(77,217,172,.09);  color: var(--green); border: 1px solid rgba(77,217,172,.2); }
.b-archive { background: rgba(255,255,255,.04); color: var(--txt3);  border: 1px solid var(--line2); }
.b-admin   { background: rgba(212,168,67,.1);   color: var(--amber); border: 1px solid rgba(212,168,67,.22); }
.b-editor  { background: rgba(91,156,246,.1);   color: var(--blue);  border: 1px solid rgba(91,156,246,.22); }
.b-viewer  { background: rgba(255,255,255,.04); color: var(--txt3);  border: 1px solid var(--line2); }
.b-public  { background: rgba(91,156,246,.09);  color: var(--blue);  border: 1px solid rgba(91,156,246,.2); }
.b-private { background: rgba(255,255,255,.03); color: var(--txt3);  border: 1px solid var(--line2); }

/* Action buttons */
.acts {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}

.act {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  border: 1px solid transparent;
  transition: all var(--ease);
}

.act-view { color: var(--amber); border-color: rgba(212,168,67,.2); background: rgba(212,168,67,.07); }
.act-view:hover { background: rgba(212,168,67,.15); border-color: rgba(212,168,67,.4); }

.act-edit { color: var(--blue); border-color: rgba(91,156,246,.2); background: rgba(91,156,246,.07); }
.act-edit:hover { background: rgba(91,156,246,.15); border-color: rgba(91,156,246,.4); }

.act-del { color: var(--red); border-color: rgba(240,113,103,.2); background: rgba(240,113,103,.07); }
.act-del:hover { background: rgba(240,113,103,.15); border-color: rgba(240,113,103,.4); }

/* Pager */
.pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 16px;
  border-top: 1px solid var(--line2);
}

.pg {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: .8rem;
  font-family: 'Outfit', sans-serif;
  background: var(--bg3);
  border: 1px solid var(--line);
  color: var(--txt2);
  transition: all var(--ease);
}

.pg:hover, .pg.active {
  background: var(--amber-a);
  border-color: rgba(212,168,67,.35);
  color: var(--amber);
}

/* ══════════════════════════════════════════════════════════
   ANALYTICS CHART
══════════════════════════════════════════════════════════ */
.chart-wrap {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chart-lbl {
  width: 180px;
  font-size: .8rem;
  color: var(--txt2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.chart-track {
  flex: 1;
  height: 24px;
  background: rgba(255,255,255,.03);
  border-radius: 5px;
  overflow: hidden;
}

.chart-bar {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(100,68,14,.9) 0%, var(--amber) 100%);
  display: flex;
  align-items: center;
  padding: 0 10px;
  transition: width .9s cubic-bezier(.22,1,.36,1);
}

.chart-num {
  font-size: .7rem;
  color: rgba(0,0,0,.65);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

/* Fields */
.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fld-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fld-lbl {
  font-size: .72rem;
  font-weight: 600;
  color: var(--txt3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.req { color: var(--red); margin-left: 2px; }
.opt { color: var(--txt3); font-size: .7rem; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 4px; }

.fld-inp {
  height: 40px;
  padding: 0 13px;
  background: var(--bg0);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--txt);
  font-size: .85rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color var(--ease);
}

.fld-inp:focus { border-color: var(--amber); }

.fld-inp::placeholder { color: var(--txt3); }

select.fld-inp { cursor: pointer; background-color: var(--bg0); }

.fld-ta {
  height: auto;
  padding: 10px 13px;
  resize: vertical;
}

/* Color row */
.color-row {
  display: flex;
  gap: 9px;
  align-items: center;
}

.color-swatch {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--bg0);
  cursor: pointer;
  flex-shrink: 0;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line2);
}

.toggle-row:last-of-type { border-bottom: none; }

.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-nm {
  font-size: .85rem;
  color: var(--txt);
  font-weight: 500;
}

.toggle-ds {
  font-size: .74rem;
  color: var(--txt3);
}

.sw { cursor: pointer; flex-shrink: 0; }
.sw input { display: none; }

.sw-track {
  display: block;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--bg3);
  border: 1px solid var(--line);
  position: relative;
  transition: all var(--ease);
}

.sw input:checked ~ .sw-track {
  background: rgba(212,168,67,.25);
  border-color: rgba(212,168,67,.5);
}

.sw-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--txt3);
  transition: all var(--ease);
}

.sw input:checked ~ .sw-track .sw-dot {
  left: 20px;
  background: var(--amber);
}

/* Save button */
.save-btn {
  height: 38px;
  padding: 0 20px;
  border-radius: var(--r);
  background: var(--amber-a);
  border: 1px solid rgba(212,168,67,.3);
  color: var(--amber);
  font-size: .83rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  align-self: flex-start;
  transition: all var(--ease);
}

.save-btn:hover {
  background: var(--amber-b);
  border-color: rgba(212,168,67,.5);
}

/* Danger zone */
.panel-danger {
  border-color: rgba(240,113,103,.18);
}

.panel-danger .panel-hd {
  border-bottom-color: rgba(240,113,103,.12);
}

.panel-danger .panel-ttl {
  color: rgba(240,113,103,.8);
}

.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(240,113,103,.07);
}

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

.danger-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  background: rgba(240,113,103,.08);
  border: 1px solid rgba(240,113,103,.22);
  color: var(--red);
  white-space: nowrap;
  transition: all var(--ease);
}

.danger-btn:hover {
  background: rgba(240,113,103,.16);
  border-color: rgba(240,113,103,.4);
}

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  padding: 16px;
}

.modal-bg.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r2);
  width: 500px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,.8);
  transform: translateY(16px) scale(.97);
  transition: transform var(--ease);
}

.modal-bg.open .modal {
  transform: translateY(0) scale(1);
}

.modal.modal-s { width: 380px; }

.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line2);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 1;
}

.modal-ttl {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--txt);
}

.modal-x {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: none;
  color: var(--txt3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}

.modal-x svg {
  width: 12px;
  height: 12px;
}

.modal-x:hover {
  background: var(--bg3);
  color: var(--txt);
  border-color: rgba(255,255,255,.12);
}

.modal-bd {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-ft {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.btn-cancel {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--txt2);
  font-size: .83rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  transition: all var(--ease);
}

.btn-cancel:hover {
  background: var(--bg3);
  color: var(--txt);
}

.btn-ok {
  height: 38px;
  padding: 0 22px;
  border-radius: var(--r);
  background: var(--amber-a);
  border: 1px solid rgba(212,168,67,.3);
  color: var(--amber);
  font-size: .83rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  transition: all var(--ease);
}

.btn-ok:hover {
  background: var(--amber-b);
  border-color: rgba(212,168,67,.55);
}

.btn-danger-ok {
  background: rgba(240,113,103,.1);
  border-color: rgba(240,113,103,.3);
  color: var(--red);
}

.btn-danger-ok:hover {
  background: rgba(240,113,103,.2);
  border-color: rgba(240,113,103,.5);
}

.confirm-msg {
  font-size: .88rem;
  color: var(--txt2);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 18px;
  font-size: .83rem;
  font-weight: 500;
  color: var(--txt);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all .25s ease;
  max-width: 320px;
  line-height: 1.5;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  border-color: rgba(77,217,172,.35);
  color: var(--green);
}

.toast.error {
  border-color: rgba(240,113,103,.35);
  color: var(--red);
}

/* ══════════════════════════════════════════════════════════
   EMPTY / LOADING STATES
══════════════════════════════════════════════════════════ */
.empty-row td,
.loading-row td {
  text-align: center;
  color: var(--txt3);
  padding: 36px !important;
  font-size: .83rem;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .a-section { padding: 24px; }
}

@media (max-width: 1024px) {
  :root { --sidebar: 200px; }
  .settings-grid { grid-template-columns: 1fr; }
  .chart-lbl { width: 130px; }
  .a-section { padding: 20px; }
}

@media (max-width: 768px) {
  body.admin-body { overflow: auto; height: auto; min-height: 100vh; }
  .admin-layout { height: auto; min-height: 100vh; }

  /* Sidebar: full-width drawer */
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    width: 250px !important;
    transform: translateX(-100%);
    transition: transform var(--ease);
    box-shadow: 6px 0 30px rgba(0,0,0,.5);
  }

  .admin-sidebar.mobile-open { transform: translateX(0); }
  .admin-sidebar.collapsed { transform: translateX(-100%); width: 250px !important; }

  .admin-main { width: 100%; overflow: visible; }

  .a-section {
    overflow: visible;
    flex: none;
    padding: 16px;
    gap: 16px;
  }

  .topbar { padding: 0 16px; }
  .page-title { font-size: 1.1rem; }
  .user-nm { display: none; }
  .user-chip { padding: 5px 8px 5px 5px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px 14px; }
  .stat-val { font-size: 1.6rem; }

  .tbl { min-width: 520px; }
  .chart-lbl { width: 100px; font-size: .74rem; }
  .chart-wrap { padding: 16px; }

  .bar { flex-direction: column; align-items: stretch; }
  .search-field { max-width: 100%; }
  .add-btn { justify-content: center; text-align: center; }

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

  .modal { width: calc(100vw - 32px); max-height: 88vh; }
  .modal.modal-s { width: calc(100vw - 48px); }
  .modal-bd { padding: 16px 18px 18px; }

  .toast { bottom: 16px; right: 12px; left: 12px; max-width: 100%; text-align: center; }

  .danger-row { flex-direction: column; align-items: flex-start; }
  .danger-btn { align-self: flex-end; }
}

@media (max-width: 480px) {
  .stat-grid { gap: 8px; }
  .stat-card { padding: 13px 12px; gap: 11px; }
  .stat-val { font-size: 1.35rem; }
  .stat-lbl { font-size: .65rem; }
  .stat-glyph { width: 38px; height: 38px; border-radius: 9px; }
  .stat-glyph svg { width: 18px; height: 18px; }

  .a-section { padding: 12px; }
  .topbar { height: 52px; padding: 0 12px; }

  .tbl { font-size: .78rem; min-width: 440px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .act { padding: 3px 8px; font-size: .7rem; }

  .modal-ft { flex-direction: column-reverse; }
  .btn-cancel, .btn-ok { width: 100%; justify-content: center; }
}
