/* ───────────────────────────────────────────────────────────────────
   Transcriptor — refined design system (v2)
   Drop this stylesheet into every admin/user template.
─────────────────────────────────────────────────────────────────── */

:root{
  /* Brand */
  --ink-900:#0B1437;
  --ink-800:#141d5e;
  --ink-700:#1B277A;
  --ink-500:#3B4280;
  --ink-300:#5B5F9E;
  --ink-100:#E8EAF4;

  /* Surfaces */
  --surface-0:#F7F8FC;
  --surface-1:#FFFFFF;
  --surface-2:#F2F4FA;
  --surface-3:#E9ECF4;

  /* Hairlines (1px lines instead of heavy shadows) */
  --hair:rgba(15,23,42,.06);
  --hair-2:rgba(15,23,42,.10);
  --hair-3:rgba(15,23,42,.18);

  /* Text */
  --text-1:#0B1437;
  --text-2:#475569;
  --text-3:#94A3B8;
  --text-4:#CBD5E1;

  /* Semantic */
  --c-arterial:#5B5F9E;
  --c-arterial-soft:#EEF0FA;
  --c-venoso:#E9965A;
  --c-venoso-soft:#FBEFE3;
  --c-premium:#2D9B8A;
  --c-premium-soft:#E5F2EF;
  --c-plus:#8C05DB;
  --c-plus-soft:#F3E5FB;
  --c-danger:#B9131E;
  --c-danger-soft:#FDECEC;
  --c-warn:#D97706;
  --c-warn-soft:#FEF4E2;
  --c-success:#0E9F6E;
  --c-success-soft:#E5F5EE;
  --c-info:#0EA5E9;
  --c-info-soft:#E2F4FB;

  /* Shadows (subtle layered) */
  --shadow-1: 0 1px 0 var(--hair), 0 1px 2px rgba(11,20,55,.04);
  --shadow-2: 0 1px 0 var(--hair), 0 8px 24px -12px rgba(11,20,55,.12);
  --shadow-3: 0 16px 40px -16px rgba(11,20,55,.22);

  /* Motion */
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ─── Reset / base ─────────────────────────────────────────────── */
*{box-sizing:border-box}
html,body{margin:0; padding:0}
body{
  font-family:'Inter','DM Sans',system-ui,-apple-system,sans-serif;
  font-feature-settings:'ss01','cv11','tnum';
  background:var(--surface-0);
  color:var(--text-1);
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  font-size:14px;
  line-height:1.45;
}

h1,h2,h3,h4,h5,h6,.display{
  font-family:'DM Sans','Inter',sans-serif;
  font-weight:700;
  letter-spacing:-.02em;
  margin:0;
  color:var(--text-1);
}
a{color:var(--ink-700); text-decoration:none}

.num{font-variant-numeric:tabular-nums; font-feature-settings:'tnum'}
.mono{font-family:'JetBrains Mono','SF Mono',monospace}
.eyebrow{
  font-size:11px; font-weight:600; letter-spacing:.08em;
  text-transform:uppercase; color:var(--text-3);
}

/* Gradient backdrop (optional, for user-facing pages) */
.bg-soft{
  background:
    radial-gradient(900px 600px at 100% -10%, rgba(91,95,158,.10), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgba(233,150,90,.08), transparent 55%),
    var(--surface-0);
}

/* ─── Admin top bar (dark) ─────────────────────────────────────── */
.admin-top{
  background:var(--ink-900);
  color:white;
  position:relative;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.admin-top::after{
  content:''; position:absolute; left:0; right:0; bottom:-1px; height:2px;
  background:linear-gradient(90deg, var(--c-danger) 0%, var(--ink-300) 30%, var(--c-venoso) 65%, var(--c-premium) 100%);
  opacity:.85;
}
.admin-top-inner{
  max-width:1480px; margin:0 auto;
  padding:14px 28px;
  display:flex; align-items:center; gap:18px;
}
.admin-brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:white;
  font-family:'DM Sans',sans-serif; font-weight:700;
  letter-spacing:-.01em; font-size:15px;
}
.admin-brand .mark{
  width:28px; height:28px; display:grid; place-items:center;
  background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.16);
  font-weight:800; font-size:13px;
}
.admin-brand .lab{
  font-size:10.5px; font-weight:600; letter-spacing:.10em; text-transform:uppercase;
  color:rgba(255,255,255,.55);
  padding:3px 7px; border:1px solid rgba(255,255,255,.18); margin-left:6px;
}
.admin-nav{display:flex; align-items:center; gap:2px; margin-left:14px; flex-wrap:wrap}
.admin-nav a{
  display:inline-flex; align-items:center; gap:7px;
  padding:8px 12px;
  color:rgba(255,255,255,.62); text-decoration:none;
  font-size:13px; font-weight:500;
  transition:all .18s var(--ease-out);
  border:1px solid transparent; position:relative;
}
.admin-nav a:hover{color:#fff; background:rgba(255,255,255,.06)}
.admin-nav a.active{color:#fff; background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.12)}
.admin-nav a i{font-size:11px; opacity:.85}

.admin-actions{margin-left:auto; display:flex; align-items:center; gap:8px}
.top-iconbtn{
  width:34px; height:34px; display:grid; place-items:center;
  color:rgba(255,255,255,.7); background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10); cursor:pointer;
  transition:all .18s var(--ease-out);
}
.top-iconbtn:hover{color:#fff; background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.18)}
.top-search{
  display:flex; align-items:center; gap:8px;
  padding:7px 10px 7px 12px; min-width:240px;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.8); font-size:13px;
  transition:all .18s var(--ease-out);
}
.top-search:focus-within{background:rgba(255,255,255,.10); border-color:rgba(255,255,255,.22)}
.top-search i{color:rgba(255,255,255,.55); font-size:11.5px}
.top-search input{
  background:transparent; border:none; outline:none; color:#fff; flex:1;
  font-family:inherit; font-size:13px;
}
.top-search input::placeholder{color:rgba(255,255,255,.45)}
.kbd{
  font-family:'JetBrains Mono',monospace; font-size:10px; font-weight:600;
  padding:2px 5px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14);
  color:rgba(255,255,255,.6);
}
.kbd.light{background:var(--surface-2); border-color:var(--hair); color:var(--text-1)}

