:root {
  --ink: #16202b; --muted: #5d6b7a; --line: #dfe4ea; --bg: #f4f6f8; --card: #ffffff;
  --brand: #13283f; --brand-2: #1f4f7a; --accent: #c8a24a;
  --blue: #00b0f0; --blue-bg: #e3f6fd; --green: #3e8e1d; --green-bg: #e8f5df; --red: #b3261e; --red-bg: #fbe9e7; --amber-bg: #fff4d6;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand-2); }
header.top { background: var(--brand); color: #fff; }
header.top .bar { max-width: 1200px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
header.top .logo { font-weight: 700; letter-spacing: .02em; color: #fff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
header.top .logo img { display: block; width: 45px; height: 44px; }
header.top .logo span { font-size: 17px; }
.login-logo { display: block; width: 96px; height: auto; margin: 0 auto 14px; }
.login-box h1 { text-align: center; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
header.top nav a { color: #d6e2ee; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
header.top nav a.on, header.top nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
header.top .who { font-size: 13px; color: #b9c8d8; display: flex; gap: 8px; align-items: center; }
header.top .who button { background: none; border: 1px solid #3c5978; color: #d6e2ee; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 13px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--brand); font-size: 12px; font-weight: 700; text-align: center; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
main.narrow { max-width: 680px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.flash { background: var(--green-bg); border: 1px solid #b9dca5; color: #24520f; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; word-break: break-word; }
.errors { background: var(--red-bg); border: 1px solid #f0b8b2; color: var(--red); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
label { display: block; font-weight: 600; font-size: 13px; margin: 0 0 4px; color: #2e3b49; }
.field { margin-bottom: 12px; }
.field .help { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 11px; border: 1px solid #c8d0d9; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); min-height: 42px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8bb8e0; border-color: #5d95c7; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; margin: 6px 0 12px; }
.check input { width: 20px; height: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand-2); background: var(--brand-2); color: #fff; padding: 10px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 42px; }
.btn.secondary { background: #fff; color: var(--brand-2); }
.btn.danger { background: #fff; color: var(--red); border-color: #e3a9a4; }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.quick a { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.quick a span { font-weight: 400; color: var(--muted); font-size: 13px; }
.quick a:hover { border-color: var(--brand-2); }
.section-office { border-left: 3px solid var(--accent); padding-left: 12px; margin-top: 8px; }
.section-office > h2 { margin-top: 6px; color: #7a5d12; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.list th, table.list td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
table.list th { background: #eef2f6; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: #4a5866; white-space: nowrap; }
table.list tr:hover td { background: #fafcfe; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.submitted { background: var(--amber-bg); color: #7a5d12; }
.tag.approved { background: var(--green-bg); color: var(--green); }
.tag.rejected { background: var(--red-bg); color: var(--red); }
.tag.unpaid, .tag.unbilled { background: var(--blue-bg); color: #00739e; }
.tag.paid, .tag.billed { background: var(--green-bg); color: var(--green); }
.tag.not_paid, .tag.no_bill { background: #eceff2; color: #59636e; }
.tag.type { background: #eaf0f7; color: var(--brand-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.bulkbar { position: sticky; bottom: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.bulkbar input, .bulkbar select { width: auto; min-height: 36px; padding: 6px 8px; }
.totals { font-weight: 700; }
.receipts { display: flex; gap: 10px; flex-wrap: wrap; }
.receipts .r { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; width: 120px; font-size: 12px; text-align: center; }
.receipts img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; display: block; margin-bottom: 4px; }
.history { font-size: 13px; color: var(--muted); }
.history li { margin-bottom: 3px; }
.entry-list { display: none; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; font-size: 14px; }
.login-box { max-width: 420px; margin: 40px auto; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 720px) {
  header.top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  header.top nav a { white-space: nowrap; }
  table.list.mobile-cards thead { display: none; }
  table.list.mobile-cards, table.list.mobile-cards tbody, table.list.mobile-cards tr, table.list.mobile-cards td { display: block; width: 100%; }
  table.list.mobile-cards tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.list.mobile-cards td { border: none; padding: 2px 8px; }
  table.list.mobile-cards td.num { text-align: left; }
  table.list.mobile-cards td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12px; }
}
