/* Job Work ERP — design system */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e1e7ef;
  --line-2: #edf1f6;
  --ink: #0e1a2b;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --brand: #0d1b30;
  --brand-2: #16305a;
  --accent: #f08c00;
  --accent-2: #d27600;
  --accent-soft: #fff3df;
  --blue: #2563eb;   --blue-soft: #e6eeff;
  --green: #15803d;  --green-soft: #e2f5e8;
  --red: #c62828;    --red-soft: #fdeaea;
  --amber: #b45309;  --amber-soft: #fef1dc;
  --violet: #6d28d9; --violet-soft: #efe8ff;
  --teal: #0f766e;   --teal-soft: #dcf2ee;
  --slate: #475569;  --slate-soft: #eef2f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .04);
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---------- scrollbars: slim, rounded, no arrow buttons ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #98a5b6; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: transparent; border: 0; border-radius: 6px; }
.side-nav:hover::-webkit-scrollbar-thumb, .side-nav:focus-within::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }
.side-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .34); }
.side-nav.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
.side-nav.more-above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px); mask-image: linear-gradient(to bottom, transparent, #000 24px); }
.side-nav.more-above.more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 24px, #000 calc(100% - 30px), transparent); }
@supports (-moz-appearance: none) {
  html { scrollbar-width: thin; scrollbar-color: #c5cdd8 transparent; }
  .side-nav { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .side-nav:hover, .side-nav:focus-within { scrollbar-color: rgba(255, 255, 255, .25) transparent; }
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0; letter-spacing: -.015em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0 0 8px; }
p { margin: .25rem 0; }
small { font-size: .82em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .9em; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 26px; }
.gap-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- shell ---------- */

.app { min-height: 100vh; }
.nav-toggle { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  display: flex; flex-direction: column;
  background: linear-gradient(185deg, #0c1a2f 0%, #112546 60%, #16305a 100%);
  color: #c4cfdf;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 13px 18px 9px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #ffad33, var(--accent) 60%, #d96d00);
  color: #fff; font-weight: 800; letter-spacing: .03em; box-shadow: 0 4px 12px rgba(240, 140, 0, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: #8fa1bb; font-size: .76rem; }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 10px 10px; }
.nav-group { margin-top: 7px; }
.nav-label { display: block; padding: 0 10px 2px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6f84a3; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 6px 10px; margin: 1px 0;
  border-radius: 8px; color: #c4cfdf; font-size: .93rem; text-decoration: none; position: relative;
}
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.on { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.side-nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--accent); }
.side-nav a .ic { opacity: .85; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 9px 12px 11px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-user { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border-radius: 8px; color: #e2e8f0; text-decoration: none; }
.side-user:hover, .side-user.on { background: rgba(255, 255, 255, .07); text-decoration: none; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #2b4a78; color: #fff; font-weight: 700; flex: none; }
.side-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side-user-text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { color: #8fa1bb; }
.side-logout { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: #a9b8cd; cursor: pointer; }
.side-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 10px 26px;
  background: rgba(242, 244, 248, .88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; place-items: center; width: 38px; height: 38px; border-radius: 9px; cursor: pointer; color: var(--ink-2); }
.menu-btn:hover { background: #e6ebf2; }
.topbar-title { flex: none; }
.client-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.client-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(21, 128, 61, .15); }
.global-search { flex: 1; max-width: 520px; margin-left: auto; position: relative; }
.global-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.global-search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.btn-new { flex: none; }
.content { padding: 22px 26px 40px; width: 100%; max-width: 1560px; }
.app-foot { margin-top: auto; padding: 14px 26px 20px; color: var(--faint); font-size: .78rem; }
.nav-scrim { display: none; }

/* ---------- page head ---------- */

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--muted); }
.eyebrow { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: .85rem; margin-bottom: 4px; }
.crumb a { color: var(--muted); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.btn:hover { border-color: #c3ccd8; text-decoration: none; box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-dark { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-dark:hover { background: var(--brand); border-color: var(--brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #e9edf3; box-shadow: none; }
.btn-danger { color: var(--red); border-color: #efc7c7; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-small { padding: 5px 10px; font-size: .82rem; border-radius: 7px; }
.btn-block { width: 100%; padding: 11px; }
.linklike { background: none; border: 0; padding: 0; color: #1d4ed8; font: inherit; cursor: pointer; }
.linklike:hover { text-decoration: underline; }

/* ---------- cards & grids ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card + .card { margin-top: 16px; }
.grid .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: .95rem; font-weight: 700; margin: 0; }
.card-title .ic { color: var(--accent-2); }
.card-sub { color: var(--muted); font-size: .82rem; font-weight: 400; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 14px 18px 0; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.section { margin-top: 18px; }

/* ---------- KPI tiles ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 15px 16px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none; overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: #c9d3e0; transform: translateY(-1px); transition: transform .15s, border-color .15s; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; }
.kpi-ic .ic { width: 17px; height: 17px; }
.kpi-val { font-size: 1.65rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 6px; }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone, transparent); }
.tone-blue { --tone: var(--blue); } .tone-blue .kpi-ic { background: var(--blue-soft); color: var(--blue); }
.tone-amber { --tone: var(--accent); } .tone-amber .kpi-ic { background: var(--amber-soft); color: var(--amber); }
.tone-violet { --tone: var(--violet); } .tone-violet .kpi-ic { background: var(--violet-soft); color: var(--violet); }
.tone-teal { --tone: var(--teal); } .tone-teal .kpi-ic { background: var(--teal-soft); color: var(--teal); }
.tone-green { --tone: var(--green); } .tone-green .kpi-ic { background: var(--green-soft); color: var(--green); }
.tone-red { --tone: var(--red); } .tone-red .kpi-ic { background: var(--red-soft); color: var(--red); }
.tone-slate { --tone: var(--slate); } .tone-slate .kpi-ic { background: var(--slate-soft); color: var(--slate); }

/* ---------- hero (dashboard) ---------- */

.hero {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; margin-bottom: 18px; border-radius: 16px; color: #fff;
  background: radial-gradient(1200px 300px at 85% -40%, rgba(240, 140, 0, .45), transparent 60%),
              linear-gradient(120deg, #0d1b30 0%, #15305a 70%, #1c3d70 100%);
  box-shadow: 0 10px 30px rgba(13, 27, 48, .18);
}
.hero h1 { font-size: 1.7rem; }
.hero p { color: #b9c7db; margin-top: 4px; }
.hero .eyebrow { color: #ffc266; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.hero-stat small { color: #9fb1c9; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- pipeline ---------- */

.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pipe { position: relative; padding: 12px 12px 11px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); color: inherit; text-decoration: none; }
a.pipe:hover { text-decoration: none; border-color: #cbd5e1; background: #fff; }
.pipe::before { content: ""; display: block; height: 4px; border-radius: 4px; margin-bottom: 9px; background: var(--c, var(--faint)); }
.pipe-label { font-size: .76rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pipe-count { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.pipe-val { font-size: .8rem; color: var(--muted); }
.c-progress { --c: var(--blue); } .c-await_wo { --c: var(--accent); } .c-to_bill { --c: var(--violet); }
.c-billed { --c: var(--teal); } .c-paid { --c: var(--green); } .c-cancelled { --c: var(--faint); }

.stepper { display: flex; gap: 4px; margin: 4px 0 2px; }
.step { flex: 1; text-align: center; font-size: .72rem; font-weight: 600; color: var(--faint); }
.step::before { content: ""; display: block; height: 6px; border-radius: 6px; background: #e2e8f0; margin-bottom: 6px; }
.step.done { color: var(--ink-2); }
.step.done::before { background: var(--green); }
.step.now { color: var(--ink); }
.step.now::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- badges ---------- */

.badge, .stage, .pay, .chip-sm {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; white-space: nowrap; line-height: 1.55;
}
.badge { background: #e8ebf0; color: #3d4654; }
.s-open { background: var(--blue-soft); color: #1d4ed8; }
.s-in-progress { background: #e0f2fe; color: #0369a1; }
.s-on-hold { background: var(--violet-soft); color: var(--violet); }
.s-completed { background: var(--green-soft); color: var(--green); }
.s-billed { background: var(--teal-soft); color: var(--teal); }
.s-closed { background: #e8ebf0; color: #3d4654; }
.s-cancelled { background: var(--red-soft); color: #8f2020; }
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-progress { background: var(--blue-soft); color: #1d4ed8; }
.st-await_wo { background: var(--amber-soft); color: var(--amber); }
.st-to_bill { background: var(--violet-soft); color: var(--violet); }
.st-billed { background: var(--teal-soft); color: var(--teal); }
.st-paid { background: var(--green-soft); color: var(--green); }
.st-cancelled { background: #eef1f4; color: var(--muted); }
.pay { padding: 0; font-size: .84rem; }
.pay-not_billed { color: var(--faint); }
.pay-pending { color: var(--red); }
.pay-part { color: var(--amber); }
.pay-received { color: var(--green); }
.chip-sm { background: var(--slate-soft); color: var(--slate); font-weight: 600; }
.chip-accent { background: var(--accent-soft); color: var(--amber); }
.late { color: var(--red); font-weight: 650; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------- filters & chips ---------- */

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: .84rem; text-decoration: none; }
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: #c3ccd8; text-decoration: none; }
.chip.on { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.chip.on b { color: #fff; }
.chip .dot { width: 7px; height: 7px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 14px; margin-bottom: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filters .grow { flex: 1 1 240px; }
.filters select, .filters input[type="date"], .filters input[type="month"] { width: auto; min-width: 120px; }
.filter-btns { display: flex; gap: 6px; }

input, select, textarea {
  font: inherit; color: var(--ink); width: 100%; min-width: 0;
  padding: 8px 10px; border: 1px solid #ccd5e1; border-radius: 8px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { resize: vertical; }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
input[type="file"] { padding: 6px; background: var(--surface-2); }
input[readonly] { background: var(--surface-2); color: var(--muted); }

/* ---------- forms ---------- */

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { width: 100%; padding: 0 0 7px; margin-bottom: 12px; border-bottom: 1px solid var(--line-2); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px 16px; }
.span-all { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 650; color: var(--ink-2); min-width: 0; }
.field i { color: var(--red); font-style: normal; }
.field small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea { font-weight: 400; }
.form-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.form-foot .spacer { flex: 1; }
.sticky-foot { position: sticky; bottom: 0; z-index: 5; margin: 0 -18px -16px; padding: 12px 18px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 160px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: .88rem; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap, .card-flush .table-wrap { border: 0; box-shadow: none; border-radius: 0; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.tbl th {
  position: sticky; top: 0; z-index: 2; text-align: left; white-space: nowrap; padding: 9px 11px;
  background: #f7f9fc; border-bottom: 1px solid var(--line);
  font-size: .7rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.tbl td { padding: 9px 11px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafbfd; }
.tbl tfoot td { background: #f7f9fc; font-weight: 700; border-top: 1px solid var(--line); }
.tbl .check-col { width: 34px; padding-right: 0; }
.tbl tr.sel td { background: #fff8eb; }
.tbl tr.off td { color: var(--faint); }
.tbl .desc { min-width: 220px; max-width: 360px; }
.tbl .desc-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbl .sub { display: block; color: var(--muted); font-size: .8rem; }
.jobno, .jobno a { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .84rem; font-weight: 650; white-space: nowrap; }
.ship-cell { font-weight: 650; white-space: nowrap; }
.compact td, .compact th { padding: 6px 9px; }

/* ---------- bulk bar ---------- */

.bulkbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 14px; margin-top: 12px; background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius); }
.bulkbar.live { position: sticky; bottom: 12px; z-index: 20; border-style: solid; border-color: var(--accent); box-shadow: 0 8px 24px rgba(15, 23, 42, .15); }
.bulkbar .count { font-weight: 700; align-self: center; }
.bulkbar label { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.bulkbar select, .bulkbar input { width: auto; min-width: 150px; }

/* ---------- charts ---------- */

.colchart { display: flex; align-items: flex-end; gap: 6px; height: 200px; padding-top: 18px; }
.grid.align-start { align-items: start; }
.stack-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack-col > .card + .card { margin-top: 0; }

/* stacked columns (stage mix) */
.cc-stack { position: relative; width: 70%; max-width: 46px; }
.cc-stack > b { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-stack-in { display: flex; flex-direction: column-reverse; height: 100%; border-radius: 6px 6px 2px 2px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04); }
.cc-stack-in .seg { display: block; width: 100%; min-height: 3px; border-top: 1px solid rgba(255, 255, 255, .55); }
.cc-col:hover .cc-stack-in { filter: brightness(1.08); }
.cc-col.now .cc-stack-in { box-shadow: 0 0 0 2px var(--accent); }
.sg-progress { background: #4f86f7; }
.sg-await_wo { background: #f5a524; }
.sg-to_bill { background: #9b6cf2; }
.sg-billed { background: #22b5a4; }
.sg-paid { background: #36c26a; }
.sg-cancelled { background: #cbd5e1; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .8rem; color: var(--ink-2); }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stage-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.minibar { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: #edf1f6; }
.minibar span { display: block; height: 100%; }
.minibar span + span { border-left: 1px solid rgba(255, 255, 255, .7); }

/* attendance / mix bar */
.mixbar { display: flex; height: 14px; border-radius: 14px; overflow: hidden; background: #edf1f6; }
.mixbar span { display: block; height: 100%; }
.mix-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; margin-top: 10px; font-size: .82rem; }
.mix-legend span { display: flex; align-items: center; gap: 7px; }
.mix-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }
.c-fmu { background: #f59e0b; } .c-work { background: #4f86f7; } .c-leave { background: #f472b6; }
.c-sick { background: #ef4444; } .c-off { background: #cbd5e1; } .c-holiday { background: #4ade80; } .c-absent { background: #7f1d1d; }

/* turnaround rows */
.cycle { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cycle li { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: center; }
.cycle .cy-name { font-weight: 650; font-size: .88rem; }
.cycle .cy-name small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; }
.cycle .cy-val { font-size: 1.15rem; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.cycle .cy-val small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.cycle .hb-track { grid-column: 1 / -1; height: 7px; }
.cc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; height: 100%; color: inherit; text-decoration: none; }
a.cc-col:hover { text-decoration: none; }
.cc-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.cc-bar { position: relative; width: 70%; max-width: 46px; min-height: 0; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4f7cf0, var(--blue)); transition: filter .15s; }
.cc-col:hover .cc-bar { filter: brightness(1.12); }
.cc-col.now .cc-bar { background: linear-gradient(180deg, #ffb444, var(--accent)); }
.cc-bar b { position: absolute; top: -19px; left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-lbl { padding-top: 6px; text-align: center; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: .86rem; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hb-label small { color: var(--muted); font-weight: 400; }
.hb-track { height: 9px; border-radius: 9px; background: #edf1f6; overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #5b86f2, var(--blue)); }
.hb-fill.amber { background: linear-gradient(90deg, #ffb444, var(--accent)); }
.hb-fill.teal { background: linear-gradient(90deg, #2bb3a3, var(--teal)); }
.hb-fill.violet { background: linear-gradient(90deg, #9a6cf0, var(--violet)); }
.hb-fill.green { background: linear-gradient(90deg, #3fbf6c, var(--green)); }
.hb-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 650; min-width: 34px; text-align: right; }

.donut-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.donut { width: 100%; height: 100%; transform: rotate(0deg); }
.donut-hole { fill: #fff; }
.donut-ring { fill: transparent; stroke: #edf1f6; stroke-width: 5.5; }
.donut-seg { fill: transparent; stroke-width: 5.5; }
.donut-seg.st-progress { stroke: var(--blue); } .donut-seg.st-await_wo { stroke: var(--accent); }
.donut-seg.st-to_bill { stroke: var(--violet); } .donut-seg.st-billed { stroke: var(--teal); }
.donut-seg.st-paid { stroke: var(--green); } .donut-seg.st-cancelled { stroke: var(--faint); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center strong { font-size: 1.45rem; line-height: 1.1; }
.donut-center small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: .86rem; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li span.lg-val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-row .legend { flex: 1; min-width: 180px; }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; }
.gauge { width: 210px; max-width: 100%; }
.g-track { fill: none; stroke: #edf1f6; stroke-width: 10; stroke-linecap: round; }
.g-fill { fill: none; stroke-width: 10; stroke-linecap: round; }
.g-ok .g-fill { stroke: var(--green); } .g-amber .g-fill { stroke: var(--accent); } .g-red .g-fill { stroke: var(--red); }
.g-mark { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.gauge-text { margin-top: -26px; text-align: center; display: flex; flex-direction: column; }
.gauge-text strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.gauge-text small { color: var(--muted); font-size: .8rem; }

.progress { display: block; height: 8px; border-radius: 8px; background: #edf1f6; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 8px; background: var(--green); }
.progress.amber > span { background: var(--accent); }
.progress.red > span { background: var(--red); }
.progress.blue > span { background: var(--blue); }

.stack { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: #edf1f6; }
.stack > span { height: 100%; }

.statlist { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.statlist div { padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); }
.statlist span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.statlist strong { font-size: 1.12rem; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- lists ---------- */

.alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alerts li a, .alerts li > div { display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: inherit; text-decoration: none; }
.alerts li a:hover { border-color: #cbd5e1; background: #fff; text-decoration: none; }
.alerts .al-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.alerts .al-ic .ic { width: 16px; height: 16px; }
.alerts strong { display: block; font-size: .9rem; }
.alerts small { color: var(--muted); }
.al-red .al-ic { background: var(--red-soft); color: var(--red); }
.al-amber .al-ic { background: var(--amber-soft); color: var(--amber); }
.al-violet .al-ic { background: var(--violet-soft); color: var(--violet); }
.al-blue .al-ic { background: var(--blue-soft); color: var(--blue); }
.al-green .al-ic { background: var(--green-soft); color: var(--green); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.feed li:last-child { border-bottom: 0; }
.feed .when { flex: none; width: 84px; color: var(--faint); font-size: .78rem; padding-top: 1px; }
.feed b { font-weight: 650; }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.board-tile { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); }
.board-tile strong { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.board-tile span { display: block; font-size: .8rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-tile small { color: var(--muted); }
.board-tile.k-ship { border-left: 4px solid var(--blue); }
.board-tile.k-fmu { border-left: 4px solid var(--accent); }
.board-tile.k-yard { border-left: 4px solid var(--teal); }
.board-tile.k-koel { border-left: 4px solid var(--violet); }
.board-tile.k-office, .board-tile.k-other, .board-tile.k-outside, .board-tile.k-admin { border-left: 4px solid var(--slate); }
.board-tile.k-away { border-left: 4px solid #e2a3ae; }

/* ---------- ships ---------- */

.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ship-card {
  --h: 215;
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 15px; border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(var(--h) 85% 97%) 0%, #fff 55%);
  border: 1px solid hsl(var(--h) 45% 86%); border-top: 4px solid hsl(var(--h) 65% 52%);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
a.ship-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 22px hsla(var(--h), 60%, 40%, .16); transition: transform .15s, box-shadow .15s; }
.ship-card.quiet { opacity: .7; }
.ship-card h3 { margin: 0; font-size: 1.05rem; }
.ship-card .cls { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; background: hsl(var(--h) 80% 93%); color: hsl(var(--h) 60% 30%); }
.ship-card .routine { display: block; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.ship-card .nums { display: flex; justify-content: space-between; gap: 8px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.ship-card .nums b { display: block; font-size: 1.08rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.ship-card .nums .warn b { color: var(--amber); }
.ship-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: hsl(var(--h) 85% 92%); color: hsl(var(--h) 65% 38%); }
.ship-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ship-foot { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); }
.class-chips .chip i { width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--h) 65% 50%); display: inline-block; }
.class-chips .chip.on { background: hsl(var(--h) 55% 38%); border-color: hsl(var(--h) 55% 38%); }

/* ---------- reports ---------- */

.report-head { display: none; }
.tbl tr.lead-row td { background: #f2f5f9; color: var(--ink-2); }
.tbl tr.lead-row .ic { width: 15px; height: 15px; }
.tabs a .ic { width: 16px; height: 16px; margin-right: 4px; vertical-align: -3px; }
.alerts .al-ic b { font-size: .86rem; }
.heat-tbl td.hc { text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 46px; }
.heat-tbl td.hc.zero { color: var(--line); }
.sev { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-weight: 750; font-size: .82rem; }
.sev-red { background: var(--red-soft); color: var(--red); }
.sev-amber { background: var(--amber-soft); color: var(--amber); }
.sev-blue { background: var(--blue-soft); color: var(--blue); }
.sev-ok { background: var(--green-soft); color: var(--green); }
.report-section { margin-top: 20px; }
.report-section > h2 { display: flex; align-items: center; gap: 8px; }
.pct-cell { min-width: 120px; }
.pct-cell .progress { margin-top: 4px; }
.mono-num { font-variant-numeric: tabular-nums; }

/* ---------- manpower grid ---------- */

.legend-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mpd-wrap { max-height: 72vh; }
table.mpd { border-collapse: separate; border-spacing: 0; font-size: .74rem; }
.mpd th, .mpd td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 0; text-align: center; }
.mpd thead th { position: sticky; top: 0; z-index: 3; background: #f7f9fc; padding: 5px 2px; font-size: .68rem; color: var(--muted); font-weight: 700; }
.mpd thead th a { color: inherit; display: block; }
.mpd thead th.we { color: var(--red); }
.mpd thead th.today { background: var(--accent-soft); color: var(--amber); }
.mpd .emp { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; padding: 5px 10px; min-width: 210px; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
.mpd thead .emp { z-index: 4; background: #f7f9fc; }
.mpd .emp small { display: block; color: var(--faint); font-size: .7rem; }
.mpd .lead-row td { background: #f2f5f9; font-weight: 700; text-align: left; padding: 5px 10px; font-size: .74rem; color: var(--ink-2); position: sticky; left: 0; }
.mpd td.cell { min-width: 44px; height: 30px; font-weight: 650; }
.mpd td.cell span { display: block; padding: 6px 2px; }
.mpd td.sum { padding: 4px 8px; font-variant-numeric: tabular-nums; font-weight: 650; background: #fbfcfe; }
.mpd td.sum.fmu { color: var(--amber); }
.k-ship { background: #e4edff; color: #1d4ed8; }
.k-fmu { background: #ffefd2; color: #9a5300; }
.k-yard { background: #daf2ee; color: #0f766e; }
.k-koel { background: #eee6ff; color: #6d28d9; }
.k-office { background: #e9eef4; color: #475569; }
.k-outside { background: #fdeadb; color: #9a4a12; }
.k-admin { background: #fdf6c3; color: #854d0e; }
.k-other { background: #f1f5f9; color: #334155; }
.k-leave { background: #fde6eb; color: #be123c; }
.k-sick { background: #fbd3d3; color: #b91c1c; }
.k-off { background: #f6f7f9; color: #a0abba; }
.k-holiday { background: #e3f5e6; color: #15803d; }
.k-absent { background: #8f1d1d; color: #fff; }
.mpd td.cell.fmu-link { box-shadow: inset 0 -3px 0 var(--accent); }
.chipk { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px; font-size: .76rem; font-weight: 650; white-space: nowrap; }

.daysheet td { vertical-align: middle; }
.daysheet input { padding: 6px 9px; }
.daysheet .prev { color: var(--faint); font-size: .8rem; }
.daysheet .ds-input { min-width: 240px; }
.daysheet tr.lead-row td { background: #f2f5f9; font-weight: 700; font-size: .78rem; color: var(--ink-2); }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 3px 7px; font-size: .72rem; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.quick button:hover { border-color: var(--accent); color: var(--amber); }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal .dow { font-size: .7rem; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; }
.cal .day { min-height: 62px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; font-size: .74rem; display: flex; flex-direction: column; gap: 3px; }
.cal .day.blank { background: transparent; border-color: transparent; }
.cal a.day { color: inherit; text-decoration: none; }
.cal a.day:hover { border-color: #c3ccd8; box-shadow: 0 1px 4px rgba(15, 23, 42, .08); }
.cal .day .dn { font-weight: 700; color: var(--muted); font-size: .72rem; }
.cal .day .chipk { white-space: normal; font-size: .68rem; padding: 2px 5px; line-height: 1.25; }

/* ---------- rate card ---------- */

.rc-sec td { background: #f2f5f9; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.rc-sub td { background: #fbfcfe; font-weight: 650; font-size: .8rem; color: var(--amber); }
.rate-now { background: #fff8eb !important; font-weight: 700; }
.calc-qty { width: 72px; padding: 5px 7px; text-align: right; }
.calc-total { position: sticky; bottom: 12px; z-index: 10; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: flex-end; margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--brand-2); color: #fff; box-shadow: 0 10px 26px rgba(13, 27, 48, .25); }
.calc-total span { color: #b8c6da; font-size: .8rem; }
.calc-total strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.calc-total[hidden] { display: none; }

/* ---------- misc ---------- */

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-size: .92rem; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-ok { background: var(--green-soft); border-color: #b5ddc2; color: #14532d; }
.flash-err { background: var(--red-soft); border-color: #efc2c2; color: #7d1a1a; }
.flash-info { background: var(--blue-soft); border-color: #c4d4fb; color: #1e3a8a; }
.empty { text-align: center; padding: 42px 20px; color: var(--ink-2); }
.empty-ic { width: 42px; height: 42px; color: var(--faint); margin-bottom: 6px; }
.empty p { margin-bottom: 12px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 650; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.month-nav a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 7px; color: var(--ink-2); }
.month-nav a:hover { background: var(--surface-2); text-decoration: none; }
.month-nav strong { padding: 0 10px; min-width: 120px; text-align: center; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding: 12px 16px; border: 1px solid #efd0d0; border-radius: var(--radius); background: #fdf7f7; }
.suggest { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.suggest li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 9px; background: #fffaf0; border: 1px solid #f6dfb5; font-size: .84rem; }
.suggest li span { min-width: 0; }
.suggest small { display: block; color: var(--muted); }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: .86rem; }
.files li a.fname { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li small { color: var(--muted); white-space: nowrap; }
.preview-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; }
.pv-new { background: var(--green-soft); color: var(--green); }
.pv-update { background: var(--amber-soft); color: var(--amber); }
.pv-same { background: #eef1f4; color: var(--muted); }
.changes { margin: 3px 0 0; padding: 0; list-style: none; font-size: .78rem; color: var(--ink-2); }
.changes del { color: var(--faint); }
.result-group { margin-bottom: 18px; }
mark { background: #ffe8b3; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- auth pages ---------- */

.auth-page { background: radial-gradient(900px 420px at 80% -10%, rgba(240, 140, 0, .25), transparent 60%), linear-gradient(140deg, #0c1a2f, #16305a); }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; padding: 28px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 42px; height: 42px; }
.auth-brand strong { display: block; font-size: 1.05rem; }
.auth-brand small { color: var(--muted); }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 4px; }
.auth-card .field { margin-top: 14px; }
.auth-card .btn-block { margin-top: 18px; }
.auth-card .flash { margin: 14px 0 0; }
.auth-foot { margin-top: 14px; text-align: center; color: var(--muted); font-size: .84rem; }
.auth-page .flash { max-width: 400px; }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .g-side { grid-template-columns: minmax(0, 1fr); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .g-2, .g-3, .g-21, .g-12 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(8, 15, 28, .45); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
  .topbar { padding: 8px 14px; gap: 10px; }
  .content { padding: 16px 14px 32px; }
  .client-tag { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.3rem; }
  .btn-new span { display: none; }
  .btn-new { padding: 8px 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-val { font-size: 1.3rem; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters label, .filters .grow { flex: 1 1 100%; }
  .filters select, .filters input[type="date"], .filters input[type="month"] { width: 100%; }
  .filter-btns { width: 100%; }
  .filter-btns .btn { flex: 1; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 1.35rem; }
  .colchart { height: 150px; gap: 3px; }
  .cc-bar b { font-size: .64rem; }
  .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 6px; }
  .app-foot { padding: 12px 14px 18px; }
  .daysheet .ds-prev { display: none; }
  .daysheet .ds-input { min-width: 150px; }
  .daysheet td, .daysheet th { padding: 7px 8px; }
}

/* ---------- print ---------- */

@media print {
  @page { size: A4 landscape; margin: 9mm; }
  body { background: #fff; font-size: 9.5pt; }
  .sidebar, .topbar, .no-print, .nav-scrim, .flash, .app-foot, .bulkbar, .pager, .filters, .chips, .tabs { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card, .table-wrap, .kpi { box-shadow: none; border-color: #bbb; }
  .tbl th { position: static; }
  .tbl td, .tbl th { padding: 4px 5px; }
  .mpd-wrap { max-height: none; overflow: visible; }
  .mpd .emp { position: static; }
  .hero { background: none; color: #000; box-shadow: none; padding: 0 0 8px; border-bottom: 2px solid #000; border-radius: 0; }
  .hero p, .hero .eyebrow, .hero-stat small { color: #333; }
  a { color: #000; }
  .desc-clip { -webkit-line-clamp: unset; display: block; }
  .report-head { display: block; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #000; }
  .report-head h1 { font-size: 15pt; }
  .no-break, .kpis, .statlist { break-inside: avoid; }
  .grid { display: block; }
  .grid > * { margin-bottom: 10px; }
  .sg-progress, .sg-await_wo, .sg-to_bill, .sg-billed, .sg-paid, .mixbar span, .minibar span, .progress > span, .heat-tbl td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
