:root {
    --ahpm-primary: #1e3a5f;
    --ahpm-accent: #d4af37;
    --ahpm-bg: #f5f7fa;
    --ahpm-text: #212529;
    --ahpm-muted: #6c757d;
    --ahpm-border: #dfe5ec;
}

.terminal-body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(212, 175, 55, .18), transparent 32rem),
        linear-gradient(135deg, #0b2742 0%, #12385a 42%, #f5f7fa 42%, #eef3f8 100%);
    color: #10243b;
}

.hall-terminal {
    min-height: 100vh;
    padding: clamp(18px, 2.2vw, 32px);
}

.terminal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    color: #fff;
}

.terminal-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.terminal-logo {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    color: #d4af37;
}

.terminal-logo svg {
    width: 74px;
    height: 74px;
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .25));
}

.terminal-brand strong {
    display: block;
    font-size: clamp(1.35rem, 2.4vw, 2.25rem);
    line-height: 1;
    color: #d4af37;
    letter-spacing: 0;
}

.terminal-brand span {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(.85rem, 1.2vw, 1rem);
    font-weight: 700;
}

.terminal-clock {
    min-width: 190px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 16px;
    background: rgba(8, 28, 48, .55);
    box-shadow: 0 16px 44px rgba(3, 18, 33, .24);
    text-align: right;
}

.terminal-clock span,
.terminal-clock small {
    display: block;
    color: rgba(255, 255, 255, .76);
    font-size: .82rem;
}

.terminal-clock strong {
    display: block;
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}

.terminal-alerts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 38px;
    margin-bottom: 14px;
}

.terminal-alert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
    color: #1e3a5f;
    box-shadow: 0 14px 36px rgba(22, 43, 65, .12);
    font-weight: 800;
}

.terminal-alert.warning {
    color: #8a5a00;
}

.terminal-alert.danger {
    color: #b42318;
}

