/* BuiltRight Invoice — app shell
   Light sidebar, tinted active state, rounded cards, document preview pane.
   No emoji anywhere — stroke SVG icons only. */

:root {
  --brand: #24b6f6;
  --brand-dk: #0d8ecf;
  --brand-bg: #e8f4fd;
  --brand-bg-2: #f2f9fe;
  --ink: #101828;
  --ink-2: #1d2939;
  --text: #475467;
  --muted: #98a2b3;
  --line: #e9edf2;
  --line-2: #f1f4f8;
  --bg: #f5f6f8;
  --card: #ffffff;
  --field: #f7f8fa;
  --green: #12a150; --green-bg: #e7f7ee;
  --amber: #b95e04; --amber-bg: #fdf3e2;
  --red:   #d33a3a; --red-bg:   #fdeceb;
  --blue:  #2563eb; --blue-bg:  #e9efff;
  --grey:  #667085; --grey-bg:  #f1f4f8;
  --indigo: #2f2b8f;
  --r: 16px; --r-sm: 10px; --r-xs: 8px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dk); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 700; letter-spacing: -0.015em; }

/* ── wordmark ───────────────────────────────────────────────── */
.wordmark { font-size: 16px; letter-spacing: .3px; color: var(--ink); line-height: 1.15; white-space: nowrap; }
.wordmark b { font-weight: 800; }
.wordmark span { font-weight: 400; letter-spacing: 1.2px; }

/* ── layout ─────────────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 252px; flex: 0 0 252px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand { padding: 20px 20px 16px; display: flex; align-items: center; gap: 11px; }
/* Wide wordmark logos need the full sidebar width, not a square slot. */
.side-brand img { max-height: 40px; max-width: 196px; object-fit: contain; }
.side nav { padding: 6px 0 12px; flex: 1; overflow-y: auto; }
.side .sec {
  color: var(--muted); font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase;
  padding: 16px 22px 7px; font-weight: 700;
}
.side a.nav {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  color: var(--text); font-size: 14px; font-weight: 500; margin: 2px 12px; text-decoration: none;
  position: relative;
}
.side a.nav:hover { background: #f6f8fa; color: var(--ink-2); text-decoration: none; }
.side a.nav.on { background: var(--brand-bg); color: var(--brand-dk); font-weight: 650; }
.side a.nav.on::before {
  content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--brand);
}
.side a.nav svg { flex: 0 0 18px; }

