/* ERM look (matches the RISEHQ tools). Buttons and controls always use dark text. */
:root {
  --accent: #019a20;
  --dark: #0a2b14;
  --text: #282828;
  --surface: #f4f7f4;
  --surface-2: #e9f0ea;
  --panel: #ffffff;
  --border: #c2cfc3;
  --error: #a31d1d;
  --error-bg: #fdf2f2;
  --primary-bg: #b8e2c0;
  --radius: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 14px/1.5 "Figtree", "Figtree Static", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

button, input, select { font: inherit; color: var(--text); }

.topbar { background: var(--surface-2); border-bottom: 3px solid var(--accent); padding: 12px 20px; }
.topbar h1 { margin: 0; font-size: 20px; color: var(--dark); }
.topbar .sub { margin: 2px 0 0; font-size: 13px; }

.page { max-width: 1240px; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 14px; }

.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.step h2 { margin: 0 0 10px; font-size: 16px; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.step h2:not(:first-child) { margin-top: 18px; }
.step h2 .n {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--primary-bg); border: 1px solid var(--accent); font-size: 13px;
}

.row-fields { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .label { font-weight: 600; font-size: 13px; color: var(--dark); }
.field.names { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.field.names label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.field.names input { width: 104px; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
input[type="number"] { width: 64px; }
input, select { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 6px; background: #fff; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; gap: 8px; margin-top: 14px; }
button {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  color: var(--dark); padding: 6px 14px; font-weight: 600; cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--primary-bg); border-color: var(--accent); color: var(--dark); }

.hint { font-size: 12px; margin: 0 0 8px; }
.notice { margin: 12px 20px 0; padding: 8px 14px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--surface-2); color: var(--dark); max-width: 1200px; }
.banner { margin-top: 12px; padding: 10px 14px; border: 1px solid var(--error); border-radius: var(--radius);
  background: var(--error-bg); color: var(--error); font-weight: 600; }

/* The chart */
.chart { border-collapse: collapse; }
.chart th, .chart td { padding: 3px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.chart th { font-size: 12px; color: var(--dark); background: var(--surface-2); }
.chart td.idx { color: var(--dark); font-weight: 700; }
.chart tr.empty td.idx { color: #5a645b; font-weight: 400; }
.chart tr.admitted td { background: #fff6d6; }
.chart td.new-tag { font-size: 12px; font-weight: 700; color: var(--dark); white-space: nowrap; }

/* The plan */
.plan { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.totals { min-width: 300px; }
.totals table { width: 100%; border-collapse: collapse; }
.totals th, .totals td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.totals th { font-size: 12px; color: var(--dark); background: var(--surface-2); }
.totals td.num, .totals th:not(:first-child) { text-align: right; }
.swatch { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--text); border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.spread { font-weight: 700; margin: 10px 0 4px; }
.warnings { margin: 6px 0; padding-left: 18px; color: var(--error); }

.map-wrap { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.map-head button { padding: 3px 10px; }
.map { display: grid; grid-auto-rows: 26px; gap: 3px; }
.room {
  display: flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; white-space: nowrap; overflow: hidden;
}
.room .num { font-weight: 700; color: var(--dark); min-width: 18px; }
.room .tag { margin-left: auto; font-weight: 700; }
.room.empty { color: #5a645b; background: var(--surface); }

.print-sheet { display: none; }

@media print {
  body { background: #fff; color: #000; }
  .topbar .sub, .notice, .page { display: none !important; }
  .print-sheet { display: block; padding: 0 8px; }
  .print-sheet h2 { font-size: 16px; margin: 0 0 6px; }
  .print-sheet table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  .print-sheet th, .print-sheet td { border: 1px solid #000; padding: 4px 6px; text-align: left; font-size: 12px; }
  .print-sheet .mini { display: grid; grid-auto-rows: 18px; gap: 2px; }
  .print-sheet .mini div { border: 1px solid #000; font-size: 9px; padding: 0 3px; white-space: nowrap; overflow: hidden; }
}