.terminal-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.terminal-metric,
.terminal-panel {
    border: 1px solid rgba(30, 58, 95, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 44px rgba(20, 42, 66, .12);
}

.terminal-metric {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 94px;
    padding: 16px;
}

.terminal-metric i {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(145deg, #1e3a5f, #0c2b4b);
    color: #fff;
    font-size: 1.35rem;
}

.terminal-metric.accent i {
    background: linear-gradient(145deg, #d4af37, #a77712);
}

.terminal-metric span {
    color: #5a6b7e;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.terminal-metric strong {
    color: #10243b;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1;
}

.terminal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.terminal-panel {
    min-height: 250px;
    padding: 16px;
    overflow: hidden;
}

.terminal-apartments {
    grid-row: span 2;
}

.terminal-solar {
    grid-column: span 2;
    min-height: 190px;
}

.terminal-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.terminal-panel-head span {
    color: #0c2b4b;
    font-size: .85rem;
    font-weight: 950;
    text-transform: uppercase;
}

.terminal-panel-head i {
    color: #d4af37;
    font-size: 1.2rem;
}

.terminal-apartment-grid {
    display: grid;
    gap: 12px;
}

.terminal-apartment {
    display: grid;
    gap: 8px;
    min-height: 116px;
    padding: 14px;
    border: 1px solid rgba(30, 58, 95, .12);
    border-left: 6px solid #20b486;
    border-radius: 16px;
    background: #f8fafc;
}

.terminal-apartment.occupied {
    border-left-color: #1f78ff;
}

.terminal-apartment.arrival {
    border-left-color: #d4af37;
}

.terminal-apartment.departure {
    border-left-color: #f97316;
}

.terminal-apartment strong {
    display: block;
    color: #10243b;
    font-size: 1.15rem;
}

.terminal-apartment span,
.terminal-apartment small {
    color: #5b6e82;
    font-weight: 800;
}

.terminal-apartment footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.terminal-apartment footer span,
.terminal-row-tags em,
.terminal-list-row b {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(30, 58, 95, .08);
    color: #1e3a5f;
    font-size: .75rem;
    font-style: normal;
    font-weight: 900;
}

.terminal-list {
    display: grid;
    gap: 9px;
}

.terminal-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid rgba(30, 58, 95, .1);
    border-radius: 14px;
    background: #f8fafc;
}

.terminal-list-row.warning {
    border-color: rgba(212, 175, 55, .45);
    background: #fffaf0;
}

.terminal-list-row.priority-urgent,
.terminal-list-row.priority-high {
    border-color: rgba(220, 38, 38, .28);
}

.terminal-list-row strong {
    display: block;
    color: #10243b;
    font-size: .98rem;
}

.terminal-list-row span,
.terminal-row-meta small {
    display: block;
    color: #617287;
    font-size: .78rem;
    font-weight: 750;
}

.terminal-row-meta {
    text-align: right;
}

.terminal-row-tags {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.terminal-empty {
    display: grid;
    place-items: center;
    min-height: 120px;
    border: 1px dashed rgba(30, 58, 95, .18);
    border-radius: 14px;
    color: #7b8da0;
    font-weight: 850;
}

.terminal-energy-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.terminal-energy-grid > div {
    min-height: 94px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fafc, #fff);
    border: 1px solid rgba(30, 58, 95, .1);
}

.terminal-energy-grid span {
    display: block;
    color: #607287;
    font-size: .76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.terminal-energy-grid strong {
    display: block;
    margin-top: 12px;
    color: #10243b;
    font-size: clamp(1.15rem, 2vw, 1.65rem);
}

.terminal-energy-grid strong.online {
    color: #0f9f6e;
}

@media (max-width: 1180px) {
    .terminal-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .terminal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .terminal-apartments,
    .terminal-solar {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .terminal-energy-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .terminal-body {
        background: #eef3f8;
    }

    .hall-terminal {
        padding: 14px;
    }

    .terminal-top {
        align-items: flex-start;
        flex-direction: column;
        color: #10243b;
    }

    .terminal-brand strong {
        color: #1e3a5f;
    }

    .terminal-brand span {
        color: #66788d;
    }

    .terminal-clock {
        width: 100%;
        background: #1e3a5f;
    }

    .terminal-metrics,
    .terminal-grid,
    .terminal-energy-grid {
        grid-template-columns: 1fr;
    }

    .terminal-metric,
    .terminal-list-row {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .terminal-metric strong,
    .terminal-row-meta {
        grid-column: 1 / -1;
        text-align: left;
    }
}

/* Solar energy dashboard */
.solar-page {
    display: grid;
    gap: 18px;
}

.solar-hero-panel {
    align-items: center;
    background:
        linear-gradient(135deg, #0b2442 0%, #1e3a5f 54%, #0f766e 100%);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(11, 36, 66, 0.12);
    color: #fff;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: auto;
    padding: 16px 18px;
    position: relative;
}

.solar-hero-copy {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    max-width: none;
    width: 100%;
    position: relative;
    z-index: 2;
}

.solar-pill,
.solar-mode-badge {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 8px;
    padding: 8px 12px;
    width: fit-content;
}

.solar-pill-status {
    border-color: rgba(255, 255, 255, .18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.solar-pill-status.is-online {
    background: rgba(34, 197, 94, .2);
    border-color: rgba(34, 197, 94, .6);
    color: #dcfce7;
}

.solar-pill-status.is-offline {
    background: rgba(239, 68, 68, .2);
    border-color: rgba(239, 68, 68, .65);
    color: #fee2e2;
}

.solar-weather-pill {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    display: inline-flex;
    font-size: .82rem;
    font-weight: 900;
    gap: 7px;
    padding: 7px 10px;
}

.solar-hero-copy h2 {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.1;
    margin: 0;
}

.solar-hero-copy p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
    line-height: 1.7;
    margin: 0;
    max-width: 640px;
}

.solar-status-line {
    align-items: center;
    color: rgba(255, 255, 255, 0.86);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 0;
}

.solar-status-dot {
    background: #22c55e;
    border-radius: 999px;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.14);
    height: 10px;
    width: 10px;
}

.solar-status-dot[data-status="standby"] {
    background: #f59e0b;
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.14);
}

.solar-status-dot[data-status="offline"] {
    background: #ef4444;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.14);
}

.solar-scene {
    min-height: 250px;
    perspective: 850px;
    position: relative;
}

.solar-sun-3d {
    background: radial-gradient(circle at 34% 30%, #fff8c7 0 12%, #facc15 35%, #d97706 74%);
    border-radius: 50%;
    box-shadow: 0 18px 50px rgba(250, 204, 21, 0.42), inset -14px -20px 28px rgba(146, 64, 14, 0.22);
    height: 92px;
    position: absolute;
    right: 28px;
    top: 8px;
    width: 92px;
}

.solar-panel-3d {
    background: linear-gradient(135deg, #0f172a, #2563eb 48%, #38bdf8);
    border: 4px solid rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    bottom: 32px;
    box-shadow: 0 28px 45px rgba(0, 0, 0, 0.26);
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, 1fr);
    height: 136px;
    left: 26px;
    padding: 12px;
    position: absolute;
    transform: rotateX(58deg) rotateZ(-16deg);
    transform-style: preserve-3d;
    width: 220px;
}

.solar-panel-3d span {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(14, 165, 233, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 4px;
}

.solar-building-3d {
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    border-radius: 8px 8px 4px 4px;
    bottom: 28px;
    box-shadow: 18px 24px 36px rgba(0, 0, 0, 0.22), inset -10px -10px 20px rgba(15, 23, 42, 0.12);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
    height: 150px;
    padding: 18px;
    position: absolute;
    right: 46px;
    width: 170px;
}

.solar-building-3d span {
    background: linear-gradient(180deg, #d4af37, #b7791f);
    border-radius: 4px;
    box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.22);
}

.solar-metrics-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.solar-top-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(460px, 0.95fr) minmax(360px, 0.8fr);
}

.solar-top-grid .solar-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.solar-metric-card {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(11, 36, 66, 0.08);
    display: grid;
    gap: 6px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
}

.solar-metric-card small {
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
}

.solar-metric-card strong {
    color: #0b2442;
    font-size: 1.55rem;
    font-weight: 900;
    grid-column: 2;
    line-height: 1;
}

.solar-icon {
    align-items: center;
    border-radius: 8px;
    box-shadow: inset -8px -10px 16px rgba(15, 23, 42, 0.16), 0 12px 24px rgba(15, 23, 42, 0.12);
    color: #fff;
    display: inline-flex;
    font-size: 1.2rem;
    grid-row: span 2;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.solar-icon-sun { background: linear-gradient(135deg, #f59e0b, #d4af37); }
.solar-icon-home { background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.solar-icon-grid { background: linear-gradient(135deg, #0891b2, #0f766e); }
.solar-icon-leaf { background: linear-gradient(135deg, #16a34a, #84cc16); }
.solar-icon-battery { background: linear-gradient(135deg, #16a34a, #0f766e); }

.solar-main-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.45fr);
}

.solar-panel-heading {
    align-items: start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.solar-panel-heading h3 {
    color: #0b2442;
    font-size: 1.25rem;
    font-weight: 900;
    margin: 2px 0 0;
}

.solar-live-flow {
    background:
        radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.16), transparent 28%),
        linear-gradient(180deg, #f8fafc, #fff);
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 8px;
    min-height: 430px;
    overflow: hidden;
    position: relative;
}

.solar-live-flow::before {
    background-image:
        linear-gradient(rgba(30, 58, 95, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 58, 95, 0.05) 1px, transparent 1px);
    background-size: 34px 34px;
    content: "";
    inset: 0;
    opacity: 0.75;
    position: absolute;
}

.solar-flow-card,
.solar-flow-inverter {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(11, 36, 66, 0.12);
    display: grid;
    gap: 5px;
    justify-items: center;
    min-width: 132px;
    padding: 12px;
    position: absolute;
    text-align: center;
    z-index: 3;
}

.solar-flow-card strong,
.solar-flow-inverter strong {
    color: #0b2442;
    font-weight: 900;
}

.solar-flow-card small,
.solar-flow-card em {
    color: #64748b;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 800;
}

.solar-flow-card-icon,
.solar-flow-inverter span {
    align-items: center;
    background: linear-gradient(135deg, #0b2442, #2563eb);
    border-radius: 8px;
    box-shadow: inset -8px -10px 16px rgba(15, 23, 42, 0.18), 0 10px 22px rgba(15, 23, 42, 0.14);
    color: #fff;
    display: inline-flex;
    font-size: 1.42rem;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.solar-flow-solar {
    left: 8%;
    top: 32px;
}

.solar-flow-grid {
    right: 8%;
    top: 32px;
}

.solar-flow-battery {
    bottom: 34px;
    left: 9%;
}

.solar-flow-home {
    bottom: 34px;
    right: 8%;
}

.solar-flow-inverter {
    left: 50%;
    min-width: 116px;
    padding: 14px;
    top: 50%;
    transform: translate(-50%, -50%);
}

.solar-flow-inverter span {
    background: linear-gradient(135deg, #d4af37, #b7791f);
}

.solar-energy-line {
    background: repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.32) 0 9px, transparent 9px 16px);
    border-radius: 999px;
    height: 4px;
    opacity: 0.85;
    position: absolute;
    transform-origin: left center;
    z-index: 2;
}

.solar-energy-line::after {
    animation: solarFlowPulse 1.4s linear infinite;
    background: #94a3b8;
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(148, 163, 184, 0.72);
    content: "";
    height: 12px;
    left: 0;
    opacity: 0;
    position: absolute;
    top: -4px;
    width: 28px;
}

.solar-energy-line.is-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.88), rgba(59, 130, 246, 0.12));
}

.solar-energy-line.is-active::after {
    background: #3b82f6;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.86);
    opacity: 1;
}

.solar-line-solar {
    left: 27%;
    top: 31%;
    transform: rotate(28deg);
    width: 27%;
}

.solar-line-grid {
    left: 53%;
    top: 47%;
    transform: rotate(-28deg);
    width: 24%;
}

.solar-line-home {
    left: 55%;
    top: 54%;
    transform: rotate(28deg);
    width: 24%;
}

.solar-line-battery {
    left: 28%;
    top: 69%;
    transform: rotate(-31deg);
    width: 25%;
}

.solar-line-grid.is-active {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.9), rgba(168, 85, 247, 0.12));
}

.solar-line-grid.is-active::after {
    background: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.82);
}

.solar-line-battery.is-active {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.9), rgba(34, 197, 94, 0.12));
}

.solar-line-battery.is-active::after {
    background: #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.82);
}

.solar-energy-line.is-reverse::after {
    animation-name: solarFlowPulseReverse;
}

@keyframes solarFlowPulse {
    from { left: 0; }
    to { left: calc(100% - 28px); }
}

@keyframes solarFlowPulseReverse {
    from { left: calc(100% - 28px); }
    to { left: 0; }
}

.solar-battery-strip {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(212, 175, 55, 0.12));
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 18px;
    padding: 14px;
}

.solar-battery-strip div {
    display: grid;
    gap: 4px;
}

.solar-battery-strip span {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.solar-battery-strip strong {
    color: #0b2442;
    font-size: 1.12rem;
    font-weight: 900;
}

.solar-totals-row {
    border-top: 1px solid rgba(30, 58, 95, 0.1);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 18px;
    padding-top: 18px;
}

.solar-totals-row div {
    background: #f8fafc;
    border-radius: 8px;
    display: grid;
    gap: 4px;
    padding: 14px;
}

.solar-totals-row span,
.solar-apartment-card span {
    color: #64748b;
}

.solar-totals-row strong {
    color: #0b2442;
    font-size: 1.2rem;
    font-weight: 900;
}

.solar-apartment-list {
    display: grid;
    gap: 12px;
}

.solar-apartment-card {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px;
}

.solar-apartment-icon {
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f, #0f766e);
    border-radius: 8px;
    box-shadow: inset -8px -10px 16px rgba(15, 23, 42, 0.18);
    color: #fff;
    display: inline-flex;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.solar-apartment-card strong {
    color: #0b2442;
}

.solar-apartment-values {
    text-align: right;
}

.solar-apartment-values strong,
.solar-apartment-values span {
    display: block;
}

.solar-apartment-badge {
    background: rgba(212, 175, 55, 0.15);
    border-radius: 999px;
    color: #8a5a00;
    font-size: 0.75rem;
    font-weight: 900;
    grid-column: 2 / -1;
    justify-self: start;
    padding: 5px 9px;
}

.solar-alert-panel {
    display: grid;
    gap: 10px;
}

.solar-report-panel {
    display: grid;
    gap: 18px;
}

.solar-report-form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.solar-report-form label {
    color: #64748b;
    display: grid;
    font-size: .78rem;
    font-weight: 900;
    gap: 5px;
    min-width: 150px;
    text-transform: uppercase;
}

.solar-report-status {
    color: #64748b;
    font-size: .9rem;
    font-weight: 800;
    min-height: 22px;
}

.solar-report-status.is-error {
    color: #dc2626;
}

.solar-report-totals {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.solar-report-totals article {
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, .08);
    border-radius: 8px;
    padding: 14px;
}

.solar-report-totals span {
    color: #64748b;
    display: block;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.solar-report-totals strong {
    color: #0b2442;
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    margin-top: 4px;
}

.solar-report-chart-wrap {
    min-height: 280px;
    position: relative;
}

.solar-report-table th,
.solar-report-table td {
    white-space: nowrap;
}

.solar-report-table tfoot th {
    background: #f8fafc;
    color: #0b2442;
    font-weight: 900;
}

.solar-alert {
    align-items: center;
    background: rgba(30, 58, 95, 0.06);
    border: 1px solid rgba(30, 58, 95, 0.1);
    border-radius: 8px;
    color: #0b2442;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
}

.solar-alert i {
    color: #d4af37;
}

.smart-devices-page {
    display: grid;
    gap: 18px;
}

.smart-devices-hero {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.smart-devices-hero h2 {
    color: #0b2442;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 900;
    margin: 4px 0 8px;
}

.smart-devices-hero p {
    color: #64748b;
    margin: 0;
    max-width: 760px;
}

.smart-devices-status {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.status-pill {
    background: #e2e8f0;
    border-radius: 999px;
    color: #334155;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 900;
    padding: 7px 11px;
}

.status-pill.success {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.status-pill.secondary {
    background: #e2e8f0;
    color: #64748b;
}

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

.smart-summary-card {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
}

.smart-summary-icon,
.smart-device-icon {
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f, #0f766e);
    border-radius: 8px;
    box-shadow: inset -8px -10px 16px rgba(15, 23, 42, 0.18);
    color: #fff;
    display: inline-flex;
    font-size: 1.2rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.smart-summary-card small {
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
}

.smart-summary-card strong {
    color: #0b2442;
    font-size: 1.2rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.smart-device-list {
    display: grid;
    gap: 12px;
}

.smart-device-card {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 14px;
}

.smart-device-card strong {
    color: #0b2442;
    display: block;
    font-weight: 900;
}

.smart-device-card span {
    color: #64748b;
}

.smart-portal-hero {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.08), rgba(212, 175, 55, 0.12));
}

.smart-portal-icon {
    align-items: center;
    background: linear-gradient(135deg, #1e3a5f, #0f766e);
    border-radius: 8px;
    box-shadow: inset -14px -16px 24px rgba(15, 23, 42, 0.18), 0 16px 32px rgba(15, 23, 42, 0.12);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 2rem;
    height: 86px;
    justify-content: center;
    width: 86px;
}

.smart-portal-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
}

.smart-portal-card {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.smart-portal-card small,
.smart-portal-url span {
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
}

.smart-portal-card strong {
    color: #0b2442;
    display: block;
    font-size: 1.18rem;
    font-weight: 900;
    margin: 2px 0 4px;
}

.smart-portal-card p {
    color: #64748b;
    margin: 0;
}

.smart-portal-url {
    display: grid;
    gap: 6px;
}

.smart-portal-url a {
    color: #1e3a5f;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.smartthings-page {
    display: grid;
    gap: 18px;
}

.smartthings-device-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.smartthings-device-card {
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 8px;
    display: grid;
    gap: 14px;
    padding: 14px;
}

.smartthings-device-main {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.smartthings-device-main strong {
    color: #0b2442;
    display: block;
    font-weight: 900;
}

.smartthings-device-main span,
.smartthings-device-values {
    color: #64748b;
}

.smartthings-device-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smartthings-device-values > span:not(.status-pill) {
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    padding: 7px 10px;
}

.smartthings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

.device-info-button {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.14);
    border-radius: 999px;
    color: #1e3a5f;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    transition: all .18s ease;
    width: 34px;
}

.device-info-button:hover {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.device-info-modal[hidden] {
    display: none;
}

.device-info-modal {
    align-items: center;
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 3100;
}

.device-info-modal__backdrop {
    background: rgba(11, 36, 66, .46);
    inset: 0;
    position: absolute;
}

.device-info-modal__dialog {
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(11, 36, 66, .24);
    max-height: min(760px, calc(100vh - 36px));
    max-width: 760px;
    overflow: hidden;
    position: relative;
    width: min(100%, 760px);
}

.device-info-modal__header {
    align-items: center;
    border-bottom: 1px solid rgba(30, 58, 95, 0.08);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 18px;
}

.device-info-modal__header h3 {
    color: #0b2442;
    font-size: 1.2rem;
    font-weight: 900;
    margin: 0;
}

.device-info-modal__body {
    max-height: calc(100vh - 180px);
    overflow: auto;
    padding: 18px;
}

.device-info-grid {
    display: grid;
    gap: 10px;
}

.device-info-row {
    align-items: start;
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.08);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
    padding: 10px 12px;
}

.device-info-row span {
    color: #64748b;
    font-size: .82rem;
    font-weight: 900;
}

.device-info-row strong {
    color: #0b2442;
    font-size: .9rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.app-loader {
    align-items: center;
    background: rgba(245, 247, 250, .72);
    backdrop-filter: blur(6px);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 3000;
}

body.app-is-loading .app-loader {
    opacity: 1;
    pointer-events: auto;
}

.app-loader-panel {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(30, 58, 95, .18);
    color: #1E3A5F;
    display: inline-flex;
    font-size: .95rem;
    font-weight: 900;
    gap: 14px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 16px 18px;
}

.app-loader-mark {
    align-items: center;
    background: #1E3A5F;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, .28), 0 12px 28px rgba(30, 58, 95, .22);
    display: inline-flex;
    flex: 0 0 auto;
    height: 52px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 58px;
}

.app-loader-mark::after {
    animation: app-loader-sweep 1.55s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .38), transparent);
    content: "";
    inset: -18% auto -18% -72%;
    position: absolute;
    transform: rotate(18deg);
    width: 42%;
}

.app-loader-mark svg {
    animation: app-loader-glow 1.55s ease-in-out infinite;
    fill: none;
    height: 40px;
    position: relative;
    stroke: #D4AF37;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    width: 40px;
    z-index: 1;
}

@keyframes app-loader-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(212, 175, 55, .38));
        transform: translateY(0);
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(212, 175, 55, .92));
        transform: translateY(-1px);
    }
}

@keyframes app-loader-sweep {
    0% {
        left: -72%;
    }
    55%,
    100% {
        left: 128%;
    }
}

.app-install-prompt {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(212, 175, 55, .45);
    border-radius: 8px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 22px 55px rgba(30, 58, 95, .2);
    display: flex;
    gap: 14px;
    left: 50%;
    max-width: min(760px, calc(100vw - 28px));
    padding: 14px;
    position: fixed;
    transform: translateX(-50%);
    width: max-content;
    z-index: 2800;
}

.app-install-prompt[hidden] {
    display: none;
}

.app-install-icon {
    align-items: center;
    background: #1E3A5F;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 54px;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.app-install-icon img {
    height: 38px;
    object-fit: contain;
    width: 38px;
}

.app-install-copy {
    display: grid;
    gap: 2px;
    min-width: min(360px, 44vw);
}

.app-install-copy strong {
    color: #1E3A5F;
    font-size: .98rem;
    font-weight: 900;
}

.app-install-copy span,
.app-install-copy small {
    color: #526173;
    font-size: .86rem;
    line-height: 1.35;
}

.app-install-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.smartthings-loader {
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 58, 95, .04), rgba(212, 175, 55, .12));
    border: 1px solid rgba(212, 175, 55, .28);
    border-radius: 8px;
    color: #1E3A5F;
    display: none;
    font-size: .88rem;
    font-weight: 900;
    gap: 12px;
    margin: 14px 0;
    padding: 12px 14px;
}

.smartthings-page.is-loading .smartthings-loader {
    display: inline-flex;
}

.smartthings-loader-mark {
    align-items: center;
    background: #1E3A5F;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, .25), 0 10px 24px rgba(30, 58, 95, .18);
    display: inline-flex;
    height: 44px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 50px;
}

.smartthings-loader-mark::after {
    animation: smartthings-loader-sweep 1.6s ease-in-out infinite;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
    content: "";
    inset: -20% auto -20% -70%;
    position: absolute;
    transform: rotate(18deg);
    width: 42%;
}

.smartthings-loader-mark svg {
    animation: smartthings-loader-glow 1.6s ease-in-out infinite;
    fill: none;
    height: 34px;
    position: relative;
    stroke: #D4AF37;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    width: 34px;
    z-index: 1;
}

@keyframes smartthings-loader-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(212, 175, 55, .35));
        transform: translateY(0);
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, .9));
        transform: translateY(-1px);
    }
}

@keyframes smartthings-loader-sweep {
    0% {
        left: -70%;
    }
    55%,
    100% {
        left: 128%;
    }
}

.reseller-portal-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.45fr);
}

