/* =============================================================================
   arzbridge calls — Admin design system  (2026)
   Sidebar + rounded "canvas" shell · light + dark via [data-theme].
   Inspired by the OpenAI platform console & Filament. Plain CSS, no build step.
   All historical component class names are preserved & restyled, so every
   existing Blade view keeps working.
   ============================================================================= */

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  /* Surfaces & text — cool neutral slate scale */
  --bg: #eef1f6;
  --bg-2: #e7ebf2;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --surface-3: #eef1f6;
  --surface-hover: #f7f9fc;
  --text: #11151c;
  --text-2: #3b4351;
  --muted: #6b7383;
  --faint: #9aa2b1;
  --border: #e6e9f0;
  --border-2: #dde1ea;
  --border-strong: #cfd4e0;

  /* Brand */
  --primary: #4f6bff;
  --primary-600: #3a52e6;
  --primary-700: #2f43c4;
  --primary-soft: rgba(79, 107, 255, .10);
  --primary-ring: rgba(79, 107, 255, .28);
  --grad: linear-gradient(135deg, #5b8cff 0%, #8a5bff 100%);
  --grad-soft: linear-gradient(135deg, rgba(91,140,255,.16) 0%, rgba(138,91,255,.16) 100%);

  /* Status */
  --success: #0ea571;  --success-soft: rgba(14,165,113,.12);  --success-border: rgba(14,165,113,.28);
  --warning: #d98a0b;  --warning-soft: rgba(217,138,11,.13);  --warning-border: rgba(217,138,11,.30);
  --danger:  #e5484d;  --danger-soft:  rgba(229,72,77,.12);   --danger-border: rgba(229,72,77,.30);
  --info:    #0a93d4;  --info-soft:    rgba(10,147,212,.12);  --info-border: rgba(10,147,212,.28);

  /* Sidebar (light) */
  --side-bg: transparent;
  --side-fg: #4a5263;
  --side-fg-dim: #818a9c;
  --side-active-bg: var(--surface);
  --side-active-fg: var(--text);

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(17,24,39,.05);
  --shadow-sm: 0 1px 2px rgba(17,24,39,.05), 0 1px 3px rgba(17,24,39,.05);
  --shadow: 0 8px 24px rgba(17,24,39,.07), 0 2px 6px rgba(17,24,39,.05);
  --shadow-lg: 0 24px 56px rgba(17,24,39,.16), 0 6px 16px rgba(17,24,39,.08);
  --shadow-shell: 0 1px 2px rgba(17,24,39,.04), 0 12px 40px rgba(17,24,39,.06);

  /* Radii */
  --r-xl: 22px;
  --r: 16px;
  --r-md: 12px;
  --r-sm: 10px;
  --r-xs: 8px;

  /* Metrics */
  --side-w: 268px;
  --gutter: 12px;
  --topbar-h: 62px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg: #070a12;
  --bg-2: #0a0e18;
  --surface: #0f1420;
  --surface-2: #161c2b;
  --surface-3: #1b2336;
  --surface-hover: #19202f;
  --text: #eef1f8;
  --text-2: #c4ccdd;
  --muted: #8e98ad;
  --faint: #5e6880;
  --border: #20283a;
  --border-2: #283149;
  --border-strong: #323c57;

  --primary-soft: rgba(99, 130, 255, .16);
  --primary-ring: rgba(99, 130, 255, .34);

  --success-soft: rgba(14,165,113,.16);
  --warning-soft: rgba(217,138,11,.18);
  --danger-soft:  rgba(229,72,77,.18);
  --info-soft:    rgba(10,147,212,.16);

  --side-fg: #aeb7cc;
  --side-fg-dim: #6c7793;
  --side-active-bg: var(--surface-2);
  --side-active-fg: #ffffff;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.5);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.65);
  --shadow-shell: 0 1px 2px rgba(0,0,0,.4), 0 18px 48px rgba(0,0,0,.45);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
a { color: var(--primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.014em; color: var(--text); }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
::selection { background: var(--primary-ring); color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; }

/* =============================================================================
   APP SHELL — fixed sidebar + rounded floating content canvas
   ============================================================================= */
.app { display: flex; min-height: 100vh; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--side-w); flex: none; height: 100vh;
  display: flex; flex-direction: column;
  padding: 16px 14px;
  background: var(--side-bg);
  overflow-y: auto; overflow-x: hidden;
}
.sidebar__brand {
  display: flex; align-items: center;
  padding: 6px 8px 16px; margin-bottom: 6px;
}
.sidebar__brand .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 17px; color: #fff;
  background: var(--grad); box-shadow: 0 6px 16px rgba(91,140,255,.4), inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar__brand .sub { color: var(--muted); font-weight: 600; }

/* Brand logo image (light/dark variants swapped by theme) */
.brand-logo { display: block; width: 184px; max-width: 100%; height: auto; }
.brand-logo--dark { display: none; }
[data-theme="dark"] .brand-logo--light { display: none; }
[data-theme="dark"] .brand-logo--dark { display: block; }

.sidebar__scroll { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 18px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navgroup__label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--faint); padding: 6px 12px 4px;
}
.navlink {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 13.5px;
  color: var(--side-fg); transition: background .14s var(--ease), color .14s var(--ease);
}
.navlink i { font-size: 16.5px; width: 20px; text-align: center; color: var(--side-fg-dim); transition: color .14s var(--ease); }
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink:hover i { color: var(--text-2); }
.navlink.is-active { background: var(--side-active-bg); color: var(--side-active-fg); box-shadow: var(--shadow-xs); font-weight: 600; }
.navlink.is-active i { color: var(--primary); }
.navlink.is-active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.navlink .navlink__badge { margin-left: auto; }