/* ─── Light navbar (user-facing pages) ─────────────────────────── */
.user-top{
  position:sticky; top:0; z-index:50;
  background:rgba(247,248,252,.72);
  backdrop-filter:saturate(180%) blur(14px);
  -webkit-backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--hair);
}
.user-top-inner{
  max-width:1400px; margin:0 auto;
  padding:14px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.user-brand{
  display:flex; align-items:center; gap:10px;
  text-decoration:none; color:var(--text-1);
  font-family:'DM Sans',sans-serif; font-weight:700; font-size:18px; letter-spacing:-.01em;
}
.user-brand .mark{
  width:28px; height:28px; display:grid; place-items:center;
  background:var(--ink-700); color:white;
  font-family:'DM Sans',sans-serif; font-weight:800; font-size:13px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.user-brand small{color:var(--text-3); font-weight:500; font-family:'Inter',sans-serif; font-size:12px}

/* ─── Page bar (breadcrumbs + title under admin-top) ───────────── */
.page-bar{
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.78));
  border-bottom:1px solid var(--hair);
  position:sticky; top:0; z-index:30;
  backdrop-filter: blur(14px) saturate(180%);
}
.page-bar-inner{
  max-width:1480px; margin:0 auto;
  padding:18px 28px;
  display:flex; align-items:center; gap:16px; flex-wrap:wrap;
}
.crumbs{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--text-3); font-weight:500}
.crumbs a{color:var(--text-3); text-decoration:none; transition:color .15s}
.crumbs a:hover{color:var(--text-2)}
.crumbs .sep{color:var(--hair-3); font-size:9px}
.crumbs .current{color:var(--text-1); font-weight:600}
.page-title-wrap{display:flex; align-items:baseline; gap:12px; margin-left:auto}
.page-title-wrap h1{font-size:18px}
.page-title-wrap .meta{
  font-size:12px; color:var(--text-3); font-weight:500;
  padding:3px 8px; border:1px solid var(--hair-2); background:var(--surface-1);
}

