/**
 * Plattegrond module – gedeelde styling (dashboard + verdiepingen)
 * Laadt na forms.css (tokens + header/footer)
 * Witte achtergrond voor leesbaarheid (geen paarse gradient)
 */

/* Tokens via <link href="../css/tokens.css"> vóór forms.css/plattegrond.css */

body.plattegrond-body {
    background: var(--surface);
    color: var(--text);
}

body.plattegrond-body .header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

body.plattegrond-body .footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
}

body.plattegrond-body .main-content {
    background: var(--surface);
}

.plattegrond-main {
    padding: 24px 0 40px;
}

.container.plattegrond-page {
    max-width: min(100%, 1680px);
    padding-left: 10px;
    padding-right: 10px;
}

.plattegrond-page {
    max-width: 100%;
}

.plattegrond-page h1 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0 0 4px;
    color: var(--text);
}

.plattegrond-page .sub,
body.plattegrond-body .sub,
body.plattegrond-body .dashboard-page > .sub {
    color: var(--ink-2);
    font-size: 13px;
    margin: 0 0 14px;
    line-height: 1.5;
}

.back-link {
    margin: 0 0 12px;
    font-size: 13px;
}

.back-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.back-link a:hover {
    text-decoration: underline;
}

/* —— Kaarten & panelen (wit vlak) —— */
.plattegrond-card,
.panel,
.summary-panel,
.capacity-panel,
.log-panel,
.import-panel,
.floor-dashboard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.panel {
    padding: 14px 16px;
    margin-top: 12px;
}

.panel-wide {
    max-width: 100%;
}

.panel-hint {
    font-size: 12px;
    color: var(--text-subtle);
    margin-bottom: 10px;
}

.capacity-panel {
    padding: 22px 24px;
    margin-bottom: 22px;
}

.capacity-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: center;
    color: var(--text);
}

.summary-panel {
    padding: 14px 16px;
    margin-top: 12px;
}

.summary-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.summary-floor-tag {
    font-weight: 500;
    color: var(--primary);
}

.summary-extra {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

/* —— Primaire knoppen —— */
.floor-open-btn,
.import-btn,
.import-actions button {
    background: var(--primary);
    color: #fff;
    border: none;
}

.floor-open-btn:hover,
.import-btn:hover,
.import-actions button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-primary);
}

.import-btn.secondary,
.add-room-btn.secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 2px solid var(--border);
}

.import-btn.secondary:hover,
.add-room-btn.secondary:hover {
    background: var(--line-2);
    border-color: var(--primary);
    box-shadow: none;
    transform: none;
}

.floor-open-btn {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.import-btn {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* —— Dashboard —— */
.dashboard-page {
    max-width: 920px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 28px;
    padding: 0 12px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
    letter-spacing: -0.02em;
}

.dashboard-section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text-muted);
    text-align: center;
}

.capacity-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: center;
    justify-content: center;
}

.capacity-gauge-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.capacity-gauge-wrap {
    position: relative;
    width: 140px;
    height: 140px;
}

.capacity-gauge-wrap svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.capacity-gauge-bg {
    fill: none;
    stroke: var(--line);
    stroke-width: 10;
}

.capacity-gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease;
}

.capacity-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    padding: 18px;
}

.capacity-gauge-center .cap-used {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
}

.capacity-gauge-center .cap-max {
    font-size: 11px;
    color: var(--text-subtle);
}

.capacity-gauge-center .cap-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cap-free {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
    color: var(--gauge-ok);
    max-width: 160px;
}

.cap-free.low {
    color: var(--gauge-warn);
}

.cap-free.full {
    color: var(--gauge-full);
}

.capacity-stats {
    flex: 1 1 300px;
    max-width: 480px;
    display: grid;
    gap: 11px;
}

.capacity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
}

.capacity-row label {
    min-width: 118px;
    font-weight: 600;
    color: var(--ink-2);
}

.capacity-row input[type="number"] {
    width: 72px;
    padding: 7px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
}

.capacity-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.capacity-row .cap-limit {
    color: var(--text-subtle);
    font-size: 12px;
}

.capacity-row .cap-auto {
    font-size: 20px;
    font-weight: 700;
    color: var(--status-sh);
    min-width: 28px;
}

.capacity-row .cap-auto-nieuw {
    color: var(--status-nieuw);
}

.capacity-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
    padding-top: 8px;
    border-top: 1px solid var(--line-2);
}

/* Floor pick tiles – homepage-stijl */
.floor-pick-top {
    margin-top: 0;
    margin-bottom: 20px;
}

.floor-pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.floor-pick a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 14px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.floor-pick a:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.12);
}

.floor-pick .pick-icon {
    font-size: 30px;
    line-height: 1;
}

#dashboard-floors {
    display: grid;
    gap: 14px;
}

.floor-dashboard {
    padding: 18px 20px;
}

.floor-dashboard-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-2);
}

.floor-dashboard-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--text);
}

.floor-dashboard-meta {
    font-size: 12px;
    color: var(--text-subtle);
    margin: 0;
}

