/* LDS Timesheets — one stylesheet, no build step.
   Palette echoes the document template the brief mandates: Georgia headings,
   Arial-family body, greens and gold. */

:root {
  --forest: #1f4d3c;
  --forest-dim: #2c6b53;
  --gold: #c4993a;
  --ink: #1a1a1a;
  --muted: #5d6661;
  --page: #f7f6f2;
  --card: #ffffff;
  --line: #dcdcd4;
  --flag: #8a4b1e;
  --flag-bg: #fdf3ea;
  --stop: #8c2f2f;
  --stop-bg: #fbeded;
  --ok: #1f5d3c;
  --ok-bg: #edf6f0;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --forest: #7fc0a3;
    --forest-dim: #a6d6bf;
    --gold: #d8b160;
    --ink: #e9e9e4;
    --muted: #9aa5a0;
    --page: #14181a;
    --card: #1c2124;
    --line: #2e3639;
    --flag: #e6a86a;
    --flag-bg: #2b211a;
    --stop: #e88b8b;
    --stop-bg: #2c1c1c;
    --ok: #8fd0ac;
    --ok-bg: #1a2620;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.5 Arial, Helvetica, "Helvetica Neue", sans-serif;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  color: var(--forest);
  margin: 0 0 .4rem;
  line-height: 1.25;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

a { color: var(--forest); }

/* Header ------------------------------------------------------------------ */

header.bar {
  background: var(--forest);
  border-bottom: 3px solid var(--gold);
  color: #f7f4ec;
  padding: .7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: baseline;
  justify-content: space-between;
}
header.bar a { color: #f7f4ec; }
header.bar .brand {
  font-family: Georgia, serif;
  font-size: 1.05rem;
  letter-spacing: .04em;
  text-decoration: none;
}
header.bar .who { font-size: .85rem; opacity: .85; }

main { max-width: 1100px; margin: 0 auto; padding: 1rem; }

/* Cards ------------------------------------------------------------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 1rem; }
@media (min-width: 800px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.side { grid-template-columns: 2fr 1fr; }
}

/* Month navigation -------------------------------------------------------- */

.monthnav {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.monthnav .spacer { flex: 1; }

.state {
  display: inline-block;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .2rem .5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.state.draft { border-color: var(--line); }
.state.submitted { color: var(--flag); border-color: var(--flag); background: var(--flag-bg); }
.state.signed_off { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.state.sealed { color: #f7f4ec; background: var(--forest); border-color: var(--forest); }

/* Tables ------------------------------------------------------------------ */

.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.offday td { background: color-mix(in srgb, var(--ok-bg) 55%, transparent); }
tr.total td { font-weight: 700; border-top: 2px solid var(--forest); border-bottom: none; }
tr.mob td { color: var(--muted); font-style: italic; }
td .note { display: block; max-width: 34ch; }
td .cat { display: block; font-size: .78rem; color: var(--muted); }

.tag {
  font-size: .7rem;
  padding: .1rem .35rem;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag.competes { color: var(--flag); border-color: var(--flag); }

/* Forms ------------------------------------------------------------------- */

form.entry { display: grid; gap: .6rem; }
@media (min-width: 720px) {
  form.entry { grid-template-columns: repeat(6, 1fr); align-items: end; }
  form.entry .wide { grid-column: span 3; }
  form.entry .full { grid-column: 1 / -1; }
}

label { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .2rem; }

input, select, textarea, button {
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .4rem .5rem;
  width: 100%;
}
textarea { min-height: 2.4rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--forest-dim); outline-offset: 1px; }

button, .btn {
  width: auto;
  cursor: pointer;
  background: var(--forest);
  color: #f7f4ec;
  border-color: var(--forest);
  border-radius: 4px;
  padding: .42rem .85rem;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
button.ghost, .btn.ghost { background: transparent; color: var(--forest); border-color: var(--line); }
button.danger { background: transparent; color: var(--stop); border-color: var(--stop); }
button.link { background: none; border: none; color: var(--forest); text-decoration: underline; padding: 0; }
button:disabled { opacity: .45; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Banners ----------------------------------------------------------------- */

.banner { border-radius: var(--radius); padding: .6rem .8rem; margin-bottom: 1rem; border: 1px solid; font-size: .9rem; }
.banner.error { color: var(--stop); border-color: var(--stop); background: var(--stop-bg); }
.banner.notice { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.banner.flag { color: var(--flag); border-color: var(--flag); background: var(--flag-bg); }
.banner.blocked { color: var(--stop); border-color: var(--stop); background: var(--stop-bg); }
.banner.ok { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.banner strong { display: block; margin-bottom: .15rem; }

/* Burn-down --------------------------------------------------------------- */

.burn { margin-bottom: .9rem; }
.burn:last-child { margin-bottom: 0; }
.burn .head { display: flex; justify-content: space-between; gap: .5rem; font-size: .85rem; margin-bottom: .25rem; }
.burn .head .code { font-weight: 700; }
.bar-track { height: 8px; background: color-mix(in srgb, var(--line) 60%, transparent); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--forest); }
.bar-fill.warn { background: var(--gold); }
.bar-fill.over { background: var(--stop); }
.burn .foot { font-size: .78rem; color: var(--muted); margin-top: .2rem; }

dl.facts { margin: 0; font-size: .87rem; }
dl.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border-bottom: 1px dotted var(--line); }
dl.facts div:last-child { border-bottom: none; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.rule { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }
details summary { cursor: pointer; color: var(--forest); font-size: .88rem; }
details > *:not(summary) { margin-top: .6rem; }

.htmx-request .actions button { opacity: .5; }
