/* ==========================================================================
   Procodify — design system
   Calm Linear/Notion surfaces + colorful accents on data.
   ========================================================================== */

:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: #f7f7f8;
  --bg-sidebar: #fbfbfc;
  --surface: #ffffff;
  --surface-2: #f3f3f5;
  --surface-3: #eaeaee;
  --border: #e6e6ea;
  --border-strong: #d4d4da;
  --text: #17171c;
  --text-2: #55555f;
  --text-3: #8b8b96;
  --accent: #1281c2;
  --accent-hover: #0e6fae;
  --accent-soft: #e4f3fb;
  --accent-text: #ffffff;
  --ring: rgba(24, 144, 210, .32);
  --shadow-sm: 0 1px 2px rgba(16, 16, 24, .05);
  --shadow: 0 1px 3px rgba(16, 16, 24, .06), 0 6px 16px -6px rgba(16, 16, 24, .08);
  --shadow-lg: 0 24px 60px -12px rgba(16, 16, 24, .25), 0 0 0 1px rgba(16, 16, 24, .06);
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --sidebar-w: 236px;

  /* tones: bg / fg */
  --t-gray-bg: #f0f0f3;   --t-gray-fg: #5c5c66;
  --t-blue-bg: #e7f0ff;   --t-blue-fg: #1d5bd8;
  --t-green-bg: #e3f7ea;  --t-green-fg: #16803c;
  --t-amber-bg: #fff3dc;  --t-amber-fg: #a35a00;
  --t-red-bg: #ffe8e8;    --t-red-fg: #c62828;
  --t-violet-bg: #f0eaff; --t-violet-fg: #6b3fd4;
  --t-teal-bg: #ddf6f3;   --t-teal-fg: #0f766e;
  color-scheme: light;
}