/* Summary cards */
.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-page .summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.summary-card {
    flex: 1 1 140px;
    min-width: 120px;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.summary-card .summary-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.summary-card .summary-label {
    font-size: 12px;
    font-weight: 600;
}

.summary-card .summary-sub {
    font-size: 11px;
    color: var(--text-subtle);
    margin-top: 2px;
}

.card-bestaand {
    background: rgba(0, 87, 183, 0.06);
    border-color: rgba(0, 87, 183, 0.25);
    color: var(--status-bestaand);
}

.card-nieuw {
    background: rgba(39, 174, 96, 0.08);
    border-color: rgba(39, 174, 96, 0.3);
    color: var(--status-nieuw);
}

.card-sh {
    background: rgba(108, 52, 131, 0.07);
    border-color: rgba(108, 52, 131, 0.28);
    color: var(--status-sh);
}

.card-vrij {
    background: rgba(var(--primary-rgb), 0.06);
    border-color: rgba(var(--primary-rgb), 0.22);
    color: var(--primary);
}

/* Import panel */
.import-panel {
    padding: 16px 20px;
    margin-bottom: 22px;
}

.import-panel summary,
.log-panel summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
    color: var(--text);
}

.import-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 12px 0 10px;
    line-height: 1.5;
}

#import-text {
    width: 100%;
    min-height: 130px;
    box-sizing: border-box;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
}

#import-text:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

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

.import-actions-top {
    margin-top: 0;
    margin-bottom: 10px;
}

.import-actions label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.import-actions select {
    padding: 7px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    min-width: 140px;
}

#import-result {
    font-size: 12px;
    margin-top: 10px;
    line-height: 1.5;
}

#import-result.ok {
    color: var(--status-nieuw);
}

#import-result.warn {
    color: var(--gauge-warn);
}

#import-result.err {
    color: var(--gauge-full);
}

#import-result .log-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    max-height: 160px;
    overflow-y: auto;
}

#import-result .log-list li {
    padding: 4px 0;
    border-bottom: 1px solid var(--line-2);
}

/* —— Plattegrond kaart —— */
.map-zoom-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.map-zoom-bar button {
    padding: 5px 11px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-elevated);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    min-width: 34px;
    transition: all 0.2s ease;
}

.map-zoom-bar button:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
}

.map-zoom-bar button.zoom-reset {
    font-size: 12px;
    font-weight: 600;
    min-width: auto;
    padding: 5px 10px;
}

#zoom-level {
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text);
}

.map-zoom-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

.map-viewport {
    width: 100%;
    max-height: 75vh;
    overflow: auto;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    -webkit-overflow-scrolling: touch;
}

.map-zoom-stage {
    display: inline-block;
    vertical-align: top;
}

#wrap {
    position: relative;
    display: inline-block;
    transform-origin: 0 0;
}

#wrap img {
    display: block;
    width: 100%;
    min-width: 600px;
    height: auto;
}

#dot-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.rm {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.13s;
}

.rm:hover {
    transform: translate(-50%, -50%) scale(1.7);
    z-index: 10;
}

#tip {
    position: absolute;
    background: rgba(15, 15, 15, 0.92);
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    font-size: 12px;
    pointer-events: none;
    z-index: 20;
    display: none;
    white-space: nowrap;
    line-height: 1.6;
    max-width: 220px;
}

.rm-wrap {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rm-wrap .rm {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    pointer-events: auto;
}

.rm-wrap:hover .rm {
    transform: scale(1.6);
    z-index: 10;
}

#tip.tip-pinned {
    border: 1px solid rgba(255, 215, 0, 0.55);
}

/* Legenda chip-balk */
.legrow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

.legrow > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: var(--surface-2);
    border-radius: 20px;
    white-space: nowrap;
}

.legd {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.leg-nb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 14px;
    background: var(--status-nb);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    vertical-align: middle;
}

.leg-rcvs {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-vrij-map);
    box-shadow: 0 0 0 2px var(--status-rcvs);
    vertical-align: middle;
}