.reseller-quick-actions h2,
.reseller-portal-grid h2 {
    color: #0b2442;
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.reseller-commission-big {
    color: #1e3a5f;
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
}

@media (max-width: 1100px) {
    .solar-top-grid,
    .solar-main-grid {
        grid-template-columns: 1fr;
    }

    .solar-hero-copy {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .solar-status-line {
        justify-content: flex-start;
    }

    .solar-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .solar-live-flow {
        min-height: 380px;
    }

    .solar-report-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .solar-flow-card,
    .solar-flow-inverter {
        min-width: 120px;
        padding: 10px;
    }

    .solar-flow-solar {
        left: 7%;
        top: 26px;
    }

    .solar-flow-grid {
        right: 7%;
        top: 26px;
    }

    .solar-flow-battery {
        bottom: 26px;
        left: 7%;
    }

    .solar-flow-home {
        bottom: 26px;
        right: 7%;
    }

    .solar-line-solar {
        left: 27%;
        top: 31%;
        transform: rotate(25deg);
        width: 25%;
    }

    .solar-line-grid {
        left: 54%;
        top: 44%;
        transform: rotate(-25deg);
        width: 23%;
    }

    .solar-line-home {
        left: 55%;
        top: 57%;
        transform: rotate(25deg);
        width: 23%;
    }

    .solar-line-battery {
        left: 28%;
        top: 69%;
        transform: rotate(-25deg);
        width: 24%;
    }
}

@media (max-width: 720px) {
    .solar-hero-panel {
        padding: 14px;
    }

    .solar-status-line,
    .solar-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .solar-metrics-grid,
    .solar-top-grid .solar-metrics-grid,
    .solar-battery-strip,
    .solar-totals-row,
    .solar-report-totals {
        grid-template-columns: 1fr;
    }

    .solar-report-form {
        justify-content: stretch;
    }

    .solar-report-form label,
    .solar-report-form .btn {
        width: 100%;
    }

    .solar-live-flow {
        min-height: 420px;
    }

    .solar-flow-card,
    .solar-flow-inverter {
        min-width: 0;
        padding: 9px;
        width: 112px;
    }

    .solar-flow-card-icon,
    .solar-flow-inverter span {
        font-size: 1rem;
        height: 40px;
        width: 40px;
    }

    .solar-flow-card strong,
    .solar-flow-inverter strong {
        font-size: 0.86rem;
    }

    .solar-flow-card small,
    .solar-flow-card em {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .device-info-modal {
        align-items: stretch;
        padding: 10px;
    }

    .device-info-modal__dialog {
        max-height: calc(100vh - 20px);
    }

    .device-info-row {
        grid-template-columns: 1fr;
    }

    .solar-flow-solar {
        left: 18px;
        top: 18px;
        transform: none;
    }

    .solar-flow-grid {
        right: 18px;
        top: 18px;
    }

    .solar-flow-battery {
        bottom: 18px;
        left: 18px;
    }

    .solar-flow-home {
        bottom: 18px;
        right: 18px;
    }

    .solar-flow-inverter {
        width: 104px;
    }

    .solar-line-solar {
        left: 33%;
        top: 34%;
        transform: rotate(34deg);
        width: 19%;
    }

    .solar-line-grid {
        left: 52%;
        top: 34%;
        transform: rotate(-34deg);
        width: 19%;
    }

    .solar-line-home {
        left: 52%;
        top: 64%;
        transform: rotate(34deg);
        width: 19%;
    }

    .solar-line-battery {
        left: 33%;
        top: 64%;
        transform: rotate(-34deg);
        width: 19%;
    }

    .solar-apartment-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .solar-apartment-values {
        grid-column: 2;
        text-align: left;
    }

    .solar-apartment-badge {
        grid-column: 2;
    }

    .smart-devices-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .smart-devices-status {
        justify-items: start;
    }

    .smart-devices-grid {
        grid-template-columns: 1fr;
    }

    .smart-device-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .smart-device-card .status-pill {
        grid-column: 2;
        justify-self: start;
    }

    .smart-portal-grid,
    .reseller-portal-grid,
    .smart-portal-card {
        grid-template-columns: 1fr;
    }

    .smart-portal-card .btn {
        justify-self: start;
    }
}

@media (max-width: 420px) {
    .solar-live-flow {
        min-height: 390px;
    }

    .solar-flow-card,
    .solar-flow-inverter {
        width: 96px;
    }

    .solar-flow-card-icon,
    .solar-flow-inverter span {
        height: 34px;
        width: 34px;
    }

    .solar-flow-card strong,
    .solar-flow-inverter strong {
        font-size: 0.78rem;
    }

    .solar-flow-card small,
    .solar-flow-card em {
        font-size: 0.66rem;
    }

    .solar-flow-solar,
    .solar-flow-battery {
        left: 10px;
    }

    .solar-flow-grid,
    .solar-flow-home {
        right: 10px;
    }

    .solar-flow-inverter {
        width: 90px;
    }
}

/* Public guest booking website */
.guest-site {
    background: #f5f7fa;
    color: #172033;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.guest-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(30, 58, 95, 0.12);
    display: flex;
    justify-content: space-between;
    min-height: 76px;
    padding: 14px clamp(18px, 5vw, 72px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.guest-brand {
    align-items: center;
    color: #0b2442;
    display: inline-flex;
    font-weight: 800;
    gap: 12px;
    letter-spacing: 0;
    text-decoration: none;
}

.guest-brand img {
    height: 44px;
    width: 44px;
}

.guest-nav {
    align-items: center;
    display: flex;
    gap: 8px;
}

.guest-nav a {
    border-radius: 999px;
    color: #24344d;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
}

.guest-nav a:hover,
.guest-login-link {
    background: #eef3f8;
    color: #0b2442;
}

.guest-language-switcher {
    align-items: center;
    display: flex;
    gap: 6px;
    margin-left: 8px;
}

.guest-language-switcher form {
    margin: 0;
}

.guest-language-switcher button {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.16);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(11, 36, 66, 0.07);
    display: inline-flex;
    font-size: 1.25rem;
    height: 38px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
    width: 38px;
}

.guest-language-switcher button:hover,
.guest-language-switcher button.active {
    border-color: #d4af37;
    transform: translateY(-1px);
}

.guest-language-screen {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 76px);
    padding: clamp(26px, 5vw, 72px) clamp(18px, 5vw, 72px);
}

.guest-construction {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(11, 36, 66, 0.92), rgba(30, 58, 95, 0.72)),
        url("../images/guest-hero-apartment.png") center/cover no-repeat;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 76px);
    padding: clamp(26px, 5vw, 72px) clamp(18px, 5vw, 72px);
}

.guest-construction-panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    max-width: 720px;
    padding: clamp(28px, 5vw, 58px);
    text-align: center;
    width: 100%;
}