/* ─── Main wrapper ─────────────────────────────────────────────── */
.main-wrap{
  max-width:1480px; width:100%;
  margin:0 auto;
  padding:24px 28px 56px;
}
.main-wrap-narrow{
  max-width:920px; width:100%;
  margin:0 auto;
  padding:32px 24px 64px;
}

.section-title{
  display:flex; align-items:center; gap:10px;
  font-size:11.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
  color:var(--text-3); margin:8px 0 14px;
}
.section-title::after{content:''; flex:1; height:1px; background:var(--hair)}
.section-title i{font-size:11px; opacity:.7}

/* ─── Stat card ────────────────────────────────────────────────── */
.stat{
  position:relative; overflow:hidden;
  background:var(--surface-1); border:1px solid var(--hair-2);
  padding:16px 18px 18px;
  box-shadow:var(--shadow-1);
  transition: all .25s var(--ease-out);
  opacity:0; transform:translateY(10px);
  animation: rise .5s var(--ease-out) forwards;
}
.stat:hover{border-color:var(--hair-3); transform:translateY(-2px); box-shadow:var(--shadow-2)}
.stat::before{
  content:''; position:absolute; left:0; top:0; bottom:0; width:2px;
  background:var(--c-arterial); opacity:.85; transition: width .3s var(--ease-spring);
}
.stat:hover::before{width:3px}
.stat[data-color="warn"]::before{background:var(--c-warn)}
.stat[data-color="premium"]::before{background:var(--c-premium)}
.stat[data-color="plus"]::before{background:var(--c-plus)}
.stat[data-color="basic"]::before{background:var(--ink-700)}
.stat[data-color="danger"]::before{background:var(--c-danger)}
.stat[data-color="venoso"]::before{background:var(--c-venoso)}
.stat[data-color="info"]::before{background:var(--c-info)}
.stat[data-color="success"]::before{background:var(--c-success)}
.stat-row{display:flex; align-items:center; justify-content:space-between; gap:12px}
.stat-label{font-size:11px; font-weight:600; color:var(--text-3); letter-spacing:.06em; text-transform:uppercase}
.stat-icon{
  width:30px; height:30px; display:grid; place-items:center;
  background:var(--surface-2); color:var(--c-arterial);
  font-size:13px; border:1px solid var(--hair);
  transition: background .25s, color .25s;
}
.stat[data-color="warn"] .stat-icon{color:var(--c-warn)}
.stat[data-color="premium"] .stat-icon{color:var(--c-premium)}
.stat[data-color="plus"] .stat-icon{color:var(--c-plus)}
.stat[data-color="danger"] .stat-icon{color:var(--c-danger)}
.stat[data-color="venoso"] .stat-icon{color:var(--c-venoso)}
.stat[data-color="info"] .stat-icon{color:var(--c-info)}
.stat[data-color="success"] .stat-icon{color:var(--c-success)}
.stat:hover .stat-icon{background:var(--surface-3)}
.stat-value{
  font-family:'DM Sans',sans-serif; font-weight:700;
  font-size:26px; line-height:1.05; margin-top:10px; letter-spacing:-.02em;
}
.stat-value.sm{font-size:20px}
.stat-meta{display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--text-3); margin-top:6px}
.stat-meta .trend{color:var(--c-success); font-weight:600}
.stat-meta .trend.down{color:var(--c-danger)}

@keyframes rise{ to{opacity:1; transform:translateY(0)} }
.delay-1{animation-delay:.04s}
.delay-2{animation-delay:.08s}
.delay-3{animation-delay:.12s}
.delay-4{animation-delay:.16s}
.delay-5{animation-delay:.20s}
.delay-6{animation-delay:.24s}