.leg-gereed {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%230e7c66' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='18' cy='18' r='5.5' fill='%23fff' stroke='%2327ae60' stroke-width='1.6'/%3E%3Cpath d='M15.6 18.1 L17.1 19.7 L20.5 16' stroke='%2327ae60' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.leg-niet-gereed {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%230e7c66' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='18' cy='18' r='5.5' fill='%23fff' stroke='%23e74c3c' stroke-width='1.6'/%3E%3Cpath d='M16.2 16.2 L19.8 19.8 M19.8 16.2 L16.2 19.8' stroke='%23e74c3c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

.leg-novon-clean,
.leg-novon-dirty,
.novon-toggle {
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: middle;
    border: none;
    padding: 0;
    cursor: pointer;
    background: center/contain no-repeat;
}

.leg-novon-clean,
.novon-toggle.novon-clean {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23fff' stroke='%2327ae60' stroke-width='1.8'/%3E%3Cpath d='M8.2 12.1 L10.7 14.6 L16 9.3' stroke='%2327ae60' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.leg-novon-dirty,
.novon-toggle.novon-dirty {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23fff' stroke='%23e74c3c' stroke-width='1.8'/%3E%3Cpath d='M9.2 9.2 L14.8 14.8 M14.8 9.2 L9.2 14.8' stroke='%23e74c3c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.leg-novon-clean,
.leg-novon-dirty {
    width: 14px;
    height: 14px;
    cursor: default;
}

.room-table .col-novon {
    text-align: center;
    padding: 4px;
    width: 36px;
}

.novon-toggle:hover {
    transform: scale(1.08);
}

.novon-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 50%;
}

.leg-playroom,
.leg-kitchen {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.leg-playroom {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%23fff8ed' stroke='%23f39c12' stroke-width='1.6'/%3E%3Ccircle cx='11.5' cy='11' r='3' fill='%235dade2'/%3E%3Cpath d='M11.5 14v7M8.5 17.5h6' stroke='%232471a3' stroke-width='1.8' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='21' cy='12' r='3' fill='%23f1948a'/%3E%3Cpath d='M21 15v6M18.5 18.5l2.5-2 2.5 2' stroke='%23c0392b' stroke-width='1.8' stroke-linecap='round' fill='none'/%3E%3Ccircle cx='24.5' cy='22.5' r='2.5' fill='%23f39c12' stroke='%23d68910' stroke-width='.9'/%3E%3C/svg%3E") center/contain no-repeat;
}

.leg-kitchen {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='15' fill='%23fff5eb' stroke='%23e67e22' stroke-width='1.6'/%3E%3Crect x='8' y='11' width='16' height='10' rx='2' fill='%23bdc3c7' stroke='%237f8c8d'/%3E%3Crect x='9.5' y='8' width='13' height='4' rx='1' fill='%2395a5a6'/%3E%3Ccircle cx='12' cy='16' r='2.2' fill='%2334495e'/%3E%3Ccircle cx='20' cy='16' r='2.2' fill='%2334495e'/%3E%3C/svg%3E") center/contain no-repeat;
}

.rm-playroom,
.rm-kitchen {
    cursor: default;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.rm-wrap-playroom:hover .rm-playroom,
.rm-wrap-kitchen:hover .rm-kitchen {
    transform: scale(1.35);
}

.rm-wrap-kitchen {
    flex-direction: column;
    gap: 2px;
}

.kitchen-resident-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    max-width: 52px;
    pointer-events: none;
}

.kitchen-resident-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* —— Tabel —— */
.table-wrap {
    overflow-x: auto;
    margin-top: 10px;
    -webkit-overflow-scrolling: touch;
}

.table-wrap-sticky {
    max-width: 100%;
}

.room-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    --sticky-col-1: 28px;
    --sticky-col-2: 13rem;
}

.room-table-compact {
    font-size: 12px;
}

.room-table-compact th,
.room-table-compact td {
    padding: 4px 5px;
}

.room-table th,
.room-table td {
    border: 1px solid var(--border);
    padding: 6px 8px;
    text-align: left;
    vertical-align: middle;
}

.room-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface-2);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: 0 1px 0 var(--line);
    color: var(--ink-2);
}

.room-table tbody tr:nth-child(even):not(.row-hl):not(.row-rcvs):not(.row-gereed):not(.row-niet-gereed) {
    background: rgba(0, 0, 0, 0.015);
}

.room-table tbody tr:hover {
    background: var(--surface-2);
}

.room-table tbody tr:hover td.col-sticky {
    background: var(--surface-2);
}

.room-table tr.row-hl {
    background: #fff8e6;
}

.room-table tr.row-rcvs {
    background: rgba(0, 168, 150, 0.07);
}

.room-table tr.row-rcvs:hover {
    background: rgba(0, 168, 150, 0.11);
}

.room-table tr.row-gereed {
    background: rgba(39, 174, 96, 0.07);
}

.room-table tr.row-gereed:hover {
    background: rgba(39, 174, 96, 0.11);
}

.room-table tr.row-rcvs.row-gereed {
    background: rgba(39, 174, 96, 0.09);
}

.room-table tr.row-rcvs.row-gereed:hover {
    background: rgba(39, 174, 96, 0.13);
}

.room-table tr.row-niet-gereed {
    background: rgba(231, 76, 60, 0.06);
}

.room-table tr.row-niet-gereed:hover {
    background: rgba(231, 76, 60, 0.1);
}

.room-table tr.row-nb td:first-child {
    color: var(--text-subtle);
}

