:root {
    --bg: #081B34;
    --panel: #102544;
    --card: #17365F;
    --hover: #21497A;
    --text: #FFFFFF;
    --muted: #B7C4D8;
    --success: #32CD32;
    --warning: #FFD54A;
    --danger: #FF4D4F;
    --info: #58A6FF;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --shadow: 0 24px 60px rgba(0, 8, 24, 0.32);
    --shadow-soft: 0 12px 30px rgba(0, 8, 24, 0.2);
    --radius: 16px;
    --radius-sm: 12px;
    --header-height: 82px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 15% 0%, rgba(33, 73, 122, 0.3), transparent 30%),
        radial-gradient(circle at 90% 12%, rgba(27, 99, 154, 0.2), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -3;
    pointer-events: none;
    opacity: 0.16;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
a,
select,
input {
    -webkit-tap-highlight-color: transparent;
}

svg {
    display: block;
    width: 1.2em;
    height: 1.2em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ambient-glow {
    position: fixed;
    z-index: -2;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.16;
    pointer-events: none;
}

.ambient-glow-one {
    left: -180px;
    top: 18%;
    background: #2878d0;
}

.ambient-glow-two {
    right: -180px;
    bottom: 8%;
    background: #1a9f88;
}

.glass-card {
    border: 1px solid var(--border);
    background: linear-gradient(145deg, rgba(23, 54, 95, 0.88), rgba(16, 37, 68, 0.82));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius);
}

.app-header {
    position: sticky;
    z-index: 100;
    top: 0;
    min-height: var(--header-height);
    padding: 12px clamp(18px, 4vw, 64px);
    border-bottom: 1px solid var(--border);
    background: rgba(8, 27, 52, 0.86);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 13px;
}

.brand-logo-wrap {
    width: 54px;
    height: 54px;
    padding: 4px;
    flex: 0 0 auto;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    display: grid;
    line-height: 1.12;
}

.brand-copy strong {
    font-size: 21px;
    letter-spacing: .08em;
}

.brand-copy small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.header-actions,
.user-badge {
    display: flex;
    align-items: center;
}

.header-actions {
    gap: 12px;
}

.user-badge {
    gap: 10px;
    padding: 7px 12px 7px 8px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #dceeff;
    background: linear-gradient(145deg, #26578d, #17365f);
    font-weight: 800;
}

.user-copy {
    display: grid;
    line-height: 1.2;
}

.user-copy strong {
    font-size: 13px;
}

.user-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.page-shell {
    width: min(1600px, calc(100% - 40px));
    margin: 0 auto;
    padding: 40px 0 72px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.page-heading,
.section-title-row,
.workspace-heading,
.progress-meta,
.object-card-top,
.object-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading h1,
.page-heading p,
.section-title-row h2,
.workspace-heading h2,
.workspace-heading p,
.login-intro h1,
.login-intro p,
.login-card h2,
.login-card p,
.object-card h3,
.object-card p,
.empty-state h2,
.empty-state p {
    margin: 0;
}

.page-heading h1 {
    margin-top: 7px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.page-heading p {
    max-width: 660px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 16px;
}

.eyebrow,
.section-kicker {
    color: #79b9ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.button {
    min-height: 44px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text);
    cursor: pointer;
    font-weight: 750;
    white-space: nowrap;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    border-color: rgba(110, 180, 255, .22);
    background: linear-gradient(135deg, #1c5791, #21497a);
    box-shadow: 0 10px 28px rgba(18, 83, 146, .28);
}

.button-primary:hover {
    background: linear-gradient(135deg, #256bab, #2b5f9d);
    box-shadow: 0 14px 34px rgba(18, 83, 146, .38);
}

.button-secondary,
.button-ghost {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, .05);
}

.button-secondary:hover,
.button-ghost:hover {
    border-color: rgba(116, 184, 255, .35);
    background: var(--hover);
}

.button-compact {
    min-height: 40px;
    padding: 0 13px;
    font-size: 13px;
}

.button-large {
    min-height: 54px;
    border-radius: 14px;
    font-size: 16px;
}

.button-full {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card {
    position: relative;
    min-height: 148px;
    padding: 22px;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    gap: 14px;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -55px;
    bottom: -80px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(80, 156, 232, .1);
    filter: blur(12px);
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(120, 187, 255, .22);
    background: linear-gradient(145deg, rgba(30, 69, 117, .92), rgba(18, 43, 78, .9));
}

.metric-highlight {
    border-color: rgba(50, 205, 50, .16);
}

.metric-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
}

.metric-icon svg {
    width: 23px;
    height: 23px;
}

.metric-blue { color: #87c5ff; background: rgba(52, 139, 230, .16); }
.metric-violet { color: #b5a2ff; background: rgba(129, 102, 240, .16); }
.metric-cyan { color: #74ddec; background: rgba(56, 183, 200, .15); }
.metric-green { color: #75e675; background: rgba(50, 205, 50, .14); }

.metric-card-live {
    min-width: 0;
    align-content: start;
}

.metric-card-live .live-summary-primary {
    min-width: 0;
}

.metric-card-live .live-summary-breakdown {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
    min-width: 0;
    margin-top: 2px;
}

.metric-card-live .live-summary-row {
    display: grid;
    grid-template-columns: 8px minmax(20px, auto) minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.metric-card-live .live-summary-row i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.metric-card-live .live-summary-row strong {
    color: #fff;
    font-size: 13px;
    letter-spacing: 0;
}

.metric-card-live .live-summary-row span {
    min-width: 0;
    margin: 0;
    color: inherit;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.metric-card-live .live-summary-row.is-done { color: #75e675; }
.metric-card-live .live-summary-row.is-denied { color: #ff8587; }
.metric-card-live .live-summary-row.is-remaining { color: #b7c4d8; }

.metric-card div {
    display: grid;
    line-height: 1.15;
}

.metric-card strong {
    font-size: 31px;
    letter-spacing: -.03em;
}

.metric-card div span {
    margin-top: 7px;
    color: #dce7f4;
    font-weight: 700;
}

.metric-card small {
    grid-column: 1 / -1;
    margin-top: 4px;
    color: var(--muted);
}

.filter-panel {
    padding: 24px;
    margin-bottom: 34px;
}

.section-title-row {
    margin-bottom: 20px;
}

.section-title-row h2,
.workspace-heading h2 {
    margin: 5px 0 0;
    font-size: 23px;
    line-height: 1.2;
}

.section-count,
.live-indicator {
    color: var(--muted);
    font-size: 13px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.live-indicator i,
.status-dot,
.login-features i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px rgba(50, 205, 50, .72);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.field-group {
    display: grid;
    gap: 8px;
    text-align: left;
}

.field-group > span:first-child,
.field-label {
    color: #dce6f2;
    font-size: 13px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    outline: none;
    border-radius: 12px;
    color: var(--text);
    background: rgba(5, 20, 39, .46);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

select {
    appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, #91a8c2 50%),
        linear-gradient(135deg, #91a8c2 50%, transparent 50%);
    background-position:
        calc(100% - 19px) calc(50% - 2px),
        calc(100% - 14px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(99, 172, 246, .72);
    background-color: rgba(10, 35, 63, .72);
    box-shadow: 0 0 0 4px rgba(73, 151, 230, .12);
}

select:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.objects-section {
    margin-bottom: 38px;
}

.object-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.object-card {
    padding: 22px;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.object-card:hover,
.object-card.is-active {
    transform: translateY(-5px);
    border-color: rgba(105, 177, 247, .36);
    background: linear-gradient(145deg, rgba(31, 72, 121, .96), rgba(18, 43, 78, .92));
}

.object-card.is-active {
    box-shadow: 0 20px 50px rgba(14, 76, 139, .28);
}

.object-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #83c5ff;
    background: rgba(64, 145, 228, .15);
}

.object-status {
    max-width: 55%;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    color: var(--muted);
    background: rgba(255, 255, 255, .035);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.object-card h3 {
    margin-top: 20px;
    font-size: 20px;
}

.object-card p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.system-tags {
    min-height: 27px;
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.system-tags span {
    padding: 4px 8px;
    border-radius: 7px;
    color: #bbd9f5;
    background: rgba(106, 172, 237, .1);
    font-size: 10px;
    font-weight: 800;
}

.mini-progress,
.progress-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.mini-progress {
    margin: 20px 0 13px;
}

.mini-progress i,
.progress-fill,
.spill-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #25b93f, #52dd67);
    box-shadow: 0 0 20px rgba(50, 205, 50, .2);
}

.object-card-footer {
    color: var(--muted);
    font-size: 12px;
}

.object-card-footer a {
    color: #8dc8ff;
    font-weight: 800;
}

.workspace-section {
    display: grid;
    gap: 18px;
}

.workspace-heading,
.progress-card,
.board-card,
.spill-card {
    padding: 24px;
}

.workspace-heading p {
    margin-top: 7px;
    color: var(--muted);
}

.breadcrumb {
    color: #81bdf4;
    font-size: 12px;
    font-weight: 700;
}

.breadcrumb b {
    padding: 0 6px;
    color: #5b7795;
}

.progress-meta strong {
    font-size: 27px;
}

.progress-card > .progress-track {
    height: 12px;
    margin-top: 14px;
}

.status-summary,
.legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 13px 24px;
}

.status-summary {
    margin-top: 20px;
}

.status-summary span,
.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.status-summary b {
    color: var(--text);
}

.status-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.status-green { background: var(--success); }
.status-yellow { background: var(--warning); }
.status-red { background: var(--danger); }
.status-white { background: #f5f8fc; }

.board-card {
    overflow: hidden;
}

.legend {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.board-scroll,
.excel-board-scroll {
    overflow-x: auto;
    padding: 3px 3px 12px;
    scrollbar-width: thin;
    scrollbar-color: #315d8c rgba(255,255,255,.04);
}

.floors-board {
    min-width: 930px;
}

.floor {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.floor-name,
.flat {
    min-height: 62px;
    border: 1px solid var(--border);
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.floor-name {
    width: 78px;
    flex: 0 0 78px;
    background: rgba(6, 22, 42, .62);
}

.floor-name span {
    font-size: 17px;
    font-weight: 850;
}

.floor-name small,
.flat small {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.flat {
    min-width: 56px;
    flex: 1 0 56px;
    color: #fff;
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
    transition: transform .18s ease, filter .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.flat strong {
    margin-top: 3px;
    font-size: 15px;
}

.flat:hover {
    z-index: 2;
    transform: translateY(-3px) scale(1.035);
    filter: brightness(1.12);
    border-color: rgba(255, 255, 255, .3);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.flat.green,
.flat.done {
    color: #fff;
    background: linear-gradient(145deg, #258f38, #32cd32);
}

.flat.yellow,
.flat.check {
    color: #342900;
    background: linear-gradient(145deg, #dcb936, #ffd54a);
}

.flat.red,
.flat.denied {
    color: #fff;
    background: linear-gradient(145deg, #cb353b, #ff4d4f);
}

.flat.white,
.flat.notdone {
    color: #dce7f3;
    background: rgba(255, 255, 255, .055);
}

.flat.white small,
.flat.notdone small {
    color: #8fa3ba;
}

.compact-row {
    margin-bottom: 18px;
}

.spill-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.spill-block {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(3, 17, 34, .25);
}

.spill-block > span:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.spill-block em {
    color: #74e47c;
    font-style: normal;
    font-weight: 850;
}

.spill-block .progress-track {
    display: block;
    margin: 13px 0;
}

.spill-block input {
    max-width: 130px;
    min-height: 42px;
}

.spill-single {
    display: block;
    margin-bottom: 18px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.rozliv-photo-fixation {
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.rozliv-photo-heading,
.rozliv-photo-progress > span,
.rozliv-photo-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rozliv-photo-heading > div {
    display: grid;
    gap: 2px;
}

.rozliv-photo-heading b { color: var(--text); }

.rozliv-photo-heading small,
.rozliv-photo-heading > span,
.rozliv-photo-hint,
.rozliv-photo-empty,
.rozliv-photo-progress small {
    color: var(--text-muted);
    font-size: 12px;
}

.rozliv-photo-heading > span {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
    background: rgba(255, 255, 255, .04);
}

.rozliv-photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rozliv-photo-thumb {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, .035);
    cursor: zoom-in;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.rozliv-photo-thumb:hover {
    transform: translateY(-2px);
    border-color: rgba(92, 169, 255, .55);
    box-shadow: 0 8px 22px rgba(2, 12, 25, .3);
}

.rozliv-photo-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.rozliv-photo-empty { margin: 10px 0 0; }

.rozliv-photo-queue {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rozliv-queue-item {
    position: relative;
    min-width: 0;
    padding: 5px;
    border: 1px solid rgba(92, 169, 255, .25);
    border-radius: 10px;
    background: rgba(31, 86, 143, .16);
}

.rozliv-queue-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 7px;
}

.rozliv-queue-item small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rozliv-queue-item button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    color: #fff;
    background: rgba(5, 16, 30, .88);
    cursor: pointer;
}

.rozliv-photo-progress {
    margin-top: 12px;
}

.rozliv-photo-progress > i {
    display: block;
    height: 6px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.rozliv-photo-progress em {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4295ed, #64d9ff);
    transition: width .22s ease;
}

.rozliv-photo-notice {
    margin: 11px 0 0;
    padding: 9px 11px;
    border: 1px solid rgba(92, 169, 255, .25);
    border-radius: 9px;
    color: #cfe8ff;
    font-size: 12px;
    background: rgba(31, 86, 143, .16);
}

.rozliv-photo-notice.is-success {
    border-color: rgba(50, 205, 50, .28);
    color: #bdf6c2;
    background: rgba(50, 205, 50, .08);
}

.rozliv-photo-notice.is-error {
    border-color: rgba(255, 77, 79, .32);
    color: #ffc4c5;
    background: rgba(255, 77, 79, .08);
}

.rozliv-photo-actions {
    justify-content: flex-start;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rozliv-photo-hint {
    display: block;
    margin-top: 8px;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 18px;
    color: #8dc8ff;
    background: rgba(71, 149, 228, .13);
}

.empty-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state p {
    margin-top: 8px;
    color: var(--muted);
}

/* Authentication */
.auth-page {
    overflow-x: hidden;
}

.login-layout {
    width: min(1180px, 100%);
    min-height: min(720px, calc(100vh - 64px));
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, .72fr);
    align-items: center;
    gap: clamp(34px, 7vw, 100px);
}

.login-intro {
    display: grid;
    grid-template-columns: 210px 1fr;
    align-items: center;
    gap: 35px;
}

.login-logo-panel {
    padding: 12px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--shadow);
    transform: rotate(-1.5deg);
}

.login-logo {
    display: block;
    width: 100%;
    height: auto;
}

.login-intro h1 {
    margin-top: 14px;
    font-size: clamp(38px, 5vw, 66px);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.login-intro p {
    max-width: 600px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 17px;
}

.login-features {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.login-features span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #dce8f4;
    font-size: 12px;
    font-weight: 700;
}

.login-card {
    padding: 34px;
}

.login-card-heading {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 32px;
    color: var(--muted);
    font-size: 12px;
}

.login-card h2 {
    font-size: 30px;
    letter-spacing: -.03em;
}

.login-card > .muted {
    margin-top: 8px;
    color: var(--muted);
}

.form-stack {
    display: grid;
    gap: 18px;
}

.login-form {
    margin-top: 28px;
}

.input-shell {
    position: relative;
    display: block;
}

.input-shell svg {
    position: absolute;
    z-index: 1;
    left: 14px;
    top: 50%;
    width: 19px;
    height: 19px;
    color: #8299b4;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-shell input {
    min-height: 52px;
    padding-left: 45px;
}

.login-security {
    margin-top: 22px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #7f96af;
    font-size: 11px;
}

.login-security svg {
    width: 15px;
    height: 15px;
}

/* Shared inner pages */
.content-card,
.form-card {
    padding: 26px;
}

.form-card {
    max-width: 820px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

input[type="file"] {
    min-height: 54px;
    padding: 8px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    height: 36px;
    margin-right: 12px;
    padding: 0 13px;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    color: var(--text);
    background: var(--hover);
    cursor: pointer;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-top: 16px;
}

.gallery-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 13px;
    cursor: zoom-in;
    transition: transform .22s ease, filter .22s ease, border-color .22s ease;
}

.gallery-photo:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
    border-color: rgba(255,255,255,.25);
}

.photo-modal {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 10, 20, .9);
    backdrop-filter: blur(12px);
    cursor: zoom-out;
}

.photo-modal:not([hidden]) { display: flex; }

.photo-modal-close {
    position: fixed;
    z-index: 1;
    top: 22px;
    right: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    background: rgba(6, 18, 34, .82);
    cursor: pointer;
}

.photo-modal img {
    max-width: min(1200px, 95vw);
    max-height: 90vh;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.notice-error {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 77, 79, .25);
    border-radius: 12px;
    color: #ffc3c4;
    background: rgba(255, 77, 79, .08);
}

.detail-layout,
.import-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.detail-summary,
.import-guide {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    padding: 24px;
}

.detail-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 22px;
    border-radius: 15px;
    color: #8dc8ff;
    background: rgba(73, 151, 230, .14);
}

.detail-icon svg {
    width: 25px;
    height: 25px;
}

.detail-summary h2,
.import-guide h2 {
    margin: 6px 0 0;
    font-size: 24px;
}

.current-status {
    margin: 20px 0;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #dce7f4;
    background: rgba(255,255,255,.04);
    font-size: 13px;
    font-weight: 800;
}

.current-status i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-panel-green i { background: var(--success); }
.status-panel-yellow i { background: var(--warning); }
.status-panel-red i { background: var(--danger); }
.status-panel-white i { background: #eef4fa; }

.detail-list {
    margin: 0;
}

.detail-list div {
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-size: 11px;
}

.detail-list dd {
    margin: 3px 0 0;
    font-size: 13px;
    font-weight: 750;
}

.upload-field small {
    color: #7f96af;
    font-size: 11px;
}

.photo-picker {
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}

.photo-picker-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.photo-add-button {
    width: fit-content;
    cursor: pointer;
}

.photo-picker-limit {
    color: var(--muted);
    font-size: 12px;
}

.photo-preview-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 4px;
}

.photo-preview-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.photo-preview-item img {
    width: 58px;
    height: 48px;
    object-fit: cover;
    border-radius: 9px;
}

.photo-preview-item span,
.photo-preview-item strong,
.photo-preview-item small {
    display: block;
    min-width: 0;
}

.photo-preview-item strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-preview-item small {
    margin-top: 3px;
}

.photo-preview-remove {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(255,77,79,.24);
    border-radius: 9px;
    color: #ffc3c4;
    background: rgba(255,77,79,.08);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.photo-picker.is-uploading {
    pointer-events: none;
    opacity: .68;
}

.photo-upload-progress {
    padding: 14px;
    border: 1px solid rgba(59,130,246,.24);
    border-radius: 12px;
    background: rgba(59,130,246,.07);
}

.photo-upload-progress-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--secondary-text, #b7c4d8);
    font-size: 12px;
}

.photo-upload-progress-track {
    height: 6px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

.photo-upload-progress-track i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #3b82f6;
    transition: width .22s ease;
}

.upload-notice,
.notice-success {
    margin-bottom: 18px;
    padding: 13px 15px;
    border-radius: 12px;
}

.notice-success {
    border: 1px solid rgba(50,205,50,.25);
    color: #baf5ba;
    background: rgba(50,205,50,.08);
}

.upload-error-page {
    max-width: 620px;
    margin: 72px auto;
    text-align: center;
}

.upload-error-page h1 {
    margin: 8px 0 10px;
}

.upload-error-page .button {
    margin-top: 16px;
}

.gallery-section {
    padding-top: 4px;
}

@media (max-width: 520px) {
    .photo-preview-list {
        grid-template-columns: 1fr;
    }

    .photo-picker-actions,
    .photo-add-button {
        width: 100%;
    }

    .photo-add-button {
        justify-content: center;
    }

    .photo-upload-progress-row {
        align-items: flex-start;
    }
}

.gallery-section h3 {
    margin: 0;
    font-size: 17px;
}

.import-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
}

.import-layout .form-card {
    width: 100%;
    max-width: none;
}

.import-guide {
    position: static;
}

.import-guide ul {
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 14px;
}

.import-guide li {
    position: relative;
    padding-left: 22px;
    color: var(--muted);
    font-size: 13px;
}

.import-guide li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 900;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.excel-board {
    display: grid;
    gap: 7px;
    min-width: max-content;
    margin-top: 24px;
}

.room-cell,
.empty-cell {
    width: 96px;
    min-height: 64px;
    border-radius: 11px;
}

.room-cell {
    border: 1px solid var(--border-strong);
    padding: 7px;
    display: grid;
    place-items: center;
    color: #eaf3fc;
    background: rgba(255, 255, 255, .055);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
    transition: transform .2s ease, background .2s ease;
}

.room-cell:hover {
    transform: translateY(-2px);
    background: var(--hover);
}

.room-cell.done { background: #2ba93e; }
.room-cell.check { color: #382c00; background: var(--warning); }
.room-cell.denied { background: var(--danger); }

.fade-up {
    animation: fade-up .55s cubic-bezier(.2, .8, .2, 1) both;
}

.delay-one { animation-delay: .08s; }
.delay-two { animation-delay: .14s; }
.delay-three { animation-delay: .2s; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(13px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quiet SaaS microinteractions. This layer only enhances existing UI classes. */
.fade-up {
    animation-duration: .32s;
    animation-timing-function: ease-out;
}

.button,
input,
select,
textarea,
.metric-card,
.object-card,
.filter-panel,
.workspace-heading,
.progress-card,
.board-card,
.spill-card,
.content-card,
.form-card,
.detail-summary,
.import-guide,
.login-card,
.room-cell,
.gallery-photo,
.flat {
    transition-duration: .25s;
    transition-timing-function: ease-out;
}

.button {
    transition-property: transform, background, border-color, box-shadow, filter;
}

.metric-card,
.object-card,
.filter-panel,
.workspace-heading,
.progress-card,
.board-card,
.spill-card,
.content-card,
.form-card,
.detail-summary,
.import-guide,
.login-card {
    transition-property: transform, border-color, background-color, box-shadow, filter;
}

.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: rgba(96, 165, 250, .78);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16), 0 0 24px rgba(59, 130, 246, .16);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(96, 165, 250, .72);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14), 0 0 22px rgba(59, 130, 246, .12);
}

select {
    transition-property: border-color, box-shadow, background-color, background-position, transform;
}

select:focus {
    transform: translateY(-1px);
    background-position:
        calc(100% - 19px) calc(50% + 1px),
        calc(100% - 14px) calc(50% + 1px);
}

.object-card.is-active,
[aria-current="page"],
.active-section {
    border-color: rgba(96, 165, 250, .34);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, .12), 0 16px 42px rgba(17, 76, 140, .22);
}

@media (hover: hover) and (pointer: fine) {
    .metric-card:hover,
    .object-card:hover,
    .filter-panel:hover,
    .workspace-heading:hover,
    .progress-card:hover,
    .board-card:hover,
    .spill-card:hover,
    .content-card:hover,
    .form-card:hover,
    .detail-summary:hover,
    .import-guide:hover,
    .login-card:hover {
        transform: translateY(-3px);
        border-color: rgba(116, 184, 255, .24);
        box-shadow: 0 18px 44px rgba(0, 8, 24, .3), 0 0 22px rgba(59, 130, 246, .08);
    }

    .button:hover {
        transform: none;
        filter: brightness(1.08);
        border-color: rgba(96, 165, 250, .44);
        box-shadow: 0 10px 28px rgba(59, 130, 246, .25);
    }

    .flat:hover {
        transform: translateY(-3px);
    }
}

.ui-ready .metric-card,
.ui-ready .login-logo-panel,
.ui-ready .login-intro-copy,
.ui-ready .login-card,
.ui-ready .login-form .field-group,
.ui-ready .login-security {
    animation: ui-rise-in .32s ease-out both;
}

.ui-ready .stats-grid .metric-card:nth-child(1) { animation-delay: 0ms; }
.ui-ready .stats-grid .metric-card:nth-child(2) { animation-delay: 40ms; }
.ui-ready .stats-grid .metric-card:nth-child(3) { animation-delay: 80ms; }
.ui-ready .stats-grid .metric-card:nth-child(4) { animation-delay: 120ms; }

.ui-ready .login-logo-panel { animation-delay: 0ms; }
.ui-ready .login-intro-copy { animation-delay: 45ms; }
.ui-ready .login-card { animation-delay: 85ms; }
.ui-ready .login-form .field-group:nth-child(1) { animation-delay: 125ms; }
.ui-ready .login-form .field-group:nth-child(2) { animation-delay: 165ms; }
.ui-ready .login-security { animation-delay: 205ms; }

.ui-observe {
    opacity: 0;
    transform: translateY(12px);
}

.ui-observe.ui-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .32s ease-out var(--ui-delay, 0ms), transform .32s ease-out var(--ui-delay, 0ms);
}

.metric-card,
.object-card,
.filter-panel,
.workspace-heading,
.progress-card,
.board-card,
.spill-card,
.content-card,
.form-card,
.import-guide,
.login-card,
table {
    position: relative;
}

:is(
    .metric-card,
    .object-card,
    .filter-panel,
    .workspace-heading,
    .progress-card,
    .board-card,
    .spill-card,
    .content-card,
    .form-card,
    .detail-summary,
    .import-guide,
    .login-card,
    table
)::before {
    content: "";
    position: absolute;
    z-index: 20;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: linear-gradient(110deg, rgba(16, 37, 68, .98) 18%, rgba(42, 78, 119, .98) 36%, rgba(16, 37, 68, .98) 54%);
    background-size: 220% 100%;
    transition: opacity .2s ease-out, visibility 0s linear .2s;
}

html.ui-loading :is(
    .metric-card,
    .object-card,
    .filter-panel,
    .workspace-heading,
    .progress-card,
    .board-card,
    .spill-card,
    .content-card,
    .form-card,
    .detail-summary,
    .import-guide,
    .login-card,
    table
)::before {
    opacity: 1;
    visibility: visible;
    animation: skeleton-shimmer 1.15s linear infinite;
    transition-delay: 0s;
}

@keyframes ui-rise-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes skeleton-shimmer {
    from { background-position: 110% 0; }
    to { background-position: -110% 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .ui-observe,
    .ui-observe.ui-visible {
        opacity: 1 !important;
        transform: none !important;
    }

    html.ui-loading :is(
        .metric-card,
        .object-card,
        .filter-panel,
        .workspace-heading,
        .progress-card,
        .board-card,
        .spill-card,
        .content-card,
        .form-card,
        .detail-summary,
        .import-guide,
        .login-card,
        table
    )::before {
        animation: none !important;
    }
}

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .object-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-layout { grid-template-columns: 1fr 430px; gap: 40px; }
    .login-intro { grid-template-columns: 150px 1fr; gap: 25px; }
}

@media (max-width: 820px) {
    :root { --header-height: 72px; }
    .app-header { padding: 9px 16px; }
    .brand-logo-wrap { width: 48px; height: 48px; border-radius: 12px; }
    .brand-copy small, .user-copy { display: none; }
    .user-badge { padding: 6px; }
    .button-compact span { display: none; }
    .button-compact { width: 40px; padding: 0; }
    .page-shell { width: min(100% - 24px, 1600px); padding-top: 26px; }
    .page-heading, .workspace-heading { align-items: flex-start; flex-direction: column; }
    .filter-grid { grid-template-columns: 1fr; }
    .login-layout { width: min(520px, 100%); grid-template-columns: 1fr; }
    .login-intro { display: none; }
    .spill-grid, .form-grid { grid-template-columns: 1fr; }
    .detail-layout, .import-layout { grid-template-columns: 1fr; }
    .detail-summary, .import-guide { position: static; }
}

@media (max-width: 620px) {
    .auth-shell { padding: 16px; }
    .login-card { padding: 25px 20px; }
    .stats-grid, .object-card-grid { grid-template-columns: 1fr; }
    .metric-card { min-height: 128px; }
    .filter-panel, .workspace-heading, .progress-card, .board-card, .spill-card, .content-card, .form-card { padding: 18px; }
    .page-heading h1 { font-size: 34px; }
    .page-heading > .button { width: 100%; }
    .section-title-row { align-items: flex-start; }
    .status-summary, .legend { gap: 11px 15px; }
    .gallery { grid-template-columns: 1fr; }
    .rozliv-photo-gallery,
    .rozliv-photo-queue { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rozliv-photo-actions .button {
        width: auto;
        min-width: min(100%, 150px);
    }
    .form-actions .button { width: 100%; }
    .brand-copy strong { font-size: 18px; }
}

/* Contractor directory modal */
.field-feedback {
    min-height: 18px;
    color: #7ed99a;
    font-size: 12px;
}

.field-feedback.is-warning { color: var(--warning); }

body.modal-open { overflow: hidden; }

.mayak-modal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .18s ease-out;
}

.mayak-modal[hidden] { display: none; }
.mayak-modal.is-open { opacity: 1; }

.mayak-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 22, .78);
    backdrop-filter: blur(10px);
}

.mayak-modal-dialog {
    position: relative;
    width: min(100%, 520px);
    padding: 28px;
    transform: translateY(10px);
    border: 1px solid rgba(116, 181, 255, .25);
    background: linear-gradient(145deg, rgba(23, 54, 95, .98), rgba(8, 27, 52, .98));
    box-shadow: 0 30px 90px rgba(0, 0, 0, .46), 0 0 0 1px rgba(255, 255, 255, .03);
    transition: transform .18s ease-out;
}

.mayak-modal.is-open .mayak-modal-dialog { transform: translateY(0); }

.mayak-modal-dialog h2 {
    margin: 7px 36px 8px 0;
    color: #fff;
    font-size: 25px;
}

.mayak-modal-dialog > p {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.55;
}

.mayak-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.mayak-modal-close:hover {
    border-color: rgba(102, 176, 255, .5);
    background: rgba(59, 130, 246, .12);
    color: #fff;
}

.mayak-modal-actions {
    justify-content: flex-end;
    margin-top: 4px;
}

body.modal-open { overflow: hidden; }

.metric-card-action {
    width: 100%;
    border: 1px solid var(--border);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease, background .24s ease;
}

.metric-card-action:hover {
    transform: translateY(-3px);
    border-color: rgba(102, 176, 255, .5);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .26), 0 0 0 3px rgba(59, 130, 246, .11);
}

.metric-card-action:focus-visible {
    outline: none;
    border-color: #66b0ff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .2);
}

.metric-card-action small b {
    margin-left: 5px;
    color: #8cc5ff;
    font-size: 15px;
}

.object-summary-dialog {
    width: min(100%, 760px);
    max-height: min(90vh, 900px);
    overflow-y: auto;
}

.object-summary-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.object-summary-filters > .field-group { grid-column: span 2; }
.object-summary-filters > .summary-date-field { grid-column: span 3; }

.summary-date-field input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    color-scheme: dark;
}

.summary-message {
    padding: 15px 16px;
    border: 1px dashed rgba(183, 196, 216, .24);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .025);
    text-align: center;
}

.summary-message.is-error {
    border-color: rgba(255, 77, 79, .42);
    color: #ffb0b1;
    background: rgba(255, 77, 79, .08);
}

.object-summary-result {
    padding: 20px;
    border: 1px solid rgba(116, 181, 255, .2);
    border-radius: 16px;
    background: rgba(8, 27, 52, .58);
}

.object-summary-result[hidden] { display: none; }

.summary-heading,
.summary-total,
.summary-spill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.summary-heading span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.summary-heading h3 {
    margin: 0;
    color: #fff;
    font-size: clamp(20px, 3vw, 28px);
}

.summary-progress { text-align: right; }
.summary-progress strong {
    display: block;
    color: #fff;
    font-size: 34px;
    line-height: 1;
}

.object-summary-result > .progress-track {
    height: 10px;
    margin: 17px 0;
}

.summary-total {
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.summary-total strong { color: #fff; font-size: 24px; }

.summary-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.summary-status-grid > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(255, 255, 255, .035);
    color: var(--muted);
}

.summary-status-grid > .summary-metric-neutral {
    border-color: rgba(102, 176, 255, .24);
    background: rgba(59, 130, 246, .07);
}

.summary-status-grid > .summary-metric-done {
    border-color: rgba(50, 205, 50, .24);
    background: rgba(50, 205, 50, .07);
}

.summary-status-grid > .summary-metric-denied {
    border-color: rgba(255, 77, 79, .25);
    background: rgba(255, 77, 79, .07);
}

.summary-status-grid > .summary-metric-remaining {
    background: rgba(183, 196, 216, .045);
}

.summary-status-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-status-grid strong { color: #fff; font-size: 18px; }

.summary-history-warning {
    margin: 14px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 213, 74, .26);
    border-radius: 10px;
    color: #ffe69a;
    background: rgba(255, 213, 74, .07);
    font-size: 13px;
}

.summary-history-warning[hidden] { display: none; }

.summary-spill {
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(33, 73, 122, .52), rgba(23, 54, 95, .3));
    color: var(--muted);
}

.summary-spill strong { color: #fff; }
.summary-spill strong + strong { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
    .mayak-modal,
    .mayak-modal-dialog,
    .metric-card-action { transition: none; }
}

@media (max-width: 620px) {
    .mayak-modal { padding: 14px; }
    .mayak-modal-dialog { padding: 22px 18px; }
    .mayak-modal-actions .button { width: 100%; }
    .object-summary-filters,
    .summary-status-grid { grid-template-columns: 1fr; }
    .object-summary-filters > .field-group,
    .object-summary-filters > .summary-date-field { grid-column: 1; }
    .summary-heading { align-items: flex-start; }
}

@media (max-width: 390px) {
    .brand-copy { display: none; }
    .page-shell { width: min(100% - 18px, 1600px); }
    .header-actions { gap: 7px; }
}
+}

/* Structure-preserving Excel chessboards. Track sizes and spans come from the
   workbook; this layer only translates them into MAYAK's existing SaaS UI. */
.excel-board-structured {
    gap: 0;
    padding: 0 0 12px;
    align-items: stretch;
    min-width: max-content;
}

.excel-layout-cell {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 0;
    padding: 0 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #eaf3fc;
    background: #0c2340;
    text-align: center;
    font-size: 11px;
    line-height: 1.18;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.excel-layout-cell small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.excel-layout-cell.is-room-link {
    background: #17365f;
    box-shadow: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.excel-layout-cell.is-room-link:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 176, 255, .56);
    background: var(--hover);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .24), 0 0 0 3px rgba(59, 130, 246, .1);
}

.excel-layout-cell.cell-type-empty_layout_cell {
    padding: 0;
    border-radius: 0;
    background: #081b34;
}

.excel-layout-cell.cell-type-entrance {
    background: linear-gradient(135deg, #21497a, #17365f);
    color: #fff;
    font-size: 12px;
    letter-spacing: .02em;
    box-shadow: none;
}

.excel-layout-cell.cell-type-floor,
.excel-layout-cell.cell-type-basement {
    background: #06162a;
    color: #cfe6fb;
    font-weight: 850;
}

.excel-layout-cell.cell-type-non_residential {
    border-style: dashed;
}

.excel-layout-cell.cell-type-technical_room {
    background:
        linear-gradient(rgba(33, 73, 122, .72), rgba(33, 73, 122, .72)),
        var(--excel-fill, transparent);
    color: #cfe6fb;
}

.excel-layout-cell.cell-type-object_address,
.excel-layout-cell.cell-type-work_type,
.excel-layout-cell.cell-type-service_header {
    border-color: rgba(255, 255, 255, .13);
    background: rgba(16, 37, 68, .92);
    color: var(--muted);
}

.excel-layout-cell.cell-type-unknown {
    border: 1px dashed rgba(255, 213, 74, .72);
    background: rgba(255, 213, 74, .08);
    color: #ffe69a;
}

.excel-layout-cell.status-green.is-room-link { background: #238f3a; }
.excel-layout-cell.status-yellow.is-room-link { background: var(--warning); color: #382c00; }
.excel-layout-cell.status-red.is-room-link { background: var(--danger); }
.excel-layout-cell.status-white.is-room-link { background: #17365f; }

.excel-layout-cell.source-border-top { border-top: 2px solid rgba(207, 230, 251, .72); }
.excel-layout-cell.source-border-right { border-right: 2px solid rgba(207, 230, 251, .72); }
.excel-layout-cell.source-border-bottom { border-bottom: 2px solid rgba(207, 230, 251, .72); }
.excel-layout-cell.source-border-left { border-left: 2px solid rgba(207, 230, 251, .72); }
.excel-layout-cell.source-align-left { align-items: flex-start; text-align: left; }
.excel-layout-cell.source-align-right { align-items: flex-end; text-align: right; }
.excel-layout-cell.source-align-top { justify-content: flex-start; }
.excel-layout-cell.source-align-bottom { justify-content: flex-end; }

.preview-meta,
.preview-actions,
.import-warnings {
    margin-bottom: 18px;
}

.preview-context,
.preview-statistics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.preview-context {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.preview-context div,
.preview-statistics div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
}

.preview-context span,
.preview-statistics span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
}

.preview-context strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-statistics strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 26px;
}

.preview-statistics .has-warning strong { color: var(--warning); }

.import-warnings ul {
    margin: 12px 0 0;
    padding-left: 20px;
    color: #ffe69a;
}

.preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.preview-actions form { margin: 0; }

@media (max-width: 820px) {
    .preview-context,
    .preview-statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .preview-context,
    .preview-statistics {
        grid-template-columns: 1fr;
    }

    .preview-actions,
    .preview-actions form,
    .preview-actions .button {
        width: 100%;
    }
}
