:root { --bg: #f3f5f8; --card: #fff; --text: #1d2433; --muted: #6b7385; --line: #e3e7ee; --accent: #3b5bdb; --danger: #d6336c;
  --free: #12a150; --free-bg: #e7f7ee; --reserved: #d98c00; --reserved-bg: #fff4dc; --sold: #8a93a3; --sold-bg: #eef0f4; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0; padding: 24px 16px; background: var(--bg); color: var(--text); }
main { max-width: 1600px; margin: 0 auto; }
header { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
header h2 { margin: 0 8px 0 0; font-size: 22px; }
.spacer { margin-left: auto; }
.muted { color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.filters, .stats, .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; font-size: 13px; }
select, input, button, .btn { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff; color: var(--text); }
button, .btn { cursor: pointer; text-decoration: none; } button:hover, .btn:hover { border-color: var(--accent); }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { color: var(--danger); min-height: 1.4em; margin: 8px 0 0; }
.stat { padding: 10px 14px; border-radius: 10px; min-width: 120px; }
.stat b { display: block; font-size: 20px; }
.stat.total { background: #eef2ff; margin-left: auto; }
/* три колонки: фильтры | шахматка | карточка помещения */
.cv { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.cv.has-detail { grid-template-columns: 230px minmax(0, 1fr) 320px; }
.cv .panel { margin: 0; }
.cv-filters { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.cv-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cv-rooms { display: flex; gap: 6px; }
.cv-rooms button { flex: 1; padding: 6px 0; }
.cv-rooms button[aria-pressed="true"] { background: #0f8a68; border-color: #0f8a68; color: #fff; }
.cv-vals { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin: 4px 0; }
.cv-track { position: relative; height: 20px; }
.cv-track::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: #cfe9e0; }
.cv-track input { position: absolute; inset: 0; width: 100%; margin: 0; padding: 0; border: 0; background: none; pointer-events: none; appearance: none; }
.cv-track input::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #0f8a68; border: 2px solid #fff; box-shadow: 0 0 0 1px #0f8a68; cursor: pointer; }
.cv-track input::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #0f8a68; border: 2px solid #fff; cursor: pointer; }
.switch { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 36px; height: 20px; border-radius: 10px; background: #d5d9e0; position: relative; flex: none; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch input:checked + span { background: #0f8a68; }
.switch input:checked + span::after { left: 18px; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cv-top .legend { margin: 0; }
.cv-top input[type="search"] { width: 150px; }
.cv-detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.cv-close { position: absolute; right: 12px; top: 12px; padding: 2px 10px; font-size: 18px; line-height: 1; }
.cv-status { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cv-status .cell { width: 12px; height: 12px; }
.cv-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 6px 40px 12px 0; text-transform: uppercase; }
.cv-plan { display: flex; align-items: center; justify-content: center; height: 240px; border-radius: 8px; background: #fafbfc; border: 1px solid var(--line); overflow: hidden; }
.cv-plan img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cv-noplan { color: var(--muted); font-size: 13px; }
.cv-price { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); }
.cv-price b { background: #ffe08a; color: var(--text); padding: 6px 12px; border-radius: 6px; font-size: 17px; }
.cv-sub { text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.cv-detail dl.info { grid-template-columns: 1fr auto; border-top: 1px solid var(--line); padding-top: 10px; }
.cv-detail dl.info dd { text-align: right; }
.cv-action:not(:empty) { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.cv-action form { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1100px) {
  .cv, .cv.has-detail { grid-template-columns: minmax(0, 1fr); }
  .cv-filters { position: static; }
  .cv-detail { position: relative; top: 0; max-height: none; }
}
.chess { overflow-x: auto; padding-bottom: 4px; }
.chess-grid { display: grid; width: max-content; min-width: 100%; }
.sec-head { padding: 0 40px 8px 0; font-size: 13px; }
.sec-head small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.fl { color: var(--muted); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.units { display: flex; gap: 4px; padding: 3px 40px 3px 0; min-height: 34px; }
.stripe { background: #f4f5f7; }
.cell { width: 28px; height: 28px; flex: none; border: 0; border-radius: 3px; padding: 0; color: #fff; font: 600 13px/1 system-ui, sans-serif;
  display: inline-flex; align-items: center; justify-content: center; }
button.cell { cursor: pointer; }
button.cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.cell.sel { outline: 3px solid #2f80ed; outline-offset: 1px; }
.s-free { background: #0f8a68; } .s-reserved { background: #c27c00; } .s-sold { background: #d43f52; } .s-closed { background: #8a93a3; }
.cell.dim { opacity: .15; filter: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 12px; }
.crumbs { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; color: var(--muted); }
.crumbs .here { color: var(--text); font-weight: 600; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link:hover { text-decoration: underline; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 12px; background: var(--card); }
.card b { font-size: 16px; }
.sr-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.btn { display: inline-block; position: relative; font-size: 14px; color: var(--text); }
label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.layout-thumb { width: 72px; height: 54px; object-fit: contain; background: #fafbfc; border: 1px solid var(--line); border-radius: 4px; }
.legend .cell { width: 18px; height: 18px; margin-right: 4px; vertical-align: middle; font-size: 11px; }
.legend .cell svg { width: 12px; height: 12px; }
dl.info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 12px 0; }
dl.info dt { color: var(--muted); } dl.info dd { margin: 0; }
.free { background: var(--free-bg); border-left-color: var(--free); }
.reserved { background: var(--reserved-bg); border-left-color: var(--reserved); }
.sold { background: var(--sold-bg); border-left-color: var(--sold); color: var(--muted); }
.dim { opacity: .25; filter: grayscale(1); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tr.done td { color: var(--muted); }
dialog { border: 0; border-radius: 14px; padding: 24px; width: min(400px, 100% - 32px); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(20,25,35,.4); }
dialog h3 { margin: 0 0 4px; }
dialog label { margin: 10px 0; }
fieldset { border: 1px dashed var(--line); border-radius: 8px; margin: 10px 0; padding: 4px 12px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.history { max-height: 160px; overflow: auto; font-size: 12px; color: var(--muted); padding-left: 16px; }
.login { max-width: 340px; margin: 10vh auto; }
.login h2 { margin-top: 0; }
.login .google { display: block; text-align: center; margin-top: 16px; }
