:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1d2330;
  --muted: #6b7280;
  --line: #e3e6eb;
  --accent: #0e7490;
  --accent-dark: #0b5c72;
  --danger: #b42318;
  --sidebar: #16202e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar); color: #cbd5e1; padding: 1.25rem 0; flex-shrink: 0; }
.brand { color: #fff; font-weight: 700; font-size: 1.2rem; padding: 0 1.25rem 1.25rem; }
.sidebar nav a, .sidebar nav .soon { display: block; padding: .55rem 1.25rem; color: #cbd5e1; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; border-left: 3px solid #22d3ee; padding-left: calc(1.25rem - 3px); }
.sidebar nav .soon { color: #64748b; cursor: default; }
.content { flex: 1; min-width: 0; padding: 2rem; max-width: 1100px; }
.card { overflow-x: auto; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: .2rem 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.card-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-wrap; }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: .5rem .95rem; font: inherit; cursor: pointer; }
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover { background: #f0f2f5; }
.btn.danger { background: var(--danger); }
.actions { display: flex; gap: .6rem; align-items: center; }
.actions form { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; color: var(--text); }
.tile:hover { border-color: var(--accent); text-decoration: none; }
.tile-value { display: block; font-size: 2rem; font-weight: 700; }
.tile-label { color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: #fafbfc; }
.tag { background: #e0f2f7; color: var(--accent-dark); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; }

.filters { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1; max-width: 360px; }
input, select, textarea { font: inherit; padding: .45rem .6rem; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; width: 100%; }
.filters select { width: auto; }
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
.form label input, .form label select, .form label textarea { margin-top: .3rem; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 1rem; }

.details { display: grid; grid-template-columns: 160px 1fr; gap: .5rem 1rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

.flash { background: #e7f6ec; border: 1px solid #b7e1c4; color: #1e5b33; padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; }
.errors { background: #fdecea; border: 1px solid #f5c2bd; color: var(--danger); padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1rem; }

.num { text-align: right; white-space: nowrap; }
.tag.grey { background: #eceef1; color: var(--muted); margin-left: .4rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.calc { position: sticky; top: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 .6rem; }
.edit-table td { padding: .35rem .4rem .35rem 0; border-bottom: 0; }
.edit-table tbody tr:hover { background: none; }
.edit-table tbody:empty::after { content: "None yet."; display: block; color: var(--muted); padding: .4rem 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.danger-text { color: var(--danger); }
.form label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form label.check input { width: auto; margin: 0; }
tr.total td { font-weight: 700; border-top: 2px solid var(--text); border-bottom: 0; font-size: 1.05rem; }
.empty { text-align: center; padding: 2rem; }
.empty .actions { justify-content: center; }

.status { display: inline-block; border-radius: 999px; padding: .1rem .65rem; font-size: .8rem; font-weight: 600; vertical-align: middle; }
.s-draft { background: #eceef1; color: #4b5563; }
.s-sent { background: #e0ecff; color: #1d4ed8; }
.s-accepted { background: #dcfce7; color: #166534; }
.s-rejected { background: #fde2e1; color: #b42318; }
.s-expired { background: #fef3c7; color: #92400e; }
h1 .status { font-size: .8rem; margin-left: .4rem; }
.status-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .7rem 1rem; }
.status-bar form { margin: 0; }
.small-btn { padding: .3rem .7rem; font-size: .88rem; }
.spacer { flex: 1; }
.actions.wrap { flex-wrap: wrap; justify-content: flex-end; }
.two-col-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
.quote-table td { vertical-align: top; }
.quote-table tfoot td { border-bottom: 0; padding: .3rem .5rem; text-align: right; }
.quote-table tfoot tr.sub td:first-child { color: var(--muted); }
.quote-table td form { margin: 0; }
#line-preview table { margin: .25rem 0 1rem; font-size: .9rem; }

/* ---- Jobs ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.column { background: #eceff3; border-radius: 10px; padding: .6rem; min-height: 220px; border: 2px solid transparent; }
.column.drop-target { border-color: var(--accent); background: #e0f2f7; }
.column header { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: #475569; padding: .2rem .3rem .6rem; display: flex; justify-content: space-between; }
.count { background: #fff; border-radius: 999px; padding: 0 .5rem; font-size: .8rem; color: var(--muted); }
.cards { display: flex; flex-direction: column; gap: .55rem; min-height: 60px; }
.job-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid #cbd5e1; border-radius: 8px; padding: .55rem .65rem; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.job-card.dragging { opacity: .45; }
.job-card.is-overdue { border-left-color: var(--danger); }
.job-card.is-today { border-left-color: #d97706; }
.job-card.is-soon { border-left-color: #eab308; }
.job-card-top { display: flex; justify-content: space-between; align-items: center; }
.job-no { font-size: .78rem; color: var(--muted); font-weight: 600; }
.job-title { display: block; color: var(--text); font-weight: 600; line-height: 1.3; margin: .15rem 0; }
.job-card-foot { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; }
.job-card-foot span:first-child { flex: 1; }
.job-card-foot form { margin: 0; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #164e63; color: #fff; font-size: .65rem; font-weight: 700; }
.next-btn { border: 1px solid var(--line); background: #f8fafc; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; font-size: 1.05rem; line-height: 1; color: var(--accent); }
.next-btn:hover { background: #e0f2f7; }

.prio { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 0 .35rem; vertical-align: middle; }
.p-high { background: #fef3c7; color: #92400e; }
.p-urgent { background: #fde2e1; color: var(--danger); }
h1 .prio { font-size: .7rem; margin-left: .3rem; }
.due { font-size: .78rem; font-weight: 600; border-radius: 4px; padding: 0 .35rem; }
.due-overdue { background: #fde2e1; color: var(--danger); }
.due-today { background: #ffedd5; color: #9a3412; }
.due-soon { background: #fef9c3; color: #854d0e; }
.stage-pill { background: #e0f2f7; color: var(--accent-dark); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; white-space: nowrap; }

.stepper { display: flex; gap: .25rem; overflow-x: auto; }
.stepper form { margin: 0; flex: 1; }
.step { width: 100%; display: flex; flex-direction: column; align-items: center; gap: .25rem; background: none; border: 0; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; padding: .35rem .2rem; border-radius: 8px; white-space: nowrap; }
.step:hover:not([disabled]) { background: #f1f5f9; }
.step .dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; font-weight: 700; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.current { color: var(--accent-dark); font-weight: 700; cursor: default; }
.step.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px #cdeef5; }
.status-bar.plain { padding: .8rem 0 0; margin: 0; border-top: 1px solid var(--line); margin-top: .8rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: 0; }
.inline-form label { flex: 1; min-width: 140px; margin-bottom: 0; }
.inline-form label.narrow { flex: 0 0 90px; min-width: 0; }
.note-input { flex: 1; min-width: 220px; width: auto; }
.callout { background: #f0fafc; border-color: #bfe6ee; }
.tile-alert { border-color: #f5c2bd; background: #fff7f6; }
.tile-alert .tile-value { color: var(--danger); }
.add-item { margin-top: .8rem; }
.add-item summary { cursor: pointer; color: var(--accent); }
.add-item form { margin-top: .6rem; }
.timeline { list-style: none; margin: 1rem 0 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 .8rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.timeline li.ev-stage::before { background: var(--accent); }
.timeline li.ev-created::before { background: #16a34a; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg a { padding: .45rem .85rem; color: var(--text); background: #fff; }
.seg a.on { background: var(--sidebar); color: #fff; }
.seg a:hover { text-decoration: none; }
.narrow-dl { grid-template-columns: 110px 1fr; }

/* ---- Invoices & payments ---- */
.s-unpaid { background: #e0ecff; color: #1d4ed8; }
.s-partial { background: #fef3c7; color: #92400e; }
.s-paid { background: #dcfce7; color: #166534; }
.s-overdue { background: #fde2e1; color: #b42318; }
.s-void { background: #eceef1; color: #6b7280; text-decoration: line-through; }
.big-num { font-size: 1.5rem; }
.aging { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.aging a { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; color: var(--text); }
.aging a:hover { border-color: var(--accent); text-decoration: none; }
.aging a span { font-size: .8rem; color: var(--muted); }
.aging a.warn { background: #fffbeb; border-color: #fde68a; }
.aging a.bad { background: #fff7f6; border-color: #f5c2bd; }
.aging a.bad strong { color: var(--danger); }
.cancelled-row td { color: var(--muted); text-decoration: line-through; }
.cancelled-row td:last-child { text-decoration: none; }
.inline-details { display: inline-block; text-align: left; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] form { margin-top: .4rem; }
.danger-zone { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.danger-zone form { margin: 0; }
.balance-line strong { font-size: 1.15rem; }
.paid-note { color: #166534; font-weight: 600; margin: 1rem 0 0; }
.sub-h { font-size: 1rem; margin: 1.25rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.inline-label { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; }
.inline-label input { width: auto; }
.small-value { font-size: 1.3rem; }
.quote-table tfoot tr.balance td { color: var(--danger); }
.owed { font-size: .85rem; font-weight: 600; color: var(--danger); margin-left: .4rem; }
.balance-due { color: var(--danger); font-weight: 600; margin-top: .2rem; }

/* ---- Reports ---- */
.range-label { font-size: 1rem; font-weight: 400; margin-left: .4rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.range-filter { flex-wrap: wrap; }
.range-filter .seg a { font-size: .85rem; padding: .4rem .7rem; }

/* Chart colours: reference data-viz palette, validated (blue/orange pass CVD checks;
   orange is below 3:1 on white, so the chart always has a table view and a legend) */
.viz-root {
  --series-1: #257de0;
  --series-2: #f47230;
  --chart-grid: #e7e7e7;
  --chart-axis: #c2c2c2;
  --chart-ink-2: #666666;
}
.legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--chart-ink-2, #666); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.key.s1 { background: var(--series-1); }
.key.s2 { background: var(--series-2); }
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart .tick { fill: var(--chart-ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar.s1 { fill: var(--series-1); }
.chart .bar.s2 { fill: var(--series-2); }
.chart .hit { fill: transparent; }
.chart .col-group { cursor: default; outline: none; }
.chart .col-group.on .hit, .chart .col-group:focus .hit { fill: rgba(0, 0, 0, .04); }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid rgba(11,11,11,.10); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.10); padding: .5rem .7rem; font-size: .85rem; white-space: nowrap; z-index: 2; }
.chart-tip div { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; }
.table-view { margin-top: .5rem; }
.table-view summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.table-view table { margin-top: .5rem; }

.report td, .report th { font-variant-numeric: tabular-nums; }
.report tfoot td { border-bottom: 0; }
.bar-col { width: 22%; min-width: 120px; }
td.bar-col { white-space: nowrap; }
.hbar { display: inline-block; height: 10px; background: #257de0; border-radius: 0 4px 4px 0; vertical-align: middle; margin-right: .4rem; max-width: calc(100% - 3rem); min-width: 2px; }
.owed-cell { color: var(--danger); font-weight: 600; }
.fin { width: 100%; }
.fin td { padding: .35rem 0; }
.cost-list { width: 100%; margin-top: .75rem; }
.cost-list td { padding: .35rem .3rem; }
.inline-form label.narrow-date { flex: 0 0 150px; min-width: 0; }

/* content width = window minus the 220px sidebar, so stack well before it gets tight */
@media (max-width: 1100px) {
  .two-col { grid-template-columns: 1fr; }
  .calc { position: static; }
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: auto; padding: .75rem 0; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .brand { padding-bottom: .5rem; }
  .content { padding: 1rem; }
  .details { grid-template-columns: 1fr; }
}

/* ---- Logins ---- */
.auth-page { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 3rem 1rem; box-sizing: border-box; }
.auth-box { width: 100%; max-width: 420px; }
.auth-brand { font-weight: 700; font-size: 1.4rem; color: var(--sidebar); margin-bottom: 1rem; }
.auth-box h1 { font-size: 1.35rem; }
.btn.wide { width: 100%; padding: .65rem; }
.form.narrow { max-width: 460px; }
.sidebar .me { margin: 1.25rem 1.25rem 0; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .88rem; }
.sidebar .me a, .sidebar .me button { color: #cbd5e1; }
.sidebar .me .who { color: #fff; font-weight: 600; }
.sidebar .me .role { color: #94a3b8; font-size: .8rem; margin-bottom: .4rem; }
.sidebar .me form { display: inline; margin: 0; }
.login-box { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.login-box[hidden] { display: none; }
.backup-path { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; word-break: break-all; }
@media (max-width: 760px) { .sidebar .me { margin-top: .5rem; padding-top: .5rem; } }

/* ---- Artwork proofs ---- */
.timeline li.ev-proof::before { background: #9333ea; }
.proof-latest { display: flex; gap: 1rem; align-items: flex-start; }
.proof-thumb { flex: 0 0 160px; height: 120px; border: 1px solid var(--line); border-radius: 8px; background: #f6f7f9; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.proof-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdf-icon { font-weight: 700; color: #b91c1c; border: 2px solid #b91c1c; border-radius: 4px; padding: .3rem .5rem; }
.proof-info { min-width: 0; display: grid; gap: .25rem; }
.proof-answer { background: #f6f7f9; border-radius: 6px; padding: .4rem .6rem; }
.proof-share { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; display: grid; gap: .7rem; }
.copy-row { display: flex; gap: .5rem; margin-top: .3rem; }
.copy-row input { font-size: .85rem; }
.actions.left { justify-content: flex-start; }
.warn { background: #fef3c7; border: 1px solid #fde68a; color: #78350f; padding: .5rem .7rem; border-radius: 8px; margin: 0; }
.proof-history { margin-top: 1rem; }
.status.ps-pending { background: #e0ecff; color: #1d4ed8; }
.status.ps-approved { background: #dcfce7; color: #166534; }
.status.ps-changes { background: #fef3c7; color: #92400e; }
.status.ps-replaced { background: #eceef1; color: var(--muted); }
.proof-badge { display: inline-block; font-size: .75rem; border-radius: 999px; padding: .05rem .5rem; margin-top: .25rem; }
.pb-pending { background: #e0ecff; color: #1d4ed8; }
.pb-approved { background: #dcfce7; color: #166534; }
.pb-changes { background: #fef3c7; color: #92400e; }
.proof-page { background: var(--bg); }
.proof-box { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.proof-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.proof-box h1 { font-size: 1.35rem; margin-bottom: .2rem; }
.proof-view { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin: 1rem 0; text-align: center; }
.proof-view img { max-width: 100%; max-height: 75vh; }
.proof-view iframe { width: 100%; height: 75vh; border: 0; }
.proof-done.ok { border-color: #b7e1c4; background: #e7f6ec; color: #1e5b33; }
.decision { border: 0; padding: 0; margin: 0 0 .9rem; display: grid; gap: .4rem; }
@media (max-width: 760px) { .proof-latest { flex-direction: column; } .proof-thumb { flex-basis: auto; width: 100%; height: 200px; } }

/* ---- Inventory ---- */
.stock-flag { display: inline-block; font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 0 .45rem; margin-left: .3rem; vertical-align: middle; }
.stock-flag.low { background: #fef3c7; color: #92400e; }
.stock-flag.out { background: #fdecea; color: var(--danger); }
td.neg, .neg { color: var(--danger); }
td.pos { color: #166534; }
.filters { margin-bottom: 1rem; flex-wrap: wrap; }
.fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem 0; margin: 0 0 1rem; }
.fieldset legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.low-stock { border-left: 4px solid #f59e0b; }
.stock-actions { align-items: start; }

/* ---- Notifications & customer messages ---- */
.sidebar .me .bell { display: inline-flex; align-items: center; gap: .3rem; margin: .1rem 0 .5rem; color: #cbd5e1; }
.sidebar .me .bell.has-new { color: #fff; font-weight: 600; }
.bell-count { background: #ef4444; color: #fff; border-radius: 999px; font-size: .72rem; padding: 0 .45rem; font-weight: 700; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { border-bottom: 1px solid var(--line); }
.alert-list li a { display: flex; justify-content: space-between; gap: 1rem; padding: .65rem .4rem; color: var(--text); }
.alert-list li a:hover { background: #f6f7f9; text-decoration: none; }
.alert-list li.unread .alert-text { font-weight: 600; }
.alert-list li.unread a { border-left: 3px solid var(--accent); padding-left: .6rem; }
.alert-list li.read { opacity: .7; }
.alert-list .muted { white-space: nowrap; }
.tell { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .9rem; display: grid; gap: .5rem; }
.card > .tell:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.tell-text { background: #f6f7f9; border-radius: 6px; padding: .5rem .7rem; color: #374151; white-space: pre-wrap; }
.tell-form { display: inline-flex; gap: .5rem; margin: 0; }
.btn.wa { background: #16a34a; }
.btn.wa:hover { background: #15803d; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.msg-log { margin-top: .8rem; }
.msg-log summary { cursor: pointer; color: var(--muted); }
.msg-log ul { margin-top: .5rem; }
.status.ms-sent { background: #dcfce7; color: #166534; }
.status.ms-failed { background: #fdecea; color: var(--danger); }
.status.ms-sending { background: #e0ecff; color: #1d4ed8; }
.msg-body { max-width: 320px; white-space: pre-wrap; }
.tpl-row { margin-bottom: .6rem; }
.tpl-row label { margin-bottom: .2rem; }
.tpl-meta { display: flex; flex-direction: column; gap: .3rem; }
.form .tpl-meta label.check { margin: 0; font-weight: 400; }

/* ---- KRA eTIMS ---- */
.etims-card.etims-todo { border-left: 4px solid var(--danger); }
.etims-card h2 .status { font-size: .75rem; margin-left: .4rem; }
.etims-sheet { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; }
.etims-sheet summary { cursor: pointer; }
.etims-sheet table { margin: .6rem 0; background: #fff; }
.etims-sheet .details { margin-top: .6rem; }
.etims-flag { display: inline-block; background: #fde2e1; color: var(--danger); border-radius: 999px; padding: .05rem .55rem; font-size: .78rem; font-weight: 600; margin-left: .3rem; white-space: nowrap; }
.inline-grid { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.inline-grid label { margin-bottom: 0; }

/* ---- Customer portal ---- */
.portal-head { align-items: center; padding-bottom: .6rem; }
.portal-head .auth-brand { display: inline-block; margin-bottom: .1rem; }
.portal-head .auth-brand:hover { text-decoration: none; }
.portal-me { text-align: right; }
.portal-me form { margin: 0; }
.portal-foot { text-align: center; margin-top: 2rem; }
.portal-login { max-width: 460px; margin: 1rem auto; }
.portal-login h1 { margin-bottom: .6rem; }
.portal-switch { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: -.6rem 0 1rem; }
.portal-todo { border-left: 4px solid var(--accent); }
.portal-todo li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: .35rem 0; }
.portal-todo .todo-text { flex: 1 1 260px; }
.portal-todo li .btn { margin-left: auto; }
.portal .nowrap { white-space: nowrap; }
.portal .show-sm { display: none; }
.portal-total { text-align: right; margin: .6rem .5rem 0; }
.todo-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; border-radius: 4px; padding: 0 .4rem; }
.todo-tag.proof { background: #e0ecff; color: #1d4ed8; }
.todo-tag.quote { background: #fef3c7; color: #92400e; }
.todo-tag.money { background: #fde2e1; color: var(--danger); }
.portal-pay { margin-top: .8rem; background: #f6f7f9; border-radius: 8px; padding: .6rem .8rem; }
.portal-past { margin-top: .8rem; }
.portal-past summary { cursor: pointer; color: var(--muted); }
.portal-sub { margin: 1.2rem 0 .3rem; text-transform: uppercase; letter-spacing: .03em; }
.stage-pill.ready { background: #dcfce7; color: #166534; font-weight: 600; }
.portal-stepper .step { cursor: default; flex: 1 1 0; }
@media (max-width: 600px) { .portal-stepper { flex-wrap: wrap; row-gap: .6rem; } .portal-stepper .step { flex: 0 0 calc(25% - .25rem); white-space: normal; text-align: center; } }
.portal-stepper .step:hover { background: none; }
@media (max-width: 600px) {
  .portal-head { flex-direction: column; align-items: flex-start; }
  .portal-me { text-align: left; }
  .portal .card { padding: .9rem; }
  .portal th, .portal td { padding: .5rem .3rem; }
  .portal .hide-sm { display: none; }
  .portal .show-sm { display: block; }
}
.portal-card .portal-link { display: flex; gap: .5rem; align-items: center; }
.portal-card .portal-link input { flex: 1; font-family: ui-monospace, monospace; font-size: .85rem; }