.room-table input[data-field="rcvs"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.room-table input[data-field="uitgaveGereed"] {
    accent-color: var(--status-gereed);
}

/* Sticky linkerkolommen: kamer + bewoners blijven zichtbaar bij scrollen */
.room-table .col-sticky {
    position: sticky;
    z-index: 2;
}

.room-table thead .col-sticky {
    z-index: 6;
    background: var(--surface-2);
}

.room-table tbody td.col-sticky {
    background: var(--surface);
}

.room-table tbody tr:nth-child(even):not(.row-hl):not(.row-rcvs):not(.row-gereed):not(.row-niet-gereed) td.col-sticky {
    background: var(--surface-2);
}

.room-table tbody tr.row-hl td.col-sticky {
    background: #fff8e6;
}

.room-table tbody tr.row-rcvs td.col-sticky {
    background: #f3fbf9;
}

.room-table tbody tr.row-gereed td.col-sticky {
    background: #f4fbf6;
}

.room-table tbody tr.row-rcvs.row-gereed td.col-sticky {
    background: #f2faf5;
}

.room-table tbody tr.row-niet-gereed td.col-sticky {
    background: #fef6f5;
}

.room-table .col-sticky-1 {
    left: 0;
    width: 28px;
    min-width: 28px;
    max-width: 28px;
}

.room-table .col-sticky-2 {
    left: var(--sticky-col-1);
    width: var(--sticky-col-2);
    min-width: var(--sticky-col-2);
    max-width: 16rem;
}

.room-table .col-sticky-3 {
    left: calc(var(--sticky-col-1) + var(--sticky-col-2));
    min-width: 108px;
    max-width: 220px;
    box-shadow: 4px 0 10px -6px rgba(0, 0, 0, 0.14);
}

.room-table .col-kamer {
    font-family: monospace;
    font-weight: 600;
    min-width: var(--sticky-col-2);
    vertical-align: middle;
}

.room-table .kamer-label-input {
    font-family: monospace;
    font-weight: 600;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 3px 5px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 11px;
    background: var(--surface-2);
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.room-table .kamer-label-input:focus {
    background: var(--surface);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.room-table .kamer-label-input:placeholder-shown {
    color: var(--text-muted);
}

.room-table .col-m2 {
    text-align: center;
    color: var(--text-muted);
    white-space: nowrap;
}

.room-table .col-status {
    font-size: 12px;
    white-space: nowrap;
}

.room-table input[type="text"],
.room-table input[type="number"],
.room-table select,
.room-table input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 7px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.room-table input[type="text"]:focus,
.room-table input[type="number"]:focus,
.room-table select:focus,
.room-table input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.room-table input[type="number"] {
    width: 42px;
    text-align: center;
}

.room-table .col-pers {
    width: 48px;
    text-align: center;
}

.room-table .col-flag {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    text-align: center;
    padding: 2px !important;
}

.room-table .col-flag .novon-toggle {
    width: 20px;
    height: 20px;
}

.room-table .col-inv {
    text-align: center;
    padding: 4px;
}

.room-table .col-inv input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.room-table .col-opm {
    min-width: 7.5rem;
    max-width: 14rem;
}

.room-table .col-opm input {
    font-size: 11px;
    padding: 3px 5px;
    white-space: normal;
    word-break: break-word;
    min-height: 2.4em;
}

.room-table .col-voorz {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    padding: 2px 3px !important;
    text-align: center;
}

.inv-chips {
    display: flex;
    gap: 1px;
    justify-content: center;
    align-items: flex-end;
}

.inv-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    font-size: 8px;
    line-height: 1;
    color: var(--text-subtle);
    cursor: pointer;
    user-select: none;
}

.inv-chip input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

.inv-chip span {
    margin-top: 1px;
    font-weight: 700;
}

.room-table select.status-select {
    min-width: 96px;
    max-width: 108px;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 4px;
}

.room-table select.status-bestaand {
    color: var(--status-bestaand);
    border-color: rgba(0, 87, 183, 0.35);
}

.room-table select.status-nieuw {
    color: var(--status-nieuw);
    border-color: rgba(39, 174, 96, 0.4);
}

.room-table select.status-sh {
    color: var(--status-sh);
    border-color: rgba(108, 52, 131, 0.35);
}

.room-table select.status-iv {
    color: var(--status-iv);
    border-color: rgba(230, 126, 34, 0.45);
}

.room-table select.status-vrij {
    color: var(--status-vrij);
    background: rgba(39, 174, 96, 0.14);
    border-color: rgba(39, 174, 96, 0.5);
    font-weight: 600;
}

.keuken-select {
    min-width: 100%;
    width: 100%;
    padding: 3px 22px 3px 6px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--surface);
}

.keuken-hint {
    color: var(--text-muted);
    font-size: 12px;
}

.col-keuken {
    min-width: 7.75rem;
    width: 7.75rem;
    white-space: nowrap;
}

.col-kitchen-linked {
    font-size: 12px;
    line-height: 1.45;
    min-width: 220px;
}

.col-kitchen-stats {
    white-space: nowrap;
    font-size: 12px;
    color: var(--text-muted);
}

.kitchen-table tbody tr {
    cursor: default;
}

.name-fields {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.name-fields input {
    font-size: 11px;
    padding: 3px 5px;
}

.name-fields .name-hint {
    color: var(--text-muted);
}

.status-bestaand { color: var(--status-bestaand); }
.status-nieuw { color: var(--status-nieuw); }
.status-sh { color: var(--status-sh); }
.status-iv { color: var(--status-iv); }
.status-vrij { color: var(--status-vrij); }
.status-nb { color: var(--text-subtle); }

.table-foot {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Floor nav tabs */
.floor-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.floor-tab {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.floor-tab:hover:not(.active) {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.floor-tab.active,
.floor-tab.active:hover,
.floor-tab.active:focus,
.floor-tab.active:visited {
    background: var(--primary);
    color: #fff !important;
    border: 1px solid var(--accent-ink);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

.floor-tab-dash {
    background: var(--surface-2);
}

.floor-tab-dash:hover:not(.active) {
    background: var(--line-2);
}

.floor-tab-plaatsing {
    background: var(--accent-soft);
    font-weight: 700;
}

.floor-tab-plaatsing:hover:not(.active) {
    background: #d6eaf8;
}

.pf-plaatsing-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px 18px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(55, 138, 221, 0.25);
}

.pf-plaatsing-cta:hover {
    opacity: 0.94;
    color: #fff;
}

.pf-plaatsing-cta-icon {
    font-size: 18px;
}

.pa-table-move-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    vertical-align: middle;
}

.pa-table-move-link:hover {
    background: #d6eaf8;
}

.floor-tab-keukens {
    background: #fff8f0;
}

.floor-tab-keukens:hover:not(.active) {
    background: #fff0e0;
}

.plattegrond-keukens-page .kitchen-table .col-kitchen-linked {
    min-width: 320px;
}

.plattegrond-keukens-page #kitchen-table-section {
    margin-top: 0;
}

.plattegrond-keukens-page #pf-map-section {
    margin-bottom: 18px;
}

.keukens-map-hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-subtle);
}

