/* =========================================================================
   activation-shop · admin (внутренний пульт оператора)
   design-system.css — токены + компоненты. Light-first + опц. dark.
   Бренд: акцент-бирюза как в клиентском портале. Шрифты IBM Plex (самохостить).
   Контракт классов — раздел 5 ТЗ, имена не менять.
   ========================================================================= */

/* ============================ TOKENS ============================ */
:root {
  /* neutrals — light */
  --bg:           #f5f6f8;
  --surface:      #ffffff;
  --surface-2:    #f3f5f7;     /* table header / hover / inset */
  --surface-3:    #eceff3;
  --border:       #e4e7ec;
  --border-strong:#d4d9e0;

  --text:         #181c23;
  --text-2:       #4a5260;
  --text-3:       #8c95a3;     /* muted */
  --text-inv:     #ffffff;

  /* brand accent (teal — единый бренд с порталом) */
  --accent:       #109d8c;     /* solid actions (white text) */
  --accent-hover: #0d8576;
  --accent-ink:   #ffffff;
  --accent-soft:  #e4f6f3;     /* tint bg */
  --accent-soft-bd:#bce7e0;
  --accent-text:  #0c7d6f;     /* accent text on light */
  --ring:         rgba(16,157,140,.30);

  /* status */
  --green:    #15924e;  --green-bg:  #e3f6ea;  --green-bd:  #bfe9cf;
  --amber:    #b46d00;  --amber-bg:  #fdf2dc;  --amber-bd:  #f4dca6;
  --red:      #d23b3b;  --red-bg:    #fde8e8;  --red-bd:    #f6c9c9;
  --neutral:  #5b6472;  --neutral-bg:#eef0f3;  --neutral-bd:#dde1e7;
  --blue:     #2563c9;  --blue-bg:   #e6effb;  --blue-bd:   #c3dbf6;

  /* radii / spacing / shadow */
  --r-xs: 5px; --r-sm: 7px; --r: 9px; --r-lg: 13px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  --sh-sm:  0 1px 2px rgba(16,24,40,.06);
  --sh-md:  0 4px 12px -2px rgba(16,24,40,.10), 0 2px 4px -2px rgba(16,24,40,.06);
  --sh-pop: 0 24px 48px -12px rgba(16,24,40,.28);

  --sidebar-w: 244px;
  --topbar-h: 60px;

  --ff: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ff-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ---- dark theme ---- */
[data-theme="dark"] {
  --bg:           #0c0f15;
  --surface:      #12161e;
  --surface-2:    #171c26;
  --surface-3:    #1d2330;
  --border:       #242b38;
  --border-strong:#313a4a;

  --text:         #e7ecf3;
  --text-2:       #a3adbd;
  --text-3:       #6b7585;

  --accent:       #2bc2b1;
  --accent-hover: #38d6c6;
  --accent-ink:   #042722;
  --accent-soft:  rgba(56,214,198,.12);
  --accent-soft-bd:rgba(56,214,198,.28);
  --accent-text:  #45ddcd;
  --ring:         rgba(56,214,198,.32);

  --green:#4ec77e; --green-bg:rgba(78,199,126,.13); --green-bd:rgba(78,199,126,.30);
  --amber:#e0a64a; --amber-bg:rgba(224,166,74,.13); --amber-bd:rgba(224,166,74,.30);
  --red:#ef6a6a;   --red-bg:rgba(239,106,106,.13);  --red-bd:rgba(239,106,106,.30);
  --neutral:#9aa4b2; --neutral-bg:rgba(154,164,178,.12); --neutral-bd:rgba(154,164,178,.26);
  --blue:#5b9bf0;  --blue-bg:rgba(91,155,240,.13);  --blue-bd:rgba(91,155,240,.30);

  --sh-sm: 0 1px 2px rgba(0,0,0,.4);
  --sh-md: 0 6px 16px -4px rgba(0,0,0,.55);
  --sh-pop:0 24px 50px -12px rgba(0,0,0,.7);
}

/* ============================ BASE ============================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--ff); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.mono { font-family: var(--ff-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ============================ LAYOUT ============================ */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  min-width: 1024px;
}