/* theme.js always sets data-theme (stored choice, else system preference) before first paint */
:root[data-theme="dark"] {
  --bg: #0f0f12;
  --bg-sidebar: #131317;
  --surface: #18181d;
  --surface-2: #1f1f25;
  --surface-3: #2a2a31;
  --border: #2a2a31;
  --border-strong: #3a3a43;
  --text: #ececf1;
  --text-2: #a8a8b3;
  --text-3: #72727e;
  --accent: #2fa3dc;
  --accent-hover: #45b1e6;
  --accent-soft: #0f2c40;
  --ring: rgba(47, 163, 220, .45);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 8px 20px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
  --t-gray-bg: #26262d;   --t-gray-fg: #b4b4be;
  --t-blue-bg: #14264a;   --t-blue-fg: #8ab4ff;
  --t-green-bg: #12301f;  --t-green-fg: #6fdc95;
  --t-amber-bg: #3a2a0c;  --t-amber-fg: #ffc061;
  --t-red-bg: #3d1517;    --t-red-fg: #ff8a8a;
  --t-violet-bg: #2a1d4d; --t-violet-fg: #bba2ff;
  --t-teal-bg: #0f322f;   --t-teal-fg: #5fd8c9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.icon { flex: none; display: block; }
[x-cloak] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus:not(:focus-visible) { outline: none; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  overflow-y: auto;
}
/* Sidebar: calm light surface, brand blue only where it means something */
.sidebar {
  background:
    radial-gradient(140% 220px at 0% 0%, color-mix(in srgb, #29abe1 13%, transparent), transparent 70%),
    radial-gradient(120% 180px at 100% 100%, color-mix(in srgb, #f7921e 9%, transparent), transparent 70%),
    var(--bg-sidebar);
}
.sidebar .brand { padding: 6px 8px 18px; font-size: 15.5px; letter-spacing: -.01em; }
.sidebar .nav { display: grid; gap: 1px; }
.sidebar .nav a { position: relative; }
.sidebar .nav a .icon { color: var(--text-3); transition: color .12s; }
.sidebar .nav a:hover .icon { color: var(--text-2); }
.sidebar .nav a.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .nav a.active .icon { color: var(--accent); }
.sidebar .nav a.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 3px 3px 0; background: linear-gradient(180deg, #29abe1, var(--accent));
}
.sidebar .nav .count { min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 11px; font-weight: 600; line-height: 18px; background: var(--accent-soft); color: var(--accent); }
.sidebar .nav-label { color: var(--text-3); }
.sidebar-foot .btn-sm.btn-icon { color: var(--text-3); width: 26px; }
.sidebar-foot > a.row { gap: 8px; }
.sidebar-foot .btn-icon:hover { color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 15px; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-3); font: inherit; cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger kbd { margin-left: auto; }
kbd {
  font: 11px var(--mono); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3);
}
.nav-label { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.active .icon { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: 7px 4px 7px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 2px; }
.sidebar-foot .who { min-width: 0; flex: 1; line-height: 1.25; }
.sidebar-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { font-size: 11.5px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13.5px; min-width: 0; }
.crumbs a:hover { color: var(--text); }
.crumbs b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px 64px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--ring); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--t-red-fg); }
.btn-danger:hover { background: var(--t-red-bg); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 28px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }
.empty { padding: 36px 18px; text-align: center; color: var(--text-3); }
.empty .icon { margin: 0 auto 10px; opacity: .6; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; }

/* ---------- KPI tiles (the colorful part) ---------- */
/* Dashboard welcome banner — same brand canvas as the login hero */
.page-head.welcome {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 24px 26px; border-radius: var(--radius-lg); color: #fff;
  background:
    radial-gradient(55% 120% at 100% 100%, rgba(247, 146, 30, .4), transparent 70%),
    linear-gradient(155deg, #0e6fae 0%, #1890d2 50%, #29abe1 100%);
  box-shadow: 0 12px 30px -16px rgba(14, 111, 174, .7);
}
.page-head.welcome::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000);
          mask-image: linear-gradient(90deg, transparent 20%, #000);
}
.page-head.welcome h1 { color: #fff; }
.page-head.welcome p { color: rgba(255, 255, 255, .82); }
.page-head.welcome .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .25); color: #fff; box-shadow: none; backdrop-filter: blur(6px); }
.page-head.welcome .btn:hover { background: rgba(255, 255, 255, .24); }
.page-head.welcome kbd { background: rgba(255, 255, 255, .18); color: #fff; border-color: transparent; }

.kpi {
  position: relative; overflow: hidden;
  padding: 16px 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, var(--kpi-glow, transparent) 0%, transparent 55%);
  opacity: .9; pointer-events: none;
}
.kpi > * { position: relative; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--kpi-bg); color: var(--kpi-fg); }
.kpi-label { margin-top: 12px; color: var(--text-2); font-size: 13px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.kpi[data-tone="blue"]   { --kpi-bg: var(--t-blue-bg);   --kpi-fg: var(--t-blue-fg);   --kpi-glow: color-mix(in srgb, var(--t-blue-fg) 14%, transparent); }
.kpi[data-tone="green"]  { --kpi-bg: var(--t-green-bg);  --kpi-fg: var(--t-green-fg);  --kpi-glow: color-mix(in srgb, var(--t-green-fg) 14%, transparent); }
.kpi[data-tone="amber"]  { --kpi-bg: var(--t-amber-bg);  --kpi-fg: var(--t-amber-fg);  --kpi-glow: color-mix(in srgb, var(--t-amber-fg) 14%, transparent); }
.kpi[data-tone="red"]    { --kpi-bg: var(--t-red-bg);    --kpi-fg: var(--t-red-fg);    --kpi-glow: color-mix(in srgb, var(--t-red-fg) 14%, transparent); }
.kpi[data-tone="violet"] { --kpi-bg: var(--t-violet-bg); --kpi-fg: var(--t-violet-fg); --kpi-glow: color-mix(in srgb, var(--t-violet-fg) 14%, transparent); }
.kpi[data-tone="teal"]   { --kpi-bg: var(--t-teal-bg);   --kpi-fg: var(--t-teal-fg);   --kpi-glow: color-mix(in srgb, var(--t-teal-fg) 14%, transparent); }

/* Reorderable card grids */
[data-reorder] > [data-id] { cursor: grab; user-select: none; -webkit-user-drag: none; }
[data-reorder] > [data-id]:active { cursor: grabbing; }
[data-reorder].is-reordering > [data-id] { transition: transform .18s; }
[data-reorder] .sortable-ghost { opacity: .25; outline: 2px dashed var(--accent); outline-offset: -2px; }
[data-reorder] .sortable-chosen { box-shadow: var(--shadow); }
/* Drag hint icon */
.drag-handle { margin-left: auto; padding: 4px; border-radius: 6px; color: var(--text-3); cursor: grab; opacity: .55; transition: opacity .12s, background .12s; }
.kpi:hover .drag-handle { opacity: 1; }
.drag-handle:hover { background: var(--surface-2); color: var(--text); }

/* ---------- Badges, avatars, dots ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--b-bg); color: var(--b-fg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.badge-gray { --b-bg: var(--t-gray-bg); --b-fg: var(--t-gray-fg); }
.badge-blue { --b-bg: var(--t-blue-bg); --b-fg: var(--t-blue-fg); }
.badge-green { --b-bg: var(--t-green-bg); --b-fg: var(--t-green-fg); }
.badge-amber { --b-bg: var(--t-amber-bg); --b-fg: var(--t-amber-fg); }
.badge-red { --b-bg: var(--t-red-bg); --b-fg: var(--t-red-fg); }
.badge-violet { --b-bg: var(--t-violet-bg); --b-fg: var(--t-violet-fg); }
.badge-teal { --b-bg: var(--t-teal-bg); --b-fg: var(--t-teal-fg); }

.avatar {
  --c: #6366f1;
  display: inline-grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
  color: color-mix(in srgb, var(--c) 85%, var(--text));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
}
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar-empty { --c: #9ca3af; border-style: dashed; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar:first-child { margin-left: 0; }
.swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--accent)); flex: none; }
.org-mark {
  --c: #0ea5e9;
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: color-mix(in srgb, var(--c) 16%, var(--surface));
  color: color-mix(in srgb, var(--c) 80%, var(--text));
}
.org-mark.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3);
  padding: 9px 14px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-main { font-weight: 550; }
.table .cell-main:hover { color: var(--accent); }
.row-link { cursor: pointer; }

/* Spreadsheet-like checklist grid */
.sheet th.check-col, .sheet td.check-col { text-align: center; padding: 6px 4px; width: 1%; }
.sheet th.check-col { writing-mode: vertical-rl; transform: rotate(180deg); height: 110px; font-weight: 600; padding: 8px 4px; }
.sheet td.sticky, .sheet th.sticky { position: sticky; left: 0; background: var(--surface); z-index: 2; }
.sheet tbody tr:hover td.sticky { background: var(--surface-2); }
.check-cell {
  width: 28px; height: 28px; margin: 0 auto; border-radius: 7px;
  display: grid; place-items: center; cursor: pointer; border: 1px dashed var(--border-strong);
  background: transparent; color: var(--text-3); transition: transform .08s, background .12s;
}
.check-cell:hover { transform: scale(1.08); }
.check-cell.yes { background: var(--t-green-bg); color: var(--t-green-fg); border: 1px solid transparent; }
.check-cell.no { background: var(--t-red-bg); color: var(--t-red-fg); border: 1px solid transparent; }
.check-cell { position: relative; }
.check-cell.auto::after { content: ""; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #29abe1); }
.progress.green > span { background: linear-gradient(90deg, #22c55e, #16a34a); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field label, .label { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 5px; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 14px var(--font);
  transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8b96' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select[multiple] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
.input-sm { height: 30px; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field .error { font-size: 12px; color: var(--t-red-fg); margin-top: 4px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--t-red-fg); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.color-input { width: 36px; height: 36px; padding: 2px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.pick-list { display: grid; gap: 6px; max-height: 300px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.pick-list label:hover { background: var(--surface-2); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .input, .filters .select { width: auto; min-width: 150px; height: 32px; font-size: 13px; }

fieldset.brand-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; }
fieldset.brand-fieldset legend { display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* ---------- Tabs & segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 7px; padding: 9px 12px; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11.5px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-3); }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--border); }
.segmented a { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 550; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-3); font-size: 12.5px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-item:last-child { padding-bottom: 0; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-weight: 600; font-size: 13px; }
.column-head .count { color: var(--text-3); font-weight: 500; }
.column-head .add { margin-left: auto; }
.column-body { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; overflow-y: auto; }
.task-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; user-select: none;
  transition: box-shadow .12s, border-color .12s, transform .12s;
  border-left: 3px solid var(--pri, transparent);
}
.task-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.task-card .t-title { font-weight: 550; font-size: 13.5px; line-height: 1.4; }
.task-card .t-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.task-card .t-foot .avatar { margin-left: auto; }
.task-card.pri-urgent { --pri: var(--t-red-fg); }
.task-card.pri-high { --pri: var(--t-amber-fg); }
.task-card.is-done .t-title { color: var(--text-3); text-decoration: line-through; }
.sortable-ghost { opacity: .35; }
.sortable-drag { transform: rotate(2deg); box-shadow: var(--shadow-lg) !important; }
.due-late { color: var(--t-red-fg) !important; font-weight: 600; }
.due-soon { color: var(--t-amber-fg) !important; }

/* ---------- Modal (native dialog) ---------- */
.task-detail { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
@media (max-width: 760px) { .task-detail { grid-template-columns: 1fr; } }
dialog.modal {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  overflow: auto;
}
dialog.modal.wide { width: min(920px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(10, 10, 16, .45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-body { padding: 20px; }

/* ---------- Command palette ---------- */
.palette-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(10, 10, 16, .4); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(620px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; font: 16px var(--font); color: var(--text); }
.palette-results { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.palette-item .sub { margin-left: auto; font-size: 12px; color: var(--text-3); }
.palette-item.active { background: var(--accent-soft); color: var(--text); }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }

/* ---------- Notifications ---------- */
.notif-wrap { position: relative; }
.bell { position: relative; }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-dropdown { position: absolute; right: 0; top: 42px; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 40; }
.notif-head, .notif-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.notif-head { border-bottom: 1px solid var(--border); }
.notif-foot { border-top: 1px solid var(--border); justify-content: center; gap: 6px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); position: relative; }
.notif:last-child { border-bottom: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
.notif.unread::after { content: ""; position: absolute; right: 14px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notif-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-2); }
.notif-title { display: block; font-weight: 550; font-size: 13.5px; padding-right: 14px; }
.notif-body { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.notif-time { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

/* Toggle switch (checkbox) */
input.switch { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(16px); }

/* Vault */
.vault-fields { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.vault-fields .vf { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.vault-fields code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }

/* Member picker with vault question */
.member-pick { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 7px 8px; border-radius: 8px; }
.member-pick:hover { background: var(--surface-2); }
.member-pick .vault-q { grid-column: 2; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); padding: 4px 0 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px;
  padding: 11px 14px; border-radius: var(--radius); background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .2s ease-out;
}
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; }
.toast.error .dot { background: #ef4444; }
.toast.warning .dot { background: #f59e0b; }

/* Running timer pill */
.timer-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--t-red-bg); color: var(--t-red-fg); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-pill .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* HTMX progress bar */
.htmx-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 300; background: linear-gradient(90deg, var(--accent), #29abe1, #f7921e); transition: width .3s ease, opacity .3s; opacity: 0; }
.htmx-bar.on { opacity: 1; width: 70%; transition: width 2s cubic-bezier(.1, .7, .2, 1); }

/* ---------- Auth ---------- */
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--t-red-bg); color: var(--t-red-fg); }
.auth-form .alert { display: flex; align-items: flex-start; gap: 8px; }
.auth-form .alert > .icon { margin-top: 1px; }
.alert.info { background: var(--t-blue-bg); color: var(--t-blue-fg); }
.alert.success { background: var(--t-green-bg); color: var(--t-green-fg); }
.alert.warning { background: var(--t-amber-bg); color: var(--t-amber-fg); }

.auth-body { background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* Left: brand panel (logo blue + orange) with a product preview */
.auth-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 28px;
  padding: 40px 52px 0; margin: 12px; border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(70% 55% at 100% 100%, rgba(247, 146, 30, .45), transparent 70%),
    radial-gradient(60% 50% at 0% 0%, rgba(255, 255, 255, .16), transparent 70%),
    linear-gradient(155deg, #0e6fae 0%, #1890d2 45%, #29abe1 100%);
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
          mask-image: linear-gradient(180deg, #000, transparent 75%);
}
.hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.hero-brand .brand-logo { background: #fff; padding: 4px; border-radius: 9px; }
.hero-copy { max-width: 500px; margin-top: 28px; }
.hero-copy h2 { font-size: clamp(30px, 3vw, 42px); line-height: 1.1; font-weight: 750; letter-spacing: -.03em; }
.hero-copy p { margin-top: 14px; font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,.85); }

.hero-shot {
  flex: 1; min-height: 300px; margin-top: 8px;
  background: #f7f8fa; color: #1f2430;
  border-radius: 14px 14px 0 0; border: 1px solid rgba(255,255,255,.5); border-bottom: 0;
  box-shadow: 0 30px 70px -20px rgba(4, 40, 70, .55);
  overflow: hidden;
}
.shot-bar { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; background: #fff; border-bottom: 1px solid #e8e9ee; font-size: 12px; font-weight: 600; color: #6b7080; }
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: #e3e4ea; }
.shot-bar i:nth-child(1) { background: #ff5f57; } .shot-bar i:nth-child(2) { background: #febc2e; } .shot-bar i:nth-child(3) { background: #28c840; }
.shot-bar span { margin-left: 10px; }
.shot-board { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: 14px; padding: 16px; }
.shot-col-head { display: flex; align-items: center; gap: 7px; margin: 0 2px 10px; font-size: 12px; font-weight: 650; color: #3d4250; }
.shot-col-head em { font-style: normal; font-weight: 600; color: #9a9eab; }
.sd { width: 8px; height: 8px; border-radius: 50%; }
.sd.gray { background: #a1a5b2; } .sd.blue { background: #29abe1; } .sd.green { background: #22c55e; }
.shot-card { background: #fff; border: 1px solid #e8e9ee; border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(16,16,24,.04); }
.shot-card b { display: block; margin: 7px 0 9px; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.shot-card.done b { color: #8a8f9c; text-decoration: line-through; text-decoration-color: #c9ccd4; }
.shot-card .tag { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; }
.tag.orange { background: #fff1e0; color: #c26a05; } .tag.blue { background: #e3f3fb; color: #1479b0; }
.tag.teal { background: #ddf6f3; color: #0f766e; } .tag.violet { background: #f0eaff; color: #6b3fd4; }
.tag.green { background: #e3f7ea; color: #16803c; } .tag.gray { background: #f0f0f3; color: #5c5c66; }
.shot-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #8a8f9c; }
.shot-card .av { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; color: #fff; background: var(--c); }
.shot-card .ok { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: #e3f7ea; color: #16803c; }
.progress-mini { height: 4px; border-radius: 999px; background: #eceef2; margin-bottom: 9px; overflow: hidden; }
.progress-mini span { display: block; height: 100%; border-radius: inherit; background: #29abe1; }
@media (max-width: 1240px) {
  .shot-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-col:nth-child(3) { display: none; }
}

/* Right: form */
.auth-main { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 28px; overflow: hidden; }
.auth-theme { position: absolute; top: 18px; right: 18px; }
:root[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }
.auth-panel { width: min(380px, 100%); margin: auto 0; animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin-bottom: 28px; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.auth-head p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.auth-head p b { color: var(--text); font-weight: 600; }
.auth-badge {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 14px;
  color: #fff; background: linear-gradient(155deg, #1890d2, #29abe1);
  box-shadow: 0 10px 24px -10px rgba(24, 144, 210, .7);
}
.auth-form { gap: 16px; }
.auth-form .input { height: 46px; border-radius: 11px; font-size: 14.5px; background: var(--surface); }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; transition: color .15s; }
.input-icon .input { padding-left: 42px; }
.input-icon:focus-within > .icon { color: var(--accent); }
.input-icon .reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; }
.input-icon .reveal:hover { color: var(--text); background: var(--surface-2); }
.input-icon:has(.reveal) .input { padding-right: 44px; }
.reveal .when-shown, .reveal.shown .when-hidden { display: none; }
.reveal.shown .when-shown { display: block; }
.btn-auth {
  position: relative; height: 46px; width: 100%; justify-content: center; gap: 8px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.btn-auth.btn-primary {
  border: 0; color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px -10px rgba(24, 144, 210, .8), inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-auth.btn-primary:hover { background: var(--accent-hover); }
.btn-auth .icon { transition: transform .2s; }
.btn-auth:hover .icon:last-child { transform: translateX(3px); }
.btn-auth.loading { pointer-events: none; color: transparent; }
.btn-auth.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-secondary { display: flex; align-items: center; }
.auth-link { display: block; text-align: center; font-size: 13.5px; font-weight: 550; color: var(--accent); padding: 4px; }
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-link.inline { display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.auth-link.back { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 18px; color: var(--text-2); font-weight: 500; }
.auth-link.back:hover { color: var(--text); }
.auth-alt { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--text-2); }
.auth-alt:empty, .auth-alt:not(:has(button)) { display: none; }
.otp-input {
  height: 64px !important; text-align: center; font-family: var(--mono); font-size: 30px !important; font-weight: 700;
  letter-spacing: .55em; padding-left: .55em !important; caret-color: var(--accent);
}
.otp-input::placeholder { color: var(--surface-3); }
.auth-foot { margin-top: 28px; font-size: 12px; color: var(--text-3); text-align: center; }

@media (max-width: 960px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-mobile-brand { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panel { animation: none; }
}

.chart-box { position: relative; height: 240px; }
.error-page { text-align: center; padding: 80px 20px; }
.error-page .code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(135deg, #1281c2, #29abe1 60%, #f7921e); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .grid-2, .grid-3, .form-row, .form-row.three { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; }
  .column { scroll-snap-align: start; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 8px; }
  .hide-sm { display: none !important; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 22px; }
}

/* Team login → client portal link */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-3); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn.auth-corporate { width: 100%; justify-content: center; gap: 8px; }
.btn.auth-corporate .icon:last-child { margin-left: auto; }
.btn.auth-corporate .icon:first-child { color: var(--accent); }

/* Generic busy state for any submit button (data-submit-once forms) */
.btn.loading { position: relative; pointer-events: none; color: transparent !important; }
.btn.loading > * { visibility: hidden; }
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: color-mix(in srgb, var(--text) 25%, transparent); border-top-color: var(--text);
  animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-brand.loading::after { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