.keukens-summary-cards .card-kitchen {
    border-top: 3px solid #e67e22;
}

.pf-rcvs-report-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.pf-rcvs-pdf-status {
    font-size: 13px;
    color: var(--text-muted);
}

.pf-panel-sub {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

.pf-panel-link {
    margin: 0 0 12px;
    font-size: 13px;
}

.pf-panel-link a {
    font-weight: 600;
}

/* Drag & room actions */
.col-drag {
    width: 28px;
    text-align: center;
    padding: 4px !important;
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle.disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.move-room-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    margin-left: 4px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}

.move-room-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
}

.col-drag {
    white-space: nowrap;
}

.room-table tr.drag-source {
    opacity: 0.5;
}

.room-table tr.drag-over td {
    background: rgba(var(--primary-rgb), 0.12) !important;
    box-shadow: inset 0 0 0 2px var(--primary);
}

body.room-dragging .rm-wrap {
    pointer-events: auto;
}

body.room-dragging .room-table input,
body.room-dragging .room-table select,
body.room-dragging .room-table button {
    pointer-events: none;
}

body.room-dragging .rm-wrap.drag-over {
    z-index: 12 !important;
}

body.room-dragging .rm-wrap.drag-over .rm {
    transform: scale(1.75);
    filter: drop-shadow(0 0 5px var(--primary));
}

.rm-wrap.drag-source .rm {
    opacity: 0.4;
}

.rm.draggable-room {
    cursor: grab;
}

.rm.draggable-room:active {
    cursor: grabbing;
}

.rm-wrap.rm-hl .rm {
    filter: drop-shadow(0 0 4px #f39c12);
    z-index: 15 !important;
}

.rm-wrap.rm-hl {
    z-index: 15 !important;
}

.room-table .col-datum {
    white-space: nowrap;
    width: 118px;
    min-width: 118px;
    max-width: 118px;
}

.room-table .col-datum input[type="date"] {
    width: 118px;
    max-width: 118px;
    font-size: 11px;
    padding: 3px 4px;
}

.col-cross {
    width: 36px;
    text-align: center;
    padding: 4px !important;
}

.col-del {
    width: 34px;
    text-align: center;
    padding: 4px !important;
}

.room-del-btn {
    padding: 2px 8px;
    border: 1px solid #e8c4c4;
    border-radius: 4px;
    background: var(--surface);
    color: var(--gauge-full);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    font-weight: 600;
}

.room-del-btn:hover {
    background: #fdeaea;
    border-color: var(--gauge-full);
}

.cross-floor-btn {
    border: none;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border-radius: 4px;
    width: 28px;
    height: 26px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.cross-floor-btn:hover {
    background: var(--primary);
    color: #fff;
}

.cross-floor-btn[hidden] {
    display: none;
}

/* Cross-floor / move-room modal */
#cross-floor-modal,
#move-room-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#cross-floor-modal[hidden],
#move-room-modal[hidden] {
    display: none;
}

.cross-floor-dialog {
    background: var(--surface);
    border-radius: var(--radius-md);
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.cross-floor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-2);
    background: var(--primary);
    color: #fff;
}

.cross-floor-head h2 {
    font-size: 15px;
    margin: 0;
    font-weight: 600;
}

#cross-floor-close,
#move-room-close {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    font-size: 22px;
    cursor: pointer;
    color: #fff;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
}

.cross-floor-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line-2);
}

.cross-floor-tab {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.cross-floor-tab:hover:not(.active) {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.cross-floor-tab.active,
.cross-floor-tab.active:hover,
.cross-floor-tab.active:focus {
    background: var(--primary);
    color: #fff !important;
    border: 1px solid var(--accent-ink);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.28);
}

#cross-floor-rooms,
#move-room-list {
    padding: 12px 16px;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.cross-floor-room {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
}

.cross-floor-room:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.04);
}

.cross-floor-room.free {
    border-left: 3px solid var(--status-gereed);
}

.cross-floor-room.occupied {
    border-left: 3px solid var(--primary);
}

.cf-num {
    font-family: monospace;
    font-weight: 700;
    font-size: 14px;
}

.cf-m2 {
    font-size: 11px;
    color: var(--text-subtle);
}

.cf-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cross-floor-empty {
    color: var(--text-subtle);
    font-size: 13px;
    grid-column: 1 / -1;
}

/* Kalibratie */
#wrap.placement-active,
#wrap.calibrate-mode {
    cursor: crosshair;
}

#wrap.placement-active .rm-wrap {
    pointer-events: none !important;
}

#wrap.calibrate-mode:not(.placement-active) .rm-wrap {
    pointer-events: auto !important;
}

#wrap.calibrate-mode .rm-wrap.rm-custom .rm {
    filter: drop-shadow(0 0 3px #ef9f27);
}

#wrap.placement-active::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 5;
    cursor: crosshair;
}

.rm-wrap.rm-cal-target .rm {
    filter: drop-shadow(0 0 5px #ef9f27);
    transform: scale(1.4);
}

.cal-section-title {
    font-size: 13px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: var(--ink-2);
}

.cal-section-title:first-of-type {
    margin-top: 4px;
}

.cal-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    cursor: pointer;
}

.cal-table-wrap {
    overflow-x: auto;
    margin-top: 6px;
}

.cal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cal-table th,
.cal-table td {
    border: 1px solid var(--line);
    padding: 5px 7px;
    text-align: left;
    vertical-align: middle;
}

