/* IIKA · оформление в духе Rocker Admin (Codervent) на Bootstrap 5.3: тёмный сайдбар, светлая шапка,
   карточки с цветной кромкой. Собственная реализация, без jQuery и сторонних шаблонов. */

:root {
  --iika-sidebar-w: 260px;
  --iika-header-h: 60px;
  --iika-sidebar-bg: #1e1e2d;
  --iika-sidebar-fg: #a2a3b7;
  --iika-sidebar-active: rgba(255, 255, 255, .08);
  --iika-page-bg: #f1f3f8;
  --iika-surface: #ffffff;
  --iika-muted: #8a8d99;
  --iika-card-radius: 10px;
  --iika-blue: #0d6efd; --iika-green: #15ca20; --iika-yellow: #e0a800; --iika-red: #f41127;
  --iika-purple: #8833ff; --iika-teal: #0aa2c0; --iika-orange: #ff6a00; --iika-gray: #6c757d;
  --bs-body-bg: var(--iika-page-bg);
  --bs-border-radius: 8px;
}
[data-bs-theme="dark"] {
  --iika-page-bg: #171a21;
  --iika-surface: #1f2330;
  --iika-sidebar-bg: #14141f;
  --iika-muted: #9a9eab;
  --bs-body-bg: var(--iika-page-bg);
}
body { background: var(--iika-page-bg); font-size: .9rem; }

