/* Bastion by GovernEdge. Brand pair from the logo SVGs: navy #0b2644, gold #caa73f.
   Gold is never text on a light ground (2.31:1). RAG colours below are a provisional
   prototype choice: the brand has no semantic alert colour yet. */
:root {
  --navy: #0b2644; --navy-2: #13355c; --gold: #caa73f;
  --ink: #000; --muted: #4a5565; --line: #e3e7ee; --bg: #f5f7fa; --card: #fff;
  --red: #b42318; --red-bg: #fef3f2; --amber: #b54708; --amber-bg: #fffaeb;
  --green: #067647; --green-bg: #ecfdf3; --blue-bg: #eef3fa;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--navy); }
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px 22px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px; }
.mark { width: 30px; height: 36px; }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.by { color: var(--gold); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
nav a { display: block; color: #dfe6f0; text-decoration: none; padding: 9px 12px; border-radius: 8px; margin-bottom: 2px; border-left: 3px solid transparent; }
nav a:hover { background: var(--navy-2); color: #fff; }
nav a.on { background: var(--navy-2); color: #fff; border-left-color: var(--gold); }
.side-foot { margin-top: auto; font-size: 12px; color: #c4cfdd; }
.side-foot select { display: block; margin-top: 4px; width: 100%; padding: 6px; border-radius: 6px; border: 0; }
.proto { margin-top: 12px; padding: 8px; border: 1px dashed rgba(202,167,63,.6); border-radius: 6px; color: var(--gold); }
.main { padding: 26px 30px 60px; max-width: 1400px; width: 100%; }
h1 { color: var(--navy); font-size: 24px; margin: 0 0 4px; }
h2 { color: var(--navy); font-size: 16px; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-top: 3px solid var(--navy); }
.kpi .n { font-size: 28px; font-weight: 700; color: var(--navy); }
.kpi .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.kpi.red { border-top-color: var(--red); } .kpi.red .n { color: var(--red); }
.kpi.amber { border-top-color: var(--amber); } .kpi.amber .n { color: var(--amber); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.grid2 > * { min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 2px solid var(--gold); padding: 6px 8px; }
td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: top; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--blue-bg); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pill.overdue, .pill.red { background: var(--red-bg); color: var(--red); }
.pill.due-7, .pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.due-30, .pill.upcoming { background: var(--blue-bg); color: var(--navy); }
.pill.filed, .pill.green { background: var(--green-bg); color: var(--green); }
.pill.verify { background: #f2f4f7; color: var(--muted); border: 1px dashed #98a2b3; }
.pill.demo { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.red { background: var(--red); } .dot.amber { background: #f79009; } .dot.green { background: #17b26a; }
.muted { color: var(--muted); } .small { font-size: 12px; }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--navy); background: var(--navy); color: #fff; padding: 7px 14px; border-radius: 8px; }
button.ghost { background: #fff; color: var(--navy); }
button.mini { padding: 3px 9px; font-size: 12px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #cfd6e0; border-radius: 8px; width: 100%; background: #fff; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; max-width: 220px; }
/* Calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal .dow { background: var(--navy); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 8px; }
.cal .day { background: #fff; min-height: 112px; padding: 6px; }
.cal .day.other { background: #fafbfc; color: #98a2b3; }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.cal .day.hol { background: #fbf8ee; }
.cal .num { font-size: 12px; font-weight: 600; margin-bottom: 4px; display: flex; justify-content: space-between; }
.cal .ev { font-size: 11px; padding: 2px 5px; border-radius: 4px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--navy); background: var(--blue-bg); }
.cal .ev.overdue { border-left-color: var(--red); background: var(--red-bg); }
.cal .ev.due-7 { border-left-color: #f79009; background: var(--amber-bg); }
.cal .ev.filed { border-left-color: #17b26a; background: var(--green-bg); text-decoration: line-through; color: var(--muted); }
.cal .ev.task { border-left-color: var(--gold); background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); }
/* Kanban */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.col { background: #eef1f5; border-radius: 12px; padding: 10px; min-height: 200px; }
.col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--navy); margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.col.drop { outline: 2px dashed var(--gold); }
.tcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: grab; }
.tcard.high { border-left: 3px solid var(--red); }
.tcard .t { font-weight: 600; margin-bottom: 4px; }
.tcard .m { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.late { color: var(--red); font-weight: 600; }
/* Client profile */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; }
.facts div span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.feed li { margin-bottom: 6px; } .feed { padding-left: 18px; margin: 0; }
/* Modal and toast */
.modal { position: fixed; inset: 0; background: rgba(11,38,68,.45); display: grid; place-items: center; z-index: 10; padding: 16px; }
.modal-card { background: #fff; border-radius: 14px; padding: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form label { font-size: 12px; color: var(--muted); display: block; }
.form .full { grid-column: 1 / -1; }
.form .check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; }
.form .check input { width: auto; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; border-left: 4px solid var(--gold); z-index: 20; }
code, pre { background: #f2f4f7; border-radius: 6px; padding: 2px 6px; font-size: 12px; }
pre { padding: 10px; overflow: auto; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side-foot { margin-top: 10px; }
  .grid2, .board { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 40px; }
  .cal .day { min-height: 70px; }
  .form { grid-template-columns: 1fr; }
}
/* v0.2: tabs, progress, notices, job card, print */
h3 { color: var(--navy); font-size: 13px; margin: 14px 0 8px; text-transform: uppercase; letter-spacing: .6px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }
.count { background: var(--red-bg); color: var(--red); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.bar { height: 6px; background: #e7ebf1; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.bar span { display: block; height: 100%; background: var(--navy); border-right: 2px solid var(--gold); }
.notice { border-left: 4px solid var(--gold); background: #fffdf5; }
.nowrap { white-space: nowrap; }
.sub-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.sub-card summary { cursor: pointer; }
.cal .ev.req { border-left-color: var(--gold); background: #fffaeb; }
.btn.mini { padding: 3px 9px; font-size: 12px; text-decoration: none; display: inline-block; }
a.btn { text-decoration: none; display: inline-block; }
.btn.ghost { background: #fff; color: var(--navy); }
.jc-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 14px; }
tr.total td { border-top: 2px solid var(--navy); }
.print-only { display: none; }
@media print {
  .side, .no-print, .toast, .modal { display: none !important; }
  .shell { display: block; } .main { padding: 0; }
  body { background: #fff; } .card { border: 0; padding: 0; }
  .print-only { display: block; }
}
/* v0.3 Bastion: identity, snapshot, admin */
.me-name { color: #fff; font-weight: 600; font-size: 14px; }
.me-role { color: #c4cfdd; font-size: 11px; margin-bottom: 8px; word-break: break-all; }
.snap-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; border-radius: 12px; margin-bottom: 16px; color: #fff; background: var(--navy); border-left: 6px solid var(--gold); }
.snap-head.red { border-left-color: #f04438; } .snap-head.amber { border-left-color: #f79009; } .snap-head.green { border-left-color: #17b26a; }
.snap-head .small { color: #dfe6f0; }
.snap-status { font-size: 20px; font-weight: 700; margin: 2px 0; }
.snap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.snap-grid > * { min-width: 0; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding-top: 2px; }
.dl dd { margin: 0; }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.area { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.area-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .area-h .small { margin-left: auto; }
.dot.grey { background: #98a2b3; }
.gaps { margin: 6px 0; padding-left: 18px; } .gaps li { margin-bottom: 3px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.perm-grid .check { margin: 3px 0; }
.ov { color: var(--amber); font-weight: 600; }
th.vert { height: 120px; white-space: nowrap; vertical-align: bottom; padding: 0 2px; }
th.vert span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; }
td.c { text-align: center; color: var(--navy); }
@media (max-width: 900px) { .snap-grid { grid-template-columns: 1fr; } .dl { grid-template-columns: 1fr; } }
.snap-grid table, .area table { table-layout: fixed; width: 100%; }
.snap-grid td, .area td, .dl dd { overflow-wrap: anywhere; }
.main { min-width: 0; overflow-x: hidden; }

/* Sign in */
.login { position: fixed; inset: 0; z-index: 50; background: #f4f6f9; overflow: auto; }
.login-shell { min-height: 100%; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.login-brand { position: relative; overflow: hidden; background: #0b2644; color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-brand::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(202,167,63,.35); box-shadow: 0 0 0 60px rgba(202,167,63,.05), 0 0 0 120px rgba(202,167,63,.03); pointer-events: none; }
.login-wordmark { width: 200px; height: auto; display: block; }
.login-pitch { max-width: 420px; position: relative; z-index: 1; }
.login-kicker { color: #caa73f; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 14px; }
.login-kicker::after { content: ""; display: block; width: 36px; height: 2px; background: #caa73f; margin-top: 10px; }
.login-pitch h2 { color: #fff; font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 34px; line-height: 1.2; margin: 0 0 14px; }
.login-pitch p { color: #c4cfdd; font-size: 15px; line-height: 1.6; margin: 0; }
.login-foot { color: #8fa1b8; font-size: 12px; position: relative; z-index: 1; }
.login-panel { display: grid; place-items: center; padding: 48px 24px; }
.login-form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login-wordmark-sm { display: none; width: 160px; height: auto; margin-bottom: 8px; }
.login-form h1 { margin: 0; color: #0b2644; font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: 30px; line-height: 1.15; }
.login-sub { margin: -6px 0 8px; color: #4a5a6e; font-size: 14px; line-height: 1.5; }
.login-form label { display: grid; gap: 6px; }
.login-form label span { font-size: 13px; font-weight: 600; color: #0b2644; }
.login-form small { color: #6b7a8c; font-size: 12px; }
.login-form input { height: 46px; padding: 0 14px; border: 1px solid #cfd8e3; border-radius: 10px; background: #fff; font: inherit; font-size: 15px; color: #000; transition: border-color .15s, box-shadow .15s; }
.login-form input:focus { outline: none; border-color: #0b2644; box-shadow: 0 0 0 3px rgba(11,38,68,.12); }
.login-btn { height: 48px; margin-top: 6px; border: 0; border-radius: 10px; background: #0b2644; color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.login-btn:hover { background: #13355c; }
.login-btn:focus-visible { outline: 3px solid #caa73f; outline-offset: 2px; }
.login-btn:disabled { opacity: .7; cursor: wait; }
.login-alt { text-align: center; padding-top: 4px; }
.login-alt a { color: #0b2644; font-size: 13px; font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(202,167,63,.8); padding-bottom: 1px; }
.login-alt a:hover { border-bottom-color: #0b2644; }
.login-err { background: #fdecea; color: #7a1c12; border: 1px solid #f5c6c0; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { align-items: start; padding: 40px 16px; }
  .login-wordmark-sm { display: block; }
}
.signout { margin-bottom: 8px; }

.secret-box { border: 1px solid var(--line, #dfe5ec); border-left: 3px solid var(--gold, #caa73f); border-radius: 10px; padding: 12px 14px; background: #fbfcfd; }
.secret-box h3 { margin: 0 0 4px; }
.secret-row { display: flex; gap: 8px; align-items: center; }
.secret-row input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
