/* Fynro Workspace — hand-written so it needs no build step. */
:root {
  /* Same palette as the FynroHub portal: navy, Fynro blue, gold. */
  --bg: #f8fafc; --panel: #ffffff; --line: #e2e8f0; --line-2: #cbd5e1;
  --ink: #0f172a; --ink-2: #475569; --muted: #64748b;
  --brand: #046bd2; --brand-ink: #0358ac; --brand-soft: #eaf3fc;
  --navy: #0b1222; --navy-2: #131c33;
  --gold: #c9a34a; --gold-soft: #faf4e4; --green: #059669; --green-soft: #e7f7f0;
  --red: #e11d48; --red-soft: #fff1f3; --violet: #7c3aed; --violet-soft: #f3efff;
  --teal: #0d9488; --teal-soft: #e6f6f4; --amber-soft: #fff7e6;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 4px 16px rgba(15,23,42,.04);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
[x-cloak] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Shell */
.ws { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--navy); color: #cbd5e1; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.06); overflow: hidden; }
.brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.brand-name { font-weight: 750; font-size: 19px; color: #fff; line-height: 1; }
.brand-name span { color: var(--gold); }
.brand-sub { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .14em; color: var(--gold); background: rgba(201,163,74,.15); padding: 2px 8px; border-radius: 6px; margin-top: 6px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-item, .nav-group > button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: #cbd5e1; font: inherit; font-weight: 550; cursor: pointer; text-align: left; }
.nav-item:hover, .nav-group > button:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.nav-ico { width: 20px; height: 20px; flex: none; }
.nav-group .chev { margin-left: auto; width: 16px; height: 16px; transform-origin: 50% 50%; }
.nav-group.open .chev { transform: rotate(90deg); }
.nav-sub { margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-sub .nav-item { font-weight: 500; padding: 7px 10px; }
.nav-sub .nav-item.active { border-left: 3px solid var(--gold); margin-left: -15px; padding-left: 22px; border-radius: 0 10px 10px 0; }
.ico-violet { color: var(--violet); } .ico-teal { color: var(--teal); } .ico-gold { color: var(--gold); } .ico-blue { color: var(--brand); } .ico-green { color: var(--green); }
.side .ico-violet, .side .ico-teal, .side .ico-gold, .side .ico-blue { color: #94a3b8; }
.side .nav-item.active .nav-ico, .side .nav-item:hover .nav-ico { color: var(--gold); }
.me { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 14px 14px; }
.me-row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.me-name { font-weight: 650; font-size: 13px; color: #fff; }
.me-role { font-size: 11.5px; color: #94a3b8; }
.me-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; }
.me-links > * { white-space: nowrap; }
.me-links a, .me-links button { color: #94a3b8; text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.main { min-width: 0; padding: 32px 36px 60px; }
.topbar { display: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.crumb { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.sub { color: var(--muted); margin-top: 4px; }

/* Cards & grid */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row > .input, .row > select.input { width: auto; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; }

.stat { padding: 16px 18px; }
.stat-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--muted); margin-top: 6px; font-size: 13px; }
.bg-violet { background: var(--violet-soft); color: var(--violet); } .bg-gold { background: var(--gold-soft); color: var(--gold); }
.bg-red { background: var(--red-soft); color: var(--red); } .bg-blue { background: var(--brand-soft); color: var(--brand); }
.bg-green { background: var(--green-soft); color: var(--green); } .bg-teal { background: var(--teal-soft); color: var(--teal); }

.module { padding: 22px; display: flex; flex-direction: column; }
.module-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; }
.module h2 { font-size: 19px; }
.module .tag { font-family: var(--mono); font-size: 12.5px; margin: 6px 0 8px; }
.module .desc { color: var(--ink-2); flex: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.mini-stats div { background: #f1f5f9; border-radius: 10px; padding: 10px 12px; }
.mini-stats b { display: block; font-size: 18px; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.thought { padding: 20px 22px; display: flex; gap: 16px; }
.thought-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--gold-soft); display: grid; place-items: center; flex: none; }
.thought-text { white-space: pre-line; font-size: 15px; line-height: 1.8; color: var(--ink-2); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: #f1f5f9; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); }
.btn-blue { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-blue:hover { background: var(--brand-ink); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { color: var(--red); border-color: #efc5c1; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

/* Forms */
label.lbl, .lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.req { color: var(--red); }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font: inherit; color: var(--ink); }
.input:focus { outline: 2px solid rgba(4,107,210,.25); border-color: var(--brand); }
.input.err { border-color: var(--red); }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.error { font-size: 12px; color: var(--red); margin-top: 5px; font-weight: 600; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 18px; }
.fields .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.section { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.section + .section { margin-top: 16px; }
.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink); }
.section-sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 14px; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; cursor: pointer; }
.choice input { accent-color: var(--brand); margin-right: 6px; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* Tabs / pills */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 9px; color: var(--ink-2); font-weight: 600; text-decoration: none !important; }
.pill:hover { background: #f1f5f9; }
.pill .count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pill.on { background: var(--brand); color: #fff; }
.pill.on .count { color: #fff; }
.filters { padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.search { position: relative; }
.search input { padding-left: 34px; min-width: 260px; }
.search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #f8fafc; }
.tbl .strong { font-weight: 650; color: var(--ink); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; }
.badge-mono { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; border-radius: 6px; }
.st-intake_received { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.st-missing_info { background: var(--red-soft); color: var(--red); }
.st-ready_for_review { background: var(--brand-soft); color: var(--brand-ink); }
.st-sent_to_client { background: var(--violet-soft); color: var(--violet); }
.st-signed_by_client { background: var(--teal-soft); color: var(--teal); }
.st-faxed { background: var(--green-soft); color: var(--green); }
.st-completed { background: #1f8a4c; color: #fff; }
.fx-processing { background: var(--amber-soft); color: #9a6a00; } .fx-faxed { background: var(--green-soft); color: var(--green); } .fx-failed { background: var(--red-soft); color: var(--red); }
.year-badge { background: var(--violet-soft); color: var(--violet); font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); } .dot-gray { background: #b9b3a6; } .dot-gold { background: var(--gold); } .dot-red { background: var(--red); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 550; border: 1px solid; }
.alert-ok { background: var(--green-soft); border-color: #bfe3cc; color: #17673a; }
.alert-err { background: var(--red-soft); border-color: #f0c4bf; color: #9a2a22; }
.alert-info { background: var(--brand-soft); border-color: #c9dcf4; color: var(--brand-ink); }
.alert-warn { background: var(--amber-soft); border-color: #f1dca8; color: #7a5600; }

/* Return editor */
.toolbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); margin: -32px -36px 24px; padding: 0 12px; overflow-x: auto; }
.tool { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 84px; padding: 12px 10px; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; text-decoration: none !important; border-right: 1px solid #f1f5f9; }
.tool:hover { background: #f8fafc; }
.tool .ti { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.tool .ti svg { width: 17px; height: 17px; }
.tool[disabled] { opacity: .45; cursor: not-allowed; }
.tool-status { margin-left: auto; padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; font-size: 12px; color: var(--muted); }
.tool-status b { color: var(--ink); font-size: 13px; }
.editor { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; align-items: start; }
.steps { padding: 8px; }
.steps-title { padding: 10px 12px 6px; font-weight: 700; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 550; text-decoration: none !important; }
.step:hover { background: #f1f5f9; }
.step.on { background: var(--brand-soft); color: var(--ink); box-shadow: inset -3px 0 0 var(--brand); }
.step-ico { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.step-ok { background: var(--green-soft); color: var(--green); }
.step-miss { background: var(--red-soft); color: var(--red); }
.progress { height: 7px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--green)); }
.meta { font-size: 12px; color: var(--muted); line-height: 1.8; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; word-break: break-word; }
.intake-box { background: var(--brand-soft); border: 1px dashed #a9c9ee; border-radius: 12px; padding: 14px 16px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.timeline li:last-child { border: 0; }

/* Modal */
dialog.modal { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); background: var(--panel); color: var(--ink); }
dialog.modal::backdrop { background: rgba(15,20,30,.45); }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.pdf-frame { width: 100%; height: 70vh; border: 0; background: #e9e5dc; display: block; }

/* Time clock */
.clock-state { font-size: 22px; font-weight: 700; margin: 6px 0 16px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.cal-head { font-family: var(--mono); font-size: 10.5px; color: var(--muted); text-align: center; text-transform: uppercase; }
.cal-day { border-radius: 10px; padding: 8px; min-height: 70px; border: 1px solid var(--line); background: #fff; font-size: 11.5px; }
.cal-day b { font-size: 13px; }
.cal-off { background: #f1f5f9; color: var(--muted); }
.cal-present { background: var(--green-soft); border-color: #c6e7d3; }
.cal-late { background: var(--amber-soft); border-color: #f0dca9; }
.cal-leave { background: var(--violet-soft); border-color: #dcd1f7; }
.cal-absent { background: var(--red-soft); border-color: #f1cbc6; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-present::before { background: #bfe3cc; } .lg-late::before { background: #f1dca8; } .lg-leave::before { background: #dcd1f7; } .lg-absent::before { background: #f0c4bf; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 0%, #1b2a4d, var(--navy) 55%); }
.auth-card { width: min(420px, 100%); padding: 32px 30px; text-align: left; }
.auth-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; margin: 0 auto 16px; color: var(--brand); }
.code-input { text-align: center; font-family: var(--mono); font-size: 26px; letter-spacing: .5em; }

/* Responsive */
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, 1fr); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .ws { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .side.open { transform: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .main { padding: 20px 16px 50px; }
  .toolbar { margin: -20px -16px 18px; }
  .g2, .g3, .fields, .editor { grid-template-columns: 1fr; }
  .g5 { grid-template-columns: repeat(2, 1fr); }
  .search input { min-width: 0; width: 100%; }
}
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; }

/* Capital letters in the return interview (emails stay as typed). */
.caps input[type=text], .caps input:not([type]), .caps select, .caps textarea { text-transform: uppercase; }
.caps input[type=email] { text-transform: none; }
.country-pick { display: flex; gap: 8px; align-items: center; }
.country-pick select { flex: 1; }
.code-chip { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); border-radius: 8px; padding: 9px 10px; white-space: nowrap; }
.side .brand { border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 8px; }

/* ==========================================================================
   Fynro premium theme (navy & gold) — same look as the portals.
   ========================================================================== */
:root {
  --bg: #f5f3ee; --line: #e8e2d4; --line-2: #d9d1bf;
  --ink: #0d1a2e; --ink-2: #3a4558; --muted: #6d7586;
  --brand: #17345f; --brand-ink: #0f2546; --brand-soft: #eef2f8;
  --navy: #0a1a33; --navy-2: #0f2546; --navy-3: #17345f;
  --gold: #c9a34a; --gold-2: #e2c47f; --gold-ink: #8a6a1f; --gold-soft: #f8f1df;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(10, 26, 51, .04), 0 10px 30px -18px rgba(10, 26, 51, .22);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}
::selection { background: var(--gold-2); color: var(--navy); }
a { color: var(--navy-3); }
a:hover { color: var(--gold-ink); }
h1 { font-family: var(--serif); font-size: 32px; font-weight: 700; color: var(--ink); }
.page-head h1 { position: relative; padding-top: 14px; }
.page-head h1::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.crumb { color: var(--gold-ink); }
.stat-num { font-family: var(--serif); font-size: 30px; }

/* Sidebar */
.side { background: radial-gradient(120% 60% at 0% 0%, rgba(201, 163, 74, .10), transparent 55%), linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 60%); border-right: 1px solid rgba(201, 163, 74, .18); position: sticky; }
.side::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.brand-sub { border: 1px solid rgba(201, 163, 74, .35); background: rgba(201, 163, 74, .08); border-radius: 999px; padding: 3px 10px; color: var(--gold-2); }
.nav-item, .nav-group > button { color: #c5cede; border-radius: 11px; }
.nav-item.active { background: linear-gradient(90deg, rgba(201, 163, 74, .18), rgba(201, 163, 74, .04)); color: #fff; font-weight: 600; }
.nav-item.active::after { display: none; }
.nav-sub .nav-item.active { border-left-color: var(--gold); }
.side .nav-item.active .nav-ico, .side .nav-item:hover .nav-ico, .side .nav-group > button:hover .nav-ico { color: var(--gold); }
.avatar { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: var(--navy); box-shadow: 0 0 0 2px rgba(201, 163, 74, .25); }
.me-links a, .me-links button { color: #9aa6bb; }
.me-links a:hover, .me-links button:hover { color: var(--gold-2); }

/* Cards, buttons, inputs */
.card { border-color: var(--line); box-shadow: var(--shadow); }
.card-head { border-bottom-color: var(--line); }
.btn { border-color: var(--line-2); border-radius: 11px; }
.btn:hover { background: #fffdf8; border-color: var(--gold); }
.btn-primary, .btn-blue, .btn-dark { background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); border-color: var(--navy-2); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 14px -8px rgba(10,26,51,.8); }
.btn-primary:hover, .btn-blue:hover, .btn-dark:hover { background: linear-gradient(180deg, var(--navy-2), var(--navy)); border-color: var(--gold); color: #fff; }
.btn-primary svg, .btn-blue svg, .btn-dark svg { color: var(--gold-2); }
.btn-green:hover { background: #047857; color: #fff; }
.link-btn { color: var(--navy-3); }
.link-btn:hover { color: var(--gold-ink); }
.input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 163, 74, .22); }
.pill.on { background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); color: #fff; box-shadow: inset 0 -2px 0 var(--gold); }
.pill:hover { background: var(--gold-soft); }
.tbl th { background: #faf8f3; }
.tbl tr:hover td { background: #fdfbf6; }
.mini-stats div { background: #f7f4ec; }
.thought-ico { background: var(--gold-soft); }
.module h2, .card h2 { color: var(--ink); }

/* Return editor */
.toolbar { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom-color: var(--line); box-shadow: 0 6px 18px -14px rgba(10,26,51,.35); }
.tool { border-right-color: #f2eee4; color: var(--ink-2); }
.tool:hover { background: var(--gold-soft); }
.step.on { background: var(--gold-soft); box-shadow: inset 3px 0 0 var(--gold); }
.step:hover { background: #faf6ec; }
.progress span { background: linear-gradient(90deg, var(--navy-3), var(--gold)) !important; }
.modal-head { background: #faf8f3; }
dialog.modal::backdrop { background: rgba(6, 14, 28, .55); backdrop-filter: blur(2px); }

/* Sign-in pages */
.auth { background: radial-gradient(70% 60% at 100% 0%, rgba(201, 163, 74, .18), transparent 60%), linear-gradient(160deg, var(--navy-2), var(--navy)); }
.auth-card { border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); border: 1px solid rgba(201,163,74,.25); }
.auth-card h2 { font-family: var(--serif); }
.auth-icon { background: var(--gold-soft) !important; color: var(--gold-ink) !important; }

/* ---- Fax Center ---- */
.fx-queued { background: #eef2ff; color: #3730a3; } .fx-sending { background: var(--amber-soft); color: #9a6a00; } .fx-awaiting { background: #fff4e5; color: #b45309; }
.fx-sent { background: var(--green-soft); color: var(--green); } .fx-cancelled { background: #f1f5f9; color: #64748b; }
.fx-sending::before, .fx-queued::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: fxpulse 1.2s infinite; }
@keyframes fxpulse { 50% { opacity: .25; } }
.fax-provider { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(135deg, #0f2a52, #17345f); color: #fff; }
.fax-provider b { color: #e5c776; }
.fax-provider .btn { margin-left: auto; }
.fax-files { display: flex; flex-wrap: wrap; gap: 6px; }
.fax-files a { font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; color: var(--ink); background: #fff; }
.fax-files a:hover { border-color: var(--gold); }
.fax-log { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; padding-left: 16px; }
.drv { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: #fff; }
.drv.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,74,.18); background: #fffdf7; }
.drv small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.st-approved_by_client { background: var(--teal-soft); color: var(--teal); }

/* ---- Responsive hardening ---- */
.ws { grid-template-columns: 264px minmax(0, 1fr); }
.ws > div, .grid > *, .editor > *, .row > * { min-width: 0; }
.tbl { min-width: 100%; }
.card.table-wrap, .table-wrap { max-width: 100%; position: relative; }
@media (max-width: 900px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed !important; top: 0; bottom: 0; left: 0; height: 100vh; width: 280px; z-index: 60; transform: translateX(-100%); }
  .side.open { transform: none; }
  .topbar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .page-head h1 { font-size: 26px; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .modal-body .fields, .fields { grid-template-columns: 1fr; }
  dialog.modal { width: calc(100vw - 20px) !important; max-height: calc(100vh - 20px); }
  .row.between { flex-wrap: wrap; }
  .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; }
  .fax-provider { flex-wrap: wrap; }
  .fax-provider .btn { margin-left: 0; }
  .g5[style] { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 520px) {
  .main { padding: 16px 12px 40px; }
  .toolbar { margin: -16px -12px 14px; }
  .g5, .g5[style] { grid-template-columns: 1fr 1fr !important; }
  .stat-num { font-size: 22px; }
}
.card:has(> .tbl), .section:has(> .tbl) { overflow-x: auto; position: relative; }