/* User card (sidebar bottom) */
.sidebar__foot { margin-top: 14px; flex: none; }
.usermenu { position: relative; }
.usermenu__btn {
  display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 8px 10px; color: var(--text); box-shadow: var(--shadow-xs); transition: border-color .14s, background .14s;
}
.usermenu__btn:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.usermenu__btn .meta { min-width: 0; flex: 1; }
.usermenu__btn .meta .nm { font-weight: 600; font-size: 13px; line-height: 1.2; }
.usermenu__btn .meta .em { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__btn .caret { margin-left: auto; color: var(--faint); font-size: 12px; flex: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.usermenu__pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 6px;
  opacity: 0; transform: translateY(6px) scale(.98); transform-origin: bottom center;
  pointer-events: none; transition: .16s var(--ease);
}
.usermenu.open .usermenu__pop { opacity: 1; transform: none; pointer-events: auto; }
.usermenu__pop .who { padding: 9px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 5px; word-break: break-all; }
.usermenu__pop a, .usermenu__pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: var(--r-xs); color: var(--text); background: none; border: 0;
  font: inherit; font-size: 13px; cursor: pointer; transition: background .12s;
}
.usermenu__pop a i, .usermenu__pop button i { font-size: 15px; color: var(--muted); }
.usermenu__pop a:hover, .usermenu__pop button:hover { background: var(--surface-2); }
.usermenu__pop .danger, .usermenu__pop .danger i { color: var(--danger); }