/* ---- Sidebar ---- */
.admin-sidebar {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.admin-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 18px; flex: none;
  border-bottom: 1px solid var(--border);
}
.admin-sidebar__mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(150deg, var(--accent), var(--accent-hover));
}
.admin-sidebar__mark .icon { width: 16px; height: 16px; stroke-width: 2; }
.admin-sidebar__title { font-weight: 600; font-size: 14px; letter-spacing: .1px; }
.admin-sidebar__title small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }

.admin-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav__section { font-size: 10.5px; font-weight: 600; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-3); padding: 14px 10px 6px; }
.admin-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  transition: background .12s, color .12s;
}
.admin-nav__item .icon { width: 17px; height: 17px; color: var(--text-3); transition: color .12s; }
.admin-nav__item:hover { background: var(--surface-2); color: var(--text); }
.admin-nav__item.is-active { background: var(--accent-soft); color: var(--accent-text); }
.admin-nav__item.is-active .icon { color: var(--accent-text); }
.admin-nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--red-bg); color: var(--red);
  font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.admin-sidebar__foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 12.5px; }
.admin-sidebar__avatar { width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--surface-3); display: grid; place-items: center; font-weight: 600; color: var(--text-2); }

/* ---- Topbar ---- */
.admin-main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.admin-topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.admin-topbar__title { font-size: 17px; font-weight: 600; }
.admin-topbar__crumb { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.admin-topbar__spacer { flex: 1; }
.admin-topbar__tools { display: flex; align-items: center; gap: 10px; }

/* kill-switch indicator in topbar */
.killswitch {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--green-bd); background: var(--green-bg);
  font-size: 12.5px; font-weight: 600; color: var(--green);
}
.killswitch .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.killswitch.is-off { border-color: var(--red-bd); background: var(--red-bg); color: var(--red); }
.killswitch.is-off .dot { background: var(--red); }

.iconbtn { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-2); border: 1px solid transparent; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

.admin-content { flex: 1; overflow-y: auto; padding: 24px 22px 40px; }
.content-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.content-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.content-head .spacer { flex: 1; }

/* ============================ BUTTONS ============================ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; transition: background .12s, border-color .12s, color .12s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn--sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { filter: brightness(.94); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
  color: var(--accent-ink); animation: spin .7s linear infinite; }
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-group { display: inline-flex; gap: 8px; }

/* link-ish action inside tables */
.tbtn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: var(--r-xs);
  font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.tbtn:hover { background: var(--surface-2); color: var(--text); }
.tbtn--danger { color: var(--red); }
.tbtn--danger:hover { background: var(--red-bg); }
.tbtn--accent { color: var(--accent-text); }
.tbtn--accent:hover { background: var(--accent-soft); }
.tbtn .icon { width: 14px; height: 14px; }

