/* ==========================================================================
   1. BASE & APP LAYOUT
   ========================================================================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    color: #333;
}

.app-layout {
    display: none !important; /* Strictly hidden until authentication is verified */
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.app-layout.veilig {
    display: flex !important; /* Display only upon approval */
}

/* --- LOADING SCREEN --- */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f0f2f5;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ccc;
    border-top-color: #0078D7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.app-loader.hidden {
    opacity: 0;
    pointer-events: none;
}


/* ==========================================================================
   2. SIDEBAR & CONTROLS
   ========================================================================== */
.sidebar {
    width: 320px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    z-index: 10;
    flex-shrink: 0;
    overflow-y: auto;
    height: 100vh;
}

.sidebar-header {
    padding: 25px 25px 15px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-header h1 {
    color: #004b87;
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.sidebar-primary-action {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.btn-hero {
    width: 100%;
    background-color: #0078D7;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 120, 215, 0.2);
}

.btn-hero:hover {
    background-color: #005a9e;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 120, 215, 0.3);
}

.sidebar-section {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.sidebar-section h3 {
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.floor-controls,
.filter-controls,
.admin-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-floor {
    background: #f8f9fa;
    border: 1px solid #ddd;
    color: #555;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
}

.btn-floor:hover {
    background: #eee;
    border-color: #ccc;
}

.btn-floor.active {
    background: #e5f1fb;
    border-color: #0078D7;
    color: #0078D7;
}

.filter-checkbox {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.filter-checkbox span {
    border: 1px solid #ccc;
    background: white;
    color: #555;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    transition: 0.2s;
    user-select: none;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.filter-checkbox input[type="checkbox"]:checked + span {
    border-color: #0078D7;
    color: #0078D7;
    background: #e5f1fb;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 25px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.admin-header {
    margin-bottom: 5px;
}

.beheer-label {
    font-size: 11px;
    color: #d9534f;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.switch-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.switch-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: #d9534f; }
input:checked + .slider:before { transform: translateX(18px); }

.btn-admin-strak {
    border: 1px solid #ffcdd2;
    background: white;
    color: #d32f2f;
    border-radius: 4px;
    padding: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: center;
}

.btn-admin-strak:hover { background: #fff5f5; }


/* ==========================================================================
   3. MAP AREA & SVG
   ========================================================================== */
.map-area {
    flex: 1;
    background-color: #f0f2f5;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
}

.plattegrond-container {
    width: 100%;
    height: 100%;
    max-width: 1500px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.plattegrond-container:active { cursor: grabbing; }

#svg-container, svg {
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

svg rect[id*="_"],
svg path[id*="_"],
svg polygon[id*="_"] {
    cursor: pointer;
    transition: fill 0.2s, opacity 0.2s, stroke 0.2s;
}

svg rect[id*="_"]:hover,
svg path[id*="_"]:hover,
svg polygon[id*="_"]:hover,
.force-hover {
    fill: #0078D7 !important;
    opacity: 0.9 !important;
    stroke: #004b87 !important;
}

.niet-actief {
    fill: #ffffff !important;
    stroke: #e2e8f0 !important;
    stroke-width: 1px !important;
    opacity: 0.3 !important;
    pointer-events: none;
}

.svg-lokaal-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 11px;
    fill: #555;
    pointer-events: none;
    text-anchor: middle;
    font-weight: 700;
    opacity: 0.8;
}

.svg-lokaal-label.label-niet-actief {
    fill: #a0aec0;
    opacity: 0.6;
    font-weight: 600;
}


/* ==========================================================================
   4. POP-UPS & OVERLAYS (DESKTOP DEFAULT)
   ========================================================================== */
.info-popup-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2004;
}

.info-popup-backdrop.active { display: block; }

.info-popup {
    position: fixed;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    display: none;
    z-index: 2005;
    width: 360px;
    border: 1px solid #cbd5e0;
    max-height: 80vh;
    flex-direction: column;
    overflow: hidden;
}

.info-popup.pinned { pointer-events: auto; }

.popup-header {
    background-color: #004b87;
    color: white;
    padding: 16px 20px;
    border-bottom: 4px solid #0078D7;
    position: relative;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 40px;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.3;
}

.popup-header .type-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-body {
    padding: 0;
    overflow-y: auto;
    flex-grow: 1;
}

.info-section {
    border-bottom: 1px solid #edf2f7;
    padding: 15px 20px;
    background: #fff;
}

.info-section:last-child { border-bottom: none; }

.info-section h4 {
    margin: 0 0 12px 0;
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prop-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px dashed #edf2f7;
}

.prop-row:last-child { border-bottom: none; }

.prop-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 15px;
}

.prop-value {
    font-size: 13.5px;
    color: #1a202c;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.opmerking-box {
    background-color: #fff8c4;
    border-left: 4px solid #f2c94c;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.4;
}

.device-link {
    color: #0078D7;
    text-decoration: none;
    font-weight: 600;
}

.device-link:hover { color: #004b87; }

.reserveer-container {
    padding: 0 20px 20px 20px;
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.book-link, .schema-link {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    display: block;
}

.book-link {
    background: #0078D7;
    color: white;
}

.schema-link {
    background: #f0f2f5;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    cursor: pointer;
}

.popup-close-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.8;
}

.mhp-hint {
    background: #ebf8f1;
    color: #27ae60;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    font-weight: 600;
    border-top: 1px solid #c8e6c9;
}


/* ==========================================================================
   5. 2-COLUMN DASHBOARD MODAL (DESKTOP)
   ========================================================================== */
.info-popup.qr-mode-popup {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90vw !important;
    max-width: 850px !important;
    background-color: white;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
    border-radius: 12px !important;
    margin: 0 !important;
    max-height: 85vh !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: auto !important;
    overflow: hidden !important;
    z-index: 2005;
}

body.is-qr-mode {
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

body.is-qr-mode .app-layout,
body.is-qr-mode .mobile-fab,
body.is-qr-mode .app-loader {
    display: none !important;
}

.sm-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 22px 30px;
    background-color: #004b87;
    color: white;
    border-bottom: 4px solid #0078D7;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0 !important;
}

.sm-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sm-room-name {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.sm-room-meta {
    font-size: 13px;
    color: #e5f1fb;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sm-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sm-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.sm-status.free {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.4);
}
.sm-status.free .dot { background: #2ecc71; }

.sm-status.busy {
    background: rgba(231, 76, 60, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(231, 76, 60, 0.4);
}
.sm-status.busy .dot { background: #ff6b6b; }

.sm-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.sm-body {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    flex-grow: 1;
}

.sm-sidebar {
    width: 320px;
    background-color: #f8fafc;
    border-right: 1px solid #edf2f7;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sm-info-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sm-info-block h4 {
    margin: 0;
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sm-amenities {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sm-prop-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2d3748;
}

.sm-icon {
    font-size: 16px;
    opacity: 0.8;
    width: 20px;
    text-align: center;
}

.sm-val { font-weight: 500; }

.sm-note {
    background-color: #ffffff;
    border-left: 3px solid #cbd5e0;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.sm-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.sm-btn-primary {
    display: block;
    width: 100%;
    background: #0078D7;
    color: #ffffff;
    text-decoration: none;
    padding: 14px 15px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    border: none;
    cursor: pointer;
    box-sizing: border-box;
}

.sm-btn-secondary {
    display: block;
    width: 100%;
    background: #ffffff;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.sm-main-content {
    width: 100% !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
    overflow: hidden !important;
}

.sm-section-title {
    padding: 20px 30px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
    background: #fdfdfd;
    flex-shrink: 0;
}

.sm-agenda-list {
    padding: 10px 0 !important;
    max-height: none !important;
    flex-grow: 1 !important;
    overflow-y: auto !important;
}

.sm-agenda-day { margin-bottom: 30px; }

.sm-day-header {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #718096;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 6px;
}

.sm-day-header.today {
    color: #0078D7;
    border-bottom-color: #0078D7;
}

.sm-day-header.tomorrow { color: #2d3748; }

.sm-event {
    display: flex;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px dashed #edf2f7;
}

.sm-time {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    min-width: 120px;
    flex-shrink: 0;
}

.sm-title {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.4;
    word-break: break-word;
}

/* --- FIXED STICKY FOOTER ACTION BAR --- */
.sm-sticky-footer {
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.sm-sticky-footer .sm-btn-secondary {
    width: auto !important;
    min-width: 200px;
    padding: 8px 16px !important;
}


/* ==========================================================================
   6. CARDS LAYOUT (DASHBOARD - QUICK RESERVE)
   ========================================================================== */
.wm-body {
    padding: 10px 25px 25px 25px !important;
    overflow-y: auto;
    max-height: 70vh;
}

.wm-floor-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    margin: 25px 0 12px 0;
}

.wm-floor-title:first-child { margin-top: 10px; }

.wm-card {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 3.2fr 1.5fr;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 22px 20px;
    margin-bottom: 14px;
}

.wm-status-badge {
    position: absolute;
    top: -10px;
    left: 18px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.wm-status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.wm-status-badge.free {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #c8e6c9;
}
.wm-status-badge.free .dot { background: #2ecc71; }

.wm-status-badge.busy {
    background: #fdedec;
    color: #c0392b;
    border: 1px solid #fadbd8;
}
.wm-status-badge.busy .dot { background: #e74c3c; }

.wm-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-room-name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
}

.wm-room-meta {
    font-size: 12px;
    color: #718096;
}

.wm-card-schedule {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wm-schedule-header {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    font-weight: 600;
    color: #a0aec0;
    text-transform: uppercase;
}

.wm-timeline { width: 100%; }

.wm-timeline-bar {
    height: 16px;
    background-color: #d1f2eb;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.wm-timeline-busy {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: #fcdddb;
    background-image: repeating-linear-gradient(45deg, #fcdddb, #fcdddb 8px, #f5b7b1 8px, #f5b7b1 16px);
    border-right: 1px solid #fff;
    border-left: 1px solid #fff;
    box-sizing: border-box;
}

.wm-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10.5px;
    color: #a0aec0;
    font-weight: 600;
}

.wm-timeline-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wm-timeline-list-item {
    font-size: 11px;
    color: #555;
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 4px 8px;
    border-radius: 4px;
}

.wm-card-action {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.wm-btn-book {
    background: #0078D7;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
    transition: background 0.2s;
    box-shadow: 0 1px 3px rgba(0, 120, 215, 0.15);
}

.wm-btn-book:hover { background: #005a9e; }

.wm-btn-schema {
    display: block;
    width: 100%;
    background: #f0f2f5;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s;
    text-decoration: none;
    box-sizing: border-box;
    cursor: pointer;
}

.wm-btn-schema:hover { background: #e2e8f0; }


/* ==========================================================================
   7. EDIT MODALS & FORMS
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    width: 90%;
    max-width: 450px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow: hidden;
}

.edit-modal-breed { max-width: 550px; }
.lijst-modal-content { max-width: 780px; }
.lijst-modal-body { padding: 0; }

.modal-header {
    padding: 18px 25px;
    border-bottom: 1px solid #eee;
    position: relative;
    background: #fdfdfd;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #004b87;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
    transition: 0.2s;
}

.close-modal:hover { color: #d9534f; }

.modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #eee;
    background: #f9fafb;
    display: flex;
    gap: 10px;
}

.btn-primary {
    background-color: #0078D7;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

.btn-primary:hover { background-color: #005a9e; }

.btn-secondary {
    background-color: #e1e1e1;
    color: #333;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

.btn-secondary:hover { background-color: #ccc; }

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mt-10 { margin-top: 10px; }
.full-width { grid-column: span 2; }

.edit-grid label {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body input[type="url"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
}

.modal-body textarea {
    resize: vertical;
    min-height: 80px;
}

.beheer-sectie {
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
}

.beheer-sectie > label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.hardware-headers {
    display: flex;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    font-weight: bold;
}

.hardware-header-type,
.hardware-header-waarde { flex: 1; }

.item-row, .hardware-item {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    align-items: center;
}

.item-row input, .hardware-item input {
    flex: 1;
    margin-top: 0 !important;
}

.admin-input-groep {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.admin-input-groep input { flex: 1; }

.delete-btn {
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
}

.add-btn {
    background: #f0f2f5;
    border: 1px dashed #0078D7;
    color: #0078D7;
    padding: 10px;
    width: 100%;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
}

.add-btn:hover { background: #e5f1fb; }
.btn-auto { width: auto; padding: 0 15px; }
.hide-dyn, .mobile-fab, .mobile-close, .menu-overlay, .mobile-tab-bar { display: none; }


/* ==========================================================================
   8. MEDIA QUERIES (DESKTOP) - min-width: 769px
   ========================================================================== */
@media (min-width: 769px) {
    .mobile-tab-content {
        display: block !important;
    }

    .sm-sidebar {
        border-right: 1px solid #edf2f7 !important; /* Herstel scheidingslijn op desktop */
    }

    .sm-main-content {
        padding: 0 !important;
    }

    .sm-agenda-list {
        padding: 20px 30px 30px 30px !important; /* Herstel strakke padding op desktop schema */
        max-height: 420px;
        overflow-y: auto;
    }

    .sm-section-title {
        padding: 20px 30px !important;
    }
}


/* ==========================================================================
   9. MEDIA QUERIES (MOBILE) - max-width: 768px (CONSOLIDATED)
   ========================================================================== */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: hidden;
    }

    /* --- MAP CONTAINER --- */
    .map-area {
        width: 100% !important;
        height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: auto !important;
        touch-action: auto !important;
    }

    .plattegrond-container {
        padding: 0;
        border-radius: 0;
        height: 100vh;
        box-sizing: border-box;
        border: none;
        overflow: auto !important; 
        touch-action: auto !important;
    }

    #svg-container svg {
        min-width: 800px;
        height: auto;
    }

    /* --- NAVIGATION & DRAWER --- */
    .mobile-fab {
        display: block;
        position: fixed;
        bottom: 25px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #0078D7;
        color: white;
        border: none;
        padding: 14px 28px;
        border-radius: 30px;
        font-size: 16px;
        font-weight: bold;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        cursor: pointer;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85% !important;
        max-width: 350px;
        height: 100dvh;
        z-index: 2010;
        background: white;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
        padding-bottom: 120px;
    }

    .sidebar.open { left: 0; }

    .mobile-close {
        display: block;
        width: 100%;
        background: #f1f3f4;
        color: #333;
        border: none;
        padding: 18px;
        font-size: 16px;
        font-weight: bold;
        text-align: center;
        cursor: pointer;
        border-bottom: 1px solid #ddd;
    }

    .menu-overlay {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 2009;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .menu-overlay.active {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    /* --- POPUPS & MODALS ON MOBILE --- */
    .info-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-width: 340px !important; 
        max-height: 85vh !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 100vmax rgba(0, 0, 0, 0.6) !important;
        border-radius: 12px !important;
        margin: 0 !important;
        pointer-events: auto !important;
        box-sizing: border-box !important;
    }

    .wm-card-action, .sm-actions, .reserveer-container {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .wm-btn-book, .wm-btn-schema, .sm-btn-primary, .sm-btn-secondary, .book-link, .schema-link {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 14px !important;
    }

    /* --- QR DEDICATED ROOM VIEW ON MOBILE --- */
    body.is-qr-mode {
        background-color: #ffffff;
        padding: 0;
        align-items: flex-start;
        overflow: hidden !important;
    }

    body.is-qr-mode .info-popup.qr-mode-popup {
        max-width: 100% !important;
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .qr-mode-popup .sm-header {
        padding: 8px 12px !important;
        min-height: auto !important;
        border-radius: 0 !important;
    }

    .qr-mode-popup .sm-room-name {
        font-size: 16px !important;
        margin: 2px 0 !important;
    }

    .qr-mode-popup .sm-status {
        font-size: 10px !important;
        padding: 2px 8px !important;
    }

    /* --- MOBILE TAB BAR & CONTENT --- */
    .mobile-tab-bar {
        display: flex !important;
        background: #eef2f6;
        padding: 4px;
        gap: 4px;
        border-bottom: 1px solid #d1d9e0;
    }

    .mobile-tab-btn {
        flex: 1;
        padding: 8px 4px;
        border: none;
        background: transparent;
        font-size: 12px;
        font-weight: bold;
        color: #57606a;
        border-radius: 6px;
        cursor: pointer;
    }

    .mobile-tab-btn.active {
        background: #ffffff;
        color: #0969da;
        box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    }

    .mobile-tab-content { display: none; }
    
    .mobile-tab-content.active-tab-mobile {
        display: flex !important;
        flex-direction: column;
        flex-grow: 1;
        width: 100%;
        height: 100%;
    }

    .sm-body {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important; 
        flex-grow: 1 !important;
        padding: 12px !important;
    }

    .sm-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: none !important;
        padding: 0 !important;
    }

    .sm-main-content {
        width: 100% !important;
        border-right: none !important;
        border-bottom: none !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
        overflow: hidden !important;
    }

    .sm-agenda-list {
        padding: 10px 0 !important;
        max-height: none !important;
        flex-grow: 1 !important;
        overflow-y: auto !important;
    }

    .sm-event {
        flex-direction: column;
        gap: 4px;
    }

    .sm-time { min-width: 100px; font-size: 13px; }
    .sm-title { font-size: 14px; }

    /* --- FIXED STICKY FOOTER --- */
    .sm-sticky-footer {
        padding: 10px 15px !important;
        justify-content: center !important;
    }
    
    .sm-sticky-footer .sm-btn-secondary {
        width: 100% !important;
    }

    .wm-card {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 30px;
    }

    .modal-content { margin: 5% auto !important; }
}