/* ─── Surface card (content blocks) ────────────────────────────── */
.card{
  background:var(--surface-1); border:1px solid var(--hair-2);
  box-shadow:var(--shadow-1);
  opacity:0; transform:translateY(10px);
  animation: rise .5s var(--ease-out) forwards;
}
.card-head{
  display:flex; align-items:center; gap:10px;
  padding:14px 20px;
  border-bottom:1px solid var(--hair);
  background:linear-gradient(180deg, var(--surface-1), var(--surface-2));
}
.card-head h3{font-size:14px; letter-spacing:-.01em}
.card-head h3 small{font-weight:500; color:var(--text-3); margin-left:6px; font-family:'Inter',sans-serif}
.card-head .head-actions{margin-left:auto; display:flex; align-items:center; gap:8px}
.card-body{padding:20px}
.card-body.tight{padding:14px}
.card-body.flush{padding:0}

/* ─── Form controls ────────────────────────────────────────────── */
label.field-label,
.field-label{
  display:block; font-size:12px; font-weight:600; color:var(--text-2);
  letter-spacing:.02em; margin-bottom:6px;
}
.field-hint{font-size:11.5px; color:var(--text-3); margin-top:4px}

input[type="text"].input,
input[type="email"].input,
input[type="password"].input,
input[type="number"].input,
input[type="search"].input,
input[type="url"].input,
input[type="date"].input,
select.input,
textarea.input{
  width:100%; padding:10px 12px;
  background:var(--surface-1); border:1px solid var(--hair-2);
  font-family:inherit; font-size:13.5px; color:var(--text-1);
  outline:none; transition: all .18s var(--ease-out);
  border-radius:0;
}
.input:focus,
.input:focus-visible{
  border-color:var(--ink-300);
  box-shadow:0 0 0 3px rgba(91,95,158,.14);
}
textarea.input{min-height:90px; resize:vertical; line-height:1.5}
select.input{
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2394A3B8'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:18px;
  padding-right:34px;
}

.field-group{display:grid; gap:14px}
.field-row{display:grid; gap:14px; grid-template-columns:1fr 1fr}
@media(max-width:640px){.field-row{grid-template-columns:1fr}}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 16px; font-family:'Inter',sans-serif; font-weight:600; font-size:13px;
  border:1px solid var(--hair-2); background:var(--surface-1); color:var(--text-1);
  cursor:pointer; transition:all .18s var(--ease-out);
  text-decoration:none; line-height:1;
}
.btn:hover{border-color:var(--hair-3); transform:translateY(-1px)}
.btn:active{transform:translateY(0)}
.btn.primary{background:var(--ink-700); color:white; border-color:var(--ink-700)}
.btn.primary:hover{background:var(--ink-800); border-color:var(--ink-800)}
.btn.success{background:var(--c-success); color:white; border-color:var(--c-success)}
.btn.success:hover{filter:brightness(.93)}
.btn.danger{background:var(--c-danger); color:white; border-color:var(--c-danger)}
.btn.warning{background:var(--c-warn); color:white; border-color:var(--c-warn)}
.btn.ghost{background:transparent; border-color:transparent}
.btn.ghost:hover{background:var(--surface-2); border-color:var(--hair)}
.btn.sm{padding:6px 10px; font-size:12px}
.btn.lg{padding:12px 22px; font-size:14px}
.btn.block{width:100%}
.btn .arrow{margin-left:2px; font-size:10px; opacity:.7; transition: transform .18s var(--ease-out)}
.btn:hover .arrow{transform:translateX(2px); opacity:1}

.icon-btn{
  width:32px; height:32px; display:grid; place-items:center;
  background:var(--surface-1); border:1px solid var(--hair-2);
  color:var(--text-2); cursor:pointer; transition: all .18s var(--ease-out);
}
.icon-btn:hover{background:var(--surface-2); color:var(--text-1); border-color:var(--hair-3); transform:translateY(-1px)}
.icon-btn.danger:hover{color:var(--c-danger); border-color:rgba(185,19,30,.3); background:var(--c-danger-soft)}
.icon-btn.warn:hover{color:var(--c-warn); border-color:rgba(217,119,6,.3); background:var(--c-warn-soft)}
.icon-btn.success:hover{color:var(--c-success); border-color:rgba(14,159,110,.3); background:var(--c-success-soft)}

