/*
  Design direction: this reads like a utility statement / meter room, not a SaaS
  analytics product. Flat panels, hairline rules, tabular numbers. Amber is spent
  in exactly one place — the current usage figure — nowhere else.

  Palette:
    --paper  #EEF1EC  page background (cool pale sage, not the default warm cream)
    --white  #FBFBF9  panel surface
    --ink    #1E2A28  primary text / headlines
    --ink-60 #52605C  secondary text
    --line   #C4CDC5  hairline borders / dividers
    --amber  #D98E2B  the one accent: usage figures
    --teal   #2F6E67  links, role badges

  Type:
    Fraunces   -> headlines, the building/unit name, the big usage number
    Inter      -> everything else, tabular-nums for all numeric columns
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --paper: #EEF1EC;
  --white: #FBFBF9;
  --ink: #1E2A28;
  --ink-60: #52605C;
  --line: #C4CDC5;
  --amber: #D98E2B;
  --teal: #2F6E67;
}

[data-theme="dark"] {
  --paper: #141F1C;
  --white: #1C2925;
  --ink: #E7EDE9;
  --ink-60: #93A39B;
  --line: #33453F;
  --amber: #E8A33D;
  --teal: #5FB3A8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3, .figure {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.01em;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar .wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
}

.sidebar .who {
  font-size: 13px;
  color: var(--ink-60);
}

.sidebar .who .role {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid var(--teal);
  border-radius: 3px;
  color: var(--teal);
  font-size: 12px;
}

.sidebar form { margin-top: auto; }

.sidebar button.link-like {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-60);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.sidebar button.link-like:hover { color: var(--ink); text-decoration: underline; }

main {
  flex: 1;
  padding: 40px 48px;
  max-width: 880px;
}

main h1 { font-size: 26px; margin: 0 0 6px; }
main .subhead { color: var(--ink-60); margin: 0 0 32px; font-size: 14px; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.panel h2 {
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  text-transform: none;
  margin: 0 0 16px;
  color: var(--ink-60);
}

.usage-figure {
  font-size: 44px;
  color: var(--amber);
  margin: 0;
  line-height: 1;
}
.usage-figure .unit-label {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--ink-60);
  margin-left: 8px;
}

table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.ledger th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-60);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px 8px 0;
}
table.ledger td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
}
table.ledger tr:last-child td { border-bottom: none; }
table.ledger td.num, table.ledger th.num { text-align: right; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--ink-60);
}
.badge.unassigned { border-color: var(--amber); color: var(--amber); }

form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
form.inline { display: flex; gap: 8px; align-items: center; }

label { font-size: 13px; color: var(--ink-60); display: block; margin-bottom: 4px; }

input, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

button.primary {
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 9px 16px;
  border-radius: 3px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
button.primary:hover { background: var(--teal); }

.error-msg {
  color: #B0432F;
  font-size: 13px;
  margin-bottom: 12px;
}

.empty-state {
  color: var(--ink-60);
  font-size: 14px;
  padding: 8px 0;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 40px;
  width: 320px;
}
.login-card h1 { font-size: 22px; margin: 0 0 24px; }
