/* Scope of Works: shared styles (admin and client portal). Light theme, accent #FF3400, Poppins. Calm and spacious; one idea per block. */
.sw-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--card-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.sw-chip.sw-draft { background: var(--card-2); color: var(--muted); }
.sw-chip.sw-sent, .sw-chip.sw-viewed { background: rgba(59,79,191,.1); color: var(--info); border-color: rgba(59,79,191,.28); }
.sw-chip.sw-signed { background: rgba(138,106,0,.1); color: var(--warn); border-color: rgba(138,106,0,.3); }
.sw-chip.sw-active, .sw-chip.sw-ok { background: rgba(15,122,74,.1); color: var(--ok); border-color: rgba(15,122,74,.3); }
.sw-chip.sw-declined, .sw-chip.sw-voided, .sw-chip.sw-expired { background: rgba(192,23,42,.08); color: var(--bad); border-color: rgba(192,23,42,.25); }
.sw-chip.sw-superseded { background: var(--card-2); color: var(--muted); text-decoration: line-through; }
.sw-chip.sw-requested { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.sw-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw-filter a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 14px; font-weight: 500; }
.sw-filter a[aria-current=true] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.sw-filter em { font-style: normal; font-size: 12px; color: var(--muted); }
.sw-lede { color: var(--muted); font-size: 14px; max-width: 62ch; }

