/* Houghton Country house style: shared with the Staff App (Time Clock) and every Houghton app.
   Cool blue-grey page, soft rounded cards, Inter, navy primary buttons, grey secondary buttons,
   uppercase spaced labels, a bold navy "hero" card at the top. Fonts are served from this server. */
@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/inter-400.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/inter-600.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/inter-700.woff) format("woff"); }
@font-face { font-family: Inter; font-weight: 800; font-display: swap; src: url(/inter-800.woff) format("woff"); }

:root {
  --page: #e8edf2; --card: #f3f6f9; --card-line: #d5dee7; --field: #ffffff; --field-line: #d3dce6; --grey-btn: #dee4eb;
  --ink: #18212d; --muted: #5a6878; --navy: #1c2f50; --navy-deep: #142440;
  --green: #216a2e; --green-text: #2e7d32; --green-soft: #dff0db;
  --blue: #2459a8; --blue-soft: #dce7f5; --amber: #a85d00; --amber-soft: #fcefd8; --red: #b3261e; --red-soft: #fbe4e1;
  --r-card: 22px; --r-hero: 24px; --r-ctl: 14px;
  --shadow: 0 6px 20px rgba(28, 47, 80, .06);
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 var(--font); font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .55em; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.015em; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .8em; }
a { color: var(--blue); text-underline-offset: 3px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .boot { padding: 3rem; color: var(--muted); }
.label { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.top { background: var(--navy); color: #fff; }
.top-in { max-width: 1320px; margin: 0 auto; padding: .9rem 1.5rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: baseline; gap: .7rem; }
.brand b { font-weight: 800; letter-spacing: .14em; font-size: 1rem; }
.brand span { font-size: .72rem; font-weight: 700; letter-spacing: .16em; color: #b9c7dc; border-left: 1px solid #3c5277; padding-left: .7rem; }
.top nav { margin-left: auto; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav button { color: #dbe4f0; text-decoration: none; font: 600 .92rem var(--font); padding: .45rem .8rem; border-radius: 10px; background: none; border: 0; cursor: pointer; }
.top nav a:hover, .top nav button:hover, .top nav a[aria-current] { background: var(--navy-deep); color: #fff; }
.who { color: #b9c7dc; font-size: .88rem; margin-right: .4rem; }

/* ---------- page ---------- */
main.page { max-width: 1320px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.hero { background: var(--navy); color: #fff; border-radius: var(--r-hero); padding: 1.8rem 2rem; margin-bottom: 1.5rem; display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; box-shadow: var(--shadow); }
.hero h1 { color: #fff; margin: 0 0 .3rem; }
.hero .label { color: #b9c7dc; }
.hero p { margin: 0; color: #dbe4f0; }
.hero-stats { display: flex; gap: 2.2rem; }
.hero-stat b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-stat span { font-size: .8rem; color: #b9c7dc; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: .2rem 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: .6rem; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .6rem; font-size: .9rem; }

/* ---------- tiles ---------- */
.group { margin-bottom: 2rem; }
.group > h2 { font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 .8rem .2rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.tile { position: relative; display: flex; flex-direction: column; gap: .5rem; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card); padding: 1.25rem 1.3rem 1.2rem; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-height: 168px; transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--blue); transform: translateY(-1px); }
.tile-head { display: flex; align-items: center; gap: .75rem; }
.tile-icon { width: 42px; height: 42px; border-radius: 13px; background: var(--blue-soft); color: var(--navy); display: grid; place-items: center; flex: none; }
.tile-icon svg { width: 22px; height: 22px; }
.tile h3 { margin: 0; font-size: 1.08rem; font-weight: 800; letter-spacing: -0.01em; }
.tile p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.tile .big { font-size: 1.65rem; font-weight: 800; letter-spacing: -0.02em; color: var(--navy); line-height: 1.1; margin-top: auto; padding-top: .35rem; }
.tile .lines { list-style: none; margin: 0; padding: 0; font-size: .86rem; color: var(--muted); }
.tile.is-planned, .tile.is-paused { background: transparent; box-shadow: none; border-style: dashed; }
.tile.is-planned .tile-icon { background: var(--grey-btn); color: var(--muted); }
.tile.tone-bad { border-color: var(--red); } .tile.tone-warn { border-color: #e2b56c; }
.pill { display: inline-block; padding: .08rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--grey-btn); color: var(--muted); white-space: nowrap; }
.tile .pill { margin-left: auto; }
.pill.live, .pill.ok { background: var(--green-soft); color: var(--green-text); }
.pill.building, .pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.paused, .pill.bad { background: var(--red-soft); color: var(--red); }
.pill.off, .pill.planned { background: var(--grey-btn); color: var(--muted); }
.pill.info { background: var(--blue-soft); color: var(--blue); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: 700 .95rem var(--font); padding: .7rem 1.15rem; border-radius: var(--r-ctl); border: 0; cursor: pointer; text-decoration: none; background: var(--grey-btn); color: var(--ink); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--navy); color: #fff; } .btn-primary:hover { background: var(--navy-deep); }
.btn-quiet { background: transparent; color: var(--muted); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-small { padding: .4rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 18px; height: 18px; }
form.stack { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field small { color: var(--muted); }
input, select, textarea { font: 1rem var(--font); padding: .65rem .8rem; border: 1.5px solid var(--field-line); border-radius: var(--r-ctl); background: var(--field); color: var(--ink); width: 100%; }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; }
.checks { display: flex; gap: 1rem; flex-wrap: wrap; } .checks label { display: flex; gap: .4rem; align-items: center; font-weight: 600; }
.checks input { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .9rem; }
.error { background: var(--red-soft); color: var(--red); border-radius: var(--r-ctl); padding: .7rem 1rem; font-weight: 600; }
.note { background: var(--blue-soft); color: var(--navy); border-radius: var(--r-ctl); padding: .8rem 1rem; }
.note.warn { background: var(--amber-soft); color: #6e3d00; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: .5rem .7rem; border-bottom: 1.5px solid var(--card-line); }
td { padding: .6rem .7rem; border-bottom: 1px solid var(--card-line); vertical-align: top; }
td.num, th.num { text-align: right; }
tr:last-child td { border-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.75rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1.15; }
.stat .delta { font-size: .85rem; font-weight: 700; }
.delta.up { color: var(--green-text); } .delta.down { color: var(--red); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.check { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; background: var(--field); border: 1.5px solid var(--card-line); border-radius: 16px; padding: .8rem 1rem; }
.check .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--green-text); } .dot.warn { background: #d18a1c; } .dot.bad { background: var(--red); } .dot.off { background: #b5c0cc; }
.check b { display: block; } .check small { color: var(--muted); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.tabs { display: flex; gap: .4rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.tabs button { font: 700 .9rem var(--font); padding: .5rem .95rem; border-radius: 999px; border: 0; background: var(--grey-btn); color: var(--ink); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; align-items: start; }
.bars { display: grid; gap: .4rem; }
.bar { display: grid; grid-template-columns: 8rem 1fr 6rem; gap: .7rem; align-items: center; font-size: .88rem; }
.bar-track { height: 12px; background: var(--grey-btn); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 6px; }

.range-bar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--r-card); padding: .9rem 1.2rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.range-part { display: grid; gap: .25rem; }
.range-part .label { margin: 0; }
.range-part select { width: auto; min-width: 11rem; }
.range-dates { display: flex; gap: .45rem; align-items: center; }
.range-dates input { width: auto; }
.range-label { margin-left: auto; align-self: center; }
.cmp { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; }
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--navy); color: #fff; padding: .75rem 1.2rem; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 2rem); }
#toast.show { opacity: 1; }
#toast.bad { background: var(--red); }

/* sign-in */
.signin { max-width: 440px; margin: 9vh auto 2rem; }
.signin .brand-mark { font-weight: 800; letter-spacing: .14em; color: var(--navy); margin: 0; }
.signin .card { padding: 2rem; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.4rem; flex-wrap: wrap; }
}
@media (max-width: 620px) {
  main.page { padding: 1.1rem 1rem 3rem; }
  .top-in { padding: .8rem 1rem; flex-wrap: wrap; gap: .5rem; }
  .top nav { margin-left: 0; width: 100%; }
  .who { display: none; }
  .hero { padding: 1.4rem; }
  h1 { font-size: 1.6rem; }
  .bar { grid-template-columns: 5.5rem 1fr 4.5rem; }
}
@media print {
  .top, .btn, #toast { display: none !important; }
  body { background: #fff; } .card, .stat, .tile { box-shadow: none; }
}
