:root {
  --page: #FFFFFF; --box: #E9F2FA; --box-line: #C5D8EA; --navy: #2B3A55; --navy-dark: #1E2A40;
  --yellow: #FFE600; --yellow-soft: #FFF8B0; --green: #1E7B34; --red: #D92B3A;
  --text: #1C2A3D; --muted: #5B6E86; --input-line: #B4C7DA; --link: #1F4FD8; --grey: #5F7390;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
a { color: var(--link); }

.bar { background: var(--navy); color: #fff; padding: 16px 24px 12px; }
.bar a { color: #fff; text-decoration: none; }
.bar-top { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; }
.brand { font-weight: 700; font-size: 30px; letter-spacing: -.01em; }
.case-name { font-size: 26px; font-weight: 700; color: var(--yellow); flex: 1; text-align: center; min-width: 200px; }
.bar-right { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-left: auto; }
.signout { background: transparent; color: #fff; border: 2px solid #fff; border-radius: 999px; padding: 10px 22px; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.signout:hover { background: #fff; color: var(--navy); }
.profile { display: flex; align-items: center; gap: 10px; background: var(--box); color: var(--navy); border-radius: 999px; padding: 6px 22px 6px 10px; }
.bar a.profile { color: var(--navy); }
.profile:hover { background: #fff; }
.profile small { display: block; font-size: 12px; color: var(--muted); }
.profile b { font-size: 16px; }
.bar-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.bar nav { display: flex; gap: 6px; }
.bar nav a { padding: 8px 16px; border-radius: 8px; font-size: 16px; }
.bar nav a:hover, .bar nav a.on { background: #fff; color: var(--navy); }
.bar-nav .who { margin-left: auto; }
.badge { display: flex; border-radius: 10px; overflow: hidden; background: #1E2A40; }
.badge div { padding: 6px 16px; }
.badge small { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #C9D6EA; }
.badge b { font-size: 18px; font-variant-numeric: tabular-nums; }
.badge .today { background: var(--yellow); color: var(--navy); }
.badge .today small { color: var(--navy); }
.who { font-size: 13px; color: #D5E0F0; }
.linklike { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.wrap { max-width: 1300px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 28px; margin: 0; line-height: 1.15; font-weight: 700; }
.sub { color: var(--muted); margin-top: 4px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 600; }
.flash.ok { background: #DDF1E2; color: #145A27; }
.flash.error { background: #FBE3E5; color: #9C1B27; }

.btn { padding: 11px 18px; border-radius: 8px; border: 0; background: var(--navy); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--navy-dark); }
.btn.green { background: var(--green); } .btn.green:hover { background: #17622A; }
.btn.red { background: var(--red); } .btn.red:hover { background: #B01F2D; }
.btn.sm { padding: 6px 14px; font-size: 13px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; align-items: center; color: var(--muted); }
.pre { padding: 7px 14px; border-radius: 16px; background: var(--grey); color: #fff; font-size: 13px; text-decoration: none; }
.pre:hover { background: var(--navy); }
.pre.on { background: var(--yellow); color: var(--navy); font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--box); border: 1px solid var(--box-line); border-radius: 12px; padding: 14px 18px; }
.tile small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile b { display: block; font-size: 30px; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.attn { border-color: #C9B800; background: var(--yellow-soft); }

.box { background: var(--box); border: 1px solid var(--box-line); border-radius: 14px; margin-bottom: 16px; }
.box-head { padding: 14px 18px 6px; font-size: 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.box-body { padding: 4px 18px 16px; }
.scroll { overflow-x: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 400; }

table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 8px; font-weight: 700; white-space: nowrap; }
td { padding: 10px 8px; border-top: 1px solid var(--box-line); white-space: nowrap; }
td.c, th.c { text-align: center; } td.r, th.r { text-align: right; }
tr.total td { font-weight: 700; border-top: 2px solid var(--navy); }
tr.row:hover td { background: var(--navy); color: #fff; }
tr.row:hover a { color: #fff; }
tr.voided td { color: var(--muted); background: #DCE7F2; }
tr.voided .d, tr.voided .amt { text-decoration: line-through; }

.st { display: inline-block; padding: 4px 11px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.st.verified { background: var(--green); color: #fff; }
.st.needs { background: var(--yellow); color: var(--navy); }
.st.flagged { background: var(--red); color: #fff; }
.st.none { background: #B9C4D2; color: #fff; }

label { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid var(--input-line);
  border-radius: 6px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus, summary:focus-visible, .btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.errors { background: #FBE3E5; color: #9C1B27; border-radius: 8px; padding: 10px 14px; margin: 10px 0; font-weight: 600; }
.errors p { margin: 2px 0; }
.note, .empty { color: var(--muted); font-size: 13px; }
.empty { padding: 18px 8px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text); }
.check input { width: auto; }

details.void summary { color: var(--red); text-decoration: underline; cursor: pointer; list-style: none; }
details.void summary::-webkit-details-marker { display: none; }
details.void form { margin-top: 8px; display: flex; gap: 8px; align-items: center; background: var(--yellow-soft); padding: 8px; border-radius: 8px; }
details.void input[type="text"] { min-width: 220px; }

.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; color: var(--muted); }

.login { max-width: 380px; margin: 60px auto; }
.login .box-body { padding: 18px; }
.login form > div { margin-bottom: 14px; }
.queue-note { margin-top: 10px; font-size: 12px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 0 0 16px; }
.workspace { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .workspace { grid-template-columns: minmax(0, 1fr); } }
iframe.scan { width: 100%; height: 720px; border: 1px solid var(--box-line); border-radius: 8px; background: #fff; }
table.entry { min-width: 860px; }
table.entry td { padding: 7px 6px; }
.dayname { font-weight: 600; }
input.t, input.n, input.notes { padding: 7px 8px; }
input.t { width: 100px; font-variant-numeric: tabular-nums; }
input.n { width: 66px; text-align: right; font-variant-numeric: tabular-nums; }
input.notes { width: 100%; min-width: 160px; }
input[readonly], textarea[readonly] { background: #F2F6FA; color: var(--muted); }
td.check { font-size: 12px; font-weight: 600; }
td.check.bad { color: var(--red); }
td.check.ok { color: var(--green); }
.in-flag { width: 18px; height: 18px; accent-color: var(--navy); }
tr.day.flagged td { background: var(--yellow-soft); }
tr.day.flagged td:first-child { box-shadow: inset 4px 0 0 var(--yellow); }
tr.note-row { display: none; }
tr.note-row.show { display: table-row; }
tr.note-row td { border-top: 0; padding: 0 6px 10px; white-space: normal; background: var(--yellow-soft); }
tr.note-row textarea { min-height: 44px; border-color: var(--navy); }
tr.pass-row td { border-top: 0; padding: 0 6px 8px; white-space: normal; font-size: 12px; color: var(--muted); }
.pass { display: inline-block; margin-right: 18px; }
.pass.differ .num { background: var(--yellow); color: var(--navy); padding: 1px 6px; border-radius: 4px; }
button.use { margin-left: 6px; padding: 2px 10px; border: 0; border-radius: 10px; background: var(--grey); color: #fff; font-size: 12px; cursor: pointer; }
button.use:hover { background: var(--navy); }
.chip { background: var(--yellow); color: var(--navy); padding: 2px 10px; border-radius: 10px; font-weight: 700; }
.signoff { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--box-line); }
.check-line { display: flex; gap: 7px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--text); margin: 0; }

.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.codes div { background: #fff; border: 1px solid var(--box-line); border-radius: 8px; padding: 10px 12px; font-size: 16px; font-weight: 700; letter-spacing: .05em; }

.banner { background: var(--yellow); color: var(--navy); text-align: center; font-weight: 700; padding: 6px 12px; letter-spacing: .02em; }

/* spacing and width helpers (kept here, not inline, because the security policy blocks inline styles) */
.m0 { margin: 0; } .wauto { width: auto; } .w220 { width: 220px; }
.mw200 { max-width: 200px; } .mw560 { max-width: 560px; } .mw600 { max-width: 600px; } .mw640 { max-width: 640px; }
.mb14 { margin-bottom: 14px; } .mb16 { margin-bottom: 16px; }
.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .ml12 { margin-left: 12px; }
.span2 { grid-column: span 2; }
.tile-link { text-decoration: none; color: inherit; }
.qr { background: #fff; border: 1px solid var(--box-line); border-radius: 8px; }
.secret-key { font-size: 18px; font-weight: 700; letter-spacing: .04em; }

.bar-track { height: 8px; background: var(--box-line); border-radius: 4px; min-width: 120px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.sh-0 { width: 0%; } 
.sh-5 { width: 5%; } .sh-10 { width: 10%; } .sh-15 { width: 15%; } .sh-20 { width: 20%; } .sh-25 { width: 25%; } 
.sh-30 { width: 30%; } .sh-35 { width: 35%; } .sh-40 { width: 40%; } .sh-45 { width: 45%; } .sh-50 { width: 50%; } 
.sh-55 { width: 55%; } .sh-60 { width: 60%; } .sh-65 { width: 65%; } .sh-70 { width: 70%; } .sh-75 { width: 75%; } 
.sh-80 { width: 80%; } .sh-85 { width: 85%; } .sh-90 { width: 90%; } .sh-95 { width: 95%; } .sh-100 { width: 100%; } 


/* ---------- dropping documents onto the costs page ---------- */
[hidden] { display: none !important; }
.dropzone { display: block; border: 2px dashed #7C97B5; border-radius: 12px; padding: 22px 18px; text-align: center; cursor: pointer; margin-bottom: 16px; background: transparent; }
.dropzone, .dropzone span { text-transform: none; letter-spacing: 0; }
.dropzone b { display: block; font-size: 17px; color: var(--navy); margin-bottom: 4px; }
.dropzone span { color: var(--muted); font-size: 13px; }
.dropzone.over, .dropzone:hover, .dropzone:focus-within { background: var(--box); border-color: var(--navy); }
.dropzone.over { background: #FFF8B0; border-style: solid; }
.dropzone.has-files { border-color: #1F7A33; border-style: solid; background: #EAF6EC; }
.dropzone.has-files b { color: #1F7A33; }
.drop-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(255, 248, 176, .92); display: flex; align-items: center; justify-content: center; border: 6px dashed var(--navy); }
.drop-overlay div { font-size: 30px; font-weight: 700; color: var(--navy); }

dialog.cost-dialog { border: 1px solid var(--box-line); border-radius: 14px; padding: 0; width: min(640px, 94vw); max-height: 92vh; overflow: auto; color: var(--text); background: #fff; box-shadow: 0 20px 50px rgba(30, 42, 64, .35); }
dialog.cost-dialog::backdrop { background: rgba(30, 42, 64, .55); }
.cost-dialog form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.cost-dialog h2 { margin: 0; font-size: 22px; }
.dlg-file { color: var(--muted); font-size: 13px; word-break: break-all; }
.dlg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notice { padding: 10px 12px; border-radius: 8px; background: var(--box); font-size: 13px; }
.notice.good { background: #DDF1E2; color: #145A27; }
.notice.warn { background: var(--yellow-soft); color: var(--navy); font-weight: 600; }
.notice.bad { background: #FBE3E5; color: #9C1B27; font-weight: 600; }
.notice a { color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--input-line); background: #fff; border-radius: 14px; padding: 5px 11px; font: inherit; font-size: 12px; cursor: pointer; color: var(--text); }
.chip:hover, .chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
fieldset.cat-grid { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset.cat-grid legend { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding: 0; }
.cat-opt { display: block; margin: 0; text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span { display: block; text-align: center; padding: 13px 8px; border: 2px solid var(--input-line); border-radius: 10px; cursor: pointer; background: #fff; }
.cat-opt span:hover { border-color: var(--navy); }
.cat-opt input:checked + span { background: var(--yellow); border-color: var(--navy); color: var(--navy); }
.cat-opt input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.dlg-actions { display: flex; gap: 10px; }
.files-cell { max-width: 240px; }
.file-link { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--link); }
.btn:disabled { cursor: not-allowed; }

.chosen { text-align: center; color: var(--muted); font-size: 13px; margin: -8px 0 14px; }
.chosen:empty { display: none; }
.filter-box .box-body { padding-top: 14px; }
.pick-row { margin: -6px 0 16px; text-align: center; }
.pick-row .btn { cursor: pointer; }
.find-bar { margin-bottom: 12px; }
.doc-tag { display: inline-block; padding: 2px 9px; border-radius: 10px; background: #fff; border: 1px solid var(--box-line); font-size: 12px; white-space: nowrap; }
fieldset.doc-grid { grid-template-columns: repeat(4, 1fr); }
fieldset.doc-grid .cat-opt span { padding: 8px 4px; font-size: 13px; }
a.edit-link { margin-right: 12px; }
.act-row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }

.bar.accent-1 { background: #1F5C55; }
.bar.accent-2 { background: #5B3A6B; }
.bar.accent-3 { background: #7A3B2E; }
.bar.accent-4 { background: #4A5E1F; }
.bar.accent-5 { background: #3F4650; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.case-switch { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0; }
.case-switch select { width: auto; max-width: 100%; font-size: 24px; font-weight: 700; color: var(--yellow); background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 230, 0, .6); border-radius: 10px; padding: 6px 12px; font-family: inherit; }
.case-switch select option { color: var(--text); background: #fff; font-size: 16px; }

td.wrap { white-space: normal; min-width: 220px; max-width: 420px; }
.note.late { color: var(--red); font-weight: 700; }
form.inline { display: inline; }
.linklike.dark { color: var(--link); font-size: 12px; }
details.edit summary { cursor: pointer; color: var(--link); text-decoration: underline; margin-bottom: 8px; }
textarea { resize: vertical; }
input[type="datetime-local"], input[type="file"] { width: 100%; font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--input-line); border-radius: 6px; background: #fff; color: var(--text); }

/* documents: sortable headings and the preview of files chosen but not yet saved */
a.sort { color: var(--muted); text-decoration: none; white-space: nowrap; }
a.sort:hover, a.sort.on { color: var(--navy); text-decoration: underline; }
.staged { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 0 0 16px; }
.staged[hidden] { display: none; }
.stage-card { background: #fff; border: 1px solid var(--box-line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stage-thumb { height: 110px; border-radius: 6px; background: var(--box); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 22px; font-weight: 700; color: var(--navy); }
.stage-thumb img, .stage-thumb video { max-width: 100%; max-height: 100%; object-fit: contain; }
.stage-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stage-meta a, .stage-meta button { color: var(--link); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.stage-meta button.rm { color: #B3261E; margin-left: auto; }

/* "+ Add new..." box under a drop-down */
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.quick-add input { flex: 1 1 140px; min-width: 0; }
.quick-msg { flex-basis: 100%; color: #B3261E; font-size: 12px; }
.quick-msg:empty { display: none; }