/* the document */
.sw-doc { padding: 22px; display: flex; flex-direction: column; gap: 26px; }
.sw-doc h1 { font-size: 24px; }
.sw-doc h3.sw-h { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.sw-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: flex-start; }
.sw-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.sw-meta dt { color: var(--muted); } .sw-meta dd { margin: 0; }
.sw-sum { font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.sw-refs { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sw-refs li { list-style: none; display: flex; gap: 8px; align-items: baseline; }
.sw-refs, .sw-list { margin: 0; padding: 0; }
.sw-list li { list-style: none; position: relative; padding: 6px 0 6px 22px; border-bottom: 1px solid var(--border); font-size: 15px; }
.sw-list li:last-child { border-bottom: 0; }
.sw-list li::before { content: ""; position: absolute; left: 4px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sw-two { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .sw-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw-ms { display: flex; flex-direction: column; gap: 10px; counter-reset: ms; }
.sw-ms li { list-style: none; counter-increment: ms; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.sw-ms li::before { content: counter(ms); width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.sw-ms b { font-weight: 600; } .sw-ms .sw-acc { color: var(--muted); font-size: 14px; }
.sw-pay { width: 100%; border-collapse: collapse; font-size: 15px; }
.sw-pay th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; }
.sw-pay td { padding: 9px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.sw-pay .num { text-align: right; white-space: nowrap; }
.sw-flexi tfoot td { border-top: 2px solid var(--border); padding-top: 11px; }
.sw-flexi tr.sw-paid td { color: var(--muted); }
.sw-flexi td .tiny { margin-top: 2px; }
.sw-total { display: grid; grid-template-columns: 1fr max-content; gap: 6px 24px; justify-content: end; margin-top: 10px; font-size: 15px; }
.sw-total dt { color: var(--muted); text-align: right; } .sw-total dd { margin: 0; text-align: right; }
.sw-total .sw-grand { font-weight: 700; font-size: 18px; }
.sw-note { padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); font-size: 14px; }
.sw-note.sw-warn { background: rgba(138,106,0,.08); border-color: rgba(138,106,0,.35); color: var(--text); }
.sw-note b { font-weight: 600; }
.sw-sigs { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .sw-sigs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw-sig { border: 1px dashed var(--border); border-radius: 12px; padding: 14px; font-size: 14px; min-height: 92px; }
.sw-sig .sw-name { font-family: "Poppins", cursive; font-size: 20px; font-style: italic; margin: 4px 0; }
.sw-sig.sw-wait { color: var(--muted); }

/* admin: tabs, checklist, grid */
.sw-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.sw-tabs a { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); font-size: 15px; font-weight: 500; }
.sw-tabs a[aria-current=page] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.sw-check { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sw-check li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 14px; }
.sw-check li:first-child { border-top: 0; }
.sw-check .sw-tick { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--card-2); color: var(--muted); }
.sw-check .sw-ok .sw-tick { background: rgba(15,122,74,.14); color: var(--ok); }
.sw-check .sw-no .sw-tick { background: rgba(192,23,42,.12); color: var(--bad); }
.sw-check .sw-adv .sw-tick { background: rgba(138,106,0,.14); color: var(--warn); }
.sw-check .sw-hint { color: var(--muted); font-size: 13px; }
.sw-check a { color: var(--accent-text); }
.sw-grid { width: 100%; border-collapse: collapse; }
.sw-grid th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 6px 6px; }
.sw-grid td { padding: 5px 6px; vertical-align: top; }
.sw-grid input, .sw-grid select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); color: var(--text); font: 500 14px var(--body); }
.sw-grid input:focus, .sw-grid select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.sw-grid .sw-k { width: 104px; } .sw-grid .sw-q { width: 84px; } .sw-grid .sw-u { width: 120px; } .sw-grid .sw-a { width: 104px; text-align: right; white-space: nowrap; font-weight: 600; padding-top: 14px; } .sw-grid .sw-x { width: 84px; white-space: nowrap; }
.sw-grid .sw-sub { margin-top: 6px; display: flex; gap: 6px; }
.sw-grid .sw-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sw-grid td.sw-d { min-width: 200px; }
.sw-gfoot { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 10px; }
.sw-keys { font-size: 13px; color: var(--muted); }
.sw-keys kbd { font: 600 12px var(--body); padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--card); }
@media (max-width: 720px) {
  .sw-grid thead { display: none; }
  .sw-grid, .sw-grid tbody, .sw-grid tr, .sw-grid td { display: block; width: 100%; }
  .sw-grid tr { border: 1px solid var(--border); border-radius: 14px; padding: 8px; margin-bottom: 10px; background: var(--card); }
  .sw-grid .sw-k, .sw-grid .sw-q, .sw-grid .sw-u, .sw-grid .sw-a, .sw-grid .sw-x { width: 100%; }
  .sw-grid td.sw-a { padding-top: 4px; text-align: left; }
  .sw-grid td::before { content: attr(data-l); display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
}
.sw-rows { display: flex; flex-direction: column; gap: 10px; }
.sw-rowed { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
@media (min-width: 720px) { .sw-rowed.sw-ms-row { grid-template-columns: minmax(0, 1.2fr) 150px minmax(0, 1.4fr) auto; align-items: start; } .sw-rowed.sw-ref-row { grid-template-columns: 130px minmax(0, 1.6fr) 90px auto auto; align-items: center; } }
.sw-rowed input, .sw-rowed select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); color: var(--text); font: 500 14px var(--body); }
.sw-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sw-suggest button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px dashed var(--border); background: var(--card); font: 500 13px var(--body); color: var(--muted); cursor: pointer; }
.sw-suggest button:hover { border-color: var(--accent); color: var(--accent-text); }
.sw-tpl { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .sw-tpl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sw-tpl label { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); cursor: pointer; }
.sw-tpl label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sw-tpl b { font-weight: 600; } .sw-tpl span.small { color: var(--muted); }
.sw-sign { padding: 18px; display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--accent); border-radius: 16px; background: var(--card); }
.sw-sign h3 { font-size: 18px; }
.sw-flex { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sw-sticky { position: sticky; top: 64px; }
@media print { .no-print, .topbar, .tabbar, .sidebar, .rail { display: none !important; } .sw-doc { border: 0; box-shadow: none; padding: 0; } }
.sw-right { text-align: right; }
.sw-big { font-size: 22px; font-weight: 600; }
.sw-ms { margin: 0; padding: 0; }