.cal-table th {
    background: var(--surface-2);
    font-size: 11px;
}

.cal-table tr.cal-active {
    background: #fff8e6;
}

.cal-num {
    font-family: monospace;
    font-weight: 600;
}

.cal-inp {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 12px;
}

.cal-inp.cal-coord {
    width: 72px;
    font-family: monospace;
}

.cal-actions {
    white-space: nowrap;
}

.cal-btn {
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    font-size: 11px;
    cursor: pointer;
    color: var(--primary);
}

.cal-btn:hover {
    background: rgba(var(--primary-rgb), 0.06);
}

.cal-btn.cal-del {
    color: var(--gauge-full);
    padding: 3px 6px;
}

.cal-export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.cal-export-ta {
    width: 100%;
    min-height: 72px;
    margin-top: 8px;
    font-family: monospace;
    font-size: 11px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    resize: vertical;
}

.add-room-fields select {
    min-width: 160px;
    padding: 6px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.add-room-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 10px 0;
}

.add-room-fields label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.add-room-fields input {
    padding: 6px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    min-width: 100px;
}

.add-room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.add-room-btn {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: #ef9f27;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.add-room-btn:hover {
    background: #d88a1f;
}

.add-room-hint {
    font-size: 12px;
    color: var(--text-subtle);
    margin: 8px 0 0;
    line-height: 1.45;
}

.add-room-empty {
    font-size: 12px;
    color: var(--text-subtle);
    margin: 8px 0 0;
}

.custom-room-ul {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    font-size: 13px;
}

.custom-room-ul li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--line-2);
}

.custom-room-num {
    font-family: monospace;
    font-weight: 600;
}

.custom-room-m2 {
    color: var(--text-subtle);
    font-size: 12px;
}

.custom-room-del {
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface);
    color: var(--gauge-full);
    font-size: 11px;
    cursor: pointer;
    margin-left: auto;
}

.custom-room-del:hover {
    background: #fdecea;
}

/* Log panel */
.log-panel {
    padding: 12px 16px;
    margin-top: 12px;
}

.log-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.log-list li {
    padding: 5px 0;
    border-bottom: 1px solid var(--line-2);
    line-height: 1.4;
}

.log-list li:last-child {
    border-bottom: none;
}

.log-list .log-ts {
    color: var(--text-muted);
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}

.log-empty {
    color: var(--text-subtle);
    font-size: 12px;
    margin-top: 8px;
}

/* —— Responsive —— */
@media (max-width: 1024px) {
    .map-zoom-bar button {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
    }

    .floor-tab {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .room-table input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .drag-handle {
        width: 28px;
        height: 28px;
        font-size: 17px;
    }

    .cross-floor-btn,
    .room-del-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .floor-open-btn,
    .import-btn {
        min-height: 44px;
        padding: 12px 18px;
    }

    .import-actions select {
        font-size: 16px;
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .plattegrond-page h1 {
        font-size: 16px;
    }

    .plattegrond-page .sub {
        font-size: 12px;
    }

    .map-zoom-hint {
        display: none;
    }

    .map-viewport {
        max-height: min(55vh, 420px);
        border-radius: 6px;
    }

    #wrap img {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100%;
    }

    .legrow {
        gap: 6px;
        font-size: 11px;
        padding: 8px 10px;
    }

    .legrow > span {
        padding: 3px 6px;
    }

    #counts {
        flex-basis: 100%;
        margin-left: 0 !important;
        margin-top: 6px;
    }

    .summary-cards {
        gap: 8px;
    }

    .summary-card {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        padding: 10px 12px;
    }

    .summary-card .summary-num {
        font-size: 22px;
    }

    .panel {
        padding: 12px;
    }

    .panel-wide .table-wrap {
        margin: 0 -4px;
        padding: 0 4px;
    }

    .room-table-compact th,
    .room-table-compact td {
        padding: 5px 4px;
    }

    .room-table .col-sticky-3 {
        min-width: 96px;
        max-width: 140px;
    }

    .room-table select.status-select,
    .room-table input,
    .room-table select {
        font-size: 16px;
    }

    .inv-chip input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .capacity-layout {
        flex-direction: column;
        align-items: stretch;
    }

    .capacity-gauge-col {
        align-self: center;
    }

    .capacity-stats {
        width: 100%;
        max-width: none;
    }

    .cross-floor-dialog {
        max-height: 90vh;
        margin: 0 8px;
    }

    #cross-floor-rooms {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .import-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .import-actions button,
    .import-actions select {
        width: 100%;
    }

    .add-room-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .add-room-fields label {
        width: 100%;
    }

    .add-room-fields input,
    .add-room-fields select {
        width: 100%;
        min-width: 0;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .floor-pick {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .floor-pick a {
        padding: 16px 12px;
        font-size: 13px;
    }

    .dashboard-page .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .capacity-panel {
        padding: 16px;
    }

    .floor-dashboard-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .floor-open-btn {
        width: 100%;
        justify-content: center;
    }

    .import-actions label {
        width: 100%;
    }
}

@media (max-width: 390px) {
    .summary-card {
        flex: 1 1 100%;
    }

    .floor-nav {
        gap: 6px;
    }

    .floor-tab {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .floor-pick {
        grid-template-columns: 1fr;
    }

    .dashboard-page .summary-cards {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1100px) {
    .dashboard-page {
        max-width: 980px;
    }
}

/* —— Woonbegeleider-overzicht (pf-*) —— */
.pf-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pf-panel-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-panel-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.pf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.pf-mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
}

.pf-muted {
    color: var(--text-muted);
    font-size: 12px;
}

.pf-empty {
    color: var(--text-subtle);
    font-size: 13px;
    margin: 0;
}

.pf-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

.pf-dashboard-grid .pf-panel {
    margin-bottom: 18px;
}

.pf-action-scroll,
.pf-instroom-scroll {
    max-height: 420px;
    overflow-y: auto;
}

.pf-action-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 12px;
    line-height: 1.45;
}

.pf-action-ok {
    margin-bottom: 12px;
}

.pf-action-urgent {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.pf-action-section-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--gauge-full);
}

.pf-action-link-urgent {
    font-weight: 600;
}

.pf-action-details {
    margin-bottom: 10px;
    border: 1px solid var(--line-2);
    border-radius: 8px;
    background: var(--surface-2);
}

.pf-action-details summary {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pf-action-details summary::-webkit-details-marker {
    display: none;
}

.pf-action-details summary::before {
    content: '▸';
    color: var(--text-subtle);
    margin-right: 4px;
    transition: transform 0.15s;
}

.pf-action-details[open] summary::before {
    transform: rotate(90deg);
}

.pf-action-details[open] summary {
    border-bottom: 1px solid var(--line-2);
}

.pf-action-floor-group {
    padding: 8px 12px 10px;
}

.pf-action-floor-group + .pf-action-floor-group {
    border-top: 1px dashed var(--line-2);
}

.pf-action-floor-head {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
}

.pf-action-floor-head a {
    color: var(--primary);
    text-decoration: none;
}

.pf-action-floor-head a:hover {
    text-decoration: underline;
}

.pf-action-ul.pf-action-compact li {
    font-size: 12px;
}

.pf-action-group {
    margin-bottom: 14px;
}

.pf-action-group-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--primary-dark);
}