.guest-construction-panel h1 {
    color: #0b2442;
    font-size: clamp(2.15rem, 5vw, 4.3rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    margin: 10px 0 16px;
}

.guest-construction-panel p {
    color: #59677a;
    font-size: 1.08rem;
    line-height: 1.7;
    margin: 0 auto;
    max-width: 560px;
}

.guest-construction-contact {
    border-top: 1px solid rgba(30, 58, 95, 0.12);
    color: #0b2442;
    font-weight: 700;
    margin-top: 24px;
    padding-top: 18px;
}

.guest-construction-panel .guest-eyebrow {
    color: #0b2442;
}

.guest-construction-language {
    display: grid;
    gap: 10px;
    justify-items: center;
    margin-top: 22px;
}

.guest-construction-language > span {
    color: #59677a;
    font-weight: 700;
}

.guest-language-switcher.compact {
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 0;
}

.guest-language-panel {
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(11, 36, 66, 0.12);
    max-width: 760px;
    padding: clamp(26px, 5vw, 52px);
    text-align: center;
    width: 100%;
}

.guest-language-logo {
    height: 74px;
    margin-bottom: 18px;
    width: 74px;
}

.guest-language-panel .guest-eyebrow,
.guest-footer strong {
    color: #0b2442;
}

.guest-language-panel h1 {
    color: #0b2442;
    font-size: clamp(2rem, 4vw, 3.7rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
    margin: 8px 0 14px;
}

.guest-language-panel p {
    color: #59677a;
    margin: 0 auto 24px;
    max-width: 520px;
}

.guest-language-form {
    display: grid;
    gap: 22px;
}

.guest-language-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.guest-language-option {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    min-height: 122px;
    padding: 16px 10px;
}

.guest-language-option input {
    opacity: 0;
    position: absolute;
}

.guest-language-option:has(input:checked) {
    background: #fff8e4;
    border-color: #d4af37;
    box-shadow: 0 14px 32px rgba(180, 132, 20, 0.14);
}

.guest-flag {
    font-size: 2.35rem;
    line-height: 1;
}

.guest-cookie-choice {
    background: #f8fafc;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 18px;
    text-align: left;
}

.guest-cookie-choice h2 {
    color: #0b2442;
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
}

.guest-cookie-choice p {
    margin: 0;
}

.guest-cookie-choice label {
    align-items: center;
    display: flex;
    gap: 10px;
    font-weight: 700;
    margin: 0;
}

.guest-cookie-banner {
    align-items: center;
    background: #0b2442;
    border-radius: 8px;
    bottom: 18px;
    box-shadow: 0 22px 55px rgba(11, 36, 66, 0.28);
    color: #fff;
    display: none;
    gap: 18px;
    justify-content: space-between;
    left: 50%;
    max-width: min(760px, calc(100vw - 32px));
    padding: 16px;
    position: fixed;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1100;
}

.guest-cookie-banner.show {
    display: flex;
}

.guest-cookie-banner div:first-child {
    display: grid;
    gap: 2px;
}

.guest-cookie-banner span {
    color: rgba(255, 255, 255, 0.78);
}

.guest-cookie-actions {
    display: flex;
    gap: 8px;
}

.guest-cookie-actions button {
    background: #d4af37;
    border: 0;
    border-radius: 999px;
    color: #0b2442;
    font-weight: 800;
    padding: 10px 14px;
}

.guest-cookie-actions button + button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.guest-hero {
    display: grid;
    gap: clamp(24px, 4vw, 54px);
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    min-height: calc(100vh - 76px);
    padding: clamp(28px, 5vw, 78px) clamp(18px, 5vw, 72px) 42px;
}

.guest-hero-copy {
    align-self: center;
    max-width: 680px;
}

.guest-eyebrow {
    color: #b18422;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.guest-hero h1,
.guest-page-hero h1,
.guest-detail-hero h1,
.guest-success h1 {
    color: #0b2442;
    font-size: clamp(2.2rem, 5vw, 4.9rem);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 0.98;
    margin: 0 0 18px;
}

.guest-hero p,
.guest-page-hero p,
.guest-detail-hero p,
.guest-success p {
    color: #59677a;
    font-size: 1.08rem;
    line-height: 1.75;
    margin: 0;
}

.guest-hero-media {
    align-self: stretch;
    border-radius: 8px;
    min-height: 420px;
    overflow: hidden;
}

.guest-hero-media img,
.guest-detail-hero > img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.guest-hero-slideshow {
    position: relative;
}

.guest-hero-slideshow img {
    inset: 0;
    opacity: 0;
    position: absolute;
    transition: opacity 900ms ease;
}

.guest-hero-slideshow img.active {
    opacity: 1;
}

.guest-search {
    align-items: end;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.13);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(30, 58, 95, 0.12);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    margin-top: 32px;
    padding: 14px;
}

.guest-search-inline {
    margin-top: 28px;
    max-width: 980px;
}

.guest-search label,
.guest-form label {
    color: #536175;
    display: grid;
    font-size: 0.82rem;
    font-weight: 800;
    gap: 7px;
}

.guest-search input,
.guest-form input,
.guest-form select,
.guest-form textarea {
    background: #f8fafc;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    color: #172033;
    font: inherit;
    min-height: 48px;
    padding: 11px 13px;
    width: 100%;
}

.guest-search input.js-date,
.guest-form input.js-date {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 2.75V5.75M17 2.75V5.75M3.75 9.25H20.25M5.75 4.25H18.25C19.3546 4.25 20.25 5.14543 20.25 6.25V18.25C20.25 19.3546 19.3546 20.25 18.25 20.25H5.75C4.64543 20.25 3.75 19.3546 3.75 18.25V6.25C3.75 5.14543 4.64543 4.25 5.75 4.25Z' stroke='%231E3A5F' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M8 13H8.01M12 13H12.01M16 13H16.01M8 16.5H8.01M12 16.5H12.01M16 16.5H16.01' stroke='%23D4AF37' stroke-width='2.3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 20px 20px;
    cursor: pointer;
    padding-right: 46px;
}

.guest-search button,
.guest-btn {
    align-items: center;
    background: #0b2442;
    border: 1px solid #0b2442;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    text-decoration: none;
}

.guest-btn.ghost {
    background: #fff;
    color: #0b2442;
}

.guest-btn.full {
    width: 100%;
}

.guest-section,
.guest-page-hero,
.guest-detail-grid,
.guest-booking-layout,
.guest-success {
    padding: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 72px);
}

.guest-page-hero.compact {
    background: #fff;
    border-bottom: 1px solid rgba(30, 58, 95, 0.1);
    padding-bottom: clamp(28px, 4vw, 54px);
}

.guest-page-hero.compact h1 {
    max-width: 780px;
}

.guest-section-heading {
    align-items: end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.guest-section-heading h2,
.guest-band h2,
.guest-detail-main h2 {
    color: #0b2442;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 850;
    letter-spacing: 0;
    margin: 0;
}

.guest-section-heading a {
    color: #0b2442;
    font-weight: 800;
    text-decoration: none;
}

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

.guest-apartment-card,
.guest-booking-panel,
.guest-form,
.guest-success-card {
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(30, 58, 95, 0.08);
}

.guest-apartment-card {
    overflow: hidden;
}

.guest-card-image {
    aspect-ratio: 1.55 / 1;
    display: block;
    overflow: hidden;
}

.guest-card-image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.guest-apartment-card {
    position: relative;
}

.guest-card-gallery-button {
    align-items: center;
    background: rgba(6, 39, 67, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 800;
    gap: 7px;
    padding: 8px 12px;
    position: absolute;
    right: 14px;
    top: 14px;
    transition: background 180ms ease, transform 180ms ease;
    z-index: 2;
}

.guest-card-gallery-button:hover {
    background: #D4AF37;
    transform: translateY(-1px);
}

.guest-whatsapp-contact {
    align-items: center;
    background: #1fa855;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    bottom: 22px;
    box-shadow: 0 18px 42px rgba(31, 168, 85, 0.32);
    color: #fff;
    display: inline-flex;
    font-weight: 850;
    gap: 10px;
    padding: 13px 18px;
    position: fixed;
    right: 22px;
    text-decoration: none;
    z-index: 1055;
}

.guest-whatsapp-contact i {
    font-size: 1.45rem;
}

.guest-whatsapp-contact:hover {
    background: #168d46;
    color: #fff;
}

.settings-image-preview {
    align-items: center;
    background: #f5f7fa;
    border: 1px solid #dbe3ee;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 8px;
}

.settings-image-preview img {
    border-radius: 6px;
    height: 54px;
    object-fit: cover;
    width: 78px;
}

.settings-image-preview span {
    color: #59677a;
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}

.guest-card-body,
.guest-card-actions {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px;
}

.guest-card-body h3 {
    color: #0b2442;
    font-size: 1.12rem;
    margin: 0 0 5px;
}

.guest-card-body p,
.guest-card-meta span,
.guest-booking-panel small {
    color: #647287;
    margin: 0;
}

.guest-card-meta {
    text-align: right;
}

.guest-card-meta strong,
.guest-booking-panel strong,
.guest-success-card strong {
    color: #0b2442;
    display: block;
    font-size: 1.45rem;
    line-height: 1.1;
}

.guest-band {
    align-items: center;
    background: #0b2442;
    color: #fff;
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    padding: clamp(34px, 5vw, 72px);
}

.guest-band h2 {
    color: #fff;
}

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

.guest-benefits span {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    font-weight: 800;
    padding: 16px;
}

.guest-empty,
.guest-alert,
.guest-availability-result,
.guest-date-range-message {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.guest-empty {
    background: #fff;
    border: 1px dashed #cbd6e2;
    color: #647287;
}

.guest-alert,
.guest-availability-result.blocked,
.guest-date-range-message.blocked {
    background: #fff0f0;
    border: 1px solid #f3b8b8;
    color: #9f1d1d;
}

.guest-availability-result.ok,
.guest-date-range-message.ok {
    background: #edf8f1;
    border: 1px solid #b9e5c6;
    color: #176a35;
}

.guest-date-range-message:empty {
    display: none;
}

.guest-search .guest-date-range-message {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.guest-detail-hero {
    background: #fff;
    display: grid;
    gap: clamp(22px, 4vw, 52px);
    grid-template-columns: minmax(0, 0.8fr) minmax(380px, 1.2fr);
    padding: clamp(28px, 5vw, 72px);
}

.guest-detail-hero > div {
    align-self: center;
}

.guest-hero-media {
    background: transparent;
    border: 0;
    cursor: zoom-in;
    display: block;
    padding: 0;
    position: relative;
}

.guest-hero-media > img,
.guest-hero-media > video {
    aspect-ratio: 1.45 / 1;
    border-radius: 8px;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.guest-hero-media > span,
.guest-gallery-thumb > span {
    align-items: center;
    background: rgba(6, 39, 67, 0.84);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    height: 42px;
    justify-content: center;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
}

.guest-detail-actions,
.guest-card-actions {
    flex-wrap: wrap;
}

.guest-detail-grid,
.guest-booking-layout {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.guest-detail-main {
    max-width: 860px;
}

.guest-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0;
}

.guest-feature-row span {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 999px;
    display: inline-flex;
    gap: 8px;
    padding: 10px 13px;
}

.guest-media-gallery {
    margin-top: 24px;
}

.guest-gallery-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.guest-gallery-thumb {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: zoom-in;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.guest-gallery-thumb.active {
    border-color: #D4AF37;
}

.guest-gallery-thumb img,
.guest-gallery-thumb video {
    aspect-ratio: 1.45 / 1;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.guest-lightbox[hidden] {
    display: none;
}

.guest-lightbox {
    align-items: center;
    background: rgba(3, 14, 25, 0.92);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    padding: 56px 72px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 4000;
}

.guest-lightbox-open {
    overflow: hidden;
}

.guest-lightbox-stage {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    width: 100%;
}

.guest-lightbox-stage img,
.guest-lightbox-stage video {
    border-radius: 8px;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.guest-lightbox-close,
.guest-lightbox-nav {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    position: fixed;
    width: 44px;
}

.guest-lightbox-close {
    right: 24px;
    top: 20px;
}

.guest-lightbox-nav.prev {
    left: 20px;
}

.guest-lightbox-nav.next {
    right: 20px;
}

.guest-lightbox-count {
    bottom: 22px;
    color: #fff;
    font-weight: 700;
    position: fixed;
}

.guest-hero-slideshow {
    cursor: default;
}

.apartment-media-admin-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.apartment-media-admin-card {
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    padding: 12px;
}

.apartment-media-admin-preview {
    background: #f5f7fa;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.apartment-media-admin-preview img,
.apartment-media-admin-preview video {
    aspect-ratio: 1.45 / 1;
    display: block;
    object-fit: cover;
    width: 100%;
}

.apartment-media-admin-preview span {
    background: #D4AF37;
    border-radius: 999px;
    color: #071633;
    font-size: .75rem;
    font-weight: 800;
    padding: 4px 9px;
    position: absolute;
    right: 8px;
    top: 8px;
}

.guest-booking-panel {
    display: grid;
    gap: 8px;
    padding: 20px;
    position: sticky;
    top: 96px;
}

.guest-booking-panel hr {
    border: 0;
    border-top: 1px solid #d8e0ea;
    margin: 12px 0;
    width: 100%;
}

.guest-form {
    display: grid;
    gap: 18px;
    padding: 20px;
}

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

.guest-success {
    margin: 0 auto;
    max-width: 760px;
    text-align: center;
}

.guest-success-card {
    display: grid;
    gap: 8px;
    margin: 24px auto;
    max-width: 420px;
    padding: 20px;
}

.guest-footer {
    align-items: center;
    background: #fff;
    border-top: 1px solid rgba(30, 58, 95, 0.12);
    display: flex;
    justify-content: space-between;
    padding: 24px clamp(18px, 5vw, 72px);
}

.guest-footer span,
.guest-footer a {
    color: #647287;
}

.guest-footer > div,
.guest-footer-links {
    display: flex;
    gap: 14px;
}

.guest-footer > div:first-child {
    flex-direction: column;
    gap: 2px;
}

.guest-footer a {
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 1100px) {
    .guest-hero,
    .guest-detail-hero,
    .guest-detail-grid,
    .guest-booking-layout,
    .guest-band {
        grid-template-columns: 1fr;
    }

    .guest-hero {
        min-height: 0;
    }

    .guest-hero-media {
        min-height: 360px;
    }

    .guest-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guest-booking-panel {
        position: static;
    }
}

@media (max-width: 720px) {
    .guest-header,
    .guest-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .guest-brand img {
        height: 38px;
        width: 38px;
    }

    .guest-nav {
        overflow-x: auto;
        width: 100%;
    }

    .guest-language-switcher {
        margin-left: 0;
    }

    .guest-hero h1,
    .guest-page-hero h1,
    .guest-detail-hero h1,
    .guest-success h1 {
        font-size: 2.35rem;
        line-height: 1.04;
    }

    .guest-search,
    .guest-form-grid,
    .guest-card-grid,
    .guest-benefits,
    .guest-gallery-strip,
    .guest-language-grid {
        grid-template-columns: 1fr;
    }

    .guest-lightbox {
        padding: 64px 14px 52px;
    }

    .guest-lightbox-nav {
        bottom: 18px;
        top: auto;
    }

    .guest-lightbox-nav.prev {
        left: 18px;
    }

    .guest-lightbox-nav.next {
        right: 18px;
    }

    .guest-whatsapp-contact {
        bottom: 14px;
        padding: 12px 14px;
        right: 14px;
    }

    .guest-whatsapp-contact span {
        display: none;
    }

    .guest-language-option {
        flex-direction: row;
        justify-content: flex-start;
        min-height: 72px;
        padding: 12px 14px;
    }

    .guest-cookie-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .guest-cookie-actions {
        width: 100%;
    }

    .guest-cookie-actions button {
        flex: 1;
    }

    .app-install-prompt {
        align-items: stretch;
        flex-wrap: wrap;
        left: 14px;
        right: 14px;
        transform: none;
        width: auto;
    }

    .app-install-copy {
        flex: 1 1 calc(100% - 72px);
        min-width: 0;
    }

    .app-install-actions {
        flex: 1 1 100%;
    }

    .app-install-actions .btn {
        flex: 1;
    }

    .guest-hero-media {
        min-height: 280px;
    }

    .guest-section-heading,
    .guest-card-body,
    .guest-card-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .guest-card-meta {
        text-align: left;
    }
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--ahpm-bg);
    color: var(--ahpm-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    text-decoration: none;
}

.btn-primary {
    --bs-btn-bg: var(--ahpm-primary);
    --bs-btn-border-color: var(--ahpm-primary);
    --bs-btn-hover-bg: #162d4a;
    --bs-btn-hover-border-color: #162d4a;
}

.btn-outline-primary {
    --bs-btn-color: var(--ahpm-primary);
    --bs-btn-border-color: var(--ahpm-primary);
    --bs-btn-hover-bg: var(--ahpm-primary);
    --bs-btn-hover-border-color: var(--ahpm-primary);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 72px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ahpm-primary);
    color: #fff;
}

.topbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
}

.brand-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.brand-logo-text {
    display: grid;
    gap: 1px;
    line-height: 1.05;
}

.brand-logo-text strong {
    color: var(--ahpm-accent);
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: .02em;
}

.brand-logo-text small {
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: inherit;
}

.icon-button:hover,
.icon-button:focus {
    border-color: rgba(212, 175, 55, .55);
    background: rgba(255, 255, 255, .08);
}

.logo-mark,
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 40px;
    border: 2px solid var(--ahpm-accent);
    color: var(--ahpm-accent);
    font-weight: 800;
    letter-spacing: 0;
}

.ahpm-logo {
    width: 54px;
    height: 54px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--ahpm-accent);
}

.ahpm-logo svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ahpm-logo svg path {
    fill: none !important;
    stroke: currentColor;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-search {
    width: min(320px, 32vw);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(30, 58, 95, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #1E3A5F;
    box-shadow: 0 10px 24px rgba(30, 58, 95, 0.07);
}

.topbar-search input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #212529;
    font-size: 0.92rem;
}

.topbar-search input::placeholder {
    color: #667085;
}

.topbar-avatar,
.user-avatar {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: #eef3f8;
    color: var(--ahpm-primary);
    object-fit: cover;
}

.user-avatar.lg {
    width: 74px;
    height: 74px;
    font-size: 1.55rem;
}

.user-list-person,
.user-photo-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu-button {
    border: 0;
    background: transparent;
    color: #fff;
}

.user-menu-button:hover,
.user-menu-button:focus {
    color: #fff;
}

.role-badge {
    padding: 3px 8px;
    border: 1px solid rgba(212, 175, 55, .7);
    border-radius: 999px;
    color: var(--ahpm-accent);
    font-size: .78rem;
    font-weight: 700;
}

.account-panel {
    display: grid;
    gap: 24px;
}

.account-avatar {
    color: var(--ahpm-primary);
    font-size: 3.5rem;
}

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    padding: 20px 14px;
    background: #fff;
    border-right: 1px solid var(--ahpm-border);
    transition: width .2s ease, flex-basis .2s ease, transform .2s ease;
    z-index: 1030;
}

.sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 14px;
    color: var(--ahpm-primary);
    font-weight: 800;
}

.sidebar-close {
    color: var(--ahpm-primary);
}

.sidebar-overlay {
    display: none;
}

body.sidebar-collapsed .sidebar {
    width: 76px;
    flex-basis: 76px;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
}

body.sidebar-collapsed .sidebar-link span {
    display: none;
}

body.sidebar-collapsed .sidebar-link .sidebar-badge,
body.sidebar-collapsed .sidebar-link .sidebar-alert {
    position: absolute;
    top: 5px;
    right: 6px;
    display: inline-grid;
}

body.sidebar-collapsed .sidebar-link.active {
    border-left-width: 0;
    box-shadow: inset 0 -3px 0 var(--ahpm-accent);
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 4px 18px;
    padding: 10px 8px 16px;
    border-bottom: 1px solid rgba(212, 175, 55, .32);
    color: var(--ahpm-primary);
}

.sidebar-brand strong {
    display: block;
    color: var(--ahpm-primary);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.05;
}

.sidebar-brand small {
    display: block;
    color: var(--ahpm-muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
}

body.sidebar-collapsed .sidebar-brand span:last-child {
    display: none;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--ahpm-text);
    border-radius: 8px;
}

.sidebar-link > span:first-of-type {
    min-width: 0;
    flex: 1;
}

.sidebar-badge,
.sidebar-alert {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
}

.sidebar-badge {
    background: #dc3545;
    color: #fff;
}

.sidebar-alert {
    background: #dc3545;
    color: #fff;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #eef3f8;
    color: var(--ahpm-primary);
}

.sidebar-link.active {
    border-left: 4px solid var(--ahpm-accent);
}

.sidebar-group {
    display: grid;
    gap: 4px;
    border-radius: 10px;
}

.sidebar-group-label {
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    background: transparent;
}

.sidebar-chevron {
    margin-left: auto;
    font-size: .72rem;
    opacity: .75;
    transition: transform .18s ease;
}

.sidebar-submenu {
    display: none;
    gap: 4px;
    margin-left: 16px;
    padding-left: 8px;
    border-left: 1px solid rgba(30, 58, 95, .14);
}

.sidebar-group.open .sidebar-submenu {
    display: grid;
}

.sidebar-group.open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-sublink {
    min-height: 38px;
    padding: 8px 10px;
    font-size: .92rem;
}

.sidebar-sublink i {
    width: 18px;
    font-size: .9rem;
}

body.sidebar-collapsed .sidebar-submenu,
body.sidebar-collapsed .sidebar-chevron {
    display: none;
}

.financial-settings-grid {
    display: grid;
    gap: 18px;
}

.financial-settings-grid h2,
.finance-review-layout h2 {
    color: var(--ahpm-primary);
    font-size: 1rem;
    font-weight: 900;
    margin: 0 0 14px;
}

.financial-settings-table {
    max-height: 520px;
    overflow: auto;
}

.finance-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
    gap: 18px;
}

.finance-document-preview {
    width: 100%;
    min-height: 540px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.finance-bill-entry-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(430px, .95fr);
    gap: 22px;
    align-items: start;
}

.finance-bill-preview {
    position: sticky;
    top: 92px;
}

.finance-bill-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.finance-bill-preview-header h2,
.finance-form-section h3 {
    color: var(--ahpm-primary);
    font-size: 1rem;
    font-weight: 900;
    margin: 0;
}

.finance-bill-fields {
    display: grid;
    gap: 16px;
}

.finance-form-section {
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    padding: 16px;
    background: #fff;
}

.finance-form-section h3 {
    margin-bottom: 14px;
}

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

.finance-total-input {
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #d8e1ef;
    padding: 10px;
}

.finance-total-input .form-label {
    color: var(--ahpm-primary);
    font-weight: 900;
}

.invoice-lines {
    display: grid;
    gap: 12px;
}

.invoice-line-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.5fr) repeat(5, minmax(92px, .75fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.invoice-line-remove {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
}

.invoice-total-box {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: flex-end;
    padding: 14px;
    border-radius: 8px;
    background: #eef3f8;
    color: var(--ahpm-primary);
}

.finance-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.finance-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.finance-badge.open {
    background: #e0f2fe;
    color: #075985;
}

.finance-badge.partial {
    background: #fef3c7;
    color: #92400e;
}

.finance-badge.overdue,
.finance-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.finance-inline-payment {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.finance-inline-payment .form-control {
    width: 110px;
}

.finance-inline-payment [name="payment_date"] {
    width: 120px;
}

.finance-inline-payment .form-select {
    width: 92px;
}

.finance-payment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.finance-payment-summary span {
    border: 1px solid #d8e1ef;
    border-radius: 8px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
    gap: 2px;
    padding: 10px 12px;
}

.finance-payment-summary strong {
    color: #0b2341;
    font-size: 1rem;
}

.finance-payment-form {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.finance-pdf-modal-preview {
    border: 0;
    display: block;
    height: min(78vh, 900px);
    width: 100%;
}

@media (max-width: 768px) {
    .finance-payment-summary {
        grid-template-columns: 1fr;
    }

    .finance-pdf-modal-preview {
        height: 70vh;
    }
}

@media (max-width: 1500px) {
    .invoice-line-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .invoice-line-description {
        grid-column: span 2;
    }

    .invoice-line-remove {
        width: 100%;
    }
}

@media (max-width: 1180px) {
    .finance-bill-entry-layout {
        grid-template-columns: 1fr;
    }

    .finance-bill-preview {
        position: static;
    }

    .finance-document-preview {
        min-height: 430px;
    }
}

.app-main {
    flex: 1;
    min-width: 0;
    padding: 28px;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1,
.brand-lockup h1 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 2rem;
    font-weight: 800;
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--ahpm-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric-card,
.content-panel,
.auth-card {
    background: #fff;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
}

.metric-card {
    min-height: 118px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f8f2de;
    color: var(--ahpm-primary);
    font-size: 1.25rem;
}

.metric-value {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--ahpm-primary);
}

.metric-label,
.panel-heading span,
.empty-state p {
    color: var(--ahpm-muted);
}

.content-panel {
    padding: 24px;
    max-width: 100%;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--ahpm-border);
}

.panel-heading h2 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.empty-state {
    min-height: 280px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
}

.empty-state i {
    color: var(--ahpm-accent);
    font-size: 2.5rem;
}

.empty-state h3 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 1.35rem;
}

.empty-state.compact {
    min-height: 220px;
}

.table {
    margin-bottom: 0;
    min-width: 720px;
}

.table thead th {
    color: var(--ahpm-primary);
    font-size: .82rem;
    text-transform: uppercase;
    border-bottom-color: var(--ahpm-border);
}

.table tbody td {
    color: var(--ahpm-text);
    border-bottom-color: #eef2f6;
}

.table tfoot td {
    border-top: 2px solid var(--ahpm-border);
}

.table-toolbar {
    display: flex;
    justify-content: flex-start;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-toolbar .form-select {
    min-width: 120px;
}

.table-toolbar-count {
    margin-left: auto;
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.table-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-total-row td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #f5f7fa;
    color: var(--ahpm-primary);
    font-weight: 800;
}

.table-pagination {
    margin-top: 14px;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.reservation-guest-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.reservation-source-badge {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    border-radius: 999px;
    color: #fff;
    font-size: .72rem;
    box-shadow: 0 8px 16px rgba(16, 42, 67, .10);
}

.reservation-source-badge.airbnb {
    background: #ff6b8a;
}

.reservation-source-badge.booking {
    background: #2f6df6;
}

.reservation-source-badge.direct {
    background: #19c5ac;
}

.reservation-source-badge.other {
    background: #d4af37;
    color: #102a43;
}

.search-results-list {
    display: grid;
    gap: 10px;
}

.search-result-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dde6ef;
    border-radius: 8px;
    color: #102a43;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.search-result-item:hover {
    border-color: #D4AF37;
    box-shadow: 0 12px 24px rgba(16, 42, 67, 0.08);
    transform: translateY(-1px);
}

.search-result-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f5f7fa;
    color: #1E3A5F;
}

.search-result-item strong,
.search-result-item small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item small {
    margin-top: 2px;
    color: #667085;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--ahpm-primary);
    font-size: .82rem;
    font-weight: 700;
}

.status-pill.reservation-status-checked_in {
    background: #dcfce7;
    color: #166534;
}

.status-pill.reservation-status-checked_out {
    background: #eef2f7;
    color: #475467;
}

.dashboard-page {
    display: grid;
    gap: 18px;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.dashboard-hero h1 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 2rem;
    font-weight: 850;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-flow-panel {
    overflow: hidden;
    padding: 0;
}

.dashboard-flow-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #e4ebf3;
}

.dashboard-flow-heading h2 {
    margin: 2px 0 0;
    color: var(--ahpm-primary);
    font-size: 1.15rem;
    font-weight: 850;
}

.dashboard-flow-heading p {
    margin: 2px 0 0;
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.dashboard-flow-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.calendar-period-form {
    min-width: min(100%, 520px);
}

.calendar-period-form .input-group {
    flex-wrap: nowrap;
}

.calendar-period-form .form-control {
    min-width: 104px;
}

.dashboard-flow-scroll {
    overflow: auto;
    max-height: 430px;
}

.dashboard-flow-grid {
    --resource-width: 250px;
    --day-width: 118px;
    min-width: calc(var(--resource-width) + (var(--day-count) * var(--day-width)));
    display: grid;
    grid-template-columns: var(--resource-width) repeat(var(--day-count), var(--day-width));
    grid-auto-rows: 74px;
}

.calendar-flow-panel .dashboard-flow-grid {
    --resource-width: 270px;
    --day-width: 108px;
}

.dashboard-flow-corner,
.dashboard-flow-day,
.dashboard-flow-apartment,
.dashboard-flow-cell {
    border-right: 1px solid #dfe7f0;
    border-bottom: 1px solid #dfe7f0;
}

.dashboard-flow-corner {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 8;
    display: grid;
    align-content: center;
    padding: 10px 14px;
    background: #fff;
}

.dashboard-flow-corner strong,
.dashboard-flow-corner small {
    display: block;
}

.dashboard-flow-corner strong {
    color: var(--ahpm-primary);
}

.dashboard-flow-corner small {
    color: var(--ahpm-muted);
    font-size: .8rem;
}

.dashboard-flow-day {
    position: sticky;
    top: 0;
    z-index: 7;
    display: grid;
    place-items: center;
    align-content: center;
    background: #fff;
    text-align: center;
}

.dashboard-flow-day.weekend {
    background: #f8fbff;
}

.dashboard-flow-day.today {
    background: #fff8df;
    box-shadow: inset 0 -3px 0 var(--ahpm-gold);
}

.dashboard-flow-day span,
.dashboard-flow-day small {
    color: var(--ahpm-muted);
    font-size: .72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.dashboard-flow-day strong {
    color: #16243a;
    font-size: 1.18rem;
    line-height: 1.05;
}

.dashboard-flow-apartment {
    position: sticky;
    left: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    background: rgba(255, 255, 255, .98);
}

.dashboard-flow-apartment img,
.dashboard-flow-apartment-fallback {
    width: 52px;
    height: 46px;
    border-radius: 7px;
    object-fit: cover;
}

.dashboard-flow-apartment-fallback {
    display: grid;
    place-items: center;
    background: #eef3f8;
    color: var(--ahpm-primary);
}

.dashboard-flow-apartment strong,
.dashboard-flow-apartment small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-flow-apartment strong {
    color: var(--ahpm-primary);
    font-size: .92rem;
}

.dashboard-flow-apartment small {
    color: var(--ahpm-muted);
    font-size: .76rem;
}

.dashboard-flow-lane {
    grid-column: span var(--day-count);
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--day-count), var(--day-width));
}

.dashboard-flow-cell {
    position: relative;
    min-width: 0;
    background:
        linear-gradient(180deg, transparent 0 59%, rgba(30, 58, 95, .04) 59% 60%, transparent 60%),
        #fff;
}

.dashboard-flow-cell.weekend {
    background: #fbfdff;
}

.dashboard-flow-rate {
    position: absolute;
    right: 7px;
    bottom: 7px;
    color: #475467;
    font-size: .72rem;
}

.dashboard-flow-booking {
    position: absolute;
    z-index: 4;
    top: 21px;
    height: 31px;
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: calc(100% - 8px);
    padding: 0 10px;
    color: #102a43;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 850;
    overflow: hidden;
    white-space: nowrap;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    box-shadow: 0 8px 18px rgba(16, 42, 67, .08);
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    margin: 0;
}

.dashboard-flow-booking i {
    width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(30, 58, 95, .8);
    color: #fff;
    font-size: .64rem;
}

.dashboard-flow-booking span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-flow-booking.airbnb {
    background: color-mix(in srgb, #ff6b8a 28%, white);
    border-left: 4px solid #ff6b8a;
}

.dashboard-flow-booking.booking {
    background: color-mix(in srgb, #6a7cff 22%, white);
    border-left: 4px solid #6a7cff;
}

.dashboard-flow-booking.direct {
    background: color-mix(in srgb, #19c5ac 30%, white);
    border-left: 4px solid #19c5ac;
}

.dashboard-flow-booking.other {
    background: color-mix(in srgb, #d4af37 26%, white);
    border-left: 4px solid #d4af37;
}

.dashboard-flow-booking.blocked {
    background: #344054;
    border-left: 4px solid #111827;
    color: #fff;
}

.dashboard-flow-booking.blocked i {
    background: rgba(255, 255, 255, .18);
}

.dashboard-flow-booking.checked_in {
    background: #dcfce7;
    border-left-color: #16a34a;
    color: #14532d;
}

.dashboard-flow-booking.checked_in i {
    background: #16a34a;
}

.dashboard-flow-booking.checked_out {
    background: #eef2f7;
    border-left-color: #667085;
    color: #344054;
}

.dashboard-flow-booking.checked_out i {
    background: #667085;
}

.dashboard-flow-delete {
    position: absolute;
    top: 4px;
    right: 7px;
    width: 18px;
    height: 18px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    display: inline-grid;
    place-items: center;
    padding: 0;
    box-shadow: 0 7px 14px rgba(15, 32, 55, .18);
    opacity: 0;
    transform: scale(.88);
    transition: opacity .16s ease, transform .16s ease;
}

.dashboard-flow-booking .dashboard-flow-delete i {
    width: auto;
    height: auto;
    background: transparent;
    font-size: .62rem;
    color: #fff;
    border-radius: 0;
}

.dashboard-flow-booking:hover .dashboard-flow-delete,
.dashboard-flow-booking:focus-within .dashboard-flow-delete {
    opacity: 1;
    transform: scale(1);
}

.dashboard-flow-booking.pending {
    border-style: dashed;
}

.calendar-event-checked_in {
    --fc-event-bg-color: #16a34a;
    --fc-event-border-color: #15803d;
}

.calendar-event-checked_out {
    opacity: .78;
}

.dashboard-flow-turnover {
    position: absolute;
    inset: 14px 9px auto;
    height: 42px;
    border: 1px solid #e7b7b7;
    border-radius: 7px;
    background:
        linear-gradient(135deg, rgba(255, 107, 138, .24) 0 48%, transparent 49%),
        linear-gradient(315deg, rgba(25, 197, 172, .24) 0 48%, transparent 49%);
}

.dashboard-flow-turnover i {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 3px 7px;
    border-radius: 999px;
    background: #fff;
    color: #b42318;
    font-size: .62rem;
    font-style: normal;
    font-weight: 900;
    box-shadow: 0 5px 12px rgba(16, 42, 67, .10);
}

.dashboard-flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #e4ebf3;
    color: var(--ahpm-muted);
    font-size: .82rem;
}

.dashboard-flow-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.dashboard-flow-legend i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dashboard-flow-legend .airbnb { background: #ff6b8a; }
.dashboard-flow-legend .booking { background: #6a7cff; }
.dashboard-flow-legend .direct { background: #19c5ac; }
.dashboard-flow-legend .other { background: #d4af37; }
.dashboard-flow-legend .checked-in { background: #16a34a; }
.dashboard-flow-legend .blocked { background: #344054; }
.dashboard-flow-legend .turnover { background: linear-gradient(135deg, rgba(255, 107, 138, .7) 0 50%, rgba(25, 197, 172, .7) 51%); }

.dashboard-kpi-card {
    min-height: 118px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 58, 95, .06);
    color: var(--ahpm-text);
}

.dashboard-kpi-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(30, 58, 95, .10);
}

.dashboard-kpi-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    font-size: 1.35rem;
}

.dashboard-kpi-icon.navy { background: linear-gradient(135deg, #0b2545, #1e3a5f); }
.dashboard-kpi-icon.gold { background: linear-gradient(135deg, #b78b1d, #d4af37); }
.dashboard-kpi-icon.teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.dashboard-kpi-icon.blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }

.dashboard-kpi-label {
    color: var(--ahpm-primary);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-kpi-value {
    color: #0b1736;
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1.15;
}

.dashboard-kpi-card span {
    color: #1d4ed8;
    font-size: .85rem;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 14px;
}

.dashboard-grid .content-panel {
    box-shadow: 0 8px 24px rgba(30, 58, 95, .055);
}

.dashboard-chart-main {
    min-height: 420px;
}

.dashboard-chart-wrap {
    height: 330px;
    padding-top: 18px;
}

.dashboard-small-chart {
    height: 210px;
    padding-top: 18px;
}

.dashboard-calendar-card {
    min-height: 420px;
    overflow: hidden;
}

.dashboard-calendar.compact {
    padding: 12px 10px 0 0;
    max-width: 100%;
    overflow: hidden;
    font-size: .82rem;
}

.dashboard-calendar.compact .fc-toolbar-title {
    color: var(--ahpm-primary);
    font-size: .92rem;
    font-weight: 800;
}

.dashboard-calendar.compact .fc-header-toolbar {
    gap: 6px;
    margin-bottom: 8px;
    padding-right: 4px;
}

.dashboard-calendar.compact .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-calendar.compact .fc-button {
    padding: 3px 7px;
    border-radius: 8px;
    background: #fff;
    border-color: var(--ahpm-border);
    color: var(--ahpm-primary);
    font-size: .72rem;
}

.dashboard-calendar.compact .fc-scrollgrid,
.dashboard-calendar.compact .fc-view-harness,
.dashboard-calendar.compact .fc-daygrid,
.dashboard-calendar.compact table {
    max-width: 100%;
}

.dashboard-calendar.compact .fc-col-header-cell-cushion,
.dashboard-calendar.compact .fc-daygrid-day-number {
    padding: 3px;
    font-size: .72rem;
}

.dashboard-calendar.compact .fc-daygrid-day-frame {
    min-height: 43px;
}

.dashboard-calendar.compact .fc-daygrid-event {
    margin: 1px 2px;
    padding: 1px 2px;
    font-size: .65rem;
}

.dashboard-list {
    display: grid;
    gap: 12px;
    padding-top: 16px;
}

.dashboard-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f6;
}

.dashboard-list-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.dashboard-list-item strong {
    display: block;
    color: #0b1736;
}

.dashboard-list-item span:not(.badge) {
    display: block;
    color: var(--ahpm-muted);
    font-size: .88rem;
}

.dashboard-list-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.dashboard-arrivals-card {
    grid-row: span 2;
}

.dashboard-empty-line {
    padding-top: 18px;
    color: var(--ahpm-muted);
}

.dashboard-bottom-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-bottom-strip a {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--ahpm-text);
}

.dashboard-bottom-strip i {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f8f2de;
    color: var(--ahpm-primary);
    font-size: 1.1rem;
}

.dashboard-bottom-strip span {
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.dashboard-bottom-strip strong {
    color: var(--ahpm-primary);
    font-size: 1.2rem;
}

.form-panel {
    max-width: 980px;
}

.form-label {
    color: var(--ahpm-primary);
    font-weight: 700;
}

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

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

.settings-grid > div {
    padding: 18px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.settings-label {
    display: block;
    margin-bottom: 6px;
    color: var(--ahpm-muted);
    font-size: .85rem;
}

.report-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 240px)) auto;
    align-items: end;
    gap: 16px;
}

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

.report-total-row td {
    background: #f5f7fa;
    color: var(--ahpm-primary);
    font-weight: 800;
}

.report-chart-panel {
    min-height: 360px;
}

.report-chart-panel canvas {
    margin-top: 18px;
    max-height: 260px;
}

.audit-json {
    display: block;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-panel {
    overflow-x: auto;
}

#reservationCalendar {
    min-width: 760px;
}

.dashboard-calendar {
    min-width: 760px;
    padding-top: 18px;
}

.fc {
    color: var(--ahpm-text);
}

.fc .fc-toolbar-title {
    color: var(--ahpm-primary);
    font-size: 1.35rem;
    font-weight: 800;
}

.fc .fc-button-primary {
    background: var(--ahpm-primary);
    border-color: var(--ahpm-primary);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: #162d4a;
    border-color: #162d4a;
}

.fc-event {
    border: 1px solid;
    padding: 2px 4px;
}

.calendar-event-confirmed {
    background: var(--ahpm-primary);
}

.calendar-event-pending {
    background: var(--ahpm-accent);
    color: #1b1b1b;
}

.calendar-event-cancelled {
    background: #6c757d;
}

.app-footer {
    padding: 14px 28px;
    background: #fff;
    border-top: 1px solid var(--ahpm-border);
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.auth-page {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(30, 58, 95, .96) 0%, rgba(30, 58, 95, .92) 46%, rgba(245, 247, 250, .98) 46%, rgba(245, 247, 250, 1) 100%),
        #f5f7fa;
}

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

.auth-card {
    width: 100%;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(10, 25, 47, .25);
}

.login-shell {
    width: min(100%, 1040px);
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(360px, .78fr);
    overflow: hidden;
    border: 1px solid rgba(223, 229, 236, .9);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(10, 25, 47, .22);
}

.login-brand-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    padding: 42px;
    background: #1e3a5f;
    color: #fff;
}

.login-brand-panel::after {
    content: "";
    width: 100%;
    height: 1px;
    display: block;
    background: linear-gradient(90deg, rgba(212, 175, 55, .9), rgba(255, 255, 255, 0));
}

.login-brand-lockup,
.login-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand-lockup strong,
.login-brand-lockup span,
.login-card-header h2,
.login-card-header p {
    display: block;
}

.login-brand-lockup strong {
    font-size: 1.2rem;
    line-height: 1.1;
}

.login-brand-lockup span {
    margin-top: 4px;
    color: rgba(255, 255, 255, .7);
    font-size: .86rem;
    font-weight: 700;
}

.login-logo {
    width: 70px;
    height: 70px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--ahpm-accent);
}

.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.login-brand-panel .login-logo {
    color: var(--ahpm-accent);
}

.login-logo.compact {
    width: 54px;
    height: 54px;
    color: var(--ahpm-accent);
}

.login-brand-copy {
    max-width: 460px;
}

.login-brand-copy .eyebrow {
    color: var(--ahpm-accent);
}

.login-brand-copy h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: .98;
    font-weight: 850;
}

.login-brand-copy p {
    max-width: 420px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 1.02rem;
    line-height: 1.65;
}

.login-card {
    align-self: center;
    justify-self: center;
    width: min(100%, 420px);
    border: 0;
    box-shadow: none;
}

.login-card-header {
    margin-bottom: 30px;
}

.login-card-header h2 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 1.75rem;
    font-weight: 850;
}

.login-card-header p {
    margin: 4px 0 0;
    color: var(--ahpm-muted);
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ahpm-muted);
    pointer-events: none;
}

.login-input-wrap .form-control {
    min-height: 50px;
    padding-left: 42px;
    border-radius: 8px;
}

.login-submit {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 8px;
    font-weight: 800;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-lockup p {
    margin: 4px 0 0;
    color: var(--ahpm-muted);
    font-size: .85rem;
    font-weight: 700;
}

.brand-mark {
    width: 70px;
    height: 50px;
    color: var(--ahpm-primary);
}

.demo-login {
    color: var(--ahpm-muted);
    font-size: .9rem;
    text-align: center;
}

.error-page {
    display: grid;
    place-items: center;
    text-align: center;
}

.cleaning-mobile {
    display: grid;
    gap: 16px;
    padding-bottom: 110px;
}

.cleaning-summary-panel,
.cleaning-report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cleaning-summary-panel h2,
.cleaning-report-head h2,
.cleaning-category h2 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 1.15rem;
    font-weight: 800;
}

.cleaning-summary-panel p,
.cleaning-report-head p {
    margin: 4px 0 0;
    color: var(--ahpm-muted);
}

.cleaning-status-select {
    width: min(100%, 240px);
}

.cleaning-time-card {
    height: 100%;
    min-height: 62px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.cleaning-time-card span {
    color: var(--ahpm-muted);
    font-size: .88rem;
}

.cleaning-time-card strong {
    color: var(--ahpm-primary);
}

.cleaning-category {
    padding: 18px;
}

.cleaning-checklist-list,
.cleaning-report-items {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.cleaning-check-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #fff;
}

.cleaning-check-row .form-check-input {
    width: 24px;
    height: 24px;
    margin: 1px 0 0;
}

.cleaning-check-row label {
    min-width: 0;
    margin: 0;
}

.cleaning-check-row label strong {
    display: block;
    color: var(--ahpm-primary);
}

.cleaning-check-row label span {
    display: block;
    margin-top: 2px;
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.cleaning-check-row textarea {
    grid-column: 2;
    resize: vertical;
}

.cleaning-action-bar {
    position: fixed;
    bottom: 0;
    right: 28px;
    left: calc(260px + 28px);
    z-index: 1040;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 12px 12px 0 0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(10, 25, 47, .08);
    backdrop-filter: blur(8px);
}

body.sidebar-collapsed .cleaning-action-bar {
    left: calc(86px + 28px);
}

.cleaning-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.cleaning-photo-grid a,
.cleaning-photo-tile {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #eef2f7;
}

.cleaning-photo-tile {
    position: relative;
}

.cleaning-photo-tile a {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
}

.cleaning-photo-tile button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, .92);
}

.cleaning-photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guest-upload-panel {
    padding: 16px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #f8fafc;
}

.guest-upload-panel h2,
.guest-documents h2 {
    margin: 0 0 12px;
    color: var(--ahpm-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.guest-documents {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--ahpm-border);
}

.document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #fff;
}

.document-row a {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ahpm-primary);
    font-weight: 700;
}

.document-row span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cleaning-report-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--ahpm-border);
}

.cleaning-report-item i {
    margin-top: 2px;
    color: #adb5bd;
}

.cleaning-report-item.is-done i {
    color: #198754;
}

.cleaning-report-item strong,
.cleaning-report-item span {
    display: block;
}

.cleaning-report-item span {
    color: var(--ahpm-muted);
    font-size: .9rem;
}

.task-list {
    display: grid;
    gap: 12px;
}

.task-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 220px)) auto;
    align-items: end;
    gap: 12px;
    flex: 1;
}

.task-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.task-card {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    background: #fff;
}

.task-card.is-done {
    background: #f8fafc;
}

.task-check {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #adb5bd;
    font-size: 1.45rem;
}

.task-card.is-done .task-check {
    color: #198754;
}

.task-card-main {
    min-width: 0;
}

.task-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.task-card h2 {
    margin: 0;
    color: var(--ahpm-primary);
    font-size: 1.05rem;
    font-weight: 800;
}

.task-card.is-done h2 {
    text-decoration: line-through;
}

.task-card p {
    margin: 10px 0 0;
    color: var(--ahpm-text);
}

.task-meta,
.task-card-foot,
.task-badges,
.task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.task-meta,
.task-card-foot {
    margin-top: 7px;
    color: var(--ahpm-muted);
    font-size: .88rem;
}

.task-card-foot a {
    color: var(--ahpm-primary);
    font-weight: 700;
}

.task-priority {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--ahpm-primary);
    background: #eef3f8;
    font-size: .82rem;
    font-weight: 800;
}

