/* Ember — server-rendered pages. Dark, dense, readable on a phone in a rental
   kitchen and printable to PDF for an adjuster. */

:root {
  --bg: #14110f;
  --panel: #1e1a17;
  --line: #322c27;
  --ink: #e9e4df;
  --dim: #a2968c;
  --accent: #e8703a;
  --warn: #e0b341;
  --bad: #d4634f;
  --ok: #6fae72;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

main { padding: 1rem 1.1rem 4rem; max-width: 1400px; margin: 0 auto; }

h1 { font-size: 1.5rem; margin: .4rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 .6rem; color: var(--dim);
     text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--accent); }

/* --- top bar ---------------------------------------------------------- */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem;
  padding: calc(.6rem + env(safe-area-inset-top)) 1.1rem .6rem;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; flex-wrap: wrap; gap: .9rem; flex: 1; }
.topbar nav a { color: var(--dim); text-decoration: none; font-size: .92rem; }
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.on { color: var(--accent); font-weight: 600; }
.topbar nav a.app { color: var(--ink); }
.who { color: var(--dim); font-size: .82rem; }

/* --- cards ------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
         gap: .8rem; margin-bottom: 1.2rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
        padding: .9rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.card.accent { border-color: var(--accent); }
.card .label { color: var(--dim); font-size: .8rem; text-transform: uppercase;
               letter-spacing: .05em; }
.card .big { font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.card .note { color: var(--dim); font-size: .78rem; }

.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar div { height: 100%; background: var(--accent); }
.progress-line { color: var(--dim); margin: .4rem 0; }

/* --- tables ----------------------------------------------------------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
          border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
caption { text-align: left; color: var(--dim); font-size: .82rem;
          padding: .6rem .8rem; }
th, td { padding: .5rem .7rem; border-bottom: 1px solid var(--line);
         text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; background: #241f1b; font-size: .78rem;
           text-transform: uppercase; letter-spacing: .05em; color: var(--dim);
           white-space: nowrap; }
tbody th[scope="row"] { font-weight: 600; }
tbody tr:hover { background: #241f1b; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot th, tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.sub { display: block; color: var(--dim); font-size: .82rem; font-weight: 400; }
.small { font-size: .82rem; color: var(--dim); }
tr.candidate { background: #241d16; }
tr.conditional td, tr.conditional th { opacity: .78; }
tr.bad td { color: var(--bad); }

/* --- bits ------------------------------------------------------------- */
.pill { display: inline-block; padding: .08rem .5rem; border-radius: 999px;
        font-size: .76rem; background: var(--line); white-space: nowrap; }
.pill.candidate, .pill.pending, .pill.not_started { background: #4a3a1c; color: #f0cf87; }
.pill.confirmed, .pill.complete, .pill.login_ok, .pill.extracted { background: #24432a; color: #a5d6a7; }
.pill.rejected, .pill.login_fail, .pill.locked, .pill.failed { background: #4a2320; color: #f0a99b; }
.pill.replaced, .pill.closed, .pill.in_progress { background: #23384a; color: #9bc4e2; }
.tag { display: inline-block; padding: .05rem .4rem; border: 1px solid var(--line);
       border-radius: 4px; font-size: .74rem; color: var(--dim); margin-right: .25rem; }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.warn { color: var(--warn); }
.note { color: var(--dim); font-size: .85rem; }
.count { color: var(--dim); }
.empty { color: var(--dim); padding: .6rem 0; }

/* --- filters ---------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end;
           margin-bottom: .8rem; }
.filters label { display: flex; flex-direction: column; gap: .2rem;
                 font-size: .8rem; color: var(--dim); }
select, input, button {
  font: inherit; padding: .45rem .6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
button { background: var(--accent); border-color: var(--accent); color: #1a1005;
         font-weight: 600; cursor: pointer; }
.clear { align-self: center; color: var(--dim); font-size: .85rem; }

/* --- login ------------------------------------------------------------ */
.login-page { display: grid; place-items: center; min-height: 100dvh; }
.login { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
         padding: 2rem; width: min(360px, 92vw); }
.login h1 { margin: 0; font-size: 1.6rem; }
.login .sub { color: var(--dim); margin: .2rem 0 1.4rem; }
.login form { display: flex; flex-direction: column; gap: .9rem; }
.login label { display: flex; flex-direction: column; gap: .3rem;
               font-size: .82rem; color: var(--dim); }
.login button { padding: .7rem; margin-top: .4rem; }
.error { background: #4a2320; color: #f0a99b; padding: .6rem .8rem;
         border-radius: 8px; font-size: .88rem; }

/* --- print: hand an adjuster a clean PDF ------------------------------ */
@media print {
  :root { --bg: #fff; --panel: #fff; --ink: #000; --dim: #444; --line: #999; }
  body { background: #fff; color: #000; }
  .topbar, .filters, .clear { display: none; }
  .scroll { border: none; overflow: visible; }
  table { font-size: 10pt; }
  thead th { position: static; background: #eee; color: #000; }
  tr { break-inside: avoid; }
}
