/* ==========================================================================
   Arivo — app design system
   Plain CSS, no build tooling. Based on the Arivo calculator aesthetic:
   warm cream canvas, ink text, gold brand, serif headings, mono numerals.
   ========================================================================== */

/* ==========================================================================
   Tokens
   ========================================================================== */
:root{
  --bg:#fbfaf7;
  --panel:#ffffff;
  --panel-2:#f1eee7;
  --line:rgba(23,33,27,0.24);
  --line-soft:rgba(23,33,27,0.12);
  --ink:#17211b;
  --ink-dim:#5f675f;
  --ink-faint:#899089;
  --gold:#e85d2a;
  --gold-dim:#b93816;
  --teal:#16877e;
  --green:#0f766e;
  --amber:#d98b20;
  --red:#c94b4b;
  --radius-s:6px;
  --radius-m:10px;
  --radius-l:14px;
  --shadow-1:0 1px 2px rgba(23,33,27,0.06);
  --shadow-2:0 18px 42px rgba(23,33,27,0.11);
  --serif:'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --mono:'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
  --ease:cubic-bezier(0.16, 1, 0.3, 1);

  /* legacy aliases — still referenced by inline styles in some templates */
  --text-1:var(--ink);
  --text-2:var(--ink-dim);
  --text-3:var(--ink-faint);
  --bg-ink:var(--ink);
  --bg-ink-2:#24352d;
  --bg-soft:var(--panel-2);
  --brand:var(--gold);
  --brand-2:var(--green);
  --brand-deep:var(--gold-dim);
  --brand-soft:rgba(232,93,42,0.09);
  --brand-soft-2:rgba(15,118,110,0.1);
  --teal-soft:rgba(22,135,126,0.1);
  --border:var(--line-soft);
  --border-strong:var(--line);
  --radius-xl:18px;
  --ff-mono:var(--mono);
}

