:root {
  --bg: #f4f2ee; --card: #ffffff; --ink: #1f2328; --muted: #6b6f76; --line: #dedad3;
  --brand: #2f3b2f; --brand-ink: #ffffff; --accent: #8a6d2f;
  --ok: #1f7a3d; --ok-bg: #e5f4ea; --warn: #8a5a00; --warn-bg: #fff4dc; --bad: #a3231b; --bad-bg: #fbe6e4;
  --info-bg: #e7eef8; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: #24518a; }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }
h1 { font-size: 26px; margin: 8px 0 16px; } h2 { font-size: 19px; margin: 0 0 12px; } h3 { font-size: 16px; margin: 6px 0; }
.muted { color: var(--muted); } small { font-weight: normal; color: var(--muted); }

.topbar { background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; flex-wrap: wrap; gap: 10px; }
.brand { color: var(--brand-ink); text-decoration: none; font-weight: 700; font-size: 18px; display: flex; flex-direction: column; line-height: 1.15; }
.brand span { font-weight: 400; font-size: 12px; opacity: .8; letter-spacing: .04em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topbar nav a, .linklike { color: var(--brand-ink); text-decoration: none; padding: 6px 10px; border-radius: 6px; font: inherit; }
.topbar nav a:hover, .linklike:hover { background: rgba(255,255,255,.12); }
.topbar nav a.muted { opacity: .75; }
.nav-primary { background: var(--accent); }
.linklike { background: none; border: 0; cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.narrow { max-width: 620px; margin: 30px auto; }
.hero { padding: 8px 0 4px; } .hero p { max-width: 760px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two-col > .card { margin-bottom: 18px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2, .grid3 { display: grid; gap: 12px; } .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); }
.span2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
label.check input { margin-top: 4px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #c9c4bb; border-radius: 7px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid #6d8fbf; border-color: #6d8fbf; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; } .radio-row label { flex-direction: row; font-weight: 400; align-items: center; gap: 6px; }

.btn { display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand); padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.15); }
.btn-big { font-size: 17px; padding: 13px 22px; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-ghost { background: #fff; color: var(--brand); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
form.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.inline-form label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters label { font-weight: 400; }
.boxed { border: 1px dashed var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
table.small { font-size: 13px; }
.pre { white-space: pre-wrap; } .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.warn-row td { background: var(--warn-bg); }
.qty { width: 80px; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; background: var(--info-bg); }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash ul { margin: 6px 0 0; }
.warn-text { color: var(--warn); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; background: #ebe8e2; color: #444; white-space: nowrap; }
.badge-available, .badge-verified, .badge-current, .badge-active, .badge-enabled, .badge-deposit, .badge-verify { background: var(--ok-bg); color: var(--ok); }
.badge-pending, .badge-reserved, .badge-due_soon, .badge-grace, .badge-unpaid, .badge-maintenance, .badge-on_site, .badge-inspect { background: var(--warn-bg); color: var(--warn); }
.badge-rejected, .badge-past_due, .badge-denied, .badge-expired, .badge-disabled, .badge-withdrawal { background: var(--bad-bg); color: var(--bad); }
.badge-occupied { background: var(--info-bg); color: #24518a; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 28px; font-weight: 700; }

.size-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.size-option { cursor: pointer; font-weight: 400; }
.size-option input { position: absolute; opacity: 0; }
.size-body { display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; height: 100%; }
.size-body .badge { align-self: flex-start; }
.size-option input:checked + .size-body { border-color: var(--brand); background: #eef2ec; }
.size-option input:focus-visible + .size-body { outline: 2px solid #6d8fbf; }
.price { font-size: 20px; font-weight: 700; color: var(--brand); }
.uploads { align-items: start; } .preview { max-width: 100%; max-height: 140px; border-radius: 6px; }
.preview:not([src]) { display: none; }
.contract { white-space: pre-wrap; border: 1px solid var(--line); background: #faf9f6; padding: 14px; border-radius: 8px; max-height: 340px; overflow: auto; font-size: 14px; }
.contract.tall { max-height: none; }
.signature { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 22px; }

.id-images { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.id-images figure { margin: 0; } figcaption { font-size: 12px; color: var(--muted); text-align: center; }
.photo { width: 150px; height: 180px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.idimg { max-width: 260px; max-height: 180px; border-radius: 8px; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.rental { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.rental.closed { opacity: .6; }

.scan-card textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 13px; margin-bottom: 10px; border-width: 2px; }
.verdict { border-width: 3px; }
.verdict-ok { border-color: var(--ok); } .verdict-ok h1 { color: var(--ok); }
.verdict-deny { border-color: var(--bad); } .verdict-deny h1 { color: var(--bad); }
.verdict-pending { border-color: var(--warn); } .verdict-pending h1 { color: var(--warn); }
.verdict-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; margin-bottom: 10px; }
.photo-large { width: 240px; height: 290px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.locker-chip { display: inline-block; background: var(--brand); color: #fff; font-weight: 700; padding: 2px 10px; border-radius: 6px; font-size: 18px; }

@media (max-width: 860px) {
  .two-col, .grid3, .grid2, .verdict-grid { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .photo-large { width: 100%; height: auto; }
}