/* ─── Segmented control ────────────────────────────────────────── */
.seg{display:inline-flex; border:1px solid var(--hair-2)}
.seg button{
  padding:7px 12px; background:var(--surface-1); border:none;
  color:var(--text-2); font:inherit; font-size:12.5px; font-weight:550; cursor:pointer;
  transition: all .15s var(--ease-out); border-right:1px solid var(--hair);
}
.seg button:last-child{border-right:none}
.seg button:hover{background:var(--surface-2); color:var(--text-1)}
.seg button.active{background:var(--ink-700); color:#fff}

/* ─── Search input (light) ─────────────────────────────────────── */
.search{
  display:flex; align-items:center; gap:8px;
  padding:7px 10px; min-width:220px;
  background:var(--surface-1); border:1px solid var(--hair-2);
  font-size:13px; color:var(--text-1);
  transition: all .18s var(--ease-out);
}
.search:focus-within{border-color:var(--ink-300); box-shadow:0 0 0 3px rgba(91,95,158,.12)}
.search i{color:var(--text-3); font-size:11.5px}
.search input{
  border:none; outline:none; background:transparent;
  font-family:inherit; font-size:13px; flex:1; color:var(--text-1); min-width:0;
}

/* ─── Tables ───────────────────────────────────────────────────── */
table.t{width:100%; border-collapse:collapse; font-size:13px}
table.t thead th{
  background:var(--surface-2);
  padding:11px 14px; text-align:left;
  font-family:'Inter',sans-serif; font-weight:600;
  font-size:11px; color:var(--text-3);
  letter-spacing:.07em; text-transform:uppercase;
  border-bottom:1px solid var(--hair-2);
}
table.t thead th.right{text-align:right}
table.t thead th.center{text-align:center}
table.t thead th i{font-size:9px; margin-left:5px; opacity:.6}
table.t tbody tr{
  border-bottom:1px solid var(--hair);
  transition: background .12s var(--ease-out);
}
table.t tbody tr:hover{background:var(--surface-2)}
table.t tbody tr:last-child{border-bottom:none}
table.t tbody td{padding:13px 14px; vertical-align:middle}
table.t tbody td.center{text-align:center}
table.t tbody td.right{text-align:right}
.table-wrap{overflow:auto; -webkit-overflow-scrolling:touch}

/* ─── Status pill ──────────────────────────────────────────────── */
.status{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 10px; font-size:11.5px; font-weight:600;
  background:var(--surface-2); border:1px solid var(--hair-2); color:var(--text-2);
}
.status .pdot{width:6px; height:6px; border-radius:50%; background:var(--text-3)}
.status.is-active{color:var(--c-success); background:var(--c-success-soft); border-color:#bce7d4}
.status.is-active .pdot{background:var(--c-success); box-shadow:0 0 0 3px rgba(14,159,110,.20); animation: pulse 2s ease-in-out infinite}
.status.is-suspended,.status.is-danger{color:var(--c-danger); background:var(--c-danger-soft); border-color:#f5c2c5}
.status.is-suspended .pdot,.status.is-danger .pdot{background:var(--c-danger)}
.status.is-warn{color:var(--c-warn); background:var(--c-warn-soft); border-color:#f5d6a6}
.status.is-warn .pdot{background:var(--c-warn); box-shadow:0 0 0 3px rgba(217,119,6,.18)}
.status.is-info{color:#0369a1; background:var(--c-info-soft); border-color:#bae6fd}
.status.is-info .pdot{background:var(--c-info)}
@keyframes pulse{ 0%,100%{box-shadow:0 0 0 3px rgba(14,159,110,.20)} 50%{box-shadow:0 0 0 6px rgba(14,159,110,.05)} }

/* ─── Tier tag ─────────────────────────────────────────────────── */
.plan-tag{
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 9px;
  font-size:11.5px; font-weight:600; color:var(--text-1);
  background:var(--surface-2); border:1px solid var(--hair-2);
  transition: all .18s var(--ease-out);
}
.plan-tag .pdot{width:6px; height:6px; border-radius:50%}
.plan-tag .module{font-family:'JetBrains Mono',monospace; font-size:10px; color:var(--text-3); font-weight:600}
.plan-tag[data-tier="basic"] .pdot{background:var(--ink-700)}
.plan-tag[data-tier="plus"] .pdot{background:var(--c-plus)}
.plan-tag[data-tier="premium"] .pdot{background:var(--c-premium); box-shadow:0 0 0 3px rgba(45,155,138,.18)}
.plan-tag[data-tier="trial"] .pdot{background:var(--c-warn)}
.plan-tag[data-tier="off"] .pdot{background:var(--text-3)}
.plan-tag[data-tier="off"]{color:var(--text-3)}
.plan-tag[data-tier="enterprise"] .pdot{background:var(--c-venoso); box-shadow:0 0 0 3px rgba(233,150,90,.18)}

/* ─── Pager ────────────────────────────────────────────────────── */
.pager{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; border-top:1px solid var(--hair); background:var(--surface-2);
  flex-wrap:wrap; gap:12px;
}
.pager .info{font-size:12.5px; color:var(--text-3); font-weight:500}
.pager .info strong{color:var(--text-1)}
.pages{display:flex; gap:4px}
.page-btn{
  min-width:30px; height:30px; padding:0 10px;
  background:var(--surface-1); border:1px solid var(--hair-2);
  color:var(--text-2); cursor:pointer;
  font:inherit; font-size:12.5px; font-weight:600;
  display:inline-flex; align-items:center; justify-content:center;
  transition: all .15s var(--ease-out);
}
.page-btn:hover:not(:disabled){border-color:var(--ink-300); color:var(--ink-700); transform:translateY(-1px)}
.page-btn.active{background:var(--ink-700); color:#fff; border-color:var(--ink-700)}
.page-btn:disabled{opacity:.4; cursor:not-allowed}
.page-btn.spacer{border:none; background:transparent; cursor:default}

/* ─── Modal ────────────────────────────────────────────────────── */
.scrim{
  position:fixed; inset:0; z-index:100;
  background:rgba(11,20,55,.42); backdrop-filter:blur(6px);
  display:none; align-items:center; justify-content:center;
  animation: scrimIn .2s ease;
}
.scrim.open{display:flex}
@keyframes scrimIn{ from{opacity:0} to{opacity:1} }
.dialog{
  width:100%; max-width:480px; margin:16px;
  background:var(--surface-1); border:1px solid var(--hair-2);
  box-shadow:0 30px 80px -20px rgba(11,20,55,.4);
  padding:24px;
  animation: dialogIn .26s var(--ease-spring);
}
.dialog.lg{max-width:640px}
.dialog h3{font-size:18px; margin-bottom:6px}
.dialog p.dialog-lead{color:var(--text-2); font-size:13.5px; line-height:1.55; margin:0 0 18px}
@keyframes dialogIn{ from{opacity:0; transform: scale(.96) translateY(8px)} to{opacity:1; transform: scale(1) translateY(0)} }
.dialog-icon{
  width:42px; height:42px; display:grid; place-items:center;
  background:var(--c-arterial-soft); color:var(--c-arterial); font-size:16px;
  margin-bottom:14px;
}
.dialog-actions{display:flex; gap:10px; margin-top:18px}
.dialog-actions .btn{flex:1}

/* ─── Toast (notifications) ────────────────────────────────────── */
.toast-stack{
  position:fixed; bottom:24px; right:24px; z-index:200;
  display:flex; flex-direction:column; gap:10px;
  pointer-events:none;
}
.toast{
  display:flex; align-items:center; gap:10px;
  padding:12px 16px;
  background:var(--surface-1); border:1px solid var(--hair-2);
  box-shadow:var(--shadow-3);
  font-size:13px; color:var(--text-1); min-width:240px;
  pointer-events:auto;
  animation: toastIn .3s var(--ease-spring);
}
.toast.success{border-left:3px solid var(--c-success)}
.toast.success i{color:var(--c-success)}
.toast.danger{border-left:3px solid var(--c-danger)}
.toast.danger i{color:var(--c-danger)}
@keyframes toastIn{ from{opacity:0; transform:translateX(20px)} to{opacity:1; transform:translateX(0)} }

/* ─── Avatar ───────────────────────────────────────────────────── */
.avatar{
  width:34px; height:34px; display:grid; place-items:center;
  background:linear-gradient(135deg, var(--ink-700), var(--ink-300));
  color:#fff; font-family:'DM Sans',sans-serif; font-weight:700; font-size:12px;
  letter-spacing:.02em; flex-shrink:0;
}
.avatar.lg{width:44px; height:44px; font-size:14px}
.avatar.sm{width:28px; height:28px; font-size:11px}
.avatar[data-color="venoso"]{background:linear-gradient(135deg, var(--c-venoso), #d17a3a)}
.avatar[data-color="premium"]{background:linear-gradient(135deg, var(--c-premium), #1d7c6d)}
.avatar[data-color="danger"]{background:linear-gradient(135deg, var(--c-danger), #8a0d16)}
.avatar[data-color="warn"]{background:linear-gradient(135deg, var(--c-warn), #b85e05)}
.avatar[data-color="plus"]{background:linear-gradient(135deg, var(--c-plus), #6c04ac)}

/* ─── Soft tile ────────────────────────────────────────────────── */
.tile{
  display:flex; align-items:center; justify-content:space-between;
  gap:14px; padding:14px 16px;
  background:var(--surface-2); border:1px solid var(--hair);
  transition: all .18s var(--ease-out);
}
.tile:hover{background:var(--surface-3)}
.tile .tlabel{font-size:12px; color:var(--text-3); font-weight:500}
.tile .tvalue{font-size:14px; color:var(--text-1); font-weight:600}

/* ─── Switch ───────────────────────────────────────────────────── */
.switch{
  position:relative;
  display:inline-block; width:40px; height:22px;
  cursor:pointer;
}
.switch input{position:absolute; opacity:0; width:0; height:0}
.switch .slider{
  position:absolute; inset:0;
  background:var(--surface-3); border:1px solid var(--hair-2);
  transition: all .22s var(--ease-out);
}
.switch .slider::before{
  content:''; position:absolute;
  width:16px; height:16px;
  left:2px; top:2px;
  background:var(--surface-1);
  box-shadow: 0 1px 3px rgba(11,20,55,.2);
  transition: transform .25s var(--ease-spring);
}
.switch input:checked + .slider{background:var(--c-success); border-color:var(--c-success)}
.switch input:checked + .slider::before{transform:translateX(18px)}
.switch input:focus + .slider{box-shadow: 0 0 0 3px rgba(91,95,158,.15)}

/* ─── Empty state ──────────────────────────────────────────────── */
.empty{
  text-align:center; padding:48px 24px;
  color:var(--text-3);
}
.empty i{font-size:28px; margin-bottom:10px; color:var(--text-4)}
.empty p{margin:0; font-size:13px}
.empty h4{font-size:14px; color:var(--text-2); margin-bottom:6px}

/* ─── Tabs (light) ─────────────────────────────────────────────── */
.tabs{
  display:flex; gap:2px; border-bottom:1px solid var(--hair-2);
  margin-bottom:20px;
}
.tabs button{
  padding:10px 14px; background:none; border:none;
  font:inherit; font-size:13px; font-weight:600; color:var(--text-3);
  cursor:pointer; transition: all .18s var(--ease-out);
  border-bottom:2px solid transparent; margin-bottom:-1px;
  display:inline-flex; align-items:center; gap:8px;
}
.tabs button i{font-size:11px}
.tabs button:hover{color:var(--text-1)}
.tabs button.active{color:var(--ink-700); border-bottom-color:var(--ink-700)}

/* ─── Code chip (mono) ─────────────────────────────────────────── */
.code-chip{
  display:inline-flex; align-items:center; gap:6px;
  font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:600;
  padding:4px 8px;
  background:var(--surface-2); border:1px solid var(--hair-2);
  color:var(--text-1); letter-spacing:.02em;
}

/* ─── Progress bar ─────────────────────────────────────────────── */
.progress{height:6px; background:var(--surface-3); position:relative; overflow:hidden}
.progress-bar{
  position:absolute; left:0; top:0; bottom:0;
  background:linear-gradient(90deg, var(--c-arterial), var(--ink-300));
  width:0; transition: width 1.2s var(--ease-out);
}
.progress-bar.venous{background:linear-gradient(90deg, var(--c-venoso), #f0b07f)}
.progress-bar.success{background:linear-gradient(90deg, var(--c-success), #2bb47e)}

/* ─── Utilities ────────────────────────────────────────────────── */
.flex{display:flex}
.flex-col{flex-direction:column}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.gap-1{gap:6px} .gap-2{gap:10px} .gap-3{gap:14px} .gap-4{gap:20px}
.mt-1{margin-top:6px} .mt-2{margin-top:12px} .mt-3{margin-top:18px} .mt-4{margin-top:24px}
.mb-1{margin-bottom:6px} .mb-2{margin-bottom:12px} .mb-3{margin-bottom:18px} .mb-4{margin-bottom:24px}
.text-sm{font-size:12.5px}
.text-xs{font-size:11.5px}
.text-mute{color:var(--text-3)}
.text-2{color:var(--text-2)}
.fw-6{font-weight:600}
.grid{display:grid}
.grid-2{grid-template-columns:repeat(2,1fr); gap:14px}
.grid-3{grid-template-columns:repeat(3,1fr); gap:14px}
.grid-4{grid-template-columns:repeat(4,1fr); gap:14px}
.grid-5{grid-template-columns:repeat(5,1fr); gap:14px}
@media(max-width:1080px){.grid-5{grid-template-columns:repeat(2,1fr)} .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:1fr}}
@media(max-width:640px){.grid-2{grid-template-columns:1fr} .grid-4{grid-template-columns:1fr} .grid-5{grid-template-columns:1fr}}

/* ─── Responsive helpers ───────────────────────────────────────── */
@media (max-width:900px){
  .admin-nav{display:none}
  .top-search{display:none}
  .admin-nav-mobile{display:flex !important}
  .page-bar-inner{padding:14px 16px}
  .page-title-wrap{margin-left:0; flex-basis:100%; order:-1}
  .main-wrap{padding:18px 16px 56px}
  .hide-sm{display:none}
}
@media (max-width:560px){
  .hide-xs{display:none}
}

/* ─── Mobile drawer for admin nav ──────────────────────────────── */
.admin-nav-mobile{display:none; align-items:center; gap:6px}
.mobile-menu-btn{
  width:34px; height:34px; display:grid; place-items:center;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10);
  color:#fff; cursor:pointer;
}

.drawer{
  display:none;
  position:fixed; inset:0; z-index:90;
  background:rgba(11,20,55,.5);
}
.drawer.open{display:block}
.drawer-panel{
  position:absolute; left:0; top:0; bottom:0;
  width:84%; max-width:320px;
  background:var(--ink-900); color:white;
  padding:18px 14px;
  transform:translateX(-100%);
  animation: drawerIn .25s var(--ease-out) forwards;
}
@keyframes drawerIn{ to{transform:translateX(0)} }
.drawer-panel a{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; color:rgba(255,255,255,.7); text-decoration:none;
  font-size:13px; font-weight:500;
}
.drawer-panel a:hover,.drawer-panel a.active{background:rgba(255,255,255,.08); color:#fff}