/* ── Content shell (the rounded "body") ──────────────────────────────────── */
.shell {
  flex: 1 1 auto; min-width: 0;
  margin: var(--gutter) var(--gutter) var(--gutter) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-shell);
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* Slim topbar inside the shell */
.topbar {
  flex: none; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar__crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.topbar__crumb i.sep { font-size: 11px; opacity: .6; }
.topbar__crumb .home { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }
.topbar__crumb .cur { color: var(--text); font-weight: 600; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); display: grid; place-items: center;
  cursor: pointer; font-size: 16px; transition: .14s var(--ease); text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.burger { display: none; }

/* Scrollable content region */
.shell__body { flex: 1 1 auto; overflow-y: auto; padding: 28px 32px 64px; }
.container { max-width: 1180px; margin: 0 auto; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page__title { font-size: 25px; letter-spacing: -.022em; display: flex; align-items: center; gap: 10px; }
.page__sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.page__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: 11px; opacity: .6; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card + .card { margin-top: 18px; }
.card__head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 56px; }
.card__head-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.card__title { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.card__title i { color: var(--primary); font-size: 16px; }
.card__sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.card__body { padding: 20px; }
.card__body.pad-0 { padding: 0; }
.card__foot { padding: 13px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }

.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.section { margin-top: 26px; }
.section__title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 13px 2px; font-weight: 700; }

/* ── Stat tiles ──────────────────────────────────────────────────────────── */
.stat { position: relative; overflow: hidden; transition: border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease); }
.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat__body { padding: 18px 20px; display: flex; align-items: center; gap: 15px; }
.stat__icon { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; flex: none; }
.stat__icon.i-primary { background: var(--primary-soft); color: var(--primary); }
.stat__icon.i-success { background: var(--success-soft); color: var(--success); }
.stat__icon.i-warning { background: var(--warning-soft); color: var(--warning); }
.stat__icon.i-info { background: var(--info-soft); color: var(--info); }
.stat__icon.i-danger { background: var(--danger-soft); color: var(--danger); }
.stat__n { font-size: 27px; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat__l { color: var(--muted); font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stat::after { content: ""; position: absolute; right: -34px; top: -34px; width: 120px; height: 120px; background: var(--grad); opacity: .045; border-radius: 50%; pointer-events: none; }
/* Clickable stat tiles (anchor variant) */
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { color: inherit; }
.stat__go { position: absolute; top: 14px; right: 14px; z-index: 1; color: var(--faint); font-size: 14px; opacity: 0; transform: translate(-3px, 3px); transition: opacity .16s var(--ease), transform .16s var(--ease); }
a.stat:hover .stat__go { opacity: 1; transform: none; color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 600 13.5px/1 "Inter", sans-serif; letter-spacing: -.005em; cursor: pointer;
  transition: .15s var(--ease); white-space: nowrap; user-select: none;
}
.btn i { font-size: 15px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(91,140,255,.30), inset 0 1px 0 rgba(255,255,255,.2); }
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; box-shadow: 0 7px 20px rgba(91,140,255,.36); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn--soft { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.btn--soft:hover { background: var(--surface-3); color: var(--text); }
.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.btn--danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 6px; }
.btn--sm i { font-size: 14px; }
.btn--icon { padding: 7px; width: 32px; height: 32px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* Tiny inline action button used in table rows */
.act {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-xs);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
  transition: .14s var(--ease); font-size: 14px;
}
.act:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.act.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.act-group { display: inline-flex; align-items: center; gap: 6px; }
.act-group form { display: inline; margin: 0; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.label .muted { font-weight: 400; }
.input, .ts-control, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7383' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px;
}
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input::placeholder { color: var(--faint); }
.input-group { position: relative; }
.input-group .input { padding-left: 38px; }
.input-group > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 15px; pointer-events: none; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1; min-width: 170px; margin-bottom: 0; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 13px; cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); }

/* ── Badges / pills ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; border: 1px solid transparent; white-space: nowrap;
}
.badge.ok { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge.warn { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-border); }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.badge.info { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.badge.neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.badge.brand { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-ring); }
.badge .dot { width: 6px; height: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); } 70% { box-shadow: 0 0 0 6px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }

/* ── Tables (Filament-grade) ─────────────────────────────────────────────── */
table.tbl, table.dt { width: 100%; border-collapse: collapse; }
.tbl th, .dt th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .045em;
  color: var(--muted); font-weight: 700; padding: 11px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.tbl td, .dt td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13.5px; }
.tbl tr:last-child td, .tbl tbody tr:last-child td, .dt tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr, .dt tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr:hover, .dt tbody tr:hover { background: var(--surface-hover); }
/* Vertical key/value tables (Profile / Summary): the leading <th> in each body
   row is a label. Scoped to `tbody` so it NEVER touches a <thead> header row's
   first cell (which would otherwise make a horizontal table's first column look
   different from the rest). */
.tbl > tbody > tr > th:first-child:not(:only-child) { background: transparent; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; width: 190px; vertical-align: top; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; color: var(--text); }
.tnum { font-variant-numeric: tabular-nums; }

