/* SurinLive panel. One accent (teal), one gray family, light and dark from the system setting. */
:root {
  --bg: #f3f6f6; --surface: #ffffff; --surface-2: #f7f9f9; --sunken: #eef2f2;
  --text: #0f1b1d; --text-2: #34474a; --muted: #66777a; --border: #e1e8e8; --border-strong: #cfd9d9;
  --accent: #0e9384; --accent-2: #0b7368; --accent-ink: #ffffff; --accent-soft: #e0f3f0;
  --danger: #d23f3f; --danger-soft: #fbe9e9; --warn: #b9700a; --warn-soft: #fbf0dc;
  --live: #e5484d; --live-soft: #fde8e8;
  --shadow-sm: 0 1px 2px rgb(15 45 45 / .05), 0 1px 1px rgb(15 45 45 / .03);
  --shadow: 0 1px 2px rgb(15 45 45 / .04), 0 6px 20px -6px rgb(15 45 45 / .10);
  --shadow-lg: 0 24px 60px -16px rgb(10 40 40 / .30), 0 2px 6px rgb(10 40 40 / .06);
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --z-sidebar: 10; --z-modal: 30; --z-toast: 40;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1012; --surface: #10181a; --surface-2: #131d20; --sunken: #0c1416;
    --text: #e6eeee; --text-2: #bfcccd; --muted: #8a9c9f; --border: #1e2b2e; --border-strong: #2a3a3e;
    --accent: #2bbfa9; --accent-2: #55d3bf; --accent-ink: #04211d; --accent-soft: rgb(43 191 169 / .13);
    --danger: #f06b6b; --danger-soft: rgb(240 107 107 / .12); --warn: #e3a440; --warn-soft: rgb(227 164 64 / .12);
    --live: #ff5d62; --live-soft: rgb(255 93 98 / .14);
    --shadow-sm: 0 1px 0 rgb(255 255 255 / .02) inset;
    --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 8px 24px -10px rgb(0 0 0 / .6);
    --shadow-lg: 0 30px 80px -20px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: Vazirmatn, Tahoma, sans-serif; font-size: 14.5px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* Fine grain so large flat surfaces don't feel sterile. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; line-height: 1.35; text-wrap: balance; }
h1 { font-size: 24px; } h2 { font-size: 22px; } h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--danger); font-size: 13px; min-height: 0; }
.error:empty { display: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
td.ltr, div.ltr { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
kbd, .chip-code { font-family: var(--mono); font-size: 12px; background: var(--sunken); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
.skip { position: fixed; top: -60px; right: 16px; z-index: var(--z-toast); background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.logo { width: 32px; height: 32px; border-radius: 10px; flex: none; background: url("/static/favicon.svg") center / cover; box-shadow: 0 6px 16px -6px rgb(14 147 132 / .7); }
.brand-lg { font-size: 20px; color: #fff; } .brand-lg .logo { width: 40px; height: 40px; border-radius: 12px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); position: relative; z-index: 1; }
.login-art { position: relative; overflow: hidden; background: #071a1a; color: #e8f4f2; display: flex; align-items: flex-end; padding: 56px; isolation: isolate; }
.login-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
  radial-gradient(circle at 1px 1px, rgb(255 255 255 / .07) 1px, transparent 0) 0 0 / 22px 22px;
  mask-image: linear-gradient(to top, #000 10%, transparent 90%); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); z-index: -2; will-change: transform; }
.orb-a { width: 520px; height: 520px; background: #0f8f7f; opacity: .55; top: -140px; left: -120px; animation: drift 18s var(--ease) infinite alternate; }
.orb-b { width: 420px; height: 420px; background: #e5484d; opacity: .22; bottom: -160px; right: -80px; animation: drift 22s var(--ease) infinite alternate-reverse; }
@keyframes drift { to { transform: translate3d(80px, 60px, 0) scale(1.12); } }
.login-art-inner { max-width: 520px; display: flex; flex-direction: column; gap: 22px; }
.login-headline { font-size: clamp(26px, 3vw, 38px); line-height: 1.45; color: #fff; font-weight: 800; letter-spacing: -.02em; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: #b5cfcb; }
.login-points li { display: flex; align-items: center; gap: 10px; }
.login-points .dot { width: 6px; height: 6px; border-radius: 2px; background: #2bbfa9; transform: rotate(45deg); }
.onair { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font: 700 11px/1 var(--mono); letter-spacing: .28em;
  color: #ffd9da; border: 1px solid rgb(255 93 98 / .45); padding: 8px 12px; border-radius: 6px; background: rgb(229 72 77 / .12); direction: ltr; }
.onair-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5d62; box-shadow: 0 0 0 0 rgb(255 93 98 / .7); animation: ring 1.8s infinite; }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; animation: rise .6s var(--ease) both; }
.login-card h1 { font-size: 26px; }
.login-card .muted { margin-top: -10px; }
.brand-mobile { display: none; }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .brand-mobile { display: inline-flex; margin-bottom: 18px; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; position: relative; z-index: 1; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(14px); border-left: 1px solid var(--border); z-index: var(--z-sidebar);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.sidebar .menu-btn { display: none; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11.5px; color: var(--muted); padding: 16px 12px 6px; font-weight: 600; }
nav a {
  position: relative; display: flex; align-items: center; gap: 12px; color: var(--text-2); padding: 9px 12px; border-radius: 10px;
  font-weight: 500; transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
nav a svg.i { color: var(--muted); transition: color .2s var(--ease); }
nav a:hover { background: var(--sunken); color: var(--text); }
nav a:active { transform: scale(.98); }
nav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
nav a.active svg.i { color: var(--accent); }
nav a.active::before { content: ""; position: absolute; right: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px 0 0 3px; background: var(--accent); }
@media (prefers-color-scheme: dark) { nav a.active { color: var(--accent-2); } }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }
.who { flex: 1; min-width: 0; line-height: 1.4; }
.who > div:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.view { padding: 30px clamp(16px, 3vw, 40px) 64px; max-width: 1280px; width: 100%; margin-inline: auto; outline: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; height: auto; padding: 10px 12px; gap: 0; border-left: 0; border-bottom: 1px solid var(--border); }
  .sidebar-head { padding: 0 4px; }
  .sidebar .menu-btn { display: inline-grid; }
  .sidebar nav, .sidebar .sidebar-foot { display: none; }
  .sidebar.open nav, .sidebar.open .sidebar-foot { display: flex; animation: rise .25s var(--ease) both; }
  .sidebar.open nav { padding-top: 10px; }
  nav a.active::before { display: none; }
  .view { padding-top: 22px; }
}

/* ---------- page structure ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-head .titles .row { gap: 12px; }
.page-head p { color: var(--muted); max-width: 65ch; }
.crumb { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.crumb:hover { color: var(--accent); }
.crumb svg.i { width: 15px; height: 15px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 22px 22px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { display: inline-flex; align-items: center; gap: 10px; }
.card-head h3 .i { color: var(--accent); }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 20px; }
.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.section { margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* stat tiles */
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat .ico svg.i { width: 17px; height: 17px; }
.stat.is-live .ico { background: var(--live-soft); color: var(--live); }
.stat .value { display: flex; align-items: baseline; gap: 6px; font-size: 27px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.3; margin-top: 6px; }
.stat .value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat .foot { font-size: 12.5px; color: var(--muted); }
.stat.is-live::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 160px; height: 160px; border-radius: 50%; background: var(--live); opacity: .07; filter: blur(20px); }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-2); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; min-height: 42px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
textarea { resize: vertical; line-height: 1.7; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder { color: var(--muted); opacity: .7; }
input[dir=ltr] { text-align: left; }
input[type=number][dir=ltr]::placeholder { text-align: right; direction: rtl; }
input[type=checkbox] {
  appearance: none; width: 19px; height: 19px; min-height: 0; padding: 0; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; margin: 0;
}
input[type=checkbox]::after { content: ""; width: 5px; height: 10px; border: 2px solid var(--accent-ink); border-top: 0; border-left: 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .2s var(--spring); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: rotate(45deg) scale(1); }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-weight: 500; cursor: pointer; user-select: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .check { border: 1px solid var(--border-strong); border-radius: 10px; padding: 7px 12px; transition: border-color .2s, background .2s; }
.chips .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.hint { font-size: 12.5px; color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; align-items: end; }
.filters .actions { display: flex; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 15px; min-height: 40px;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn svg.i { width: 16px; height: 16px; }
.btn:hover { border-color: var(--muted); background: var(--surface-2); color: var(--text); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); box-shadow: 0 1px 0 rgb(255 255 255 / .2) inset, 0 6px 16px -6px rgb(14 147 132 / .6); }
.btn.primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.small { padding: 5px 11px; min-height: 32px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; min-height: 46px; font-size: 15px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.loading span { opacity: .4; }
.btn.loading::after { content: ""; width: 15px; height: 15px; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; position: absolute; }
.btn.loading { position: relative; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, transform .15s; }
.icon-btn:hover { background: var(--sunken); color: var(--text); }
.icon-btn:active { transform: scale(.94); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin-inline: -22px; padding-inline: 22px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--surface-2); border-bottom-color: var(--border); }
th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
th:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
th { border-bottom: 0; }
tbody tr, table tr { transition: background .15s; }
tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--muted); font-size: 12.5px; }
td a { font-weight: 600; }
.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; padding: 2px 9px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--muted); line-height: 1.8; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.live { background: var(--live-soft); color: var(--live); font-weight: 700; }
.badge.live::before { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 70%, transparent); animation: ring 1.6s infinite; }
.badge.off { color: var(--danger); background: var(--danger-soft); }
.badge.ok { color: var(--accent-2); background: var(--accent-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.plain::before { display: none; }
@keyframes ring { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- key/value + copy fields ---------- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 16px; align-items: center; }
.kv > .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.kv > .v { min-width: 0; }
@media (max-width: 560px) { .kv { grid-template-columns: minmax(0, 1fr); gap: 4px; } .kv > .k:not(:first-child) { margin-top: 10px; } }
.copy { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 3px; transition: border-color .2s, box-shadow .2s; }
.copy:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.copy input { flex: 1; min-width: 0; min-height: 32px; border: 0; background: transparent; box-shadow: none !important; padding: 4px 8px; direction: ltr; text-align: left; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.copy .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.copy .icon-btn svg.i { width: 16px; height: 16px; }
.copy .icon-btn.done { color: var(--accent); background: var(--accent-soft); }
.copy .icon-btn.done svg.i { animation: pop .35s var(--spring); }
.note { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 12px 14px; color: var(--text-2); font-size: 13px; line-height: 1.9; }
.note svg.i { color: var(--accent); margin-top: 3px; }
.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 12.5px; }

/* ---------- chart ---------- */
.chart { position: relative; overflow-x: clip; }
.bars { display: flex; align-items: flex-end; gap: clamp(2px, .6vw, 6px); height: 190px; padding-top: 12px;
  background: repeating-linear-gradient(to top, transparent 0 47px, var(--border) 47px 48px); }
.bars .bar { position: relative; flex: 1; min-height: 3px; border-radius: 6px 6px 2px 2px; transform-origin: bottom;
  background: linear-gradient(to top, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent)); opacity: .85; transition: opacity .2s, filter .2s; }
.bars .bar:hover { opacity: 1; filter: brightness(1.12); }
.bars .bar.zero { background: var(--border-strong); opacity: .6; }
.bars .bar::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px); white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 12px; padding: 4px 9px; border-radius: 7px; pointer-events: none; opacity: 0;
  transition: opacity .15s, transform .15s var(--ease); z-index: 2;
}
.bars .bar:hover::after { opacity: 1; transform: translate(-50%, 0); }
.enter .bars .bar { animation: grow .8s var(--ease) both; animation-delay: calc(min(var(--i, 0), 40) * 20ms + 150ms); }
.bars-labels { display: flex; gap: clamp(2px, .6vw, 6px); font-size: 11px; color: var(--muted); margin-top: 8px; }
.bars-labels span { flex: 1; text-align: center; overflow: visible; white-space: nowrap; }
.meter { height: 7px; background: var(--sunken); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; border-radius: inherit; background: linear-gradient(to left, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent)); transition: width .8s var(--ease); }
.meter.hot > div { background: linear-gradient(to left, var(--danger), color-mix(in srgb, var(--danger) 60%, transparent)); }
.enter .meter > div { animation: fill 1s var(--ease) both .2s; }

/* ---------- empty / loading states ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 36px 16px; color: var(--muted); }
.empty .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); margin-bottom: 6px; }
.empty .ico svg.i { width: 24px; height: 24px; }
.empty strong { color: var(--text); font-size: 15px; }
.empty .btn { margin-top: 8px; }
.skeleton { display: grid; gap: 16px; }
.sk { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--sunken) 0, var(--surface-2) 40%, var(--sunken) 80%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.sk.line { height: 30px; width: 220px; border-radius: 8px; }
.sk.tiles { height: 110px; }
.sk.block { height: 260px; }
.fail { display: flex; gap: 12px; align-items: center; color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* ---------- modal, toast ---------- */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: center; padding: 16px;
  background: rgb(4 14 16 / .5); backdrop-filter: blur(6px); animation: fade .2s var(--ease) both; }
.modal-body { width: 100%; max-width: 540px; max-height: min(90dvh, 820px); overflow: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; padding: 26px; box-shadow: var(--shadow-lg); animation: pop-in .35s var(--spring) both; }
.modal-body h3 { font-size: 18px; margin-bottom: 2px; }
.modal-actions { display: flex; gap: 8px; margin-top: 6px; }
.modal-actions .btn.primary, .modal-actions .btn.solid { min-width: 110px; }
.confirm { display: flex; flex-direction: column; gap: 12px; }
.confirm .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.confirm p { color: var(--text-2); }
.toast { position: fixed; bottom: 24px; left: 24px; z-index: var(--z-toast); display: flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg); padding: 11px 16px 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 500;
  animation: toast-in .4s var(--spring) both; }
.toast svg.i { color: var(--accent-2); }
@media (prefers-color-scheme: dark) { .toast svg.i { color: var(--accent-ink); } }
.toast.err svg.i { color: var(--live); }
@media (max-width: 560px) { .toast { left: 16px; right: 16px; bottom: 16px; } }

.log { background: var(--sunken); padding: 10px; border-radius: 8px; max-height: 140px; overflow: auto; font-size: 12px; white-space: pre-wrap; font-family: var(--mono); }

/* ---------- entrance motion (route changes only, not periodic refreshes) ---------- */
.enter > * { animation: rise .55s var(--ease) both; }
.enter > :nth-child(2) { animation-delay: 60ms; } .enter > :nth-child(3) { animation-delay: 120ms; }
.enter > :nth-child(4) { animation-delay: 180ms; } .enter > :nth-child(5) { animation-delay: 240ms; }
.enter > :nth-child(n+6) { animation-delay: 300ms; }
.enter .stats > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 80ms); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes fill { from { width: 0; } }
@keyframes shimmer { to { background-position: -300% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- small pieces used by app.js ---------- */
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .name { font-weight: 600; }
.user-cell .sub { direction: ltr; text-align: right; }
.quota-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.chips + .hint { margin-top: 8px; }
.toggles { gap: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.domain-detail { min-width: 180px; max-width: 340px; white-space: normal; margin-top: 4px; }
.domain-detail [title] { cursor: help; text-decoration: underline dotted; }
.note.spaced { margin-top: 16px; }
.foot-line { margin-top: 6px; }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 22px; }
  .stat .ico { width: 30px; height: 30px; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin-inline: -16px; padding-inline: 16px; }
  .page-head { margin-bottom: 18px; }
}
.quota-cell { min-width: 120px; }
.quota-cell .meter { margin-top: 6px; }
.account-reports { margin-top: 16px; }
.account-reports p { margin: 0 0 14px; }
