:root {
  --bg: #f5f6f4; --surface: #ffffff; --ink: #1c2321; --muted: #5d6b66; --line: #dde3e0;
  --accent: #1f6f5c; --accent-ink: #ffffff; --warn-bg: #fff6e0; --warn: #8a5a00;
  --ok-bg: #e5f4ee; --ok: #1f6f5c; --dup-bg: #eef0f2; --err: #b3261e; --fill-bg: #e6eefb; --fill: #2556a8;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141816; --surface: #1d2220; --ink: #e6ebe9; --muted: #9aa8a3; --line: #323a37;
    --accent: #4fb89a; --accent-ink: #0d1411; --warn-bg: #3a2f14; --warn: #f1c46b;
    --ok-bg: #16362c; --ok: #7fd6b9; --dup-bg: #262c2a; --err: #ff8a80; --fill-bg: #1c2a44; --fill: #9dbbf0; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 700; }
h1 { font-size: 17px; margin: 0; } header p { margin: 0; color: var(--muted); font-size: 12px; }
#auth { display: flex; gap: 10px; align-items: center; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 60px; display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
h2 { font-size: 15px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.step { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 12px; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 9px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  border-radius: 6px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; align-items: end; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; }
.grid7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 12px 0; }
.row-end { display: flex; justify-content: flex-start; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-top: 4px; }
.seg { display: flex; gap: 18px; margin-bottom: 12px; }
.seg label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.banner { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; }
.log { margin-top: 12px; font-family: Consolas, monospace; font-size: 12px; background: var(--bg); border-radius: 6px;
  padding: 10px 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; }
.log .err { color: var(--err); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.file { font-size: 12px; max-width: 170px; word-break: break-word; }
td.file .srf { color: var(--muted); }
td input, td textarea { padding: 5px 7px; }
td textarea { min-width: 280px; resize: vertical; }
td.hrs input { width: 64px; } td.chg select { width: 76px; } td.date input { width: 140px; } td.client input { min-width: 170px; }
.pill { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.new { background: var(--ok-bg); color: var(--ok); }
.pill.dup { background: var(--dup-bg); color: var(--muted); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.fill { background: var(--fill-bg); color: var(--fill); }
td input:disabled, td textarea:disabled { background: transparent; border-color: transparent; color: var(--muted); }
tr.off td:not(:first-child) { opacity: .55; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.actions #summary { margin-right: auto; }
@media (max-width: 760px) {
  header { padding: 12px 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid7 { grid-template-columns: repeat(3, 1fr); }
}
.span2 { grid-column: 1 / -1; margin: 0; }
footer { text-align: center; padding-top: 8px; }
footer a { color: var(--accent); }
