    /* ===== RESPONSIVE (fase 4) =====
       Alle breakpoints staan hier, geladen na components.css zodat de
       bronvolgorde de basisregels overschrijft. Mobiel-principe: onderweg
       opzoeken, checken en hooguit een status wijzigen; aanmaken en
       bewerken gebeuren op een groter scherm.

       Breakpoints:
         <= 900px         grids dichter
         768 tot 900px    sidebar als 64px-icoonrail (tablet)
         < 768px          sidebar als off-canvas paneel (telefoon),
                          tabellen naar cards, factuur-aanmaak desktop-only */

    /* ---------- <= 900px: grids dichter ---------- */
    @media (max-width: 900px) {
      .kpi-grid { grid-template-columns: repeat(2, 1fr); }
      .stat-grid-4, .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
      .factuur-meta-grid { grid-template-columns: repeat(2, 1fr); }
    }

    /* ---------- 768 tot 900px (tablet): sidebar naar 64px-icoonrail ---------- */
    @media (min-width: 768px) and (max-width: 900px) {
      .sidebar { width: 64px; min-width: 64px; }
      .sidebar-brand { justify-content: center; padding: 1.4rem 0.5rem 1.2rem; }
      .sidebar-brand-text, .sidebar-brand-sub { display: none; }
      .sidebar-nav { padding: 0.3rem 0.4rem; }
      .sidebar-section-label { display: none; }
      .nav-item { justify-content: center; padding: 0.6rem 0; position: relative; }
      .nav-label { display: none; }
      .nav-item .count-badge-pill {
        position: absolute; top: 4px; right: 12px; margin-left: 0;
        min-width: 16px; height: 16px; padding: 0 3px; border-radius: var(--r-avatar);
        display: flex; align-items: center; justify-content: center;
        font-size: 0.55rem; line-height: 1;
      }
      .sidebar-footer { padding: 0.8rem 0.4rem 1rem; }
      .sidebar-user { justify-content: center; padding: 0.5rem 0; }
      .sidebar-user-info { display: none; }
      .logout-btn { justify-content: center; padding: 0.55rem 0; }
    }

    /* ---------- < 768px (telefoon): off-canvas nav via hamburger ---------- */
    @media (max-width: 767.98px) {
      /* Hamburger zichtbaar in de topbar; datum weg om ruimte te sparen */
      .nav-toggle { display: inline-flex; }
      .topbar { padding: 0.9rem 1rem; }
      .topbar-date { display: none; }

      /* Sidebar wordt inschuivend paneel; houdt zijn volledige labels uit de basis-CSS */
      .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 600;
        width: 260px; min-width: 260px;
        transform: translateX(-100%); transition: transform 0.3s ease;
      }
      .sidebar.open { transform: translateX(0); box-shadow: var(--sh-drawer); }

      /* Scrim achter het paneel (basis is display:none, zie base.css) */
      .nav-scrim { position: fixed; inset: 0; background: rgba(27,42,59,0.55); z-index: 550; }
      .nav-scrim.open { display: block; }

      /* Grids: alles onder elkaar */
      .kpi-grid, .stat-grid-4, .stat-grid-3, .dash-grid { grid-template-columns: 1fr; }

      /* Tabellen worden cards: één record per card, kolomlabel voor de waarde.
         Het label komt uit data-label op elke td (zie render/*.js). */
      .table-wrap { background: transparent; border: none; box-shadow: none; overflow: visible; }
      .table-wrap thead { display: none; }
      .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
      .table-wrap tr {
        background: var(--white); border: 1px solid var(--border); border-radius: var(--r-card);
        box-shadow: var(--sh-card); margin-bottom: 0.8rem;
      }
      .table-wrap tbody tr:hover, .table-wrap tr.row-clickable:hover td { background: var(--white); }
      .table-wrap td {
        display: flex; justify-content: space-between; align-items: center; gap: 1rem;
        padding: 0.55rem 0.9rem; text-align: right; overflow-wrap: anywhere;
        border-bottom: 1px solid var(--grey);
      }
      .table-wrap tr td:last-child { border-bottom: none; }
      .table-wrap td[data-label]::before {
        content: attr(data-label); text-align: left; flex-shrink: 0;
        font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
        text-transform: uppercase; letter-spacing: 0.04em;
      }
      /* Actie-cel (zonder data-label, niet de empty-state met colspan): knoppen rechts */
      .table-wrap td:not([data-label]):not([colspan]) { justify-content: flex-end; }
      .table-wrap td .td-actions { justify-content: flex-end; }
      /* Empty-state blijft één gecentreerd blok binnen de card */
      .table-wrap td[colspan] { display: block; text-align: center; }

      /* Filterrij stapelt verticaal, velden op volle breedte */
      .filter-row { flex-direction: column; align-items: stretch; }
      .filter-row input, .filter-row select { width: 100%; }
      .filter-row input[type="text"] { min-width: 0; }

      /* Kanban: horizontaal scrollen met snap */
      .kanban-board { scroll-snap-type: x mandatory; }
      .kanban-col { scroll-snap-align: start; }

      /* Touch targets minimaal 44px */
      .icon-action, .modal-close, .drawer-close, .notif-btn, .nav-toggle {
        min-width: 44px; min-height: 44px;
        display: inline-flex; align-items: center; justify-content: center;
      }
      .btn, .btn-sm, .facturen-tab, .view-toggle-btn, .nav-item { min-height: 44px; }
      .form-group input, .form-group select, .form-group textarea,
      .filter-row input, .filter-row select, .login-field input,
      .factuur-klant-form input { min-height: 44px; }

      /* Factuur aanmaken/bewerken is desktop-only: toon de melding, verberg het formulier */
      #modal-factuur .modal-body, #modal-factuur .modal-footer-split { display: none; }
      #modal-factuur .factuur-desktop-note { display: block; }
      /* Bewerk-ingangen die naar de desktop-only modal leiden, verbergen */
      #btn-detail-bewerken { display: none; }
      #section-facturen .table-wrap button[data-action="openFactuurModal"] { display: none; }
    }

    /* ---------- < 560px: overlays full-screen, formulierrijen naar één kolom ---------- */
    @media (max-width: 559.98px) {
      /* Modals vullen het scherm */
      .modal-overlay { padding: 0; }
      .modal, .modal-sm, .modal-md, .modal-lg {
        max-width: 100%; width: 100%; max-height: 100vh; border-radius: 0; margin: 0;
      }
      .modal-header { border-radius: 0; }

      /* Drawer full-width */
      .drawer { width: 100%; max-width: 100%; }

      /* Formulierrijen naar één kolom */
      .form-row, .form-grid-2 { grid-template-columns: 1fr; }

      /* Factuurdocument (bekijken): full-screen en reflow zodat alles binnen 375px past */
      .factuur-detail-overlay { padding: 0; }
      .factuur-detail-doc { max-width: 100%; border-radius: 0; }
      .factuur-detail-content { padding: 1.2rem; }
      .factuur-detail-actions { flex-wrap: wrap; gap: 0.5rem; }
      .factuur-detail-buttons { flex-wrap: wrap; }
      .factuur-doc-header { flex-direction: column; gap: 0.8rem; }
      .factuur-doc-header-right { text-align: left; }
      .factuur-doc-info-grid { grid-template-columns: 1fr; gap: 1rem; }
      .factuur-doc-gegevens td:first-child { width: auto; }
      .factuur-doc-totalen { min-width: 0; width: 100%; }
      .factuur-doc-table th:nth-child(2), .factuur-doc-table th:nth-child(3),
      .factuur-doc-table th:nth-child(4), .factuur-doc-table th:last-child { width: auto; }
      .factuur-doc-table th, .factuur-doc-table td { padding: 0.5rem 0.4rem; }
      .factuur-doc-table th:first-child, .factuur-doc-table td:first-child { padding: 0.5rem 0.5rem; }
    }

