/* Modernus Expenses – redesigned desktop screens. */
:root {
  --bg: #f5f6f8; --surface: #ffffff; --ink: #111827; --muted: #4b5563; --line: #d1d5db; --line-soft: #e5e7eb; --head: #f9fafb;
  --primary: #4f46e5; --primary-ink: #3730a3; --primary-soft: #eef2ff; --primary-line: #c7d2fe;
  --purple: #5b21b6; --purple-soft: #f5f3ff; --purple-line: #c4b5fd;
  --warn: #ea580c; --warn-ink: #9a3412; --warn-soft: #fff7ed; --warn-line: #fdba74;
  --good: #16a34a; --good-ink: #166534; --good-soft: #dcfce7; --good-line: #86efac;
  --teal: #0f766e; --teal-soft: #ccfbf1; --info-soft: #dbeafe; --info-ink: #1e40af;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Arial, Helvetica, sans-serif; }
a { color: #4338ca; }
a:hover { color: #312e81; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; }
h2 { margin: 0; font-size: 19px; }
h3 { margin: 8px 0 0; font-size: 15px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Header and navigation */
.top { background: #111827; color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 28px; }
.brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand span { font-size: 18px; color: #d1d5db; border-left: 1px solid #4b5563; padding-left: 14px; }
.brand:hover { color: #fff; }
.top-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.demo-pill { font-size: 12px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; background: #374151; color: #fde68a; padding: 4px 10px; border-radius: 999px; }
.viewas { display: flex; align-items: center; gap: 4px; background: #1f2937; border-radius: 999px; padding: 4px; margin: 0; }
.viewas span { font-size: 12px; color: #d1d5db; padding: 0 8px; }
.viewas button { border: 0; border-radius: 999px; padding: 6px 13px; font-weight: 700; font-size: 13px; cursor: pointer; background: transparent; color: #e5e7eb; }
.viewas button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.who { font-size: 14px; color: #e5e7eb; }
a.tour { text-decoration: none; color: inherit; }
a.tour:hover strong { text-decoration: underline; }
.guide-list .chip { cursor: pointer; }
.guide-index h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin: 0 0 10px; }
.guide-index .chips + h2 { margin-top: 18px; }
.guide-list .chip span { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin-left: 4px; }
.guide-player { padding: 0; }
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.guide-sound { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); }
.guide-sound[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.guide-speed { display: flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.guide-speed span { font-size: 13px; font-weight: 700; color: var(--muted); padding: 0 8px; }
.guide-speed button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--ink); }
.guide-speed button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.guide-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; background: var(--primary-soft); border-bottom: 1px solid var(--primary-line); }
.btn.big { font-size: 16px; padding: 12px 20px; }
.btn:disabled { opacity: .45; cursor: default; }
.guide-where { flex: 1 1 220px; text-align: center; display: flex; flex-direction: column; }
.guide-where strong { font-size: 18px; }
.guide-where span { color: var(--muted); }
.guide-caption { margin: 0; padding: 14px 20px; font-size: 17px; min-height: 52px; }
.guide-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 14px; margin: 0; }
.guide-steps button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 13px; cursor: pointer; color: var(--ink); }
.guide-steps b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line-soft); font-size: 12px; }
.guide-steps li.done b { background: var(--primary-line); }
.guide-steps li[aria-current] button { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.guide-steps li[aria-current] b { background: var(--primary); color: #fff; }
#guide-screen { display: block; width: 100%; height: 680px; border: 0; border-top: 1px solid var(--line); background: var(--bg); }
.viewas-pick { position: relative; }
.viewas-pick summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 700; color: #111827; background: #fde68a; border-radius: 8px; padding: 7px 12px; }
.viewas-pick summary::-webkit-details-marker { display: none; }
.viewas-pick summary::after { content: " \25BE"; }
.viewas-pick form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.15); width: 280px; max-width: calc(100vw - 32px); padding: 8px; margin: 0; }
.viewas-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; margin-bottom: 6px; }
.viewas-list { max-height: 60vh; overflow-y: auto; }
.viewas-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.viewas-label span { font-weight: 400; }
.viewas-list button { display: block; width: 100%; text-align: left; padding: 7px 10px; color: var(--ink); background: none; border: 0; border-radius: 6px; cursor: pointer; font-size: 14px; }
.viewas-list button:hover, .viewas-list button:focus { background: var(--bg); }
.viewas-list button[aria-current="true"] { background: var(--primary-soft); font-weight: 700; }
.viewas-list button small { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.viewas-list .viewas-back { color: var(--primary-ink); font-weight: 700; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.viewas-none { color: var(--muted); font-size: 14px; padding: 8px 10px; margin: 0; }
.viewas-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; padding: 10px 28px; background: #fef3c7; border-bottom: 1px solid #fcd34d; color: #78350f; font-size: 14px; }
.viewas-banner button { border: 1px solid #b45309; background: #fff; color: #78350f; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.help-toggle { display: flex; align-items: center; gap: 6px; background: transparent; color: #fff; border: 1px solid #9ca3af; border-radius: 8px; padding: 7px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.help-toggle[aria-expanded="true"] { background: #fff; color: var(--ink); }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; font-size: 14px; color: #e5e7eb; border: 1px solid #4b5563; border-radius: 8px; padding: 7px 12px; }
.account summary::-webkit-details-marker { display: none; }
.account > div { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.15); min-width: 190px; padding: 6px; display: flex; flex-direction: column; }
.account a, .account button { display: block; text-align: left; padding: 9px 12px; color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 6px; cursor: pointer; font-size: 14px; width: 100%; }
.account a:hover, .account button:hover { background: var(--bg); }
.account form { margin: 0; }
nav.main { background: #fff; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: stretch; gap: 2px; padding: 0 18px; position: sticky; top: 0; z-index: 10; }
nav.main a { display: flex; align-items: center; gap: 6px; padding: 15px 13px 12px; border-bottom: 3px solid transparent; color: #374151; font-weight: 700; text-decoration: none; }
nav.main a:hover { color: var(--primary-ink); }
nav.main a[aria-current="page"] { color: var(--primary-ink); border-bottom-color: var(--primary); }
.admin-nav { display: flex; align-items: stretch; gap: 2px; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.admin-nav a[aria-current="page"] { color: var(--purple); border-bottom-color: #7c3aed; }
.admin-label { align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding-right: 4px; }
.count { background: var(--primary); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 7px; }
.admin-nav .count { background: #7c3aed; }

/* Page frame */
.stage { position: relative; }
main { margin: 0 auto; padding: 26px 24px 56px; display: flex; flex-direction: column; gap: 18px; }
main.wide { max-width: 1400px; }
main.medium { max-width: 1200px; }
main.narrow { max-width: 640px; }
main.full { max-width: 1600px; padding: 18px 18px 48px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.lead { margin-top: 6px; color: var(--muted); max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.big { font-size: 22px; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 360px; min-width: 0; }
.side-left { flex: 1 1 320px; max-width: 420px; min-width: 0; }
.split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions form { margin: 0; }
.scroll-x { overflow-x: auto; }
.empty { padding: 22px 18px; color: var(--muted); }
.pad { padding: 20px; }
.pad-sm { padding: 12px 16px; }
.warn-text { color: var(--warn-ink); }
.good-text { color: var(--good-ink); }

/* Cards and panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.card.pad { overflow: visible; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.card-title { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.admin-card { border-color: var(--purple-line); }
.admin-card .card-head { background: var(--purple-soft); }
.admin-badge { font-size: 13px; color: var(--purple); margin-left: 6px; }
.note-box { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 10px; padding: 16px 20px; font-size: 14px; line-height: 1.5; }
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 200px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; }
.tile span { display: block; font-size: 13px; color: var(--muted); }
.tile strong { font-size: 17px; }
.tile-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7c2d12; }
.tile-warn span { color: #7c2d12; }
.totals { margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals dt, .totals dd { margin: 0; }
.totals dd { font-weight: 700; }
.mini-msg { font-size: 14px; margin-top: 12px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.program { border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; }
.program .muted { margin-top: 6px; font-size: 14px; line-height: 1.6; }

/* Tasks */
.task { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }
.task:last-child { border-bottom: 0; }
.task-text { flex: 1 1 320px; min-width: 0; }
.task-text .muted { font-size: 14px; margin-top: 3px; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; min-width: 92px; text-align: center; }
.tag-card { background: #dbeafe; color: #1e3a8a; }
.tag-receipts { background: #e0e7ff; color: var(--primary-ink); }
.tag-fix { background: #ffedd5; color: var(--warn-ink); }
.tag-reimburse { background: var(--good-soft); color: var(--good-ink); }
.tag-message, .tag-statement { background: var(--line-soft); color: #374151; }
.tag-review { background: #ede9fe; color: var(--purple); }
.tag-pay { background: var(--teal-soft); color: var(--teal); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #fff; color: var(--ink); border: 1px solid #9ca3af; font-weight: 700; font-size: 14px; padding: 9px 15px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bg); color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #4338ca; color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #374151; color: #fff; }
.btn.purple { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn.purple:hover { background: #4c1d95; color: #fff; }
.btn.teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: #b91c1c; }
.btn.approve { color: var(--good-ink); border: 2px solid var(--good); min-width: 96px; }
.btn.approve.on { background: var(--good); color: #fff; }
.btn.fixbtn { color: var(--warn-ink); border: 2px solid var(--warn); min-width: 96px; list-style: none; }
.btn.fixbtn::-webkit-details-marker { display: none; }
.btn.fixbtn.on { background: var(--warn); color: #fff; }
.btn:disabled { background: #e0e7ff; border-color: #e0e7ff; color: #6366f1; cursor: not-allowed; }
.small-btn { padding: 6px 10px; font-size: 13px; }

/* Chips, pills, banners, alerts */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip { border: 1px solid #9ca3af; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; text-decoration: none; }
.chip span { font-weight: 400; }
.chip:hover { color: var(--ink); background: var(--bg); }
.chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line-soft); color: #1f2937; white-space: nowrap; }
.pill-warn { background: #ffedd5; color: var(--warn-ink); }
.pill-good { background: var(--good-soft); color: var(--good-ink); }
.pill-info { background: var(--info-soft); color: var(--info-ink); }
.pill-teal { background: var(--teal-soft); color: #115e59; }
.pill-purple { background: #ede9fe; color: var(--purple); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 13px 18px; border-radius: 10px; border: 1px solid; }
.banner form { margin: 0; }
.banner-info { background: var(--primary-soft); border-color: var(--primary-line); }
.banner-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.banner-good { background: var(--good-soft); border-color: var(--good-line); }
.alert-warn, .alert-info, .alert-good { border-radius: 8px; padding: 10px 13px; font-size: 14px; border: 1px solid; }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: #7c2d12; }
.alert-info { background: var(--primary-soft); border-color: var(--primary-line); }
.alert-good { background: var(--good-soft); border-color: var(--good-line); color: #14532d; }
.flash { border-radius: 10px; padding: 12px 16px; border: 1px solid var(--good-line); background: var(--good-soft); color: #14532d; }
.flash.error { background: var(--warn-soft); border-color: var(--warn-line); color: #7c2d12; }
.flash.warning, .flash.info { background: var(--primary-soft); border-color: var(--primary-line); color: var(--ink); }
.suggest { background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: 8px; padding: 12px; font-size: 14px; display: flex; flex-direction: column; gap: 10px; }
.suggest form { margin: 0; }
.note-chip { display: block; font-size: 13px; color: var(--warn-ink); margin-top: 6px; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 6px; padding: 6px 8px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: var(--head); text-align: left; color: #374151; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.table th.sortable a:hover { color: var(--primary-ink); text-decoration: underline; }
.table th.sortable .sort-mark { font-size: 11px; color: #9ca3af; }
.table th[aria-sort] .sort-mark { color: var(--primary); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table a { color: var(--ink); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table td .btn { color: #fff; }
.clickable { cursor: pointer; }
.clickable:hover td { background: #fafafb; }
.table tr.selected td { background: var(--primary-soft); }
.table tr.selected td:first-child { box-shadow: inset 4px 0 0 var(--primary); }
.row-warn td { background: #fffaf5; }
.check-col { width: 44px; }
.check-col input { width: 18px; height: 18px; }
.claim-head { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.claim-head .muted { margin-top: 4px; font-size: 14px; }
.stat { text-align: right; }
.stat span { display: block; font-size: 13px; color: var(--muted); }
.stat strong { font-size: 20px; }
.claim-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; background: var(--head); border-top: 1px solid var(--line-soft); }
.claim-foot form { margin: 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.form-grid > [hidden] { display: none; }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; min-width: 0; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { font-size: 15px; font-weight: 400; padding: 9px 10px; border: 1px solid #9ca3af; border-radius: 6px; background: #fff; width: 100%; min-width: 0; }
.field input[type=file] { border-style: dashed; padding: 8px; }
.field textarea { resize: vertical; }
.field small { font-weight: 400; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: auto; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--warn) !important; }
.error { font-style: normal; font-weight: 400; color: #b91c1c; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 18px; height: 18px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0; }
.inline-form .field { flex: 1 1 220px; }
form { margin: 0; }

/* Receipts */
.receipt-view { border: 1px solid var(--line); border-radius: 8px; background: #fafafa; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; overflow: hidden; }
.receipt-view img { max-width: 100%; max-height: 460px; object-fit: contain; display: block; }
.receipt-view iframe { width: 100%; height: 460px; border: 0; background: #fff; }
.receipt-view a { font-size: 14px; }
.receipt-view.empty { color: var(--muted); text-align: center; font-size: 14px; padding: 24px; }

/* Messages */
.thread { display: block; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid transparent; color: var(--ink); text-decoration: none; background: #fafafa; }
.thread:hover { color: var(--ink); background: #fff; }
.thread.unread { background: #fff; }
.thread.unread .thread-from { font-weight: 700; }
.thread.selected { background: var(--primary-soft); border-left-color: var(--primary); }
.thread-about { display: block; font-size: 13px; color: var(--primary-ink); font-weight: 700; margin-top: 4px; }
.thread-preview { display: block; font-size: 14px; color: #374151; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-view { display: flex; flex-direction: column; min-height: 520px; }
.thread-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.thread-head .muted { margin-top: 4px; font-size: 14px; }
.posts { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.post { max-width: 72%; align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.post.mine { align-self: flex-end; background: var(--primary-soft); border-color: var(--primary-line); }
.post.system { background: #f3f4f6; }
.post-meta { font-size: 13px; color: var(--muted); }
.post-meta strong { color: var(--ink); }
.post-body { margin-top: 4px; }
.reply { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }

/* Review */
.review { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.queue { flex: 1 1 250px; max-width: 300px; min-width: 0; }
.queue-item { display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid transparent; color: var(--ink); text-decoration: none; }
.queue-item:hover { color: var(--ink); background: #fafafb; }
.queue-item.selected { background: var(--primary-soft); border-left-color: var(--primary); }
.progress-text { color: var(--primary-ink); }
.queue-done { display: flex; flex-direction: column; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.small-h { font-size: 14px; }
.review-main { flex: 999 1 560px; min-width: 0; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.review-head h1 { font-size: 22px; }
.review-head .muted { margin-top: 4px; font-size: 14px; }
.progress-box { flex: 1 1 220px; }
.bar { height: 10px; background: var(--line-soft); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.bar div { height: 10px; background: var(--primary); }
.line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); border-left: 4px solid transparent; }
.line:last-child { border-bottom: 0; }
.line.ok { background: #f0fdf4; border-left-color: var(--good); }
.line.fix { background: var(--warn-soft); border-left-color: var(--warn); }
.line.focus { border-left-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-line); }
.line-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; }
.line-text:hover { color: var(--ink); }
.line-amount { min-width: 86px; text-align: right; }
.line-buttons { display: flex; gap: 6px; align-items: flex-start; }
.fix-box { position: relative; }
.fix-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 320px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(17,24,39,.15); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.receipt-pane { flex: 1 1 320px; max-width: 400px; min-width: 0; position: sticky; top: 66px; }

/* Help drawer */
.help { position: absolute; top: 0; right: 0; z-index: 15; width: 380px; max-width: 100%; min-height: 600px; background: #fff; border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(17,24,39,.12); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.help[hidden] { display: none; }
.help-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.help h2 { margin-top: 4px; font-size: 20px; }
.help-close { background: none; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; color: #374151; }
.help ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.45; }
.tour { display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.tour-icon { flex: 0 0 56px; height: 40px; border-radius: 6px; background: #9ca3af; display: flex; align-items: center; justify-content: center; }
.tour small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.help-foot { border-top: 1px solid var(--line-soft); padding-top: 14px; font-size: 14px; color: #374151; }

/* Login */
.login-card { margin-top: 40px; }

/* Person form: role (project manager or everyone else) */
.role-pick { display: flex; flex-direction: column; gap: 8px; }
.role-option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; cursor: pointer; background: var(--surface); }
.role-option input { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; }
.role-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }

/* Phones: a compact header with a Menu button, and tables shown as stacked cards. */
.menu-toggle { display: none; align-items: center; gap: 6px; position: relative; background: transparent; color: #fff; border: 1px solid #9ca3af; border-radius: 8px; padding: 7px 11px; font-weight: 700; font-size: 14px; cursor: pointer; }
.menu-toggle[aria-expanded="true"] { background: #fff; color: #111827; }
.menu-dot { position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; border: 2px solid #111827; }
@media (max-width: 760px) {
  .top { padding: 8px 12px; gap: 8px; position: sticky; top: 0; z-index: 30; }
  .brand { margin-right: auto; gap: 10px; }
  .brand img { height: 20px; }
  .brand span { font-size: 15px; padding-left: 10px; }
  .top-right { display: contents; }
  .top-right > * { order: 1; }
  .help-toggle { padding: 7px 9px; }
  .help-word { display: none; }
  .menu-toggle { display: flex; }
  .top .who, .top .account, .top .viewas-pick, .top .demo-pill { display: none; }
  .menu-open .top { padding-bottom: 12px; }
  .menu-open .top .who { display: block; order: 5; flex-basis: 100%; padding-top: 8px; border-top: 1px solid #374151; }
  .menu-open .top .demo-pill { display: inline-block; order: 6; }
  .menu-open .top .viewas-pick { display: block; order: 7; flex-basis: 100%; }
  .menu-open .top .viewas-pick form { left: 0; right: auto; width: 100%; max-width: none; box-sizing: border-box; }
  .menu-open .top .account { display: block; order: 8; flex-basis: 100%; }
  .top .account summary { display: none; }
  .top .account > div { position: static; background: transparent; border: 0; box-shadow: none; padding: 0; flex-direction: row; flex-wrap: wrap; gap: 6px; min-width: 0; }
  .top .account a, .top .account button { color: #e5e7eb; border: 1px solid #4b5563; width: auto; padding: 7px 12px; }
  .top .account a:hover, .top .account button:hover { background: #1f2937; }
  nav.main { display: none; position: static; padding: 6px 0; }
  .menu-open nav.main { display: flex; flex-direction: column; gap: 0; }
  nav.main a { padding: 13px 18px; border-bottom: 0; border-left: 4px solid transparent; justify-content: space-between; }
  nav.main a[aria-current="page"] { border-left-color: var(--primary); background: var(--primary-soft); }
  .admin-nav { flex-direction: column; margin: 6px 0 0; padding: 6px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .admin-nav a[aria-current="page"] { border-left-color: #7c3aed; background: var(--purple-soft, #f5f3ff); }
  .admin-label { align-self: flex-start; padding: 6px 18px 2px; }
  .viewas-banner { padding: 10px 16px; }
  main { padding: 18px 14px 40px; }
  h1 { font-size: 24px; }
  .side-left, .queue, .receipt-pane { max-width: none; }
  .receipt-pane { position: static; }
  aside, section { scroll-margin-top: 64px; }
  .post { max-width: 90%; }
  .fix-form { position: static; width: auto; margin-top: 8px; }
  .btn, .field input:not([type=checkbox]):not([type=radio]), .field select { min-height: 42px; }
  .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { font-size: 16px; }
  .line-text { flex-basis: 100%; }
  .claim-head, .claim-foot, .thread-head, .reply { padding-left: 14px; padding-right: 14px; }
  .stat { text-align: left; }
  #guide-screen { height: 520px; }

  /* Tables become one card per row; each cell shows its column name on the left. */
  .table.stackable, .table.stackable tbody, .table.stackable tfoot, .table.stackable tr, .table.stackable td { display: block; width: auto; }
  .table.stackable thead { display: block; }
  .table.stackable thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; background: var(--head); border-bottom: 1px solid var(--line); }
  .table.stackable thead th { display: none; }
  .table.stackable thead th.sortable { display: block; padding: 0; border: 0; background: none; }
  .table.stackable thead tr:not(:has(.sortable, input)) { display: none; }
  .table.stackable thead th:has(input) { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; }
  .table.stackable thead th:has(input)::after { content: "Select all"; font-size: 14px; }
  .table.stackable thead tr:has(.sortable)::before { content: "Sort by"; align-self: center; font-size: 13px; color: var(--muted); font-weight: 700; margin-right: 2px; }
  .table.stackable thead th.sortable a { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 13px; background: var(--surface, #fff); }
  .table.stackable thead th[aria-sort] a { border-color: var(--primary); color: var(--primary-ink); }
  .table.stackable tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { position: relative; padding: 4px 14px 4px calc(36% + 14px); border: 0; text-align: left; overflow-wrap: anywhere; }
  .table.stackable td::before { content: attr(data-label); position: absolute; left: 14px; top: 5px; width: 34%; font-size: 13px; font-weight: 700; color: var(--muted); overflow-wrap: normal; }
  .table.stackable td:not([data-label])::before, .table.stackable td[data-label=""]::before { content: none; }
  .table.stackable td:not([data-label]), .table.stackable td[data-label=""] { padding-left: 14px; }
  .table.stackable td.num { text-align: left; }
  .table.stackable td:empty { display: none; }
  .table.stackable tr.selected td:first-child { box-shadow: none; }
  .table.stackable tr.selected { box-shadow: inset 4px 0 0 var(--primary); }
  .table.stackable .check-col { width: auto; }
}
@media (max-width: 440px) {
  .brand span { display: none; }
}

/* Dark theme: the moon button next to Account sets data-theme="dark" on <html> and remembers it. */
.theme-toggle { display: flex; align-items: center; justify-content: center; background: transparent; color: #fff; border: 1px solid #9ca3af; border-radius: 8px; width: 38px; height: 34px; cursor: pointer; padding: 0; }
.theme-toggle:hover { background: #1f2937; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
/* Dark theme in a code-editor style: layered greys, with a distinct colour for each kind of thing —
   blue for links and actions, green for approved and paid, orange for attention, red for sent back,
   purple for labels and admin, gold for headings and teal for amounts. */
[data-theme="dark"] {
  --bg: #1e1f22; --surface: #2b2d30; --ink: #d4d7dd; --muted: #a0a6ae; --line: #43454a; --line-soft: #393b40; --head: #313337;
  --primary: #2b62cf; --primary-ink: #8ab8ff; --primary-soft: #25324d; --primary-line: #35538f;
  --purple: #d391c8; --purple-soft: #3a2a3d; --purple-line: #74507a;
  --warn: #e0a85a; --warn-ink: #f0b46c; --warn-soft: #3d3022; --warn-line: #8a6430;
  --good: #6aab73; --good-ink: #8cc796; --good-soft: #263a2b; --good-line: #4c7a54;
  --teal: #56c2b8; --teal-soft: #1f3a38; --info-soft: #25324d; --info-ink: #7fb0ff;
  --red: #f0766a; --red-soft: #452a2a; --gold: #e8c46a; --amount: #6fc1d8;
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--bg); }
[data-theme="dark"] .top { background: #18191b; border-bottom: 1px solid #2f3134; }
[data-theme="dark"] nav.main { background: #26282b; border-color: var(--line); }
[data-theme="dark"] nav.main a, [data-theme="dark"] .btn, [data-theme="dark"] .chip, [data-theme="dark"] .thread, [data-theme="dark"] .queue-item, [data-theme="dark"] a.tour { color: var(--ink); }
[data-theme="dark"] nav.main a[aria-current="page"] { color: var(--primary-ink); border-bottom-color: var(--primary); }
[data-theme="dark"] .admin-label, [data-theme="dark"] .admin-badge { color: var(--purple); }
[data-theme="dark"] .admin-nav a[aria-current="page"] { color: var(--purple); border-bottom-color: var(--purple); }
[data-theme="dark"] h1, [data-theme="dark"] h2 { color: var(--gold); }
[data-theme="dark"] h3, [data-theme="dark"] .eyebrow, [data-theme="dark"] .viewas-label, [data-theme="dark"] .guide-index h2 { color: var(--purple); }
[data-theme="dark"] .field > span, [data-theme="dark"] .facts dt, [data-theme="dark"] .tile span { color: var(--purple); }
[data-theme="dark"] .table th { background: #2f3135; color: var(--teal); }
[data-theme="dark"] .num, [data-theme="dark"] .line-amount, [data-theme="dark"] strong.big, [data-theme="dark"] .stat strong, [data-theme="dark"] .totals dd { color: var(--amount); }
[data-theme="dark"] a { color: var(--primary-ink); }
[data-theme="dark"] .muted, [data-theme="dark"] .lead { color: var(--muted); }
[data-theme="dark"] .card, [data-theme="dark"] .tile, [data-theme="dark"] .help, [data-theme="dark"] .account > div, [data-theme="dark"] .viewas-pick form,
[data-theme="dark"] .fix-form, [data-theme="dark"] .post, [data-theme="dark"] .thread.unread, [data-theme="dark"] .guide-steps button,
[data-theme="dark"] .receipt-view, [data-theme="dark"] .guide-sound, [data-theme="dark"] .guide-speed { background: var(--surface); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .card-head, [data-theme="dark"] .claim-head, [data-theme="dark"] .claim-foot, [data-theme="dark"] .guide-bar { background: #303236; border-color: var(--line); }
[data-theme="dark"] .field input:not([type=checkbox]):not([type=radio]), [data-theme="dark"] .field select, [data-theme="dark"] .field textarea,
[data-theme="dark"] .viewas-search { background: #1e1f22; color: var(--ink); border-color: #4e5157; }
[data-theme="dark"] .field input:focus, [data-theme="dark"] .field select:focus, [data-theme="dark"] .field textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-line); }
[data-theme="dark"] .btn, [data-theme="dark"] .chip { background: #393b40; border-color: #4e5157; }
[data-theme="dark"] .btn:hover, [data-theme="dark"] .chip:hover, [data-theme="dark"] .clickable:hover td, [data-theme="dark"] .queue-item:hover, [data-theme="dark"] .thread:hover { background: #35373c; color: var(--ink); }
[data-theme="dark"] .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .btn.purple { background: #8f5f93; border-color: #8f5f93; color: #fff; }
[data-theme="dark"] .btn.teal, [data-theme="dark"] .btn.approve.on { background: #3f7f63; border-color: #3f7f63; color: #fff; }
[data-theme="dark"] .btn.warn, [data-theme="dark"] .btn.fixbtn.on { background: #a8584f; border-color: #a8584f; color: #fff; }
[data-theme="dark"] .btn.dark, [data-theme="dark"] .chip[aria-current="true"], [data-theme="dark"] .guide-speed button[aria-pressed="true"],
[data-theme="dark"] .guide-sound[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .pill-good, [data-theme="dark"] .good-text, [data-theme="dark"] .alert-good { color: var(--good-ink); }
[data-theme="dark"] .pill-good, [data-theme="dark"] .alert-good, [data-theme="dark"] .banner-good { background: var(--good-soft); border-color: var(--good-line); }
[data-theme="dark"] .pill-warn, [data-theme="dark"] .tag-fix, [data-theme="dark"] .alert-warn, [data-theme="dark"] .banner-warn, [data-theme="dark"] .tile-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
[data-theme="dark"] .warn-text { color: var(--red); }
[data-theme="dark"] .row-warn td { background: #352725; }
[data-theme="dark"] .line.ok { background: #263a2b; }
[data-theme="dark"] .line.fix, [data-theme="dark"] .note-chip { background: var(--red-soft); color: #f3b0a9; }
[data-theme="dark"] .error, [data-theme="dark"] .flash.error { color: var(--red); }
[data-theme="dark"] .flash.success { background: var(--good-soft); color: var(--good-ink); border-color: var(--good-line); }
[data-theme="dark"] .alert-info, [data-theme="dark"] .banner-info, [data-theme="dark"] .note-box { background: var(--info-soft); border-color: var(--primary-line); color: var(--ink); }
[data-theme="dark"] .pill-info, [data-theme="dark"] .tag-receipts { background: var(--info-soft); color: var(--info-ink); }
[data-theme="dark"] .pill-purple, [data-theme="dark"] .tag-review { background: var(--purple-soft); color: var(--purple); }
[data-theme="dark"] .pill-teal, [data-theme="dark"] .tag-pay { background: var(--teal-soft); color: var(--teal); }
[data-theme="dark"] .tag-reimburse { background: var(--good-soft); color: var(--good-ink); }
[data-theme="dark"] .tag-message, [data-theme="dark"] .tag-statement, [data-theme="dark"] .pill { background: #393b40; color: var(--ink); }
[data-theme="dark"] .admin-card { border-color: var(--purple-line); }
[data-theme="dark"] .admin-card .card-head { background: var(--purple-soft); }
[data-theme="dark"] .post.system { background: var(--head); }
[data-theme="dark"] .post.mine { background: var(--primary-soft); }
[data-theme="dark"] .count { background: var(--primary); }
[data-theme="dark"] .viewas-banner { background: #3d3522; border-color: #8a6f30; color: var(--gold); }
[data-theme="dark"] .viewas-banner button { background: var(--surface); color: var(--gold); border-color: #8a6f30; }
[data-theme="dark"] .guide-controls { background: #25324d; border-color: var(--primary-line); }
[data-theme="dark"] .guide-steps li[aria-current] button { background: var(--primary-soft); border-color: var(--primary); }
[data-theme="dark"] img[src*="sample-receipt"], [data-theme="dark"] .receipt-view img { background: #fff; }/* Dark mode contrast pass: every remaining light-theme colour that would sit dark-on-dark. */
[data-theme="dark"] a:hover { color: #a9c8ff; }
[data-theme="dark"] .pill, [data-theme="dark"] .tag-message, [data-theme="dark"] .tag-statement { background: #3b3e44; color: #e3e6eb; }
[data-theme="dark"] .pill-good { background: var(--good-soft); color: var(--good-ink); }
[data-theme="dark"] .pill-warn { background: var(--warn-soft); color: var(--warn-ink); }
[data-theme="dark"] .pill-info { background: var(--info-soft); color: var(--info-ink); }
[data-theme="dark"] .pill-teal { background: var(--teal-soft); color: var(--teal); }
[data-theme="dark"] .pill-purple { background: var(--purple-soft); color: var(--purple); }
[data-theme="dark"] .tag-card { background: #24364f; color: #8ab4f8; }
[data-theme="dark"] .tile-warn, [data-theme="dark"] .tile-warn span, [data-theme="dark"] .alert-warn, [data-theme="dark"] .flash.error { color: var(--warn-ink); }
[data-theme="dark"] .flash.error { background: var(--warn-soft); border-color: var(--warn-line); }
[data-theme="dark"] .alert-good, [data-theme="dark"] .flash { color: var(--good-ink); }
[data-theme="dark"] .flash { background: var(--good-soft); border-color: var(--good-line); }
[data-theme="dark"] .thread-preview, [data-theme="dark"] .help-foot { color: var(--muted); }
[data-theme="dark"] .btn.danger, [data-theme="dark"] .error { color: var(--red); }
[data-theme="dark"] .btn.quiet { background: transparent; border-color: transparent; color: var(--muted); }
[data-theme="dark"] .btn:disabled, [data-theme="dark"] .btn[aria-disabled="true"] { background: #2f3136; border-color: #45484e; color: #7d838c; opacity: 1; }
[data-theme="dark"] .btn.approve { background: transparent; color: var(--good-ink); border-color: var(--good); }
[data-theme="dark"] .btn.fixbtn { background: transparent; color: var(--warn-ink); border-color: var(--warn); }
[data-theme="dark"] .help-close { color: var(--ink); }
[data-theme="dark"] .viewas-pick summary { background: #e8c46a; color: #1e1f22; }[data-theme="dark"] .btn:disabled, [data-theme="dark"] .btn.primary:disabled { background: #34363b; border-color: #4a4d53; color: #a3a8b0; }
[data-theme="dark"] .thread.selected, [data-theme="dark"] .thread.unread { background: var(--primary-soft); }
[data-theme="dark"] .thread.selected { border-left-color: var(--primary-ink); }
[data-theme="dark"] .thread-from, [data-theme="dark"] .thread-about { color: var(--ink); }
[data-theme="dark"] .table th[aria-sort] .sort-mark { color: var(--primary-ink); }[data-theme="dark"] .thread { background: var(--surface); }
[data-theme="dark"] .thread.selected, [data-theme="dark"] .thread.unread { background: var(--primary-soft); }

/* Sign-in code page */
.login-resend { padding: 4px 18px; }
.login-resend .btn { margin-left: 4px; padding: 4px 10px; }
#id_code { font-size: 22px; letter-spacing: 6px; max-width: 220px; }
