/* Layout: one column with three views (new entry, weekly report, techs and rates) switched by the tabs under the title. */
:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #5b6b7a;
  --line: #cfd7df;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --result-bg: #17212b;
  --result-ink: #f4f6f8;
  --result-muted: #a9b6c2;
  --font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --font-body: "Barlow", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10161c;
    --surface: #1a232c;
    --ink: #e8edf1;
    --muted: #9aa8b5;
    --line: #33414e;
    --accent: #f97316;
    --accent-ink: #1a1206;
    --result-bg: #0a0f14;
    --result-ink: #f4f6f8;
    --result-muted: #9aa8b5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10161c;
  --surface: #1a232c;
  --ink: #e8edf1;
  --muted: #9aa8b5;
  --line: #33414e;
  --accent: #f97316;
  --accent-ink: #1a1206;
  --result-bg: #0a0f14;
  --result-ink: #f4f6f8;
  --result-muted: #9aa8b5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  padding: 32px 16px 48px;
}
main {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
header { display: flex; flex-direction: column; gap: 14px; }
header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}
nav { display: flex; gap: 8px; flex-wrap: wrap; }
nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--surface);
}
nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
nav a:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.view { display: none; flex-direction: column; gap: 20px; }
.view.on { display: flex; }

.note {
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  background: var(--surface);
}
.note:empty { display: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.hint a { color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 15px; }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr; } }

.input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
  min-width: 0;
}
.input-wrap:focus-within, select:focus-visible, input.plain:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.input-wrap span { padding: 0 10px; color: var(--muted); font-weight: 600; }
.input-wrap input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  padding: 10px 10px 10px 0;
  outline: none;
}
.input-wrap.suffix input { padding-left: 10px; padding-right: 0; }
select, input.plain {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  width: 100%;
  min-width: 0;
}
select { cursor: pointer; }

#jobs { display: flex; flex-direction: column; gap: 10px; }
.job, .col-heads {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  gap: 8px;
}
.job { align-items: stretch; }
.col-heads { font-size: 14px; font-weight: 600; color: var(--muted); }

button {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1.5px solid transparent;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.remove {
  padding: 0;
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  font-size: 20px;
  line-height: 1;
}
.remove:hover { color: var(--accent); border-color: var(--accent); }
.outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.solid { background: var(--accent); color: var(--accent-ink); }
.quiet { background: transparent; color: var(--muted); border-color: var(--line); padding: 6px 10px; font-size: 14px; }
.quiet.armed { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
#add { align-self: flex-start; }
.error { color: var(--accent); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }

.rates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 480px) { .rates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rate-row { border-top: 1px solid var(--line); padding-top: 14px; max-width: 200px; }

.result {
  background: var(--result-bg);
  color: var(--result-ink);
  border-radius: 10px;
  border-left: 6px solid var(--accent);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.result .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--result-muted);
}
.hours {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 72px;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.hours small { font-size: 28px; font-weight: 600; margin-left: 6px; color: var(--result-muted); }
.sub { color: var(--result-muted); font-variant-numeric: tabular-nums; }
.sub strong { color: var(--result-ink); font-weight: 600; }
.math {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: 14px;
  font-size: 15px;
  color: var(--result-muted);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.math .total { color: var(--result-ink); margin-top: 6px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
#calc-detail { display: flex; flex-direction: column; gap: 14px; }
#calc-detail[hidden] { display: none; }
#toggle-detail { align-self: flex-start; padding: 6px 12px; font-size: 14px; }
.result .ghost { background: transparent; color: var(--result-ink); border-color: rgba(255,255,255,0.3); }
.result .status { font-size: 14px; color: var(--result-muted); }
.status { font-size: 14px; color: var(--muted); }

.weekbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.weekbar .range { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.weekbar .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 14px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; padding-right: 0; padding-left: 10px; }
tr.total td { font-weight: 600; border-bottom: 0; }
td.big { font-weight: 600; }
.entry {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.entry .top { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.entry .who { font-weight: 600; }
.entry .lines { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
#techlist { display: flex; flex-direction: column; gap: 10px; }
.techitem { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.techrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.techrow .name { font-weight: 600; }
.techrow .rates-text { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.techrow .info { display: flex; flex-direction: column; min-width: 0; }
.techrow .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.techedit { display: flex; flex-direction: column; gap: 12px; background: var(--bg); border-radius: 8px; padding: 14px; }
.techedit .input-wrap { background: var(--surface); }
.techedit .rate-row { border-top: 0; padding-top: 0; }
.addtech { display: flex; gap: 8px; }
.addtech input { flex: 1; }

/* ---- additions for the self-hosted version ---- */
.topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.topline form { margin: 0; }
.login { max-width: 420px; margin: 8vh auto 0; }
.login form { display: flex; flex-direction: column; gap: 14px; }


td.wrap { white-space: normal; }