.priority-low { background: #eef3f8; color: #52616f; }
.priority-normal { background: #eaf7f3; color: #0f766e; }
.priority-high { background: #fff6db; color: #9a6700; }
.priority-urgent { background: #ffe8e8; color: #b42318; }

.task-mobile-form {
    padding-bottom: 96px;
}

.task-action-bar {
    position: fixed;
    right: 28px;
    bottom: 0;
    left: calc(260px + 28px);
    z-index: 1040;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 12px 12px 0 0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 30px rgba(10, 25, 47, .08);
    backdrop-filter: blur(8px);
}

body.sidebar-collapsed .task-action-bar {
    left: calc(86px + 28px);
}

.task-files {
    display: grid;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--ahpm-border);
}

.task-files h2 {
    margin: 0 0 4px;
    color: var(--ahpm-primary);
    font-size: 1rem;
    font-weight: 800;
}

.task-files a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--ahpm-border);
    border-radius: 8px;
    color: var(--ahpm-primary);
    background: #f8fafc;
}

@media (max-width: 1024px) {
    .auth-main {
        align-items: center;
        padding: 22px;
    }

    .login-shell {
        width: min(100%, 920px);
        min-height: 520px;
        grid-template-columns: minmax(0, .9fr) minmax(330px, .72fr);
    }

    .login-brand-panel {
        min-height: 0;
        gap: 22px;
        padding: 30px;
    }

    .login-brand-panel::after {
        display: block;
    }

    .login-brand-copy h1 {
        font-size: 2.85rem;
    }

    .login-brand-copy p {
        max-width: 380px;
        margin-top: 12px;
        font-size: .96rem;
        line-height: 1.55;
    }

    .login-card {
        width: min(100%, 360px);
        padding: 24px;
    }

    .login-card-header {
        margin-bottom: 22px;
    }

    .login-card-header h2 {
        font-size: 1.55rem;
    }

    .login-input-wrap .form-control,
    .login-submit {
        min-height: 46px;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .topbar {
        height: 64px;
        padding: 16px;
        align-items: center;
        gap: 12px;
        flex-direction: row;
    }

    .topbar-left {
        flex: 1;
    }

    .topbar-brand {
        gap: 10px;
    }

    .brand-text {
        max-width: min(54vw, 420px);
        font-size: .9rem;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        flex-basis: auto;
        padding: 16px 14px;
        overflow-y: auto;
        border-right: 1px solid var(--ahpm-border);
        transform: translateX(-100%);
        box-shadow: 18px 0 40px rgba(10, 25, 47, .18);
    }

    .sidebar-header {
        display: flex;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        display: block;
        background: rgba(10, 25, 47, .38);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 1020;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.sidebar-collapsed .sidebar {
        width: min(86vw, 320px);
        flex-basis: auto;
    }

    body.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 12px;
    }

    body.sidebar-collapsed .sidebar-link span {
        display: inline;
    }

    body.sidebar-collapsed .sidebar-link .sidebar-badge,
    body.sidebar-collapsed .sidebar-link .sidebar-alert {
        position: static;
        display: inline-grid;
    }

    body.sidebar-collapsed .sidebar-submenu {
        display: grid;
    }

    body.sidebar-collapsed .sidebar-chevron {
        display: inline-block;
    }

    .app-main {
        padding: 20px 16px;
    }

    .page-header,
    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .report-filter {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-kpi-grid,
    .dashboard-grid,
    .dashboard-bottom-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-flow-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-flow-actions {
        justify-content: flex-start;
    }

    .dashboard-arrivals-card {
        grid-row: auto;
    }

    .table-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .task-filter {
        grid-template-columns: 1fr;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .cleaning-mobile {
        padding-bottom: 128px;
    }

    .cleaning-action-bar,
    .task-action-bar,
    body.sidebar-collapsed .cleaning-action-bar {
        right: 16px;
        left: 16px;
    }

    body.sidebar-collapsed .task-action-bar {
        right: 16px;
        left: 16px;
    }

    .cleaning-summary-panel,
    .cleaning-report-head {
        align-items: stretch;
        flex-direction: column;
    }

    .cleaning-status-select {
        width: 100%;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    .auth-main {
        align-items: start;
        padding-top: max(34px, 12vh);
    }
}

@media (min-width: 1025px) and (max-width: 1180px) {
    .topbar {
        padding: 0 20px;
    }

    .sidebar {
        width: 220px;
        flex-basis: 220px;
    }

    .app-main {
        padding: 24px 20px;
    }

    .brand-text {
        max-width: 46vw;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .auth-page {
        min-height: 100dvh;
    }

    .auth-main {
        align-items: center;
        padding: 10px;
    }

    .login-shell {
        width: 100%;
        min-height: 360px;
        grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
        border: 1px solid rgba(223, 229, 236, .9);
        border-radius: 8px;
        box-shadow: 0 18px 46px rgba(10, 25, 47, .18);
    }

    .login-brand-panel {
        justify-content: space-between;
        gap: 10px;
        padding: 14px 12px;
    }

    .login-brand-panel::after {
        display: block;
    }

    .login-brand-lockup {
        align-items: flex-start;
        gap: 8px;
    }

    .login-logo {
        width: 34px;
        height: 34px;
    }

    .login-brand-lockup strong {
        font-size: .74rem;
        line-height: 1.12;
    }

    .login-brand-lockup > div span {
        display: block;
        font-size: .63rem;
    }

    .login-brand-copy .eyebrow {
        display: block;
        margin-bottom: 3px;
        font-size: .58rem;
    }

    .login-brand-copy h1 {
        font-size: 1.25rem;
    }

    .login-brand-copy p {
        display: block;
        margin-top: 7px;
        font-size: .62rem;
        line-height: 1.35;
    }

    .login-card {
        align-self: center;
        width: 100%;
        padding: 14px 12px;
    }

    .login-card-header {
        gap: 8px;
        margin-bottom: 12px;
    }

    .login-logo.compact {
        width: 30px;
        height: 30px;
    }

    .login-card-header h2 {
        font-size: 1.08rem;
    }

    .login-card-header p {
        font-size: .72rem;
    }

    .login-input-wrap .form-control,
    .login-submit {
        min-height: 40px;
    }

    .login-input-wrap .form-control {
        padding-left: 34px;
        font-size: .86rem;
    }

    .login-input-wrap i {
        left: 11px;
        font-size: .86rem;
    }

    .login-submit {
        font-size: .86rem;
    }

    .login-card .form-label {
        margin-bottom: 4px;
        font-size: .82rem;
    }

    .login-card .mb-3 {
        margin-bottom: .6rem !important;
    }

    .login-card .mb-4 {
        margin-bottom: .8rem !important;
    }

    .topbar {
        padding: 10px 12px;
    }

    .logo-mark {
        width: 50px;
        height: 36px;
        font-size: .85rem;
    }

    .brand-text,
    .role-badge {
        display: none;
    }

    .topbar-actions {
        margin-left: 0;
    }

    .topbar-search {
        width: 44px;
        padding: 0;
        justify-content: center;
        border-color: rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
        box-shadow: none;
    }

    .topbar-search:focus-within {
        position: absolute;
        left: 12px;
        right: 12px;
        top: 10px;
        z-index: 30;
        width: auto;
        padding: 0 14px;
        justify-content: flex-start;
        background: #fff;
        color: #1E3A5F;
        box-shadow: 0 14px 30px rgba(16, 42, 67, 0.18);
    }

    .topbar-search input {
        width: 0;
        opacity: 0;
    }

    .topbar-search:focus-within input {
        width: 100%;
        opacity: 1;
    }

    .topbar-user span {
        max-width: 110px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .page-header h1,
    .brand-lockup h1 {
        font-size: 1.55rem;
    }

    .content-panel {
        padding: 18px 14px;
    }

    .finance-review-layout {
        grid-template-columns: 1fr;
    }

    .finance-document-preview {
        min-height: 360px;
    }

    .invoice-line-row {
        grid-template-columns: 1fr;
    }

    .invoice-total-box {
        justify-content: flex-start;
    }

    .cleaning-mobile {
        gap: 12px;
        padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
    }

    .cleaning-check-row {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 12px 10px;
    }

    .cleaning-check-row textarea {
        grid-column: 1 / -1;
    }

    .cleaning-action-bar {
        left: 0;
        right: 0;
        bottom: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 14px 14px 0 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .cleaning-action-bar .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .task-card {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .task-card-head {
        flex-direction: column;
    }

    .task-actions {
        grid-column: 2;
    }

    .task-mobile-form {
        padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }

    .task-action-bar {
        left: 0;
        right: 0;
        bottom: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 14px 14px 0 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .task-action-bar .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .dashboard-kpi-card,
    .dashboard-bottom-strip a,
    .dashboard-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-bottom-strip a {
        display: flex;
    }

    .dashboard-chart-wrap {
        height: 280px;
    }

    .dashboard-small-chart {
        height: 230px;
    }

    .fc .fc-toolbar {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }
}