/* ============================ BADGES ============================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; letter-spacing: .1px;
  border: 1px solid var(--neutral-bd); background: var(--neutral-bg); color: var(--neutral);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--green   { color: var(--green);   background: var(--green-bg);   border-color: var(--green-bd); }
.badge--amber   { color: var(--amber);   background: var(--amber-bg);   border-color: var(--amber-bd); }
.badge--red     { color: var(--red);     background: var(--red-bg);     border-color: var(--red-bd); }
.badge--neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-bd); }
.badge--blue    { color: var(--blue);    background: var(--blue-bg);    border-color: var(--blue-bd); }
.badge--plain::before { display: none; }
.badge .icon { width: 13px; height: 13px; }

.check { color: var(--green); display: inline-grid; place-items: center; }
.check--off { color: var(--text-3); }

/* ============================ CARDS / PANELS ============================ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); }
.panel__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.panel__head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.panel__head .spacer { flex: 1; }
.panel__body { padding: 18px; }

/* ============================ STAT TILES ============================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.stat-tile__label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.stat-tile__label .icon { width: 15px; height: 15px; color: var(--text-3); }
.stat-tile__value { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 8px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-tile__value small { font-size: 15px; font-weight: 600; color: var(--text-3); }
.stat-tile__meta { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.trend { font-weight: 600; }
.trend--up { color: var(--green); } .trend--down { color: var(--red); }
.stat-tile--accent { border-color: var(--accent-soft-bd); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.stat-tile--danger .stat-tile__value { color: var(--red); }
.stat-tile--warn .stat-tile__value { color: var(--amber); }

/* ============================ TABLE ============================ */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-sm); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 720px; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text-3); padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table th.center, .data-table td.center { text-align: center; }
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.data-table__row:hover td { background: var(--surface-2); }
.data-table__row:last-child td { border-bottom: 0; }
.data-table .cell-strong { font-weight: 600; }
.data-table .cell-mono { font-family: var(--ff-mono); font-size: 12.5px; }
.data-table .cell-sub { color: var(--text-3); font-size: 12px; }
.data-table .cell-actions { white-space: nowrap; text-align: right; }
.data-table .cell-actions .tbtn + .tbtn { margin-left: 2px; }
.row-check { width: 16px; height: 16px; accent-color: var(--accent); }

/* mini activation meter (slots) */
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter__bar { width: 60px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 99px; background: var(--accent); }
.meter__fill.is-amber { background: var(--amber); } .meter__fill.is-red { background: var(--red); }
.meter__txt { font-family: var(--ff-mono); font-size: 12px; color: var(--text-2); }

/* health bar */
.health { display: inline-flex; align-items: center; gap: 8px; }
.health__bar { width: 48px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.health__fill { height: 100%; background: var(--green); }
.health__fill.is-amber { background: var(--amber); } .health__fill.is-red { background: var(--red); }

/* ============================ SLA TIMER ============================ */
.sla-timer {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ff-mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd);
}
.sla-timer .icon { width: 14px; height: 14px; }
.sla-timer.is-warn { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.sla-timer.is-overdue { background: var(--red-bg); color: var(--red); border-color: var(--red-bd); animation: slablink 1.3s var(--ease) infinite; }
@keyframes slablink { 50% { opacity: .55; } }

/* ============================ FILTERS / TABS / PAGINATION ============================ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 11px; color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 34px; width: 260px; }

.filter-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 13px; color: var(--text-2);
}
.filter-chip .icon { width: 14px; height: 14px; color: var(--text-3); }
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.is-active { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 600; }

.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; }
.pagination .spacer { flex: 1; }
.page-btn { min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-xs);
  border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; font-size: 12.5px; }
.page-btn:hover { background: var(--surface-2); }
.page-btn.is-active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ FORMS ============================ */
.form-field { margin-bottom: 16px; }
.form-field > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.form-field .hint { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.input, .select, textarea.input {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--text); font-size: 13.5px; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; font-family: var(--ff-mono); font-size: 12.5px; line-height: 1.6; }
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238c95a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle__track { width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong);
  position: relative; transition: background .15s; flex: none; }
.toggle__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform .15s var(--ease); }
.toggle input:checked + .toggle__track { background: var(--accent); }
.toggle input:checked + .toggle__track::after { transform: translateX(17px); }
.toggle__label { font-size: 13.5px; }

/* big kill-switch (settings) */
.killswitch-panel { display: flex; align-items: center; gap: 18px; padding: 20px;
  border: 1px solid var(--red-bd); background: var(--red-bg); border-radius: var(--r-lg); }