/* Cell helpers */
.cell-title { font-weight: 600; color: var(--text); }
.cell-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* Copyable code chip */
.copy {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs);
  padding: 3px 4px 3px 10px; font-family: var(--mono); font-size: 12px; color: var(--text-2);
}
.copy code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy button { border: 0; background: var(--surface-3); color: var(--muted); width: 26px; height: 24px; border-radius: 6px; cursor: pointer; flex: none; display: grid; place-items: center; transition: .14s; }
.copy button:hover { background: var(--primary); color: #fff; }

/* Success-rate bar */
.bar { height: 6px; width: 96px; background: var(--surface-3); border-radius: 999px; overflow: hidden; display: inline-block; vertical-align: middle; margin-left: 8px; }
.bar > span { display: block; height: 100%; background: var(--success); border-radius: 999px; transition: width .3s var(--ease); }
.bar.warn > span { background: var(--warning); }
.bar.bad > span { background: var(--danger); }
.rate { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Empty state */
.empty { text-align: center; padding: 52px 20px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 14px; font-size: 26px; color: var(--faint); }
.empty i { font-size: 26px; opacity: .9; }
.empty h4 { font-size: 15px; color: var(--text); margin-bottom: 5px; }
.empty p { font-size: 13px; max-width: 360px; margin: 0 auto; }

/* Reveal / secret card */
.reveal { border: 1px solid var(--success-border); background: var(--success-soft); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 20px; }
.reveal h4 { margin: 0 0 12px; color: var(--success); font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.reveal.alert { border-color: var(--danger-border); background: var(--danger-soft); }
.reveal.alert h4, .reveal.alert span { color: var(--danger); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; align-items: center; }
.kv .k { color: var(--muted); font-size: 12.5px; }

/* Code block */
pre.code {
  margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 16px; overflow: auto; max-height: 360px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--text-2);
}

/* ── DataTables — fully self-styled (Filament look) ──────────────────────────
   The DataTables default stylesheet is deliberately NOT loaded (see layout.blade
   .php). Everything DataTables renders — the layout rows, search box, sort
   arrows, info text and pager — is styled from scratch here with low-specificity
   selectors, so there are no cascade fights and no !important needed. If you ever
   re-add `dataTables.dataTables.css`, these rules will need specificity bumps.
   ───────────────────────────────────────────────────────────────────────── */
.dt-container { color: var(--text); width: 100%; }

/* Layout rows (DataTables builds these; we provide the flexbox the default CSS
   would otherwise supply) */
.dt-container .dt-layout-row { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; }
.dt-container .dt-layout-cell { display: flex; align-items: center; }
.dt-container .dt-layout-cell.dt-layout-start { justify-content: flex-start; margin-right: auto; }
.dt-container .dt-layout-cell.dt-layout-end { justify-content: flex-end; margin-left: auto; }
.dt-container .dt-layout-cell:empty { display: none; }
.dt-container .dt-layout-table { display: block; width: 100%; overflow-x: auto; }
.dt-container .dt-layout-table > div { display: block; width: 100%; }
/* The search box is lifted into the card header by admin.js; this hides the
   now-empty control row so the table has no wasted band above it. */
.dt-container .dt-layout-row.dt-row-empty { display: none; }
.dt-container > .dt-layout-row:first-child:not(.dt-row-empty) { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.dt-container > .dt-layout-row:last-child { padding: 13px 18px; border-top: 1px solid var(--border); gap: 12px; }

/* Search box — styled identically whether it sits in the control row OR is
   relocated into a card header toolbar (so it never falls back to native UI) */
.dt-search { position: relative; display: inline-flex; align-items: center; margin: 0; }
.dt-search label { margin: 0; display: none; }
.dt-search::before {
  content: "\F52A"; font-family: "bootstrap-icons"; font-weight: normal; position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--faint); font-size: 13.5px; line-height: 1; pointer-events: none; z-index: 2;
}
.dt-search input, .dt-search input.dt-input {
  box-sizing: border-box; height: 38px; width: 240px; max-width: 100%; margin: 0;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--r-sm); padding: 8px 12px 8px 34px; font: inherit; font-size: 13px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dt-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.dt-search input::placeholder { color: var(--faint); }
.card__head-tools .dt-search input { width: 230px; }
.dt-container .dt-length select { height: 38px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--r-sm); padding: 7px 10px; margin: 0 6px; }

/* Info text */
.dt-container .dt-info { color: var(--muted); font-size: 12.5px; padding: 0; margin: 0; }

/* Pager */
.dt-container .dt-paging { display: flex; gap: 4px; padding: 0; margin: 0; }
.dt-container .dt-paging .dt-paging-button {
  box-sizing: border-box; display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; text-decoration: none; transition: .14s var(--ease);
}
.dt-container .dt-paging .dt-paging-button:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.dt-container .dt-paging .dt-paging-button.current,
.dt-container .dt-paging .dt-paging-button.current:hover { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(91,140,255,.3); }
.dt-container .dt-paging .dt-paging-button.disabled,
.dt-container .dt-paging .dt-paging-button.disabled:hover { opacity: .45; cursor: default; color: var(--muted); background: var(--surface); border-color: var(--border); }
.dt-container .dt-paging .ellipsis { padding: 0 6px; color: var(--muted); }

/* Empty / no-records row */
table.dt td.dt-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
/* Processing indicator */
.dt-container .dt-processing { color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 10px 16px; }

/* Sort arrows — we supply the glyphs (no default CSS). Subtle & modern: faint on
   hover, only the active direction highlighted; no clunky stacked double-arrows. */
table.dt thead th.dt-orderable-asc, table.dt thead th.dt-orderable-desc { cursor: pointer; position: relative; padding-right: 28px; user-select: none; }
table.dt thead th.dt-orderable-none { cursor: default; }
table.dt thead th span.dt-column-order { position: absolute; right: 12px; top: 0; bottom: 0; width: 12px; }
table.dt thead th span.dt-column-order::before,
table.dt thead th span.dt-column-order::after {
  position: absolute; left: 0; display: block; line-height: 1; font-size: 9px; opacity: 0; color: var(--muted);
  transition: opacity .12s var(--ease), color .12s var(--ease);
}
table.dt thead th span.dt-column-order::before { content: "\25B2"; bottom: 50%; margin-bottom: 1px; } /* ▲ */
table.dt thead th span.dt-column-order::after  { content: "\25BC"; top: 50%; margin-top: 1px; }       /* ▼ */
table.dt thead th:hover span.dt-column-order::before,
table.dt thead th:hover span.dt-column-order::after { opacity: .35; }
table.dt thead th.dt-ordering-asc span.dt-column-order::before { opacity: 1; color: var(--primary); }
table.dt thead th.dt-ordering-desc span.dt-column-order::after { opacity: 1; color: var(--primary); }
table.dt thead th.dt-ordering-asc span.dt-column-order::after,
table.dt thead th.dt-ordering-desc span.dt-column-order::before { opacity: 0; }
table.dt thead th.dt-ordering-asc, table.dt thead th.dt-ordering-desc { color: var(--text); }

/* ── Tom Select theming ──────────────────────────────────────────────────── */
.ts-wrapper.single .ts-control, .ts-wrapper .ts-control {
  border-radius: var(--r-sm); border-color: var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: none; min-height: 42px; padding: 6px 10px; font-size: 13.5px;
}
.ts-control input { color: var(--text) !important; }
.ts-control input::placeholder { color: var(--faint) !important; }
.ts-wrapper.multi .ts-control > .item {
  background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-ring);
  border-radius: 7px; font-size: 12px; font-weight: 600; padding: 2px 8px;
}
.ts-wrapper.multi .ts-control > .item .remove { border-left-color: var(--primary-ring); }
.ts-dropdown { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-lg); border-radius: var(--r-sm); margin-top: 5px; overflow: hidden; }
.ts-dropdown .option { padding: 9px 12px; font-size: 13px; }
.ts-dropdown .active { background: var(--primary-soft); color: var(--text); }
.ts-dropdown .create { color: var(--primary); }
.ts-wrapper.focus .ts-control { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* =============================================================================
   TOAST NOTIFICATIONS  ("twist" / toast)  — custom component
   ============================================================================= */
.toast-host {
  position: fixed; top: calc(var(--gutter) + 14px); right: calc(var(--gutter) + 14px); z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; width: 360px; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  position: relative; pointer-events: auto; overflow: hidden;
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 13px 14px 13px 14px;
  transform: translateX(120%); opacity: 0; transition: transform .36s var(--ease), opacity .36s var(--ease);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.hide { transform: translateX(120%); opacity: 0; }
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.toast__icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; font-size: 16px; margin-top: 1px; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 650; font-size: 13.5px; color: var(--text); letter-spacing: -.01em; }
.toast__msg { font-size: 12.5px; color: var(--muted); margin-top: 2px; word-wrap: break-word; }
.toast__close { flex: none; border: 0; background: transparent; color: var(--faint); cursor: pointer; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 14px; transition: .12s; }
.toast__close:hover { background: var(--surface-2); color: var(--text); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left; opacity: .85; }
.toast--success::before { background: var(--success); } .toast--success .toast__icon { background: var(--success-soft); color: var(--success); } .toast--success .toast__bar { background: var(--success); }
.toast--error::before   { background: var(--danger); }  .toast--error .toast__icon   { background: var(--danger-soft); color: var(--danger); }   .toast--error .toast__bar   { background: var(--danger); }
.toast--warning::before { background: var(--warning); } .toast--warning .toast__icon { background: var(--warning-soft); color: var(--warning); } .toast--warning .toast__bar { background: var(--warning); }
.toast--info::before    { background: var(--info); }    .toast--info .toast__icon    { background: var(--info-soft); color: var(--info); }       .toast--info .toast__bar    { background: var(--info); }
@keyframes toastbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── SweetAlert2 theme bridge ────────────────────────────────────────────── */
.swal2-popup { background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border) !important; border-radius: var(--r) !important; box-shadow: var(--shadow-lg) !important; font-family: "Inter", sans-serif !important; }
.swal2-title { color: var(--text) !important; font-size: 18px !important; font-weight: 700 !important; }
.swal2-html-container { color: var(--muted) !important; font-size: 14px !important; }
.swal2-actions .btn { margin: 0 5px; }
.swal2-icon.swal2-warning { border-color: var(--warning) !important; color: var(--warning) !important; }

