/* ARS-X 3.0 — проектирование, мебель на заказ, девелопмент (шахматка), безопасность входа */
.num { text-align: right; }
.data-table.compact th, .data-table.compact td { padding: 6px 8px; font-size: 13px; }
.data-table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.wide { grid-column: 1 / -1; }
.warn { color: var(--warning); }

/* ---------------------------------------------------------------- проектирование */
.design-screen, .project-design { display: grid; gap: 14px; min-width: 0; }
.design-screen > .btn { justify-self: start; }
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.design-card { display: grid; gap: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.design-card:hover { border-color: var(--accent-line); }
.design-progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.design-progress i { display: block; height: 100%; background: var(--success); }
.design-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--text-2); }
.design-stats .danger, .design-table .danger { color: var(--danger); }
.design-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.design-head h2 { margin: 0; }
.design-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.design-kpis span { display: grid; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 12px; color: var(--muted); min-width: 92px; }
.design-kpis b { font-size: 17px; color: var(--text); }
.design-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.design-stage { display: grid; gap: 6px; }
.design-stage h3 { margin: 6px 0 0; }
.design-table td { vertical-align: top; }
.design-status { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.design-status.ds-work { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.design-status.ds-check, .design-status.ds-expertise, .design-status.rs-answered { background: color-mix(in srgb, #F59E0B 18%, transparent); color: #B45309; }
.design-status.ds-issued, .design-status.ds-approved, .design-status.rs-accepted { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.design-status.rs-open, .design-status.rs-rejected { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
html[data-theme="dark"] .design-status.ds-check, html[data-theme="dark"] .design-status.ds-expertise, html[data-theme="dark"] .design-status.rs-answered { color: #F5B454; }
.design-issues { display: grid; gap: 4px; font-size: 13px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); margin-top: 10px; }
.remark-list { display: grid; gap: 6px; }
.remark-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.remark-row:hover { border-color: var(--accent-line); }
.remark-row.overdue { border-left: 3px solid var(--danger); }
.remark-row.rs-accepted { opacity: .7; }
.remark-num { min-width: 30px; font-weight: 700; color: var(--muted); }
.remark-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.remark-main b { font-weight: 600; overflow-wrap: anywhere; }
.design-hours { display: grid; gap: 8px; }
.hours-bar { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.hours-bar i { display: block; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.hours-bar.over i { background: var(--danger); }
.timesheet { display: grid; gap: 12px; }
.time-form { display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(140px, 1fr) 150px 90px minmax(160px, 1.6fr) auto; gap: 8px; align-items: center; }
.project-design-slot { min-width: 0; }

/* ---------------------------------------------------------------- безопасность */
.sec-screen { display: grid; gap: 14px; max-width: 900px; }
.sec-card { display: grid; gap: 12px; }
.sec-head { display: flex; gap: 12px; align-items: center; }
.sec-head h3 { margin: 0; }
.sec-badge { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--muted); flex: none; }
.sec-badge.on { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.sec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-sessions { display: grid; gap: 6px; }
.sec-session { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sec-session.current { border-color: var(--accent-line); background: var(--accent-softer); }
.sec-session > div { display: grid; min-width: 0; }
.sec-policy { flex-wrap: wrap; }
.mfa-setup { display: grid; gap: 14px; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--text-2); }
.mfa-qr-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.mfa-qr { width: 180px; height: 180px; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--line); flex: none; }
.mfa-qr svg { width: 100%; height: 100%; display: block; }
.mfa-key { display: grid; gap: 6px; min-width: 0; }
.mfa-key code { font-size: 15px; letter-spacing: .08em; overflow-wrap: anywhere; background: var(--surface-2); padding: 6px 10px; border-radius: 8px; }
.mfa-codes { display: grid; gap: 10px; }
.mfa-code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.mfa-code-grid code { padding: 8px; text-align: center; background: var(--surface-2); border-radius: 8px; font-size: 14px; letter-spacing: .06em; }
.mfa-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mfa-gate { z-index: 200; }
#mfaForm .mfa-hint { color: var(--muted); margin: 0 0 10px; }

/* ---------------------------------------------------------------- мебель */
.furn-screen { display: grid; gap: 14px; min-width: 0; }
.furn-screen > .btn { justify-self: start; }
.furn-list { display: grid; gap: 12px; }
.furn-order { display: grid; gap: 14px; min-width: 0; }
.furn-head { display: grid; gap: 12px; }
.furn-head-main { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.furn-head-main h2 { margin: 2px 0 6px; }
.furn-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.furn-total { display: grid; justify-items: end; text-align: right; }
.furn-total b { font-size: 24px; }
.furn-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.furn-actions select { min-height: 36px; }
.furn-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.furn-grid > .card { display: grid; gap: 10px; min-width: 0; }
.furn-product { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; }
.furn-product + .furn-product { margin-top: 6px; }
.furn-product summary { display: flex; gap: 10px; align-items: center; padding: 10px 0; cursor: pointer; list-style: none; }
.furn-product summary::-webkit-details-marker { display: none; }
.furn-product summary .muted { margin-left: auto; font-size: 13px; }
.furn-product[open] { padding-bottom: 10px; }
.tpl-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cut-board { display: grid; gap: 8px; margin-top: 8px; }
.cut-sheets { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cut-sheet { margin: 0; display: grid; gap: 4px; }
.cut-sheet svg { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.cut-sheet figcaption { font-size: 12px; color: var(--muted); }
.cut-bg { fill: var(--surface-3); }
.cut-part { stroke: #475569; stroke-width: 4; }
.cut-label { font-size: 46px; fill: #1f2937; text-anchor: middle; dominant-baseline: middle; }
.furn-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.furn-col { display: grid; gap: 8px; align-content: start; background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.furn-col-head { display: flex; justify-content: space-between; font-size: 13px; }
.furn-card { display: grid; gap: 2px; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 10px 12px; }
.furn-card.overdue { border-left: 3px solid var(--danger); }

/* ---------------------------------------------------------------- девелопмент */
.realty-screen, .realty-complex { display: grid; gap: 14px; min-width: 0; }
.realty-screen .screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.realty-screen .screen-head select { min-height: 36px; }
.realty-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.realty-head h2 { margin: 0; }
.realty-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.realty-stats { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.realty-stats .spacer { flex: 1; }
.realty-stats select { min-height: 34px; }
.realty-stat i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--lot-bg); border: 1px solid var(--lot-line); }
.lot-free { --lot-bg: color-mix(in srgb, var(--success) 14%, var(--surface)); --lot-line: color-mix(in srgb, var(--success) 45%, transparent); --lot-text: var(--success); }
.lot-booked { --lot-bg: color-mix(in srgb, #F59E0B 20%, var(--surface)); --lot-line: color-mix(in srgb, #F59E0B 55%, transparent); --lot-text: #B45309; }
.lot-sold { --lot-bg: color-mix(in srgb, var(--brand) 16%, var(--surface)); --lot-line: color-mix(in srgb, var(--brand) 45%, transparent); --lot-text: var(--brand); }
.lot-closed { --lot-bg: var(--surface-3); --lot-line: var(--line); --lot-text: var(--muted); }
html[data-theme="dark"] .lot-booked { --lot-text: #F5B454; }
.chess-wrap { overflow-x: auto; padding: 12px; min-width: 0; }
.chess { display: flex; gap: 22px; width: max-content; }
.chess-section { display: grid; gap: 4px; align-content: start; }
.chess-sec-title { font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; margin-bottom: 2px; }
.chess-row { display: flex; gap: 4px; align-items: center; }
.chess-floor { width: 26px; text-align: right; font-size: 12px; color: var(--muted); margin-right: 4px; }
.lot { width: 68px; height: 54px; border-radius: 8px; border: 1px solid var(--lot-line, transparent); background: var(--lot-bg, transparent); color: var(--text); display: grid; place-content: center; text-align: center; font: inherit; font-size: 12px; line-height: 1.15; padding: 0; cursor: pointer; }
.lot b { color: var(--lot-text); }
.lot small { font-size: 10.5px; color: var(--text-2); }
.lot:hover { box-shadow: 0 0 0 2px var(--lot-line); }
.lot.dim { opacity: .22; }
.lot-empty { border: 0; background: transparent; cursor: default; }
.lot-pill { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--lot-bg); color: var(--lot-text); border: 1px solid var(--lot-line); }
.lot-detail { display: grid; gap: 12px; }
.lot-price { display: flex; gap: 6px 12px; align-items: baseline; flex-wrap: wrap; }
.lot-price b { font-size: 24px; }
.lot-price-edit { display: inline-flex; gap: 6px; margin-left: auto; }
.lot-price-edit input { width: 140px; }
.lot-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.lot-customer { position: relative; flex: 1 1 260px; min-width: 0; }
.lot-customer input { width: 100%; }
.lot-customer .chip { display: inline-flex; align-items: center; gap: 4px; }
.lot-hits { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); display: grid; }
.lot-hits button { text-align: left; border: 0; background: transparent; color: var(--text); font: inherit; padding: 8px 12px; cursor: pointer; }
.lot-hits button:hover { background: var(--surface-2); }
.lot-days { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.lot-days input { width: 56px; }
.tour-frame { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #000; }
.tour-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tpl-item.layout { grid-template-columns: repeat(3, minmax(0, 1fr)) 32px; }

@media (max-width: 1000px) {
  .furn-grid { grid-template-columns: 1fr; }
  .time-form { grid-template-columns: 1fr 1fr; }
  .time-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .hours-bar { grid-template-columns: 1fr auto; }
  .hours-bar i { grid-column: 1 / -1; grid-row: 2; }
  .lot { width: 58px; height: 50px; font-size: 11px; }
  .lot-price-edit { margin-left: 0; width: 100%; }
  .furn-total { justify-items: start; text-align: left; }
  .tpl-item.layout { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; }
}

/* правки по макету */
.furn-grid table, .design-hours table, .sec-card table, .lot-detail table { min-width: 0; }
.furn-actions select, .realty-stats select, .realty-screen .screen-head select, .field-filters select { width: auto; max-width: 100%; }
.realty-stats select { min-width: 140px; }
.lot-detail .tour-frame { aspect-ratio: auto; height: min(420px, 50vh); }
.cut-label { font-size: 70px; }
.sec-session { justify-content: flex-start; }
.sec-session > div { flex: 1; }
.sec-card > .btn { justify-self: start; }