.killswitch-panel.is-on { border-color: var(--green-bd); background: var(--green-bg); }
.killswitch-panel__icon { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--surface); color: var(--red); box-shadow: var(--sh-sm); }
.killswitch-panel.is-on .killswitch-panel__icon { color: var(--green); }
.killswitch-panel__txt { flex: 1; }
.killswitch-panel__txt strong { font-size: 15px; } .killswitch-panel__txt p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }
.toggle--lg .toggle__track { width: 54px; height: 30px; }
.toggle--lg .toggle__track::after { width: 26px; height: 26px; }
.toggle--lg input:checked + .toggle__track::after { transform: translateX(24px); }

/* ============================ MODAL ============================ */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-start; justify-content: center;
  padding: 56px 20px; overflow-y: auto; }
.modal.is-open { display: flex; }
.modal__overlay { position: fixed; inset: 0; background: rgba(16,24,40,.5); backdrop-filter: blur(2px); animation: mfade .15s var(--ease); }
[data-theme="dark"] .modal__overlay { background: rgba(0,0,0,.6); }
@keyframes mfade { from { opacity: 0; } to { opacity: 1; } }
.modal__dialog { position: relative; width: 100%; max-width: 520px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop);
  animation: mpop .18s var(--ease); }
.modal--wide .modal__dialog { max-width: 680px; }
@keyframes mpop { from { opacity: 0; transform: translateY(-8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal__head p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.modal__close { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-xs); display: grid; place-items: center; color: var(--text-3); }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 20px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ============================ STATES ============================ */
.state { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 56px 20px; text-align: center; color: var(--text-3); }
.is-empty > .state--empty, .is-loading > .state--loading, .is-error > .state--error { display: flex; }
.is-loading > .table-scroll, .is-empty > .table-scroll, .is-error > .table-scroll,
.is-loading > .pagination, .is-empty > .pagination, .is-error > .pagination { display: none; }
.state__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-3); }
.state__icon .icon { width: 22px; height: 22px; }
.state__title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.state__text { font-size: 13px; max-width: 320px; }
.state--error .state__icon { background: var(--red-bg); color: var(--red); }
.state--error .state__title { color: var(--red); }

/* table skeleton loader */
.skeleton-rows { padding: 8px 0; }
.skeleton-row { height: 18px; margin: 12px 16px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.spinner-lg { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ============================ TOASTS ============================ */
.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 380px;
  padding: 12px 14px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--sh-pop); font-size: 13.5px;
  animation: toastin .24s var(--ease); }
.toast.is-out { animation: toastout .2s var(--ease) forwards; }
@keyframes toastin { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(16px); } }
.toast__icon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; }
.toast__icon .icon { width: 17px; height: 17px; }
.toast--ok .toast__icon { background: var(--green-bg); color: var(--green); }
.toast--error .toast__icon { background: var(--red-bg); color: var(--red); }
.toast--info .toast__icon { background: var(--accent-soft); color: var(--accent-text); }
.toast__body { flex: 1; } .toast__body strong { display: block; font-weight: 600; }
.toast__body span { color: var(--text-2); font-size: 12.5px; }
.toast__close { color: var(--text-3); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; }
.toast__close:hover { background: var(--surface-2); color: var(--text); }

/* ============================ LOGIN ============================ */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(900px 500px at 50% -150px, var(--surface-2), var(--bg) 65%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-md); padding: 30px 28px; }
.login-card__brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-card__brand .admin-sidebar__mark { width: 34px; height: 34px; }
.login-card h1 { font-size: 19px; font-weight: 600; margin: 0 0 4px; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin: 0 0 22px; }
.login-2fa-note { margin-top: 14px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }

/* misc helpers */
.muted { color: var(--text-3); }
.flex { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 2px; }
.divider { height: 1px; background: var(--border); border: 0; margin: 18px 0; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; font-size: 13px; }
.dl dt { color: var(--text-3); } .dl dd { margin: 0; font-weight: 500; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.grid-2-eq { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

@media (max-width: 1180px) {
  :root { --sidebar-w: 210px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
