/* einvoice UI. Plain CSS, no build step. Brand: DIT blue #007ACD / #005598. */
:root {
  --brand: #007ACD;
  --brand-dark: #005598;
  --ink: #1f2933;
  --muted: #5b6f81;
  --line: #e2e8f0;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #15803d;   --ok-bg: #dcfce7;
  --warn: #b45309; --warn-bg: #fef3c7;
  --bad: #b91c1c;  --bad-bg: #fee2e2;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
small, .muted { color: var(--muted); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }

/* layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 220px; background: var(--brand-dark); color: #fff; padding: 20px 14px; flex-shrink: 0; display: flex; flex-direction: column; }
.side .brand { font-weight: 700; font-size: 17px; letter-spacing: .3px; margin: 0 6px 18px; }
.side .brand span { display: block; font-weight: 400; font-size: 11px; opacity: .7; letter-spacing: 0; }
.side nav a { display: block; color: #dbeafe; padding: 8px 10px; border-radius: 6px; margin-bottom: 2px; }
.side nav a:hover, .side nav a.on { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.side .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; opacity: .55; margin: 16px 10px 6px; }
.side .foot { margin-top: auto; font-size: 12px; opacity: .85; padding: 0 6px; }
.side .foot button { background: none; border: 0; color: #dbeafe; padding: 0; cursor: pointer; font: inherit; }
.side select { width: 100%; margin: 0 0 8px; padding: 6px; border-radius: 6px; border: 0; font: inherit; }
.main { flex: 1; padding: 24px 28px; min-width: 0; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* cards, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { font-size: 26px; font-weight: 700; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.b-draft { background: #e2e8f0; color: #334155; }
.b-validated, .b-accepted { background: var(--ok-bg); color: var(--ok); }
.b-rejected { background: var(--bad-bg); color: var(--bad); }
.b-issued { background: #dbeafe; color: var(--brand-dark); }
.b-pending, .b-accepted_with_warning, .b-warning { background: var(--warn-bg); color: var(--warn); }
.b-fatal { background: var(--bad-bg); color: var(--bad); }

/* forms */
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.err { font-size: 12px; color: var(--bad); margin-top: 3px; }
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.ghost:hover { background: #eff6ff; }
.btn.danger { background: #fff; color: var(--bad); border-color: #fca5a5; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lines td { padding: 6px 4px; }
.lines input, .lines select { padding: 6px 7px; font-size: 13px; }

/* notices */
.notice { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.finding { padding: 8px 0; border-bottom: 1px solid var(--line); }
.finding:last-child { border-bottom: 0; }
pre.xml { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 6px; overflow: auto; max-height: 420px; font-size: 12px; }

/* type-ahead (public/js/lookup.js) */
.lookup { position: absolute; z-index: 50; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(15,23,42,.12); max-height: 320px; overflow-y: auto; max-width: 560px; }
.lookup-item { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 13px; }
.lookup-item:last-child { border-bottom: 0; }
.lookup-item strong { display: block; font-weight: 600; }
.lookup-item span { color: var(--muted); font-size: 12px; }
.lookup-item:hover, .lookup-item.on { background: #eff6ff; }

/* login */
.auth { max-width: 380px; margin: 10vh auto; }
.auth .logo { text-align: center; font-weight: 700; font-size: 22px; color: var(--brand-dark); margin-bottom: 18px; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; }
  .main { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}