.side-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 36px; display: grid; place-items: center;
  background: var(--brand-bg); color: var(--brand-dk); font-weight: 700; font-size: 13px; letter-spacing: .3px;
}
.side-foot .who { color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.25; }
.side-foot .role { color: var(--muted); font-size: 11.5px; text-transform: capitalize; }
.side-foot .grow { flex: 1; min-width: 0; }
.icon-btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: var(--r-xs);
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; flex: 0 0 34px;
}
.icon-btn:hover { color: var(--ink-2); background: #f6f8fa; }

.main { flex: 1; min-width: 0; }
.topbar {
  padding: 22px 30px 12px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: var(--bg); position: sticky; top: 0; z-index: 20;
}
.topbar .ttl { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar h1 { font-size: 22px; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.wrap { padding: 10px 30px 60px; max-width: 1320px; }

@media (max-width: 900px) {
  .side { position: fixed; left: -260px; z-index: 60; transition: left .2s; box-shadow: var(--shadow-lg); }
  .side.open { left: 0; }
  .topbar, .wrap { padding-left: 16px; padding-right: 16px; }
  .menu-btn { display: grid !important; }
}
.menu-btn { display: none; }

/* ── cards ──────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-h { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 16px; }
.card-h .hint { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-b { padding: 22px; }
.card-b.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px)  { .g3, .g2 { grid-template-columns: 1fr; } }
@media (max-width: 560px)  { .g4 { grid-template-columns: 1fr; } }

/* stat tile — label, icon chip, big number, status pill */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 16px; }
.stat .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat .k { color: var(--text); font-size: 13px; font-weight: 500; }
.stat .chip {
  width: 30px; height: 30px; border-radius: var(--r-xs); background: var(--brand-bg-2);
  color: var(--brand-dk); display: grid; place-items: center; flex: 0 0 30px;
}
.stat .v { color: var(--ink); font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -.8px; }
.stat .pills { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

/* ── tables ─────────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase;
  letter-spacing: .8px; font-weight: 700; padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: #fbfcfd; white-space: nowrap;
}
table.tbl td { padding: 14px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: #fbfcfd; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* ── badges & buttons ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .2px; white-space: nowrap; text-transform: capitalize;
  background: var(--grey-bg); color: var(--grey);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.draft  { background: var(--grey-bg);  color: var(--grey); }
.badge.issued { background: var(--blue-bg);  color: var(--blue); }
.badge.paid   { background: var(--green-bg); color: var(--green); }
.badge.void   { background: var(--red-bg);   color: var(--red); }
.badge.warn   { background: var(--amber-bg); color: var(--amber); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; min-height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f6f8fa; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); border-color: var(--brand-dk); }
.btn-dark { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn-dark:hover { background: #241f78; }
.btn-danger { color: var(--red); border-color: #f4d2d0; background: #fff; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ── forms ──────────────────────────────────────────────────── */
label.lbl { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13.5px; font-family: inherit; color: var(--ink-2); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-bg); border-color: var(--brand); }
textarea { resize: vertical; min-height: 80px; }
.field { margin-bottom: 18px; }
.row { display: grid; gap: 15px; }
/* Grid items default to min-width:auto, which lets a file input push a column
   wider than its track and overflow the page. */
.row > * { min-width: 0; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 820px) { .row.c2, .row.c3 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .f { min-width: 150px; }
.filters select, .filters input { min-width: 150px; }

/* ── notices ────────────────────────────────────────────────── */
.notice {
  display: flex; gap: 12px; padding: 14px 17px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: #fff; font-size: 13.5px; margin-bottom: 18px;
}
.notice svg { flex: 0 0 18px; margin-top: 1px; }
.notice.info  { background: var(--brand-bg); border-color: #c9e8fb; color: #0a6a99; }
.notice.warn  { background: var(--amber-bg); border-color: #f6e0bd; color: #8a5a00; }
.notice.error { background: var(--red-bg);   border-color: #f4d2d0; color: #9c2a2a; }
.notice.ok    { background: var(--green-bg); border-color: #c4ecd5; color: #0b6d38; }
.notice b { display: block; margin-bottom: 2px; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { opacity: .3; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; }

/* ── split auth screen ──────────────────────────────────────── */
.auth-split { display: flex; min-height: 100vh; background: #fff; }
.auth-left {
  flex: 0 0 44%; max-width: 660px; padding: 34px 40px; display: flex; flex-direction: column;
}
.auth-left .top { flex: 0 0 auto; }
.auth-form { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 500px; width: 100%; }
.auth-form h1 { font-size: 33px; letter-spacing: -.9px; }
.auth-form .sub { color: var(--muted); font-size: 14.5px; margin: 8px 0 34px; }
.auth-right {
  flex: 1; background: var(--bg); border-left: 1px solid var(--line);
  padding: 26px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
@media (max-width: 1050px) { .auth-right { display: none; } .auth-left { flex: 1; max-width: none; } }

/* input with a leading icon, as on the sign-in screen */
.in-wrap { position: relative; }
.in-wrap > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.in-wrap input {
  padding: 15px 46px 15px 46px; background: var(--field); border: 1px solid #eceff3;
  border-radius: 14px; font-size: 15px;
}
.in-wrap input::placeholder { color: #98a2b3; }
.in-wrap .eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px;
}
.in-wrap .eye:hover { color: var(--ink-2); background: #eef1f5; }
.auth-form .field { margin-bottom: 14px; }
.forgot { text-align: right; margin: 2px 0 26px; }
.forgot a { font-size: 13px; font-weight: 600; }
.btn-signin {
  width: 100%; background: var(--brand); color: #fff; border: 0; border-radius: 14px;
  padding: 17px; font-size: 14.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  cursor: pointer; font-family: inherit;
}
.btn-signin:hover { background: var(--brand-dk); }
.auth-terms { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 26px; }
.code-input {
  text-align: center; font-size: 28px; letter-spacing: 14px; font-weight: 700;
  padding: 16px 16px 16px 30px !important; background: var(--field); border-radius: 14px;
}

/* preview mock on the right of the auth screen */
.mock {
  width: 100%; max-width: 1000px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16,24,40,.10); overflow: hidden; display: flex; font-size: 11px;
  transform: translateX(3%);
}
.mock .m-side { width: 150px; flex: 0 0 150px; border-right: 1px solid var(--line); padding: 12px 10px; background: #fff; }
.mock .m-brand { display: flex; align-items: center; gap: 7px; padding: 0 4px 12px; }
.mock .m-brand .dot { width: 20px; height: 20px; border-radius: 6px; background: var(--ink); }
.mock .m-brand b { font-size: 10.5px; color: var(--ink); letter-spacing: .3px; }
.mock .m-sec { font-size: 8px; letter-spacing: 1px; color: var(--muted); font-weight: 700; padding: 10px 6px 4px; }
.mock .m-nav { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text); font-size: 10.5px; }
.mock .m-nav i { width: 12px; height: 12px; border-radius: 3px; background: #dfe5ec; display: block; }
.mock .m-nav.on { background: var(--brand-bg); color: var(--brand-dk); font-weight: 650; }
.mock .m-nav.on i { background: var(--brand); }
.mock .m-body { flex: 1; padding: 13px 15px; background: var(--bg); min-width: 0; }
.mock .m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.mock .m-head b { font-size: 13px; color: var(--ink); }
.mock .m-btn { background: var(--brand); color: #fff; border-radius: 7px; padding: 5px 10px; font-size: 9.5px; font-weight: 650; }
.mock .m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.mock .m-stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.mock .m-stat .l { color: var(--muted); font-size: 8.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.mock .m-stat .n { color: var(--ink); font-size: 15px; font-weight: 700; margin-top: 4px; letter-spacing: -.4px; }
.mock .m-stat .p { display: inline-block; margin-top: 5px; font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: var(--green-bg); color: var(--green); }
.mock .m-cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 9px; margin-top: 9px; }
.mock .m-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.mock .m-panel .t { font-size: 10px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.mock .m-row { display: flex; align-items: center; gap: 7px; padding: 5px 0; border-top: 1px solid var(--line-2); font-size: 9.5px; color: var(--text); }
.mock .m-row:first-of-type { border-top: 0; }
.mock .m-row .g { flex: 1; }
.mock .m-row .amt { color: var(--ink); font-weight: 650; }
.mock .m-pill { font-size: 8px; font-weight: 700; padding: 2px 6px; border-radius: 999px; }
.mock .m-doc { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.mock .m-doc .dt { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 7px; }
.mock .m-doc .dt .ti { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--ink); }
.mock .m-doc .dt .no { font-size: 8px; color: var(--brand-dk); font-weight: 700; text-align: right; }
.mock .m-line { height: 5px; border-radius: 3px; background: #eef1f5; margin-top: 7px; }
.mock .m-line.s { width: 55%; }
.mock .m-line.m { width: 75%; }
.mock .m-tot { display: flex; justify-content: space-between; margin-top: 11px; padding-top: 8px; border-top: 1px solid var(--ink); font-size: 11px; font-weight: 800; color: var(--ink); }

/* ── document preview pane (invoice screen) ─────────────────── */
.split { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 20px; align-items: start; }
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } }

.pane {
  background: #eef0f4; border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 18px 74px; position: relative; overflow: hidden;
}
.doc-scroll { overflow: auto; max-height: 78vh; }
/* The page keeps its true A4-ish width and is scaled down to fit, like a PDF viewer —
   the holder carries the scaled box size, since a transform does not affect layout. */
.doc-holder { margin: 0 auto; }
.doc-scale { width: 820px; transform-origin: top left; }
.doc-scale > .doc { width: 820px; max-width: none; margin: 0; }
.doc-tools {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 4px; padding: 6px 8px;
}
.doc-tools button, .doc-tools a {
  border: 0; background: none; color: var(--text); width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.doc-tools button:hover, .doc-tools a:hover { background: #f1f4f8; color: var(--ink); }
.doc-tools .zoom {
  min-width: 52px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--ink-2);
}
.doc-tools .div { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

/* ── invoice line editor ────────────────────────────────────── */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); text-align: left; padding: 0 8px 8px; font-weight: 700; }
.lines td { padding: 4px 8px 4px 0; vertical-align: top; }
.lines td:last-child { padding-right: 0; }
.lines input, .lines select { padding: 9px 10px; font-size: 13px; }
.lines .del {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: var(--r-xs);
  width: 36px; height: 38px; cursor: pointer; display: grid; place-items: center;
}
.lines .del:hover { color: var(--red); border-color: #f4d2d0; background: var(--red-bg); }
.totals { margin-left: auto; width: 310px; max-width: 100%; margin-top: 20px; }
.totals div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13.5px; }
.totals div.grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font-size: 18px; font-weight: 800; color: var(--ink); }

.sticky-actions {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 15px 22px; display: flex; gap: 10px; justify-content: flex-end; border-radius: 0 0 var(--r) var(--r);
}

/* ── uploads ────────────────────────────────────────────────── */
.upload { display: flex; gap: 14px; align-items: flex-start; }
.upload .prev {
  width: 132px; height: 76px; border: 1px dashed #d8dee6; border-radius: var(--r-sm);
  display: grid; place-items: center; background: #fbfcfd; overflow: hidden; flex: 0 0 auto;
}
.upload .prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.upload .prev span { color: var(--muted); font-size: 11px; }
.upload .ctl { flex: 1; min-width: 0; }
input[type=file] { font-size: 12.5px; max-width: 100%; width: 100%; }

/* ── confirmation dialog ────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 9998; background: rgba(16, 24, 40, .5);
  display: grid; place-items: center; padding: 20px;
}
.modal-back[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--r-lg); padding: 26px 26px 20px;
  width: 100%; max-width: 440px; box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
}
.modal-icon {
  width: 46px; height: 46px; border-radius: 50%; background: var(--red-bg); color: var(--red);
  display: grid; place-items: center; margin-bottom: 16px;
}
.modal h2 { font-size: 18px; margin-bottom: 8px; }
.modal .modal-msg { color: var(--text); font-size: 14px; margin: 0; line-height: 1.6; }
.modal .modal-note {
  margin: 14px 0 0; padding: 11px 13px; background: var(--grey-bg); border-radius: var(--r-sm);
  color: var(--grey); font-size: 12.5px; line-height: 1.55;
}
.modal .modal-note[hidden] { display: none; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal-actions .btn { min-width: 110px; }

/* ── contractor portal (no admin sidebar) ───────────────────── */
body.portal { background: var(--bg); }
.p-bar {
  background: #fff; border-bottom: 1px solid var(--line); padding: 14px 26px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.p-brand { display: flex; align-items: center; text-decoration: none; }
.p-brand img { max-height: 32px; max-width: 190px; object-fit: contain; }
.p-nav { display: flex; gap: 4px; }
.p-nav a {
  padding: 7px 12px; border-radius: var(--r-sm); color: var(--text);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.p-nav a:hover { background: #f6f8fa; text-decoration: none; }
.p-nav a.on { background: var(--brand-bg); color: var(--brand-dk); font-weight: 650; }
.p-wrap { max-width: 980px; margin: 0 auto; padding: 26px 20px 60px; }
.p-narrow { max-width: 560px; margin: 0 auto; }
.p-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 20px 34px; }
@media (max-width: 600px) { .p-bar { padding: 12px 16px; gap: 12px; } .p-wrap { padding: 18px 14px 50px; } }

/* ── loading feedback ───────────────────────────────────────── */
.nprog {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--brand), #6fd2ff);
  box-shadow: 0 0 8px rgba(36,182,246,.6);
  transition: width .25s ease, opacity .3s ease .1s; opacity: 1;
}
.nprog.go { width: 92%; transition: width 9s cubic-bezier(.03,.85,.2,1); }

.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading svg { visibility: hidden; }
.btn.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 15px; height: 15px;
  margin: -8px 0 0 -8px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  color: var(--ink-2); animation: spin .7s linear infinite;
}
.btn-primary.loading::after, .btn-dark.loading::after { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.skel-wrap { padding-top: 2px; }
.skel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .skel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .skel-grid { grid-template-columns: 1fr; } }
.skel-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 10px;
}
.skel-card.big { margin-top: 18px; padding: 22px; }
.skel-rows { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.sk {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite;
}
.sk-sm   { height: 11px; width: 45%; }
.sk-md   { height: 15px; width: 190px; }
.sk-xl   { height: 26px; width: 72%; }
.sk-pill { height: 18px; width: 96px; border-radius: 999px; }
.sk-row  { height: 13px; width: 100%; }
.sk-row:nth-child(even) { width: 88%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk, .btn.loading::after { animation: none; } }

.tag { display: inline-block; padding: 3px 9px; background: var(--grey-bg); color: var(--grey); border-radius: 7px; font-size: 11.5px; font-weight: 650; }
.sep { height: 1px; background: var(--line-2); margin: 24px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
