:root {
  --bg: #0e1410;
  --panel: #161d18;
  --border: #2c3a30;
  --text: #f2f5f0;
  --muted: #9aab9f;
  --green: #2d8a45;
  --gold: #d4a017;
  --radius: 12px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.err { color: #e85d5d; min-height: 1.2rem; }
a { color: #8fd49c; }

.screen { min-height: 100vh; }
.login {
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login .card {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
}
.badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 8px;
}
.login h1 { margin: 0 0 8px; }
label { display: block; font-weight: 600; margin: 0 0 10px; font-size: 0.9rem; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 0.65rem 0.75rem;
  border-radius: 10px; border: 1px solid var(--border); background: #0c100e; color: var(--text);
  font-size: 1rem;
}
.btn {
  border: 1px solid var(--border); background: #243428; color: var(--text);
  border-radius: 10px; padding: 0.6rem 0.9rem; font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: var(--green); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; }
.row.gap { margin: 8px 0; }
.wrap { flex-wrap: wrap; }

.top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); background: #121814;
}
.top h1 { margin: 0; font-size: 1.35rem; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.layout {
  display: grid; grid-template-columns: minmax(280px, 340px) 1fr; min-height: calc(100vh - 72px);
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.controls {
  border-right: 1px solid var(--border); padding: 14px 16px 28px; overflow: auto;
  background: var(--panel);
}
.controls h2 {
  margin: 18px 0 10px; font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; color: #8a9a8e;
}
.checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.check {
  display: flex; gap: 8px; align-items: flex-start; font-weight: 500; font-size: 0.92rem;
  margin: 0; color: var(--text);
}
.check input { width: auto; margin: 3px 0 0; }
.multi-list { list-style: none; padding: 0; margin: 8px 0; }
.multi-list li {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 4px; font-size: 0.9rem;
}
.multi-list button { font-size: 0.8rem; }

.preview { overflow: auto; background: #1a1a1a; }
.preview-toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between;
  padding: 10px 16px; background: #121814; border-bottom: 1px solid var(--border);
}
.sheets { padding: 16px; }
.pad { padding: 24px; }

/* Print sheets */
.sheet {
  background: #fff; color: #111; border-radius: 4px; padding: 18px 20px 22px;
  margin: 0 auto 18px; max-width: 900px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.sheet h1 { font-size: 1.25rem; margin: 0 0 4px; color: #111; }
.sheet h2 { font-size: 1.05rem; margin: 14px 0 8px; color: #111; border-bottom: 1px solid #ccc; padding-bottom: 4px; }
.sheet .meta { color: #444; font-size: 0.9rem; margin: 0 0 12px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0 12px; }
.sheet th, .sheet td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; vertical-align: top; }
.sheet th { background: #f0f0f0; }
.sheet .right { text-align: right; }
.sheet .note { color: #444; font-size: 0.85rem; margin-top: 10px; }
.sheet .ok { color: #0a6b2d; font-weight: 700; }
.sheet .bad { color: #a11; font-weight: 700; }
.sheet footer.sig { margin-top: 16px; font-size: 0.85rem; color: #555; }

@media print {
  body { background: #fff; }
  .no-print, .login, .top, .controls, .preview-toolbar { display: none !important; }
  .layout { display: block; }
  .preview { overflow: visible; background: #fff; }
  .sheets { padding: 0; }
  .sheet {
    box-shadow: none; border: none; margin: 0 0 12mm; max-width: none;
    page-break-after: always; border-radius: 0;
  }
  .sheet:last-child { page-break-after: auto; }
}