/* ── Auth (login) ────────────────────────────────────────────────────────── */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 560px at 78% -12%, rgba(138,91,255,.16), transparent 60%),
    radial-gradient(880px 520px at -6% 112%, rgba(79,107,255,.16), transparent 60%),
    var(--bg);
}
.auth__card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 34px; }
.auth__brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; margin-bottom: 10px; }
.auth__brand .brand-logo { width: 220px; }
.auth__brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; font-size: 19px; color: #fff; box-shadow: 0 8px 20px rgba(91,140,255,.4), inset 0 1px 0 rgba(255,255,255,.25); }
.auth__brand .sub { color: var(--muted); font-weight: 600; }
.auth h1 { font-size: 22px; margin: 20px 0 4px; }
.auth p.sub { color: var(--muted); margin: 0 0 24px; font-size: 13.5px; }
.auth .checkbox { margin: 2px 0 20px; }
.auth__foot { text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--faint); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.flex { display: flex; } .inline-flex { display: inline-flex; }
.items-center { align-items: center; } .items-end { align-items: flex-end; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-r { text-align: right; }
.w-full { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
.scrim { display: none; }

@media (max-width: 1080px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app { overflow: visible; height: auto; min-height: 100vh; }
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 200; height: 100vh; width: 280px;
    background: var(--bg); border-right: 1px solid var(--border);
    transform: translateX(-102%); transition: transform .26s var(--ease); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 150; background: rgba(8,12,22,.5); backdrop-filter: blur(2px); }
  .shell { margin: var(--gutter); height: auto; min-height: calc(100vh - 24px); }
  .burger { display: grid; }
  .shell__body { padding: 22px 18px 56px; }
  .grid.cols-4 { grid-template-columns: 1fr; }
  .page__title { font-size: 22px; }
  .form-row .field { min-width: 100%; }
  .toast-host { right: 12px; top: 12px; left: 12px; width: auto; }
}

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.is-hidden { display: none !important; }
@keyframes arzspin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: arzspin .7s linear infinite; }