/* ---------- каркас ---------- */
.iika-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--iika-sidebar-w); z-index: 1040;
  background: var(--iika-sidebar-bg); color: var(--iika-sidebar-fg);
  display: flex; flex-direction: column; overflow-y: auto;
}
.iika-sidebar .brand {
  height: var(--iika-header-h); display: flex; align-items: center; gap: .6rem; padding: 0 1.25rem; flex-shrink: 0;
  color: #fff; font-weight: 600; font-size: 1.15rem; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06);
}
.iika-sidebar .brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--iika-blue); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.iika-sidebar .section { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #6c6d80; padding: 1.1rem 1.25rem .4rem; }
.iika-sidebar .nav-link {
  color: var(--iika-sidebar-fg); display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; margin: .1rem .75rem;
  border-radius: 8px; font-size: .9rem;
}
.iika-sidebar .nav-link .bi { font-size: 1.05rem; width: 1.3rem; text-align: center; }
.iika-sidebar .nav-link:hover { color: #fff; background: var(--iika-sidebar-active); }
.iika-sidebar .nav-link.active { color: #fff; background: var(--iika-sidebar-active); box-shadow: inset 3px 0 0 var(--iika-blue); }
.iika-sidebar .sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; font-size: .8rem; color: #6c6d80; border-top: 1px solid rgba(255,255,255,.06); }

.iika-header {
  position: sticky; top: 0; z-index: 1030; height: var(--iika-header-h);
  background: var(--iika-surface); display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 2px 10px rgba(0,0,0,.04);
}
.iika-header .search { max-width: 340px; flex: 1; }
.iika-header .search .form-control { background: var(--iika-page-bg); border: 0; border-radius: 999px; padding-left: 2.4rem; }
.iika-header .search .bi-search { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); color: var(--iika-muted); }
.iika-header .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--iika-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; }
.iika-header .user-name { line-height: 1.1; font-weight: 600; font-size: .85rem; }
.iika-header .user-role { font-size: .72rem; color: var(--iika-muted); }
.iika-header .icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #5b5f6e; background: transparent; border: 0; position: relative; text-decoration: none; }
[data-bs-theme="dark"] .iika-header .icon-btn { color: #c3c6d1; }
.iika-header .icon-btn:hover { background: var(--iika-page-bg); }
.iika-header .icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; }

.iika-main { margin-left: var(--iika-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.iika-content { padding: 1.25rem 1.5rem 2rem; flex: 1; }
.iika-footer { padding: .9rem 1.5rem; font-size: .8rem; color: var(--iika-muted); border-top: 1px solid var(--bs-border-color); }

@media (max-width: 991.98px) {
  .iika-sidebar { transform: translateX(-100%); transition: transform .2s; }
  .iika-sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .iika-main { margin-left: 0; }
  .iika-content { padding: 1rem; }
  .iika-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
}

/* ---------- заголовок страницы ---------- */
.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; }

/* ---------- карточки ---------- */
.card { border: 0; border-radius: var(--iika-card-radius); box-shadow: 0 2px 6px rgba(20, 20, 45, .06); background: var(--iika-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--bs-border-color); font-weight: 600; padding: .85rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.card-header > span:first-child .bi { color: var(--iika-muted); }
.card-header .card-sub { font-weight: 400; font-size: .8rem; color: var(--iika-muted); }
.card-footer { background: transparent; }

.kpi { border-left: 4px solid var(--kpi, var(--iika-blue)); }
.kpi .kpi-title { font-size: .78rem; color: var(--iika-muted); font-weight: 500; }
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; color: var(--kpi, var(--iika-blue)); line-height: 1.15; white-space: nowrap; }
.kpi .kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; color: var(--kpi, var(--iika-blue)); background: color-mix(in srgb, var(--kpi, var(--iika-blue)) 12%, transparent); }
.kpi .kpi-sub { font-size: .78rem; color: var(--iika-muted); }
.kpi .kpi-help { color: #b5b8c4; text-decoration: none; }
.kpi .kpi-help:hover { color: var(--kpi, var(--iika-blue)); }
.kpi-blue { --kpi: var(--iika-blue); } .kpi-green { --kpi: var(--iika-green); } .kpi-yellow { --kpi: var(--iika-yellow); }
.kpi-red { --kpi: var(--iika-red); } .kpi-purple { --kpi: var(--iika-purple); } .kpi-teal { --kpi: var(--iika-teal); }
.kpi-orange { --kpi: var(--iika-orange); } .kpi-gray { --kpi: var(--iika-gray); }

.delta { font-size: .75rem; font-weight: 600; border-radius: 999px; padding: .15rem .5rem; display: inline-flex; align-items: center; gap: .1rem; white-space: nowrap; }
.delta-up { color: #0f8f17; background: rgba(21, 202, 32, .14); }
.delta-down { color: #c20d1c; background: rgba(244, 17, 39, .12); }
.delta-none { color: var(--iika-muted); background: rgba(108, 117, 125, .12); font-weight: 500; }
[data-bs-theme="dark"] .delta-up { color: #5ee368; } [data-bs-theme="dark"] .delta-down { color: #ff7b85; }

/* ---------- таблицы ---------- */
.card .table { margin-bottom: 0; }
.card .table > :not(caption) > * > * { padding: .55rem .8rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--iika-muted); font-weight: 600; border-bottom-width: 1px; }
.table > thead.table-light th { --bs-table-bg: transparent; }
.badge { font-weight: 600; }
table.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th[data-sort]::after { content: " ↕"; opacity: .35; font-size: .8em; }
table.sortable th[data-sort].asc::after  { content: " ↑"; opacity: 1; }
table.sortable th[data-sort].desc::after { content: " ↓"; opacity: 1; }
.cursor-pointer { cursor: pointer; }
tr[aria-expanded="true"] .bi-chevron-right { transform: rotate(90deg); }
.bi-chevron-right { transition: transform .15s; display: inline-block; }

/* ---------- панель периода ---------- */
.period-bar .btn-group .btn { border-radius: 999px !important; margin-right: .25rem; border: 1px solid var(--bs-border-color); background: var(--iika-surface); color: var(--bs-body-color); }
.period-bar .btn-group .btn.active { background: var(--iika-blue); border-color: var(--iika-blue); color: #fff; }
.period-bar .btn-group .btn:hover:not(.active) { border-color: var(--iika-blue); color: var(--iika-blue); }
.period-bar .input-group .form-control, .period-bar .btn-outline-secondary { background: var(--iika-surface); }

/* ---------- строка свежести ---------- */
.freshness { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--iika-muted); }
.freshness .bi { margin-right: .3rem; }

/* ---------- тепловая карта ---------- */
table.heatmap { --hm-r: 13; --hm-g: 110; --hm-b: 253; }
table.heatmap td.hm-cell {
  text-align: center; font-size: .72rem; padding: .3rem .2rem; min-width: 2.6rem;
  background-color: rgba(var(--hm-r), var(--hm-g), var(--hm-b), calc(var(--a) * .9 + 0.04));
  border: 2px solid var(--iika-surface); border-radius: 4px;
}
table.heatmap td.hm-dark { color: #fff; }
table.heatmap th { padding: .3rem .2rem; font-size: .72rem; }
canvas { max-width: 100%; }

/* ---------- справочник (markdown) ---------- */
.markdown-body h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.markdown-body h2 { font-size: 1.15rem; margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--bs-border-color); }
.markdown-body h3 { font-size: 1rem; margin-top: 1.4rem; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { scroll-margin-top: 80px; }
.markdown-body table { font-size: .85rem; }
.markdown-body code { font-size: .85em; }
.markdown-body li { margin-bottom: .2rem; }

/* ---------- вход ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--iika-page-bg); padding: 1rem; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { width: 56px; height: 56px; border-radius: 14px; background: var(--iika-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.6rem; }

/* ---------- телефоны ---------- */
@media (max-width: 575.98px) {
  .page-title { font-size: 1.15rem; }
  .kpi .kpi-value { font-size: 1.12rem; white-space: normal; overflow-wrap: anywhere; }
  .kpi { overflow: hidden; }
  .kpi .kpi-icon { display: none; }
  .kpi .card-body { padding: .75rem .8rem; }
  .kpi .kpi-icon { width: 38px; height: 38px; font-size: 1.1rem; }
  .kpi .kpi-sub { font-size: .74rem; }
  .period-bar { width: 100%; }
  .period-bar .input-group { max-width: 100% !important; }
  .period-bar .btn-group .btn { font-size: .78rem; padding: .25rem .55rem; }
  .freshness { font-size: .74rem; gap: .2rem .7rem; }
  .card-header { padding: .7rem .85rem; }
  .iika-content { padding: .75rem; }
  .markdown-body table { font-size: .78rem; }
  .accordion-button { padding: .6rem .85rem; font-size: .9rem; }
  .nav-pills .nav-link { font-size: .8rem; padding: .25rem .6rem; }
}
.markdown-body .table-responsive { margin-bottom: 1rem; }
.markdown-body code { word-break: break-word; }

/* отмены в списке чеков */
tr.row-cancelled > td { background: rgba(244, 17, 39, .10) !important; }
tr.row-cancelled > td:first-child { box-shadow: inset 4px 0 0 var(--iika-red); }
tr.row-return > td { background: rgba(33, 37, 41, .08) !important; }
tr.row-return > td:first-child { box-shadow: inset 4px 0 0 #343a40; }
tr.row-partial > td { background: rgba(255, 193, 7, .14) !important; }
tr.row-partial > td:first-child { box-shadow: inset 4px 0 0 var(--iika-yellow); }
[data-bs-theme="dark"] tr.row-cancelled > td { background: rgba(244, 17, 39, .18) !important; }
[data-bs-theme="dark"] tr.row-partial > td { background: rgba(255, 193, 7, .16) !important; }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 2px; }
.legend-swatch.row-cancelled { background: rgba(244, 17, 39, .25); border-left: 3px solid var(--iika-red); }
.legend-swatch.row-return { background: rgba(33, 37, 41, .2); border-left: 3px solid #343a40; }
.legend-swatch.row-partial { background: rgba(255, 193, 7, .35); border-left: 3px solid var(--iika-yellow); }
/* плотная таблица чеков: 12 колонок должны помещаться на 1366–1440 px */
#ordersTable > :not(caption) > * > *, #staffTable > :not(caption) > * > * { padding: .45rem .5rem; }
#ordersTable, #staffTable { font-size: .82rem; }

/* карта зала */
.floor-wrap { width: 100%; }
.floor-svg { width: 100%; height: auto; max-height: 560px; display: block; font-family: inherit; }
.floor-bg { fill: var(--iika-page-bg); stroke: var(--bs-border-color); stroke-width: 2; }
.floor-zone rect { fill: rgba(108, 117, 125, .12); stroke: var(--bs-border-color); stroke-dasharray: 6 5; }
.floor-zone text, .floor-label { fill: var(--iika-muted); font-size: 22px; font-weight: 600; letter-spacing: .04em; }
.floor-table rect { stroke-width: 3; transition: filter .15s; }
.floor-table:hover rect { filter: brightness(.92); }
.floor-table .floor-num { font-size: 28px; font-weight: 700; }
.floor-table .floor-sub { font-size: 13px; font-weight: 600; }
.floor-idle rect, .floor-idle ellipse { fill: var(--iika-surface); stroke: #c7cbd4; } .floor-idle text { fill: #8a8d99; }
.floor-busy rect, .floor-busy ellipse { fill: #cfe2ff; stroke: var(--iika-blue); } .floor-busy text { fill: #0a3d91; }
.floor-recent rect, .floor-recent ellipse { fill: #ffe8a1; stroke: var(--iika-yellow); } .floor-recent text { fill: #6b4b00; }
[data-bs-theme="dark"] .floor-idle rect, [data-bs-theme="dark"] .floor-idle ellipse { fill: #2a2f3d; stroke: #4a5062; }
[data-bs-theme="dark"] .floor-busy rect, [data-bs-theme="dark"] .floor-busy ellipse { fill: #1d3a6e; } [data-bs-theme="dark"] .floor-busy text { fill: #cfe2ff; }
[data-bs-theme="dark"] .floor-recent rect, [data-bs-theme="dark"] .floor-recent ellipse { fill: #5c4300; } [data-bs-theme="dark"] .floor-recent text { fill: #ffe8a1; }
.floor-legend { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 3px; border: 2px solid; }
.floor-legend.floor-busy { background: #cfe2ff; border-color: var(--iika-blue); }
.floor-legend.floor-recent { background: #ffe8a1; border-color: var(--iika-yellow); }
.floor-legend.floor-idle { background: var(--iika-surface); border-color: #c7cbd4; }

/* редактор плана */
.editor-wrap { overflow: auto; max-height: calc(100vh - 220px); background: var(--iika-page-bg); border-radius: 8px; }
#editor { display: block; font-family: inherit; outline: none; }
#editor .ed-bg { fill: var(--iika-surface); stroke: var(--bs-border-color); }
#editor .ed-grid line { stroke: rgba(108,117,125,.15); stroke-width: 1; } #editor .ed-grid line.major { stroke: rgba(108,117,125,.3); }
#editor .ed-item { cursor: move; }
#editor .ed-sel { fill: none; stroke: var(--iika-blue); stroke-width: 2; stroke-dasharray: 5 3; pointer-events: none; }
#editor .ed-handle { fill: var(--iika-blue); stroke: #fff; stroke-width: 2; cursor: nwse-resize; }
#editor .ed-table rect, #editor .ed-table2 rect, #editor .ed-bartable rect { fill: #cfe2ff; stroke: var(--iika-blue); stroke-width: 2; }
#editor .ed-round ellipse { fill: #cfe2ff; stroke: var(--iika-blue); stroke-width: 2; }
#editor .num { fill: #0a3d91; font-weight: 700; font-size: 14px; } #editor .num.missing { fill: #d01020; }
#editor .ed-chair rect { fill: #fff; stroke: #8a8d99; stroke-width: 1.5; } #editor .ed-barchair circle { fill: #fff; stroke: #8a8d99; stroke-width: 1.5; }
#editor .ed-sofa rect { fill: #dde3ec; stroke: #1e1e2d; stroke-width: 1.5; } #editor .ed-sofa .back { fill: #b9c2d1; stroke: none; }
#editor .ed-bar rect { fill: #1e1e2d; } #editor .ed-bar text { fill: #fff; font-size: 12px; font-weight: 600; }
#editor .ed-room rect { fill: rgba(224,168,0,.15); stroke: #e0a800; stroke-dasharray: 6 4; } #editor .ed-room text { fill: #6b4b00; font-weight: 600; font-size: 14px; }
#editor .ed-wall rect { fill: #8a8d99; } #editor .ed-entrance rect { fill: #15ca20; } #editor .ed-entrance text { fill: #fff; font-size: 11px; font-weight: 600; }
#editor .ed-text .label { fill: var(--iika-muted); font-size: 13px; font-weight: 600; }
/* карта по схеме владельца */
.floor-custom .fl-room rect { fill: rgba(224,168,0,.12); stroke: #e0a800; stroke-dasharray: 6 4; } .floor-custom .fl-room text { fill: #8a6d1a; font-weight: 600; font-size: 14px; }
.floor-custom .fl-wall rect { fill: #8a8d99; } .floor-custom .fl-entrance rect { fill: #15ca20; } .floor-custom .fl-entrance text { fill: #fff; font-size: 11px; font-weight: 600; }
.floor-custom .fl-sofa rect { fill: #dde3ec; stroke: #1e1e2d; stroke-width: 1.5; } .floor-custom .fl-sofa .back { fill: #b9c2d1; stroke: none; }
.floor-custom .fl-bar rect { fill: #1e1e2d; } .floor-custom .fl-bar text { fill: #fff; font-size: 12px; font-weight: 600; }
.floor-custom .fl-chair { fill: var(--iika-surface); stroke: #8a8d99; stroke-width: 1.5; } .floor-custom .fl-barchair { fill: var(--iika-surface); stroke: #8a8d99; stroke-width: 1.5; }
.floor-custom .floor-table rect, .floor-custom .floor-table ellipse { stroke-width: 2; }
.floor-custom .floor-label { font-size: 13px; }
[data-bs-theme="dark"] .floor-custom .fl-sofa rect { fill: #3a4152; } [data-bs-theme="dark"] .floor-custom .fl-room text { fill: #e0b84a; }

/* живой баннер карты зала */
.floor-banner { overflow: hidden; }
.floor-banner .banner-head { background: linear-gradient(90deg, #1e1e2d 0%, #2b2f45 60%, #0d6efd 140%); color: #fff; padding: .7rem 1.1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.floor-banner .banner-head .title { font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: .5rem; }
.floor-banner .chip { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: .15rem .7rem; font-size: .8rem; white-space: nowrap; }
.floor-banner .chip b { font-weight: 700; }
.floor-banner .chip.warn { background: rgba(255, 193, 7, .18); border-color: rgba(255,193,7,.4); color: #ffe8a1; }
.floor-banner .legend { display: flex; gap: .9rem; font-size: .78rem; color: rgba(255,255,255,.8); flex-wrap: wrap; }
.floor-banner .legend .floor-legend { border-color: transparent; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #15ca20; box-shadow: 0 0 0 0 rgba(21,202,32,.7); display: inline-block; }
.live-dot.blink, .live-dot { animation: livepulse 2s ease-out infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(21,202,32,.7); } 70% { box-shadow: 0 0 0 9px rgba(21,202,32,0); } 100% { box-shadow: 0 0 0 0 rgba(21,202,32,0); } }
.floor-banner .banner-body { padding: .75rem 1rem .5rem; }
.floor-banner .floor-svg { max-height: 460px; margin: 0 auto; }
.floor-banner .floor-table { cursor: pointer; }
.floor-banner .banner-foot { padding: .35rem 1.1rem .6rem; font-size: .76rem; color: var(--iika-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) { .floor-banner .floor-svg { max-height: 320px; } .floor-banner .legend { display: none; } }

a.floor-table, a.floor-table text { text-decoration: none !important; }
a.floor-table:hover rect, a.floor-table:hover ellipse { filter: brightness(.93); }

/* ---------- сцена зала (тёмная, по референсу) ---------- */
.floor-scene { background: #0f1420; border: 1px solid #222a3d; color: #e6e9f2; }
.floor-scene .banner-head { background: linear-gradient(90deg, #141a2a, #1b2234); border-bottom: 1px solid #262e44; padding: .8rem 1.2rem; }
.floor-scene .banner-head .title { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: .6rem; }
.floor-scene .banner-head .title .bi { color: #8fb3ff; }
.floor-scene .pill { font-size: .75rem; font-weight: 500; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: .15rem .6rem; color: #c9d1e3; }
.floor-scene .stat { display: inline-flex; align-items: center; gap: .45rem; font-size: .95rem; color: #c9d1e3; padding-left: 1rem; border-left: 1px solid #2c3550; }
.floor-scene .stat .bi { color: #8fb3ff; font-size: 1.1rem; } .floor-scene .stat b { color: #fff; font-size: 1.25rem; }
.floor-scene .stat.warn .bi, .floor-scene .stat.warn b { color: #ffd166; }
.floor-scene .live-badge { font-weight: 700; letter-spacing: .08em; font-size: .8rem; color: #7ee787; display: inline-flex; align-items: center; gap: .4rem; }
.floor-scene .banner-body { padding: .6rem 1rem .3rem; background: radial-gradient(ellipse at 50% 30%, #182036 0%, #0f1420 70%); }
.floor-scene .floor-svg { max-height: 520px; }
.floor-scene .floor-bg { fill: #0f1420; stroke: none; }
.floor-scene .fl-wall rect { fill: #b8bec9; } .floor-scene .fl-room rect { fill: rgba(255,255,255,.04); stroke: #3a4460; stroke-dasharray: 0; } .floor-scene .fl-room text { fill: #8e97ad; font-size: 15px; font-weight: 600; }
.floor-scene .fl-entrance rect { fill: #0d6efd; } .floor-scene .fl-entrance text { fill: #fff; font-size: 11px; font-weight: 700; }
.floor-scene .fl-sofa rect { fill: #2a3650; stroke: #3d4c6e; stroke-width: 1.2; } .floor-scene .fl-sofa .back { fill: #3b4a6b; stroke: none; }
.floor-scene .fl-bar rect { fill: #1b2130; stroke: #4b5366; stroke-width: 1.5; } .floor-scene .fl-bar text { fill: #d9dde5; font-size: 12px; letter-spacing: .08em; }
.floor-scene .fl-chair, .floor-scene .fl-barchair { fill: #2a3650; stroke: #3d4c6e; stroke-width: 1.2; }
.floor-scene .floor-table rect, .floor-scene .floor-table ellipse { fill: #5a4433; stroke: #7a5e46; stroke-width: 2; }
.floor-scene .floor-table.floor-busy rect, .floor-scene .floor-table.floor-busy ellipse { stroke: #4da3ff; }
.floor-scene .floor-table.floor-recent rect, .floor-scene .floor-table.floor-recent ellipse { stroke: #ffc107; }
.floor-scene .floor-table text { fill: #fff; }
.floor-scene .floor-table .floor-sub { fill: #e0e4ee; }
.floor-scene .floor-table .status-dot { fill: #6c757d; stroke: #0f1420; stroke-width: 1.5; }
.floor-scene .floor-table.floor-busy .status-dot { fill: #4da3ff; } .floor-scene .floor-table.floor-recent .status-dot { fill: #ffc107; }
.floor-scene .floor-label { fill: #8e97ad; }
.floor-scene .banner-foot { background: #121827; border-top: 1px solid #262e44; color: #aeb6c8; padding: .55rem 1.2rem .7rem; }
.floor-scene .banner-foot .legend { display: flex; gap: 1.1rem; flex-wrap: wrap; align-items: center; }
.floor-scene .banner-foot .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: .3rem; }
.floor-scene .banner-foot .dot.open { background: #2ecc71; } .floor-scene .banner-foot .dot.recent { background: #ffc107; } .floor-scene .banner-foot .dot.busy { background: #4da3ff; } .floor-scene .banner-foot .dot.idle { background: #6c757d; }
.floor-scene .banner-foot a { color: #c9d1e3; }
/* сцена со спрайтами */
.floor-sprites .fl-door { fill: #131a26; }
.floor-sprites .fl-wc { fill: #6f788f; font-size: 18px; font-weight: 700; letter-spacing: .12em; }
.floor-sprites .fl-stool circle:first-child { fill: #262d3f; stroke: #4a5470; stroke-width: 2; } .floor-sprites .fl-stool circle:last-child { fill: #3a4360; }
.floor-sprites .fl-entrance-pill rect { fill: #0d6efd; stroke: #5aa0ff; stroke-width: 1.5; } .floor-sprites .fl-entrance-pill text { fill: #fff; font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.floor-sprites .floor-table image { transition: filter .15s; } .floor-sprites .floor-table:hover image { filter: brightness(1.15); }
.floor-sprites .badge-num rect { fill: rgba(22, 28, 44, .92); stroke: #4a5470; stroke-width: 2; }
.floor-sprites .floor-table.floor-busy .badge-num rect { stroke: #4da3ff; } .floor-sprites .floor-table.floor-recent .badge-num rect { stroke: #ffc107; }
.floor-sprites .floor-num { fill: #fff; font-weight: 800; } .floor-sprites .floor-sub { fill: #c9d1e3; font-weight: 600; paint-order: stroke; stroke: #0f1420; stroke-width: 3px; }
.floor-sprites .status-dot { fill: #6c757d; stroke: #0f1420; stroke-width: 1.5; }
.floor-sprites .floor-busy .status-dot { fill: #4da3ff; } .floor-sprites .floor-recent .status-dot { fill: #ffc107; }
.floor-sprites .floor-table.floor-open .badge-num rect { stroke: #2ecc71; } .floor-sprites .floor-open .status-dot { fill: #2ecc71; animation: flPulse 1.6s ease-in-out infinite; }
@keyframes flPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.floor-sprites .fl-hookah .plate { fill: #c9a24a; stroke: #7a5e1e; stroke-width: 1.2; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); }
.floor-sprites .fl-hookah .bowl { fill: #3a2a22; stroke: #1a1410; stroke-width: 1; }
.floor-sprites .fl-hookah .ember { fill: #ff7a1a; animation: flEmber 1.6s ease-in-out infinite alternate; }
.floor-sprites .fl-hookah .hose { fill: none; stroke: #15171c; stroke-width: 3; stroke-linecap: round; }
.floor-sprites .fl-hookah .smoke { fill: #e6ecff; opacity: 0; transform-box: fill-box; transform-origin: center; animation: flSmoke 3.2s ease-out infinite; }
@keyframes flEmber { from { fill: #ff5a00; } to { fill: #ffb347; } }
@keyframes flSmoke { 0% { opacity: .45; transform: scale(.4); } 100% { opacity: 0; transform: scale(2.6) translateY(-6px); } }
.fl-person { filter: drop-shadow(0 3px 3px rgba(0,0,0,.65)); }
.fl-person .body { transform-box: fill-box; transform-origin: center; }
.fl-person .body.sway { animation: flSway 4s ease-in-out infinite alternate; }
.fl-person.walking .body { animation: flWalk 1.1s ease-in-out infinite alternate; }
@keyframes flSway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes flWalk { from { transform: translateX(-2px) rotate(-2deg); } to { transform: translateX(2px) rotate(2deg); } }
.fl-bubble path { fill: #f4f6fb; stroke: #2a3350; stroke-width: 1.5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.fl-bubble text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; fill: #1b2232; }
.fl-bubble .pop { transform-box: fill-box; transform-origin: 50% 100%; animation: flPop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.fl-bubble.out .pop { animation: flOut .3s ease-in both; }
@keyframes flPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes flOut { from { transform: scale(1); opacity: 1; } to { transform: scale(.6); opacity: 0; } }
.floor-scene .banner-body { overflow-x: auto; }
@media (max-width: 767.98px) { .floor-scene .floor-svg { min-width: 760px; max-height: none; } }
@media (max-width: 991.98px) { .floor-scene .stat { display: none; } }
.floor-scene .fl-toggle { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.floor-scene .fl-toggle .bi { transition: transform .2s; }

/* ---------- таблицы на телефоне: карточки ---------- */
@media (max-width: 767.98px) {
  body.tables-as-cards .table-responsive.tbl-cards-wrap { overflow: visible; }
  body.tables-as-cards table[data-cards="done"] { display: block; width: 100%; border-collapse: separate; }
  body.tables-as-cards table[data-cards="done"] thead { display: none; }
  body.tables-as-cards table[data-cards="done"] tbody, body.tables-as-cards table[data-cards="done"] tfoot { display: block; width: 100%; }
  body.tables-as-cards table[data-cards="done"] tbody tr { display: block; width: 100%; box-sizing: border-box; border: 1px solid var(--bs-border-color); border-radius: 12px; margin: .55rem 0; padding: .45rem .85rem .5rem; background: var(--bs-body-bg); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
  body.tables-as-cards table[data-cards="done"] tbody tr.collapse:not(.show) { display: none; }
  body.tables-as-cards table[data-cards="done"] tbody tr.collapsing { display: block; }
  body.tables-as-cards table[data-cards="done"] td { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: .15rem .35rem; min-width: 0; overflow-wrap: anywhere; padding: .28rem 0 !important; border: 0 !important; font-size: .95rem; text-align: right; white-space: normal !important; line-height: 1.35; box-shadow: none !important; background: transparent !important; }
  body.tables-as-cards table[data-cards="done"] td, body.tables-as-cards table[data-cards="done"] td.text-truncate { max-width: none !important; width: auto !important; overflow: visible !important; text-overflow: clip; }
  body.tables-as-cards table[data-cards="done"] td::before { content: attr(data-label); flex: 1 1 40%; min-width: 40%; margin-right: auto; text-align: left; color: var(--iika-muted); font-size: .8rem; font-weight: 500; line-height: 1.3; }
  body.tables-as-cards table[data-cards="done"] td:not([data-label])::before { content: none; }
  body.tables-as-cards table[data-cards="done"] td:first-child { display: block; font-weight: 600; font-size: 1.02rem; text-align: left; padding: .1rem 0 .35rem !important; border-bottom: 1px dashed var(--bs-border-color) !important; margin-bottom: .2rem; }
  body.tables-as-cards table[data-cards="done"] td:first-child::before { content: none; }
  body.tables-as-cards table[data-cards="done"] td[data-empty] { display: none; }
  body.tables-as-cards table[data-cards="done"] tr.tbl-row-wide > td { display: block; text-align: left; padding: .4rem 0 !important; border-bottom: 0 !important; }
  body.tables-as-cards table[data-cards="done"] tr.tbl-row-wide > td::before { content: none; }
  body.tables-as-cards table[data-cards="done"] td[data-mhide], body.tables-as-cards table[data-cards="done"] tr[data-more] { display: none !important; }
  body.tables-as-cards table[data-cards="done"] caption.tbl-more-cap { display: block; caption-side: bottom; padding: .25rem 0 .5rem; }
  body:not(.tables-as-cards) caption.tbl-more-cap { display: none; }
  body.tables-as-cards table[data-cards="done"] td .small, body.tables-as-cards table[data-cards="done"] td small { font-size: .85rem; }
  body.tables-as-cards table[data-cards="done"] td .text-truncate { max-width: 100% !important; white-space: normal !important; }
  body.tables-as-cards table[data-cards="done"] td > div { display: inline; }
  body.tables-as-cards table[data-cards="done"] td > div + div::before { content: " · "; color: var(--iika-muted); }
  body.tables-as-cards table[data-cards="done"] td:first-child > div { display: inline; }
  body.tables-as-cards table[data-cards="done"] td:first-child > div + div::before { content: " · "; color: var(--iika-muted); font-weight: 400; }
  body.tables-as-cards table[data-cards="done"] tr.table-light, body.tables-as-cards table[data-cards="done"] tr.table-primary, body.tables-as-cards table[data-cards="done"] tr.table-secondary { background: var(--bs-tertiary-bg); }
  body.tables-as-cards table[data-cards="done"].table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
  body.tables-as-cards table[data-cards="done"] td .btn-sm { padding: .3rem .6rem; font-size: .9rem; }
  body.tables-as-cards table[data-cards="done"] td .form-control-sm, body.tables-as-cards table[data-cards="done"] td .form-select-sm { font-size: .95rem; min-height: 38px; }
  body.tables-as-cards .table-sm > :not(caption) > * > * { padding: .28rem 0; }
  .table-mode-switch { display: flex; }
  body.tables-as-cards table[data-cards="done"] td:first-child { position: static !important; box-shadow: none !important; }
}
@media (min-width: 768px) { .table-mode-switch { display: none !important; } }
/* общие мобильные улучшения */
@media (max-width: 991.98px) {
  .table:not([data-cards="done"]) td:first-child, .table:not([data-cards="done"]) th:first-child { position: sticky; left: 0; background: var(--bs-body-bg); z-index: 1; box-shadow: 1px 0 0 var(--bs-border-color); }
  .table:not([data-cards="done"]) tr.collapse > td[colspan] > *, .table:not([data-cards="done"]) tr.collapsing > td[colspan] > * { position: sticky; left: 0; max-width: calc(100vw - 2.5rem); box-sizing: border-box; }
  .table:not([data-cards="done"]) tr.collapse > td[colspan] { position: static; }
}
@media (max-width: 767.98px) {
  .table:not([data-cards="done"]) { font-size: .9rem; }
  .markdown-body table { font-size: .9rem; }
  .doc-switch { flex-wrap: wrap; }
  .kpi-help { padding: .5rem; margin: -.5rem; }
  .iika-sidebar .section { font-size: .78rem; }
  .badge { font-size: .74em; }
  .period-bar .btn-group { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .period-bar .btn-group .btn { white-space: nowrap; font-size: .85rem; padding: .4rem .7rem; }
  .btn-sm, .btn-group-sm > .btn { min-height: 36px; }
  .nav-pills .nav-link, .chip-row .btn { min-height: 36px; }
  .card-header .card-sub { width: 100%; }
}
.att-days { max-width: 980px; }

/* ---------- логотип ---------- */
.iika-sidebar .brand { height: 72px; padding: 0 1.25rem; }
.iika-sidebar .brand .brand-logo { width: 100%; max-width: 168px; height: auto; min-width: 0; flex: 0 1 auto; object-fit: contain; }
.login-card .login-logo { width: 150px; max-width: 100%; height: auto; object-fit: contain; margin-bottom: .5rem; }
@media (max-width: 575.98px) { .login-card .login-logo { width: 128px; } }
.login-card .logo-on-dark { display: none; }
[data-bs-theme="dark"] .login-card .logo-on-light { display: none; }
[data-bs-theme="dark"] .login-card .logo-on-dark { display: inline-block; }
