/* public/css/style.css */
:root {
  --primary: #1e3a8a;          /* Zakelijk diep marineblauw */
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --secondary: #0f766e;        /* Teal accent */
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f3f4f6;
  color: var(--gray-800);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
@media (max-width: 1200px) {
  #view-settings-templates .template-editor-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar-mobile-backdrop {
  display: none;
}

.sidebar-mobile-close {
  display: none;
}

.btn-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  border-color: var(--gray-300);
}

.btn-topbar-mobile-search {
  display: none;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #0f172a;
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  transition: padding 0.22s ease;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.sidebar-collapse-btn .icon-collapse-arrow {
  transition: transform 0.22s ease;
}

.sidebar.collapsed .sidebar-collapse-btn .icon-collapse-arrow {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
  padding: 16px 8px;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.sidebar.collapsed .sidebar-brand-info {
  display: none !important;
}

.sidebar.collapsed .sidebar-brand-link {
  justify-content: center;
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-collapse-btn {
  margin: 0 auto;
}

.sidebar-brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.sidebar-brand .logo-icon {
  background: #2563eb;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

.sidebar-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  transition: padding 0.22s ease;
}

.sidebar.collapsed .sidebar-nav {
  padding: 16px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: var(--radius);
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.sidebar.collapsed .nav-item {
  padding: 10px 0;
  justify-content: center;
  gap: 0;
}

.sidebar.collapsed .nav-item .nav-item-label,
.sidebar.collapsed .nav-item .nav-chevron {
  display: none !important;
}

.sidebar.collapsed .nav-item .icon {
  margin: 0 auto;
}

.sidebar.collapsed .nav-submenu {
  display: none !important;
}

/* Tooltip bij hoveren over icoon in ingeklapte staat */
@media (min-width: 769px) {
  .sidebar.collapsed .nav-item {
    position: relative;
  }
  .sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
    border: 1px solid #334155;
  }
  .sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
  }
}

.nav-item:hover {
  background: #1e293b;
  color: #fff;
}

.nav-item.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item .icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
  transition: padding 0.22s ease;
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px 6px;
  text-align: center;
}

.sidebar.collapsed #sidebarUserBox {
  justify-content: center;
}

.sidebar.collapsed #sidebarUserDisplay {
  display: none !important;
}

.sidebar.collapsed #sidebarLogoutBtn {
  margin: 0 auto;
  padding: 4px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

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

.content-body {
  padding: 28px;
}

/* View Sections */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* Cards & Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .dashboard-tables-grid,
  .dashboard-widgets-grid {
    grid-template-columns: 1fr !important;
  }
}

.stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px -1px rgba(0, 0, 0, 0.06);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  font-size: 16px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
}

.stat-card.primary .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-card.success .stat-icon { background: #f0fdf4; color: #16a34a; }
.stat-card.warning .stat-icon { background: #fffbeb; color: #d97706; }
.stat-card.danger .stat-icon { background: #fef2f2; color: #dc2626; }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-sub {
  font-size: 12.5px;
  color: #64748b;
}

/* Aging & Overdue badges */
.badge-overdue {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 700;
}
.badge-due-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  font-weight: 600;
}
.badge-due-ok {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
  font-weight: 500;
}


/* Card container */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #fff;
  border-color: var(--gray-300);
  color: var(--gray-700);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-success:hover {
  background: #15803d;
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border-color: #fca5a5;
}
.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

table.data-table th {
  background: var(--gray-50);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}

table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-700);
  font-size: 13.5px;
}

table.data-table tr:hover td {
  background: #f8fafc;
}

.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: var(--success-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #9a3412; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }
.badge-danger { background: var(--danger-bg); color: #991b1b; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input, .select-input {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  background: #fff;
  outline: none;
}

.search-input:focus, .select-input:focus, .form-control:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

.modal-content.large {
  max-width: 950px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-50);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-500);
  padding: 4px;
  border-radius: 4px;
}
.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--gray-50);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-700);
}

.form-label span.req {
  color: var(--danger);
}

.form-control {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13.5px;
  background: #fff;
  outline: none;
  width: 100%;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Line items editor */
.items-table-wrapper {
  margin: 16px 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
}

.items-table th {
  background: var(--gray-100);
  padding: 8px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
}

.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-200);
}

.items-table select.item-vat {
  min-width: 75px;
  padding-left: 8px;
  padding-right: 6px;
  font-weight: 500;
}

.totals-summary {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 13px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  width: 280px;
  padding: 4px 0;
}

.totals-row.grand-total {
  border-top: 2px solid var(--gray-800);
  margin-top: 4px;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

/* BTW Aangifte Rapport Styling */
.tax-box {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.tax-rubriek-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
}
.tax-rubriek-row:last-child {
  border-bottom: none;
}

.tax-rubriek-title {
  font-weight: 600;
  font-size: 13.5px;
}

.tax-rubriek-turnover {
  color: var(--gray-500);
  font-size: 13px;
  margin-right: 24px;
}

.tax-rubriek-vat {
  font-weight: 700;
  font-size: 14px;
  min-width: 110px;
  text-align: right;
}

.tax-highlight {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 16px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 16px;
}

/* Print CSS Rules */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ==========================================================================
   Navigation Brand & Changelog Styling
   ========================================================================== */
.sidebar-brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.sidebar-brand-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-brand-link:hover .sidebar-brand-text {
  color: #60a5fa !important;
}

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 175px;
  transition: color 0.15s ease;
}

.topbar-company-badge {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-company-badge:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
}

.status-indicator-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Changelog Timeline & Cards */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  padding-left: 20px;
  border-left: 2px solid #e2e8f0;
  margin: 16px 0 16px 8px;
}

.changelog-entry {
  position: relative;
}

.changelog-entry::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.changelog-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.2s ease;
}

.changelog-summary {
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  display: block;
}

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

.changelog-summary:hover {
  background: #f8fafc;
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.changelog-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.changelog-chevron {
  font-size: 11px;
  color: #94a3b8;
  transition: transform 0.2s ease;
  display: inline-block;
}

details[open] .changelog-chevron {
  transform: rotate(90deg);
}

.changelog-body {
  padding: 0 20px 16px 20px;
  border-top: 1px solid #f1f5f9;
  padding-top: 14px;
}

.changelog-ver-badge {
  font-weight: 700;
  font-size: 14px;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 3px 10px;
  border-radius: 6px;
}

.changelog-date {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.changelog-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  line-height: 1.45;
}

.changelog-pill {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.03em;
  margin-top: 1px;
}

.changelog-pill.nieuw {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.changelog-pill.verbeterd {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.changelog-pill.opgelost {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}


/* ==========================================================================
   Rustiger uiterlijk (v1.2.0)
   ========================================================================== */
.sidebar-header {
  padding: 22px 20px;
  background: #0f172a;
}

.sidebar-brand-link .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.sidebar-subtitle {
  font-size: 12px;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  color: #94a3b8;
}

.nav-subitem {
  font-size: 13.5px !important;
}

.card-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
  line-height: 1.4;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 16px;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Toggle Switch (Aan/Uit balk) */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.2s ease;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #16a34a;
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 1px #16a34a;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.advanced-box {
  margin-bottom: 8px;
  font-size: 13px;
  color: #64748b;
}

.advanced-box summary {
  cursor: pointer;
  font-weight: 600;
}

.card {
  box-shadow: none;
}

.stat-card .stat-icon {
  opacity: 0.5;
}

/* Help-modus styling */
.help-tip {
  display: none;
  margin-left: 6px;
  vertical-align: middle;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  border: 1px solid #bae6fd;
  transition: all 0.2s ease;
  user-select: none;
  line-height: 1;
  text-decoration: none !important;
  position: relative;
  pointer-events: auto;
}

.help-tip:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* Dynamische zwevende tooltip op body-niveau (nooit afgekapt door overflow) */
#floatingHelpTooltip {
  position: fixed;
  background: #0f172a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  max-width: 280px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: none;
}

#floatingHelpTooltip.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

#floatingHelpTooltip::after {
  content: '';
  position: absolute;
  border: 5px solid transparent;
  pointer-events: none;
}

#floatingHelpTooltip.arrow-bottom::after {
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border-top-color: #0f172a;
}

#floatingHelpTooltip.arrow-top::after {
  bottom: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border-bottom-color: #0f172a;
}

body.help-mode-active .help-tip {
  display: inline-flex;
}

/* Gevarenzone styling */
.danger-card {
  border: 1px solid #fecaca;
  background: #fff;
  border-radius: var(--radius);
  margin-top: 24px;
}
.danger-card .card-header {
  background: #fef2f2;
  border-bottom: 1px solid #fee2e2;
}
.danger-card .card-title {
  color: #991b1b;
}

/* ==========================================
 * Zoekbare Grootboekrekening Autocomplete Picker
 * ========================================== */
.ledger-picker-wrapper {
  position: relative;
  width: 100%;
}

.ledger-picker-input {
  width: 100%;
  padding-right: 28px !important;
}

.ledger-picker-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  display: none;
}
.ledger-picker-clear:hover {
  color: #ef4444;
  background: #f1f5f9;
}

.ledger-picker-dropdown {
  position: fixed;
  min-width: 280px;
  max-width: 420px;
  max-height: 250px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 999999;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  font-size: 13px;
}

.ledger-picker-item {
  padding: 7px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.1s ease;
  border-bottom: 1px solid #f8fafc;
}
.ledger-picker-item:last-child {
  border-bottom: none;
}

.ledger-picker-item:hover,
.ledger-picker-item.active {
  background-color: #eff6ff;
}

.ledger-picker-code {
  font-family: monospace;
  font-weight: 700;
  color: #1e3a8a;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.ledger-picker-name {
  flex: 1;
  color: #1e293b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-picker-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}
.ledger-picker-badge.badge-omzet {
  background: #dcfce7;
  color: #166534;
}
.ledger-picker-badge.badge-kosten {
  background: #fee2e2;
  color: #991b1b;
}
.ledger-picker-badge.badge-activa {
  background: #e0e7ff;
  color: #3730a3;
}
.ledger-picker-badge.badge-passiva {
  background: #fef3c7;
  color: #92400e;
}

.ledger-picker-empty {
  padding: 10px 12px;
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
  font-style: italic;
}

/* ==========================================
 * Zoekbare Relaties (Klanten & Leveranciers) Autocomplete Picker
 * ========================================== */
.relation-picker-wrapper {
  position: relative;
  width: 100%;
}

.relation-picker-input {
  width: 100%;
  padding-right: 28px !important;
}

.relation-picker-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  display: none;
}
.relation-picker-clear:hover {
  color: #ef4444;
  background: #f1f5f9;
}

.relation-picker-dropdown {
  position: fixed;
  min-width: 280px;
  max-width: 440px;
  max-height: 250px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
  z-index: 999999;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  font-size: 13px;
}

.relation-picker-item {
  padding: 7px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.1s ease;
  border-bottom: 1px solid #f8fafc;
}
.relation-picker-item:last-child {
  border-bottom: none;
}

.relation-picker-item:hover,
.relation-picker-item.active {
  background-color: #eff6ff;
}

.relation-picker-name {
  flex: 1;
  color: #1e293b;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.relation-picker-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-left: 4px;
  font-weight: normal;
}

.relation-picker-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}
.relation-picker-badge.badge-customer {
  background: #dbeafe;
  color: #1e40af;
}
.relation-picker-badge.badge-supplier {
  background: #fef3c7;
  color: #92400e;
}
.relation-picker-badge.badge-both {
  background: #e0e7ff;
  color: #3730a3;
}

.relation-picker-empty {
  padding: 10px 12px;
  color: #64748b;
  font-size: 12.5px;
  text-align: center;
  font-style: italic;
}

/* ========================================== */
/* Topbar Algemene Zoekfunctie                */
/* ========================================== */
.topbar-search-container {
  position: relative;
  width: 380px;
  max-width: 100%;
}

.topbar-search-bar {
  display: flex;
  align-items: center;
  position: relative;
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.topbar-search-bar:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.topbar-search-bar .search-icon {
  position: absolute;
  left: 10px;
  color: var(--gray-400);
  pointer-events: none;
}

.topbar-search-input {
  width: 100%;
  height: 36px;
  padding: 6px 70px 6px 32px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--gray-800);
  outline: none;
}

.topbar-search-input::placeholder {
  color: var(--gray-400);
}

.topbar-search-btn {
  position: absolute;
  right: 4px;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.topbar-search-btn:hover {
  background: #1d4ed8;
}

/* Dropdown Zoekresultaten */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 520px;
  max-width: 90vw;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
  animation: modalIn 0.15s ease-out;
}

.global-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 600;
}

.global-search-hint {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: normal;
}

.global-search-list {
  max-height: 420px;
  overflow-y: auto;
}

.global-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s ease;
  text-decoration: none;
  color: inherit;
}

.global-search-item:last-child {
  border-bottom: none;
}

.global-search-item:hover, .global-search-item.selected {
  background: #f1f5f9;
}

.global-search-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.global-search-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-verkoop { background: #dcfce7; color: #166534; }
.badge-inkoop { background: #ffedd5; color: #9a3412; }
.badge-relatie { background: #dbeafe; color: #1e40af; }
.badge-memoriaal { background: #ede9fe; color: #5b21b6; }
.badge-grootboek { background: #f1f5f9; color: #334155; }
.badge-offerte { background: #fef3c7; color: #92400e; }
.badge-contract { background: #e0e7ff; color: #3730a3; }
.badge-project { background: #ccfbf1; color: #115e59; }
.badge-product { background: #fce7f3; color: #9d174d; }
.badge-activa { background: #fee2e2; color: #991b1b; }
.badge-passiva { background: #ffedd5; color: #9a3412; }

.global-search-item-info {
  min-width: 0;
  flex: 1;
}

.global-search-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-search-item-sub {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.global-search-item-right {
  text-align: right;
  margin-left: 12px;
  flex-shrink: 0;
}

.global-search-item-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
}

.global-search-item-date {
  font-size: 11.5px;
  color: var(--gray-400);
}

.global-search-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}





/* Handmatig betalen staat uit: alles wat een betaling zelf invoert verdwijnt */
body.no-manual-payments .manual-pay-only { display: none !important; }

/* ====================================================
   Centraal Aanmaakmenu & Overzichtskaarten
   ==================================================== */
.topbar-create-container {
  position: relative;
}

.topbar-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: 1px solid #1d4ed8;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.topbar-create-btn:hover {
  background: #1d4ed8;
}

.quick-create-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 720px;
  max-width: 95vw;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-create-header {
  padding: 14px 20px 10px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.quick-create-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.quick-create-subtitle {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.quick-create-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 16px 20px;
}

@media (max-width: 820px) {
  .quick-create-grid {
    grid-template-columns: 1fr 1fr;
  }
  .quick-create-dropdown {
    width: 92vw;
    right: -20px;
  }
}

.quick-create-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-create-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.quick-create-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.quick-create-item:hover {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 600;
}

.quick-create-footer {
  padding: 10px 20px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.quick-create-footer a {
  font-size: 12.5px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  cursor: pointer;
}

.quick-create-footer a:hover {
  text-decoration: underline;
}

/* Aanmaak Overzichtspagina (/aanmaken) */
.create-hub-section {
  margin-bottom: 28px;
}

.create-hub-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.create-hub-section-desc {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.create-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.create-hub-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.create-hub-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.create-hub-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-shrink: 0;
}

.create-hub-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
}

.create-hub-card-desc {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.45;
}

/* Subgroep in sidebar (bijv. "Meer boekhouding") */
.nav-subgroup {
  margin-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
  padding-top: 6px;
}

.nav-subgroup-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-subgroup-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-subgroup-menu {
  display: none;
  padding-left: 6px;
  margin-top: 2px;
}

.nav-subgroup.expanded .nav-subgroup-menu {
  display: block;
}

.nav-subgroup.expanded .nav-subgroup-chevron {
  transform: rotate(90deg);
}

.nav-subgroup-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
  color: #64748b;
}

/* ==========================================================================
   Mobiele Navigatie & Responsieve Styling (Smartphones & Tablets)
   ========================================================================== */

/* Onderbalk (Standaard verborgen op desktop) */
.mobile-bottom-nav {
  display: none;
}

.mobile-sheet-backdrop {
  display: none;
}

@media (max-width: 768px) {
  /* 1. Basis Layout & Scrolling */
  body.mobile-sidebar-open,
  body.sheet-open {
    overflow: hidden;
  }

  .app-container {
    flex-direction: column;
    min-height: 100vh;
    position: relative;
  }

  .main-content {
    min-width: 0;
    max-height: none;
    overflow-y: visible;
    padding-bottom: 78px; /* Ruimte voor de vaste onderbalk */
  }

  /* 2. Uitschuifbaar Zijmenu (Off-canvas Drawer) */
  .sidebar-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .sidebar-mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 84vw;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    border-right: none;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-collapse-btn {
    display: none !important;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
  }

  .sidebar-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
  }

  .sidebar-mobile-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
  }

  /* 3. Compacte Topbar */
  .topbar {
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-700);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
  }

  .btn-sidebar-toggle:active {
    background: var(--gray-100);
  }

  .topbar-title {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .btn-topbar-mobile-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-700);
    cursor: pointer;
  }

  .btn-topbar-mobile-search:active {
    background: var(--gray-100);
  }

  /* Snel Aanmaken knop compacter op mobiel */
  .topbar-create-btn {
    height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  /* Zoekbalk klapt op mobiel over de breedte open */
  .topbar-search-container {
    display: none;
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1020;
  }

  .topbar-search-container.mobile-search-open {
    display: block;
    animation: modalIn 0.15s ease-out;
  }

  .global-search-dropdown {
    width: 100%;
    max-width: 100vw;
    right: 0;
    left: 0;
    border-radius: 0 0 8px 8px;
  }

  /* 4. Content & Kaarten */
  .content-body {
    padding: 14px 12px;
  }

  .card, .fullpage-card {
    padding: 16px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
  }

  .card-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-body {
    padding: 14px 12px;
  }

  /* KPI Grid: 2x2 op mobiel voor overzichtelijk dashboard */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 12px 14px;
    border-radius: 8px;
  }

  .stat-label {
    font-size: 10.5px;
  }

  .stat-value {
    font-size: 18px;
    margin-bottom: 2px;
  }

  .stat-sub {
    font-size: 11px;
    line-height: 1.3;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .dashboard-tables-grid,
  .dashboard-widgets-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* 5. Sub-tabs horizontaal scrollbaar */
  .sub-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 14px;
    gap: 4px;
  }

  .sub-tab-btn {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 12.5px;
    flex-shrink: 0;
  }

  /* 6. Filter-bars & Formulieren */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-bar > * {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .form-group.full-width {
    grid-column: span 1 !important;
  }

  .form-control,
  input.form-control,
  select.form-control,
  textarea.form-control {
    font-size: 16px !important; /* Voorkomt automatisch inzoomen op smartphones */
  }

  /* 7. Inkoopbon Foto bovenaan op smartphone */
  .split-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .expense-receipt-col {
    order: -1;
    margin-bottom: 10px;
  }

  .receipt-preview-zone {
    min-height: 180px;
    height: auto !important;
    max-height: none !important;
    padding: 12px;
  }

  /* 8. Tabellen & Uren-rijen */
  table.data-table th,
  table.data-table td {
    padding: 8px 10px;
    font-size: 12.5px;
  }

  /* Projecten & Uren Mobiel */
  .project-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .project-tasks-notes-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .project-quick-hours-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .project-quick-hours-bar input,
  .project-quick-hours-bar button {
    width: 100% !important;
  }

  #modalTimeRowsTbody tr.modal-time-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 10px;
  }

  #modalTimeRowsTbody tr.modal-time-row td {
    padding: 0;
    border-bottom: none;
    width: 100% !important;
  }

  #modalTimeRowsTbody tr.modal-time-row td:last-child {
    text-align: right;
  }

  #modalLogTime .items-table {
    min-width: 100% !important;
  }

  #modalLogTime .items-table thead {
    display: none;
  }

  /* 9. Modals als Bottom-sheet op smartphone */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    height: auto;
    border-radius: 16px 16px 0 0 !important;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-title {
    font-size: 16px;
  }

  .modal-body {
    padding: 16px 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* 10. Vaste Mobiele Onderbalk */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    z-index: 990;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--gray-500);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    flex: 1;
    transition: color 0.15s ease;
  }

  .mobile-nav-btn:hover,
  .mobile-nav-btn.active {
    color: #2563eb;
  }

  .mobile-nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-nav-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Opvallende Actieknop in het midden */
  .mobile-nav-action-btn {
    position: relative;
    top: -12px;
  }

  .mobile-nav-action-circle {
    width: 46px;
    height: 46px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease;
  }

  .mobile-nav-action-circle svg {
    width: 22px;
    height: 22px;
  }

  .mobile-nav-action-btn:active .mobile-nav-action-circle {
    transform: scale(0.92);
  }

  /* 11. Mobiele Snelle Acties Bottom Sheet */
  .mobile-sheet-backdrop {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    align-items: flex-end;
    justify-content: center;
  }

  .mobile-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-sheet-card {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 16px 16px 0 0;
    padding: 14px 16px 24px;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-sheet-backdrop.active .mobile-sheet-card {
    transform: translateY(0);
  }

  .mobile-sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 0 auto 12px;
  }

  .mobile-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
  }

  .mobile-sheet-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
  }

  .mobile-sheet-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-sheet-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #ffffff;
    color: var(--gray-800);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.12s ease;
  }

  .mobile-sheet-btn:active {
    background: #f1f5f9;
  }

  .mobile-sheet-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
  }

  .mobile-sheet-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .mobile-sheet-text strong {
    font-size: 14px;
    color: var(--gray-900);
  }

  .mobile-sheet-text small {
    font-size: 11.5px;
    color: var(--gray-500);
  }
}