.pf-action-ul,
.pf-instroom-ul,
.pf-multi-ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pf-action-ul li,
.pf-instroom-ul li,
.pf-multi-ul li {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.45;
}

.pf-action-link,
.pf-instroom-link,
.pf-search-hit {
    color: var(--primary);
    text-decoration: none;
}

.pf-action-link:hover,
.pf-instroom-link:hover,
.pf-search-hit:hover {
    text-decoration: underline;
}

.pf-more {
    color: var(--text-subtle);
    font-style: italic;
}

.pf-instroom-section.urgent .pf-instroom-head {
    color: var(--gauge-full);
}

.pf-instroom-section.warn .pf-instroom-head {
    color: var(--gauge-warn);
}

.pf-instroom-head {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px;
}

.pf-instroom-section {
    margin-bottom: 12px;
}

.pf-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
}

.pf-tag.ok {
    background: #d5f5e3;
    color: #1e8449;
}

.pf-tag.warn {
    background: #fdebd0;
    color: #b7950b;
}

.pf-tag.miss {
    background: #fadbd8;
    color: var(--gauge-full);
}

.pf-insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.pf-insight-stat {
    text-align: center;
    padding: 10px 8px;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid var(--line-2);
}

.pf-insight-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
}

.pf-insight-lbl {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pf-insight-diff {
    font-size: 13px;
    margin: 0 0 12px;
}

.pf-insight-floors {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pf-insight-floor {
    display: grid;
    grid-template-columns: 110px 1fr 42px auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.pf-insight-floor-label {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pf-bar-wrap {
    height: 8px;
    background: #eef0f5;
    border-radius: 4px;
    overflow: hidden;
}

.pf-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    min-width: 2px;
}

.pf-insight-pct {
    font-weight: 700;
    text-align: right;
}

.pf-kitchen-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pf-kitchen-table th,
.pf-kitchen-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.pf-kitchen-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 11px;
}

.pf-subhead {
    font-size: 13px;
    font-weight: 700;
    margin: 14px 0 8px;
}

/* Zoeken */
.pf-search-wrap {
    position: relative;
    margin-bottom: 18px;
}

.pf-search-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pf-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pf-search-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.pf-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.pf-search-filter {
    padding: 10px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--surface);
}

.pf-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.pf-search-results .pf-search-results {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    max-height: none;
}

.pf-search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pf-search-results li {
    margin: 0;
}

.pf-search-hit {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
}

.pf-search-hit:hover {
    background: #f5f7ff;
}

/* Toolbar plattegrond-pagina */
.pf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pf-toolbar .pf-search-wrap {
    flex: 1 1 280px;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pf-toolbar .pf-search-input {
    flex: 1 1 180px;
}

.pf-toolbar .pf-search-results {
    flex: 1 1 100%;
}

.pf-view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.pf-view-toggle button {
    padding: 9px 16px;
    border: none;
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
}

.pf-view-toggle button + button {
    border-left: 1px solid var(--border);
}

.pf-view-toggle button.active {
    background: var(--primary);
    color: #fff;
}

.pf-view-toggle button:hover:not(.active) {
    background: #f5f7ff;
}

/* Lijstweergave */
.pf-list-panel {
    margin-bottom: 18px;
}

.pf-list-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.pf-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pf-list-table th {
    position: sticky;
    top: 0;
    background: #f8f9fc;
    padding: 8px 10px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.pf-list-table th:hover {
    color: var(--primary);
}

.pf-list-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: top;
}

.pf-list-table tbody tr {
    cursor: pointer;
}

.pf-list-table tbody tr:hover {
    background: #f5f7ff;
}

.pf-list-hint {
    font-size: 11px;
    color: var(--text-subtle);
    margin: 6px 0 0;
}

/* Meldingen op verdieping-tegels */
.floor-pick a {
    position: relative;
}

.floor-pick a.floor-pick-warn {
    border-color: #f0b429;
    background: #fffdf5;
}

.floor-pick a.floor-pick-urgent {
    border-color: #e74c3c;
    background: #fff8f7;
}

.pf-floor-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.floor-pick-urgent .pf-floor-badge {
    background: #e74c3c;
}

@media (max-width: 768px) {
    .pf-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .pf-insight-floor {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .pf-insight-pct {
        text-align: left;
    }
}

/* —— Teamleider-dashboard (KPI, compacte verdiepingen, planbord) —— */

.pf-dashboard-sticky {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--surface-2);
    margin: 0 -4px 12px;
    padding: 8px 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.pf-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.pf-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pf-kpi.urgent {
    border-color: var(--gauge-full);
    background: color-mix(in srgb, var(--gauge-full) 6%, var(--surface));
}

.pf-kpi.warn {
    border-color: var(--gauge-warn);
    background: color-mix(in srgb, var(--gauge-warn) 8%, var(--surface));
}

.pf-kpi-muted .pf-kpi-num {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.pf-kpi-num {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
}

.pf-kpi-lbl {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
}

.pf-kpi-sub {
    display: block;
    font-size: 9px;
    color: var(--text-subtle);
    margin-top: 2px;
}

.pf-compact-floors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    padding-bottom: 10px;
}

.pf-compact-floor {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    min-height: 72px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pf-compact-floor:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.pf-compact-floor.pf-floor-warn,
.pf-compact-floor.floor-pick-warn {
    border-color: var(--gauge-warn);
    background: color-mix(in srgb, var(--gauge-warn) 8%, var(--surface));
}

.pf-compact-floor.pf-floor-urgent,
.pf-compact-floor.floor-pick-urgent {
    border-color: var(--gauge-full);
    background: color-mix(in srgb, var(--gauge-full) 6%, var(--surface));
}

.pf-compact-floor-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
}

.pf-compact-floor-pct {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.pf-compact-floor-bar {
    display: block;
    height: 4px;
    background: #eef0f5;
    border-radius: 999px;
    overflow: hidden;
}

.pf-compact-floor-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.pf-fill-low { background: #27ae60; }
.pf-fill-mid { background: #f1c40f; }
.pf-fill-high { background: #e74c3c; }

.pf-compact-floor-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.pf-compact-floor-keuken .pf-compact-floor-pct {
    display: none;
}

.pf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.pf-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1 1 auto;
}

.pf-toolbar-btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    font-family: inherit;
}

.pf-toolbar-btn-primary {
    background: var(--primary);
    color: #fff;
}

.pf-toolbar-btn-outline {
    background: var(--surface);
    color: var(--primary-dark);
    border: 1px solid var(--border);
}

.pf-view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.pf-view-toggle button {
    min-height: 44px;
    min-width: 100px;
    padding: 10px 18px;
    border: none;
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
}

.pf-view-toggle button.active {
    background: var(--primary);
    color: #fff;
}

.pf-collapse-section {
    margin-bottom: 12px;
}

.pf-collapse-summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    padding: 4px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pf-collapse-summary::-webkit-details-marker {
    display: none;
}

.pf-collapse-summary::before {
    content: '▸';
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.15s;
}

.pf-collapse-section[open] > .pf-collapse-summary::before {
    transform: rotate(90deg);
}

.pf-collapse-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.capacity-panel-nested {
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 0;
}

.floor-pick-inline {
    margin-bottom: 12px;
}

.pf-planboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    align-items: start;
}

.pf-board-col {
    background: #f8f9fc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 200px;
}

.pf-board-col-head {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pf-board-col-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.pf-board-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
}

.pf-board-card-room {
    border-left: 4px solid var(--status-vrij-map, #27ae60);
}

.pf-board-card-wait {
    border-left: 4px solid var(--status-nieuw, #1e8449);
}

.pf-board-card-action {
    border-left: 4px solid #e74c3c;
}

.pf-board-card-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.pf-board-card-title a {
    color: var(--primary-dark);
    text-decoration: none;
}

.pf-board-card-title a:hover {
    text-decoration: underline;
}

.pf-chip {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    margin-right: 4px;
    margin-top: 4px;
}

.pf-chip-vrij { background: #d5f5e3; color: #1e8449; }
.pf-chip-nieuw { background: #d4efdf; color: var(--status-nieuw, #1e8449); }
.pf-chip-sh { background: #e8daef; color: var(--status-sh, #6c3483); }
.pf-chip-bestaand { background: #d6eaf8; color: var(--status-bestaand, #2471a3); }
.pf-chip-iv { background: #fdebd0; color: var(--status-iv, #b7950b); }
.pf-chip-onderhoud { background: #eaecee; color: #566573; }

@media (max-width: 1100px) {
    .pf-planboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .pf-kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .pf-compact-floors {
        grid-template-columns: repeat(2, 1fr);
    }

    .pf-planboard {
        grid-template-columns: 1fr;
    }

    .pf-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .pf-view-toggle button {
        flex: 1;
    }
}