*{ box-sizing:border-box; }
html, body{ margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  background:var(--bg);
  color:var(--ink);
  font-family:var(--sans);
  font-size:14px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
::selection{ background:var(--gold); color:#fff; }

/* ==========================================================================
   Auth shell — cream canvas with a soft grid, mirroring the landing hero
   ========================================================================== */
/* ==========================================================================
   Auth shell — equal split: deep-cream brand panel + pure white form panel
   ========================================================================== */
.auth-shell{ position:relative; display:grid; grid-template-columns:minmax(0,1fr); min-height:100vh; background:#fdfaf1; }
.auth-main{ position:relative; z-index:1; width:100%; max-width:400px; margin:0 auto; padding:40px 16px; display:flex; flex-direction:column; }
.auth-main > *{ width:100%; }
.auth-brand{ display:none; }
.auth-foot{ margin-top:22px; }
.auth-main{ font-family:var(--mono); }
.auth-main h1, .auth-main h2, .auth-main h3{ font-family:var(--mono); }
.auth-main .card-title{ font-size:24px; font-weight:700; color:#0f1712; letter-spacing:0.1px; }
.auth-main .muted{ font-size:13.5px; color:var(--ink-dim); }
.auth-main label.field{ font-size:12.5px; color:#17211b; }
.auth-main .field-wrap{ margin-bottom:16px; }
.auth-main input[type="text"], .auth-main input[type="email"], .auth-main input[type="password"],
.auth-main input[type="number"], .auth-main input[type="url"], .auth-main input[type="tel"],
.auth-main input[type="search"], .auth-main input[type="date"], .auth-main select, .auth-main textarea{
  font-family:var(--mono); font-size:15px; padding:11px 13px;
}
.auth-main .btn{ font-family:var(--mono); font-size:14px; padding:11px 14px; }
.auth-main .link{ font-size:13px; }
.auth-main .auth-foot{ font-size:12px; color:var(--ink-faint); }
.btn.google{ background:#fff; border:1.5px solid rgba(23,33,27,0.28); color:#17211b; font-family:var(--mono); font-weight:600; gap:10px; }
.btn.google:hover{ border-color:rgba(23,33,27,0.55); background:#fcfaf6; color:#17211b; }
.btn.google svg{ width:18px; height:18px; }
.auth-divider{ display:flex; align-items:center; gap:12px; margin:4px 0 18px; color:var(--ink-faint); font-family:var(--mono); font-size:11px; letter-spacing:0.05em; text-transform:uppercase; }
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background:var(--line-soft); }
@media (max-width:600px){ .auth-main{ padding:28px 14px; } }

@media (max-width:899px){
  .auth-shell{ display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }
  .auth-main{ margin:auto; }
}

@media (min-width:900px){
  .auth-shell{ grid-template-columns:repeat(2, minmax(0,1fr)); }

  .auth-brand{
    position:relative; overflow:hidden auto; align-self:stretch;
    display:flex; flex-direction:column; justify-content:center; gap:clamp(36px,6vh,64px);
    padding:clamp(48px,6vw,88px) clamp(40px,6vw,80px);
    background:
      radial-gradient(120% 90% at 110% -10%, rgba(232,93,42,0.16), transparent 55%),
      radial-gradient(110% 90% at -10% 110%, rgba(15,118,110,0.14), transparent 60%),
      linear-gradient(155deg, #f4ead0 0%, #ecdcb8 55%, #e4d0a6 100%);
    color:#0f1712;
  }

  .auth-brand-head{ position:relative; z-index:1; display:flex; align-items:center; gap:11px; font-family:var(--serif); font-weight:700; font-size:20px; color:#0f1712; }
  .auth-brand-name{ letter-spacing:0.2px; }

  .auth-brand-copy{ position:relative; z-index:1; }
  .auth-pill{ display:inline-flex; align-items:center; gap:8px; margin-bottom:22px; padding:6px 12px; border-radius:999px;
    border:1px solid rgba(232,93,42,0.4); background:rgba(232,93,42,0.12);
    font-family:var(--serif); font-size:12.5px; font-weight:600; letter-spacing:0.3px; color:var(--gold-dim); }
  .auth-pulse{ width:7px; height:7px; border-radius:50%; background:var(--gold); box-shadow:0 0 0 0 rgba(232,93,42,0.6); animation:authPulse 2.2s infinite; }
  @keyframes authPulse{ 0%{ box-shadow:0 0 0 0 rgba(232,93,42,0.55); } 70%{ box-shadow:0 0 0 9px rgba(232,93,42,0); } 100%{ box-shadow:0 0 0 0 rgba(232,93,42,0); } }

  .auth-brand-title{ font-family:var(--serif); font-size:clamp(30px,3.4vw,48px); line-height:1.14; letter-spacing:0.2px; font-weight:700; color:#0f1712; }
  .auth-brand-title .grad{ background:linear-gradient(90deg, var(--gold), var(--green)); -webkit-background-clip:text; background-clip:text; color:transparent; }
  .auth-brand-sub{ margin-top:18px; max-width:480px; font-family:var(--serif); font-size:16px; line-height:1.7; color:#17211b; }

  .auth-brand-feats{ margin-top:34px; display:flex; flex-direction:column; gap:15px; }
  .auth-brand-feats li{ display:flex; align-items:flex-start; gap:11px; font-family:var(--serif); font-size:14.5px; color:#0f1712; }
  .auth-tick{ flex-shrink:0; width:20px; height:20px; margin-top:1px; display:flex; align-items:center; justify-content:center;
    border-radius:6px; background:rgba(232,93,42,0.16); color:var(--gold-dim); font-weight:700; font-size:11px; }

  .auth-main{
    max-width:none; margin:0; align-self:stretch;
    align-items:center; justify-content:center;
    background:linear-gradient(180deg, #fdfbf4 0%, #f9f4e7 60%, #f7f0e0 100%);
  }
  .auth-main > *{ width:100%; max-width:400px; }
}
h1,h2,h3,h4,h5,h6{ font-family:var(--serif); font-weight:600; margin:0 0 6px 0; letter-spacing:0.2px; }
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
ul,ol{ list-style:none; margin:0; padding:0; }
img{ max-width:100%; }
table{ border-collapse:collapse; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; padding:0; }
input,select,textarea{ font-family:inherit; }
figure{ margin:0; }
[x-cloak]{ display:none !important; }
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
}

/* ---------------------------------------------------------------
   Typography helpers
   --------------------------------------------------------------- */
.serif{ font-family:var(--serif); }
.mono{ font-family:var(--mono); }
.num{ font-family:var(--mono); font-variant-numeric:tabular-nums; }
.mini{ font-size:11px; color:var(--ink-faint); }
.muted{ color:var(--ink-dim); }
.faint{ color:var(--ink-faint); }
.strong{ font-weight:600; }
.uppercase{ text-transform:uppercase; }
.small{ font-size:12px; }
.xs{ font-size:11px; }
.micro{ font-size:10px; text-transform:uppercase; letter-spacing:0.06em; color:var(--ink-faint); font-weight:600; }
.center{ text-align:center; }
.right{ text-align:right; }
.cursor-pointer{ cursor:pointer; }
.whitespace-pre-line{ white-space:pre-line; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.text-lg{ font-size:18px; }
.scroll-mt-24{ scroll-margin-top:96px; }
.line-clamp-2, .line-clamp-3{ display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; }
.line-clamp-2{ -webkit-line-clamp:2; }
.line-clamp-3{ -webkit-line-clamp:3; }
.truncate{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nowrap{ white-space:nowrap; }

/* ---------------------------------------------------------------
   Layout primitives
   --------------------------------------------------------------- */
.flex{ display:flex; gap:10px; align-items:center; }
.flex-col{ display:flex; flex-direction:column; }
.flex-between{ display:flex; justify-content:space-between; align-items:center; gap:12px; }
.stack > * + *{ margin-top:14px; }
.stack-sm > * + *{ margin-top:8px; }
.stack-lg > * + *{ margin-top:20px; }
.items-start{ align-items:flex-start; }
.items-end{ align-items:flex-end; }
.justify-center{ justify-content:center; }
.wrap{ flex-wrap:wrap; }
.grow{ flex-grow:1; }
.shrink{ flex-shrink:0; }
.shrink-0{ flex-shrink:0; }
.flex > *, .flex-between > *{ min-width:0; }
.divider{ border:none; border-top:1px solid var(--line-soft); margin:16px 0; }

.grid{ display:grid; gap:14px; }
.g2{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.g3{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
.g4{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
@media (max-width:900px){ .g2,.g3,.g4{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:600px){ .g2,.g3,.g4{ grid-template-columns:minmax(0,1fr); } }

.gap-s{ gap:6px; }
.gap-m{ gap:12px; }
.gap-l{ gap:18px; }

/* ---------------------------------------------------------------
   App shell — sidebar + topbar + content
   --------------------------------------------------------------- */
.app-shell{ display:flex; min-height:100vh; }

.sidebar{
  width:225px;
  flex:0 0 225px;
  background:var(--panel-2);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
}
.sidebar-brand{
  padding:20px 20px 16px;
  border-bottom:1px solid var(--line-soft);
  margin-bottom:8px;
  display:flex;
  align-items:center;
  gap:10px;
}
.sidebar-brand h1{ font-size:21px; color:var(--gold); margin:0; }
.sidebar-brand small{ color:var(--ink-faint); font-size:11px; display:block; }
.sidebar-nav{ flex:1; padding:2px 0 12px; overflow-y:auto; }
.nav-group{
  padding:16px 20px 6px;
  color:var(--ink-faint);
  font-size:10px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  font-weight:600;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 20px;
  color:var(--ink-dim);
  font-size:13px;
  border-left:3px solid transparent;
  transition:background .12s, color .12s;
}
.nav-item:hover{ background:var(--line-soft); color:var(--ink); }
.nav-item.active{ color:var(--gold); border-left-color:var(--gold); background:var(--line-soft); font-weight:600; }
.nav-item .ico{ width:16px; text-align:center; flex-shrink:0; font-size:13px; }
.sidebar-foot{ border-top:1px solid var(--line-soft); padding:12px 14px; }
.sidebar-foot .chip{ width:100%; }

.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  height:56px;
  padding:0 28px;
  background:var(--panel);
  border-bottom:1px solid var(--line-soft);
}
.content{ flex:1; padding:28px; max-width:1160px; width:100%; margin:0 auto; }

@media (max-width:768px){
  .sidebar{ display:none; }
  .content{ padding:18px; }
  .topbar{ padding:0 16px; }
}

/* ---------------------------------------------------------------
   Page headers
   --------------------------------------------------------------- */
.page-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; margin-bottom:20px; }
.page-title{ font-size:26px; line-height:1.15; color:var(--ink); }
.page-sub{ color:var(--ink-dim); font-size:13px; max-width:640px; margin-top:4px; }
.page-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* ---------------------------------------------------------------
   Cards & sections
   --------------------------------------------------------------- */
.card{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-m); padding:18px 20px; }
.section{ margin-bottom:26px; }
.section-title{ font-size:12px; text-transform:uppercase; letter-spacing:0.07em; color:var(--ink-faint); margin:0 0 10px 0; font-weight:600; }
.card-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.card-title{ font-size:17px; }
.subcard{ background:var(--panel-2); border:1px solid var(--line-soft); border-radius:8px; padding:12px 14px; margin-bottom:10px; }
.subcard.sel{ border-color:var(--gold-dim); box-shadow:0 0 0 2px rgba(232,93,42,0.2); background:var(--brand-soft); }
.empty{ text-align:center; color:var(--ink-faint); font-size:13px; padding:42px 16px; }
.empty-line{ display:block; margin-top:6px; font-size:12px; color:var(--ink-faint); }

/* KPI row */
.kpi-row{ display:grid; grid-template-columns:repeat(4, 1fr); gap:12px; margin-bottom:24px; }
@media (max-width:900px){ .kpi-row{ grid-template-columns:1fr 1fr; } }
@media (max-width:600px){ .kpi-row{ grid-template-columns:1fr; } }
.kpi{ background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-m); padding:14px 16px; position:relative; overflow:hidden; }
.kpi::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--gold-dim); }
.kpi.pos::before{ background:var(--green); }
.kpi.neg::before{ background:var(--red); }
.kpi-label{ font-size:11px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:0.05em; font-weight:600; }
.kpi-value{ font-size:24px; font-weight:600; margin-top:4px; color:var(--ink); font-family:var(--mono); font-variant-numeric:tabular-nums; }
.kpi-sub{ font-size:11px; color:var(--ink-faint); margin-top:3px; }

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:7px; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:7px; padding:8px 14px; font-size:12.5px; font-weight:500; cursor:pointer; transition:background .12s, border-color .12s, color .12s; white-space:nowrap; }
.btn:hover{ border-color:var(--gold-dim); color:var(--gold); }
.btn.primary{ background:var(--gold); color:#fff; border-color:var(--gold); font-weight:600; }
.btn.primary:hover{ background:var(--gold-dim); color:#fff; border-color:var(--gold-dim); }
.btn.teal{ background:var(--green); color:#fff; border-color:var(--green); font-weight:600; }
.btn.teal:hover{ background:#0a5d55; color:#fff; border-color:#0a5d55; }
.btn.danger{ background:var(--red); color:#fff; border-color:var(--red); font-weight:600; }
.btn.danger:hover{ background:#a33b3b; color:#fff; border-color:#a33b3b; }
.btn.ghost{ background:transparent; }
.btn.block{ width:100%; }
.btn.small{ padding:4px 10px; font-size:11.5px; border-radius:6px; }
.btn .ico{ font-size:0.9em; }
a.btn{ text-decoration:none; }

.link{ color:var(--gold); font-weight:600; }
.link:hover{ text-decoration:underline; }
.text-gold{ color:var(--gold); }
.text-teal{ color:var(--teal); }
.text-green{ color:var(--green); }
.text-amber{ color:var(--amber); }
.text-red{ color:var(--red); }
.text-faint{ color:var(--ink-faint); }
.bg-panel{ background:var(--panel); }
.bg-soft{ background:var(--panel-2); }
.stat-value{ font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:26px; font-weight:600; color:var(--ink); line-height:1.1; overflow-wrap:anywhere; }

.toolbar{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.field-wrap{ margin-bottom:14px; }
label.field{ display:block; font-size:11px; color:var(--ink-faint); margin-bottom:3px; font-weight:600; letter-spacing:0.02em; }
label.field .req{ color:var(--gold); font-weight:700; }
.field-hint{ font-size:11px; color:var(--ink-faint); margin-top:4px; }
.err{ color:var(--red); font-size:11px; margin-top:3px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="url"], input[type="tel"], input[type="search"], input[type="date"],
select, textarea{
  background:#fff;
  border:1.5px solid rgba(23,33,27,0.4);
  color:var(--ink);
  border-radius:8px;
  padding:10px 12px;
  font-size:14px;
  width:100%;
  transition:border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover{ border-color:rgba(23,33,27,0.6); }
input::placeholder, select::placeholder, textarea::placeholder{ color:var(--ink-faint); }
input[type="number"]{ text-align:right; font-family:var(--mono); font-variant-numeric:tabular-nums; }
input:focus, select:focus, textarea:focus{ outline:none; border-color:var(--gold-dim); box-shadow:0 0 0 3px rgba(232,93,42,0.18); background:#fffdf8; }
input.invalid{ border-color:var(--red); }
input[type="checkbox"], input[type="radio"]{ width:auto; accent-color:var(--gold); }

/* select chevron */
.select-wrap{ position:relative; }
.select-wrap select{ appearance:none; -webkit-appearance:none; padding-right:30px; }
.select-wrap .sep{ position:absolute; right:10px; top:50%; transform:translateY(-50%); pointer-events:none; color:var(--ink-faint); width:14px; height:14px; }

/* password show/hide toggle */
.pass-wrap{ position:relative; }
.pass-wrap input{ padding-right:42px; }
.pass-toggle{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  display:flex; align-items:center; justify-content:center;
  width:30px; height:30px; border:none; background:transparent; border-radius:7px;
  color:var(--ink-faint); cursor:pointer; transition:background .12s, color .12s;
}
.pass-toggle:hover{ background:var(--line-soft); color:var(--ink); }
.pass-toggle svg{ width:17px; height:17px; }
.pass-toggle .eye-off{ display:none; }
.pass-toggle.show .eye-on{ display:none; }
.pass-toggle.show .eye-off{ display:block; }

/* password strength meter */
.strength{ margin-top:7px; }
.strength-bar{ display:flex; gap:4px; }
.strength-bar i{ height:4px; flex:1; border-radius:2px; background:var(--line-soft); transition:background .12s; }
.strength.s1 .strength-bar i.on{ background:var(--red); }
.strength.s2 .strength-bar i.on{ background:var(--amber); }
.strength.s3 .strength-bar i.on{ background:var(--teal); }
.strength.s4 .strength-bar i.on{ background:var(--green); }
.strength-label{ display:block; margin-top:4px; font-size:10.5px; font-weight:600; letter-spacing:0.02em; }
.strength.s1 .strength-label{ color:var(--red); }
.strength.s2 .strength-label{ color:var(--amber); }
.strength.s3 .strength-label{ color:var(--teal); }
.strength.s4 .strength-label{ color:var(--green); }

/* combobox (typable dropdown, Alpine) */
.combo{ position:relative; }
.combo field{ position:absolute; right:4px; top:50%; transform:translateY(-50%); border-radius:7px; display:flex; align-items:center; justify-content:center; width:26px; height:26px; color:var(--ink-faint); cursor:pointer; transition:background .12s, color .12s, transform .15s var(--ease); }
.combo field:hover{ background:var(--line-soft); color:var(--ink); }
.combo field.open{ transform:translateY(-50%) rotate(180deg); color:var(--gold); }
.combo input{ padding-right:36px; }
.combo-menu{ position:absolute; z-index:40; top:calc(100% + 4px); left:0; right:0; background:var(--panel); border:1px solid var(--line); border-radius:var(--radius-s); box-shadow:var(--shadow-2); max-height:240px; overflow-y:auto; padding:4px; }
.combo-item{ display:flex; align-items:center; gap:8px; width:100%; text-align:left; padding:7px 9px; border-radius:5px; font-size:13px; color:var(--ink-dim); cursor:pointer; transition:background .1s, color .1s; }
.combo-item:hover{ background:var(--panel-2); color:var(--ink); }
.combo-item.active{ background:var(--brand-soft); color:var(--gold-dim); font-weight:600; }

/* key/lock chip rows (credentials) */
.key-row{ display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.key-row .key{ flex:1; }
.key-lock{
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px dashed var(--line);
  border-radius:var(--radius-s);
  background:var(--panel-2);
  color:var(--ink-dim);
  font-family:var(--mono);
  font-size:12px;
}
.key-row .rm{ flex-shrink:0; width:30px; height:30px; display:flex; align-items:center; justify-content:center; border:1px solid var(--line); border-radius:var(--radius-s); color:var(--red); cursor:pointer; transition:background .12s, border-color .12s; }
.key-row .rm:hover{ background:rgba(201,75,75,0.08); border-color:var(--red); }
.key-row .lock{ flex-shrink:0; width:30px; height:30px; display:flex; align-items:center; justify-content:center; color:var(--ink-faint); }
.add-field{
  display:inline-flex; align-items:center; gap:6px;
  margin-top:2px; padding:5px 10px; border:1px dashed var(--line);
  border-radius:var(--radius-s); font-size:12px; font-weight:600; color:var(--ink-dim);
  cursor:pointer; transition:border-color .12s, color .12s, background .12s;
}
.add-field:hover{ border-color:var(--gold-dim); color:var(--gold); background:var(--brand-soft); }

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
.table-wrap{ overflow-x:auto; border:1px solid var(--line); border-radius:var(--radius-m); background:var(--panel); }
.table-wrap table{ width:100%; font-size:12.5px; }
.table-wrap th{
  text-align:left;
  color:var(--ink-faint);
  font-weight:600;
  font-size:10.5px;
  text-transform:uppercase;
  letter-spacing:0.05em;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
  background:var(--panel-2);
}
.table-wrap td{ padding:10px 12px; border-bottom:1px solid var(--line-soft); vertical-align:middle; }
.table-wrap tbody tr:last-child td{ border-bottom:none; }
.table-wrap tbody tr:hover td{ background:rgba(23,33,27,0.02); }
.table-wrap td.num, .table-wrap th.num{ text-align:right; }
.table-wrap .row-actions{ display:flex; gap:6px; justify-content:flex-end; align-items:center; }

/* ---------------------------------------------------------------
   Tags & badges
   --------------------------------------------------------------- */
.tag, .badge{
  display:inline-block;
  padding:2px 8px;
  border-radius:20px;
  font-size:10.5px;
  font-weight:600;
  white-space:nowrap;
}
.tag.healthy, .badge.ok{ background:rgba(15,118,110,0.12); color:var(--green); }
.tag.good{ background:rgba(22,135,126,0.12); color:var(--teal); }
.tag.low{ background:rgba(217,139,32,0.14); color:var(--amber); }
.tag.warn, .badge.warn{ background:rgba(201,75,75,0.12); color:var(--red); }
.tag.loss{ background:rgba(201,75,75,0.2); color:var(--red); }
.badge.mute{ background:var(--panel-2); color:var(--ink-dim); }
.badge.gold{ background:var(--brand-soft); color:var(--gold-dim); }
.badge.teal{ background:var(--teal-soft); color:var(--teal); }
.badge.bad{ background:rgba(201,75,75,0.12); color:var(--red); }
.badge.amber{ background:rgba(217,139,32,0.14); color:var(--amber); }

.badge-provider{ font-size:10px; padding:2px 7px; border-radius:5px; background:var(--line-soft); color:var(--ink-dim); }

.rank-pill{ display:inline-flex; width:20px; height:20px; align-items:center; justify-content:center; border-radius:50%; background:var(--panel-2); color:var(--ink-dim); font-size:11px; font-weight:600; margin-left:8px; }
.rank-pill--lead{ background:var(--brand-soft); color:var(--gold-dim); }

/* ---------------------------------------------------------------
   Chips
   --------------------------------------------------------------- */
.chip-row{ display:flex; gap:6px; flex-wrap:wrap; }
.chip{
  padding:3px 9px;
  border-radius:20px;
  font-size:11px;
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--ink-dim);
  cursor:pointer;
  transition:background .12s, color .12s, border-color .12s;
  display:inline-flex; align-items:center; gap:5px;
}
.chip:hover{ border-color:var(--gold-dim); color:var(--gold); }
.chip.active{ background:var(--gold); color:#fff; border-color:var(--gold); }
.chip.mute{ background:var(--panel-2); border-color:var(--line-soft); cursor:default; }

/* ---------------------------------------------------------------
   Alerts / flash / errors
   --------------------------------------------------------------- */
.alert{ padding:10px 14px; border-radius:8px; font-size:12.5px; margin-bottom:10px; border:1px solid; }
.alert.ok{ border-color:rgba(15,118,110,0.35); background:rgba(15,118,110,0.07); color:var(--green); }
.alert.warn{ border-color:rgba(217,139,32,0.35); background:rgba(217,139,32,0.08); color:var(--amber); }
.alert.bad{ border-color:rgba(201,75,75,0.35); background:rgba(201,75,75,0.08); color:var(--red); }

.flash-err{ padding:12px 16px; border:1px solid rgba(201,75,75,0.35); background:rgba(201,75,75,0.07); color:var(--red); border-radius:8px; font-size:13px; margin-bottom:16px; }
.flash-err ul{ list-style:disc; padding-left:18px; margin-top:6px; }
.flash-err li{ margin:2px 0; }

/* toast stack (flash) */
.toast-stack{
  position:fixed; top:0; left:0; right:0; z-index:60;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:16px; pointer-events:none;
}
.toast{
  pointer-events:auto;
  display:flex; align-items:flex-start; gap:10px;
  width:100%; max-width:440px;
  padding:12px 16px; border-radius:var(--radius-m); font-size:13px; font-weight:500;
  border:1px solid; box-shadow:var(--shadow-2); background:var(--panel);
}
.toast.ok{ border-color:rgba(15,118,110,0.35); color:var(--green); }
.toast.warn{ border-color:rgba(217,139,32,0.35); color:var(--amber); }
.toast.bad{ border-color:rgba(201,75,75,0.35); color:var(--red); }
.toast .t-ico{ width:16px; height:16px; flex-shrink:0; margin-top:1px; }
.toast .t-x{ color:var(--ink-faint); }

/* ---------------------------------------------------------------
   Dropdown menus (Alpine)
   --------------------------------------------------------------- */
.dropdown{ position:relative; }
.menu{
  position:absolute;
  z-index:40;
  min-width:200px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius-s);
  box-shadow:var(--shadow-2);
  overflow:hidden;
}
.menu.up{ bottom:calc(100% + 6px); }
.menu.down{ top:calc(100% + 6px); }
.menu-head{ padding:10px 14px; border-bottom:1px solid var(--line-soft); background:var(--panel-2); }
.menu-item{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:9px 14px; font-size:13px; color:var(--ink-dim); transition:background .1s, color .1s; }
.menu-item:hover{ background:var(--panel-2); color:var(--ink); }
.menu-item.active{ background:var(--brand-soft); color:var(--gold-dim); font-weight:600; }
.menu-item .ico{ width:16px; text-align:center; flex-shrink:0; color:var(--ink-faint); }
.menu-divider{ border:none; border-top:1px solid var(--line-soft); margin:4px 0; }

/* ---------------------------------------------------------------
   Modals
   --------------------------------------------------------------- */
.modal-backdrop{
  position:fixed; inset:0; z-index:50;
  display:flex; align-items:center; justify-content:center; padding:16px;
  background:rgba(23,33,27,0.55);
  backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px);
}
.modal{
  width:100%; max-width:520px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius-l);
  box-shadow:var(--shadow-2);
  overflow:hidden;
  max-height:90vh;
  display:flex; flex-direction:column;
}
.modal-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px 22px; border-bottom:1px solid var(--line-soft); }
.modal-title{ font-size:17px; }
.modal-body{ padding:20px 22px; overflow-y:auto; }
.modal-foot{ display:flex; justify-content:flex-end; gap:10px; padding:14px 22px; border-top:1px solid var(--line-soft); background:var(--panel-2); }
.modal-x{ width:28px; height:28px; display:flex; align-items:center; justify-content:center; border-radius:7px; color:var(--ink-faint); cursor:pointer; transition:background .12s, color .12s; }
.modal-x:hover{ background:var(--line-soft); color:var(--ink); }

/* ---------------------------------------------------------------
   Sidebar user + avatars
   --------------------------------------------------------------- */
.avatar{
  flex:0 0 32px; width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-weight:700; font-size:12px; font-family:var(--mono);
  background:linear-gradient(135deg, var(--gold), var(--green));
}
.avatar.sm{ flex-basis:26px; width:26px; height:26px; font-size:10px; }
.user-chip{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:8px 10px; border-radius:8px; text-align:left;
  color:var(--ink); transition:background .12s;
}
.user-chip:hover{ background:var(--line-soft); }
.user-chip .meta{ min-width:0; flex:1; }
.user-chip .name{ display:block; font-size:13px; font-weight:600; }
.user-chip .sub{ display:block; font-size:11px; color:var(--ink-faint); }
.user-chip .caret{ color:var(--ink-faint); transition:transform .15s var(--ease); }
.user-chip.open .caret{ transform:rotate(180deg); }

/* breadcrumb-ish topbar switcher */
.switch-chip{
  display:inline-flex; align-items:center; gap:8px;
  border:1px solid var(--line); border-radius:8px;
  padding:4px 8px 4px 4px; background:var(--panel);
  color:var(--ink); font-size:13px; font-weight:600;
  transition:border-color .12s, box-shadow .12s;
}
.switch-chip:hover{ border-color:var(--gold-dim); box-shadow:var(--shadow-1); }
.switch-chip .caret{ color:var(--ink-faint); transition:transform .15s var(--ease); }
.switch-chip.open .caret{ transform:rotate(180deg); }

/* ---------------------------------------------------------------
   Logo / brand mark
   --------------------------------------------------------------- */
.logo-mark{
  width:34px; height:34px; flex-shrink:0;
  border-radius:8px;
  display:flex; align-items:center; justify-content:center;
  background:#fff;
  border:1px solid var(--line-soft);
  color:var(--green); font-weight:800; font-size:15px; font-family:var(--serif);
  overflow:hidden;
}
.logo-mark img{ width:100%; height:100%; object-fit:contain; }

/* ---------------------------------------------------------------
   Pagination
   --------------------------------------------------------------- */
.pagination, nav[role="navigation"]{ margin-top:20px; display:flex; gap:6px; flex-wrap:wrap; }
.pagination a, .pagination span{
  min-width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center;
  padding:0 8px; border:1px solid var(--line); border-radius:var(--radius-s);
  font-size:12px; color:var(--ink-dim); transition:border-color .12s, color .12s;
}
.pagination a:hover{ border-color:var(--gold-dim); color:var(--gold); }
.pagination .active span{ background:var(--gold); color:#fff; border-color:var(--gold); font-weight:600; }
.pagination .disabled span{ color:var(--ink-faint); pointer-events:none; }

/* ---------------------------------------------------------------
   Print
   --------------------------------------------------------------- */
@media print{
  .sidebar, .topbar, .toolbar, .no-print{ display:none !important; }
  body{ background:#fff; color:#000; }
  .content{ padding:0; max-width:none; }
  .card, .kpi, .table-wrap{ border-color:#ccc !important; background:#fff !important; }
  .num{ color:#000 !important; }
}

/* ---------------------------------------------------------------
   Component: file input (shared with file-input.blade.php)
   --------------------------------------------------------------- */
.ar-file{ position:relative; }
.ar-file-label{ display:block; margin-bottom:6px; font-size:12px; font-weight:600; color:var(--ink-dim); }
.ar-file-zone{ position:relative; border:2px dashed var(--line); border-radius:12px; background:rgba(23,33,27,0.035); transition:border-color .15s, background-color .15s, box-shadow .15s; }
.ar-file-zone:hover, .ar-file-zone.is-drag{ border-color:var(--green); background:var(--teal-soft); }
.ar-file:focus-within .ar-file-zone{ border-color:var(--green); box-shadow:0 0 0 3px rgba(15,118,110,0.16); }
.ar-file-zone-inner{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-height:92px; padding:20px 16px; text-align:center; cursor:pointer; }
.ar-file-input{ position:absolute; inset:0; z-index:1; width:100%; height:100%; opacity:0; cursor:pointer; }
.ar-file-idle, .ar-file-picked{ display:flex; flex-direction:column; align-items:center; }
.ar-file-ico{ width:28px; height:28px; color:var(--green); transition:transform .15s; }
.ar-file-zone:hover .ar-file-ico{ transform:translateY(-2px); }
.ar-file-zone-title{ margin-top:6px; display:block; max-width:260px; font-size:14px; font-weight:600; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ar-file-zone-title-truncate{ font-family:var(--mono); font-size:12.5px; }
.ar-file-zone-sub{ display:block; font-size:12px; color:var(--ink-faint); }
.ar-file-preview{ width:48px; height:48px; border-radius:8px; object-fit:cover; border:1px solid var(--line-soft); background:#fff; box-shadow:var(--shadow-1); }
.ar-file-doc{ width:24px; height:24px; color:var(--ink-faint); }
.ar-file-replace{ display:block; margin-top:2px; font-size:12px; font-weight:600; color:var(--green); }
.ar-file-actions{ display:flex; justify-content:flex-end; margin-top:6px; }
.ar-file-actions button{ display:inline-flex; align-items:center; gap:4px; padding:0; background:transparent; font-size:12px; font-weight:600; color:var(--red); cursor:pointer; }
.ar-file-actions button:hover{ text-decoration:underline; }
.ar-file-x{ width:14px; height:14px; }
.ar-file-current{ display:flex; align-items:center; gap:12px; margin-top:8px; padding:8px 12px; background:var(--panel); border:1px solid var(--line-soft); border-radius:8px; }
.ar-file-current > img{ width:40px; height:40px; border-radius:8px; object-fit:cover; border:1px solid var(--line-soft); flex-shrink:0; }
.ar-file-current-box{ min-width:0; flex:1; }
.ar-file-current-name{ font-size:14px; font-weight:600; color:var(--ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ar-file-remove-check{ display:inline-flex; align-items:center; gap:6px; margin-top:2px; font-size:12px; color:var(--red); cursor:pointer; }
.ar-file-remove-check input{ width:14px; height:14px; accent-color:#b91c1c; }
.ar-file-hint{ margin-top:4px; font-size:12px; color:var(--ink-faint); }
.ar-file-error{ margin-top:4px; font-size:12px; color:var(--red); }

/* ---------------------------------------------------------------
   Sidebar scrollbars
   --------------------------------------------------------------- */
.sidebar-nav{ scrollbar-width:thin; scrollbar-color:transparent transparent; }
.sidebar-nav:hover{ scrollbar-color:rgba(100,116,139,0.35) transparent; }
.sidebar-nav::-webkit-scrollbar{ width:6px; height:6px; }
.sidebar-nav::-webkit-scrollbar-track{ background:transparent; }
.sidebar-nav::-webkit-scrollbar-thumb{ background-color:transparent; border-radius:9999px; }
.sidebar-nav:hover::-webkit-scrollbar-thumb{ background-color:rgba(100,116,139,0.35); }

/* roll/chevron micro-utilities used by Alpine bindings */
.rotate-180{ transform:rotate(180deg); }
.transition{ transition:color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }