body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f5f7;
  color: #222;
  overflow-x: hidden;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  width: 100%;
  max-width: 520px;
}

.auth-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.auth-card-wide {
  max-width: 640px;
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.auth-card p {
  color: #6b7280;
  margin-bottom: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #1f2937;
  color: #fff;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.nav a {
  color: #dbe4ee;
  text-decoration: none;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.userbar-name {
  font-weight: 700;
}

.userbar-role {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.logout-form {
  margin: 0;
}

.logout-button {
  background: #475569;
}

.page {
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px 0;
}

.page-header p {
  margin: 0;
  color: #666;
}

.dashboard-period {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #f6f9fc 100%);
}

.dashboard-period-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 20px;
}

.stack-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.full-width {
  grid-column: 1 / -1;
}

.panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
}

.compact-panel {
  padding: 14px 18px;
}

.top-space {
  margin-top: 20px;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.stats-grid-dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.dashboard-stack {
  gap: 20px;
}

.bookkeeping-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.summary-block {
  padding: 14px 0;
  border-top: 1px solid #eceff3;
}

.summary-block:first-child {
  border-top: none;
  padding-top: 0;
}

.summary-block h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
}

.summary-highlight {
  background: #f8fafc;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.summary-highlight-purple {
  background: linear-gradient(135deg, #f7f0ff 0%, #f2f8ff 100%);
  border-color: #d9c9f8;
}

.summary-kpi {
  font-size: 32px;
  font-weight: 700;
  color: #5b21b6;
  margin: 8px 0 10px;
}

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

.summary-pairs div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.summary-pairs span {
  color: #6b7280;
  font-size: 13px;
}

.summary-pairs strong {
  font-size: 20px;
}

.summary-pairs-strong strong {
  color: #111827;
}

.summary-note {
  margin: 14px 0 0;
}

.stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}

.stat-label {
  color: #6b7280;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.stat-value-small {
  font-size: 22px;
}

.stat-card-alert {
  border-color: #fca5a5;
  background: #fef2f2;
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #eceff3;
  vertical-align: top;
}

.table th {
  font-size: 13px;
  color: #5b6470;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.inline-search input,
.inline-search select {
  border: 1px solid #cfd6de;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.full {
  grid-column: 1 / -1;
}

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

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-form {
  gap: 6px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 10px 14px;
  background: #1f5fbf;
  color: #fff;
  text-decoration: none;
}

button {
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  background: #1f5fbf;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.danger-button {
  background: #b91c1c;
}

button:disabled {
  background: #9ca3af;
  cursor: default;
}

.inline-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  text-decoration: none;
}

.tab-link.is-active {
  background: #1f5fbf;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e5e7eb;
}

.badge-concept,
.badge-verstuurd,
.badge-on_hold {
  background: #ede9fe;
  color: #4c1d95;
}

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

.badge-afgewezen {
  background: #fee2e2;
  color: #991b1b;
}

.badge-job-gepland {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-job-actief {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-job-afgerond {
  background: #dcfce7;
  color: #166534;
}

.badge-job-gefactureerd {
  background: #fef3c7;
  color: #92400e;
}

.badge-invoice-concept {
  background: #e5e7eb;
  color: #374151;
}

.badge-invoice-verstuurd {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-invoice-deels_betaald {
  background: #ede9fe;
  color: #6d28d9;
}

.badge-invoice-betaald {
  background: #dcfce7;
  color: #166534;
}

.badge-invoice-herinnering_1,
.badge-invoice-herinnering_2 {
  background: #ffedd5;
  color: #c2410c;
}

.badge-invoice-te_laat {
  background: #fee2e2;
  color: #991b1b;
}

.detail-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  margin: 0;
}

.detail-list.single-column {
  grid-template-columns: 1fr;
}

.detail-list div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-list dt {
  font-size: 12px;
  color: #6b7280;
}

.detail-list dd {
  margin: 0;
}

.stack-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stack-list li {
  padding: 10px 0;
  border-bottom: 1px solid #eceff3;
}

.muted {
  color: #6b7280;
}

.text-danger {
  color: #b91c1c;
  font-weight: 700;
}

.placeholder-box {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.pdf-frame {
  width: 100%;
  min-height: 720px;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #f8fafc;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 240px;
  padding: 12px 0 4px;
}

.mini-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mini-chart-bars {
  height: 200px;
  width: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 8px;
  padding: 0 4px;
}

.mini-bar {
  width: 24px;
  min-height: 8px;
  border-radius: 10px 10px 4px 4px;
}

.mini-bar-omzet {
  background: linear-gradient(180deg, #7c3aed 0%, #5b21b6 100%);
}

.mini-bar-kosten {
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
}

.mini-chart-label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: #475569;
  font-size: 13px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
}

.legend-dot-omzet {
  background: #6d28d9;
}

.legend-dot-kosten {
  background: #16a34a;
}

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

.progress-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  background: #2563eb;
}

.workplan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workplan-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #fff;
}

.workplan-item.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checkbox-button {
  min-width: 42px;
  background: #0f172a;
}

.workplan-toggle {
  margin: 0;
}

.workplan-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.template-block {
  padding: 16px 0;
  border-bottom: 1px solid #e5e7eb;
}

.template-block h3 {
  margin: 0 0 4px 0;
}

.flash-stack {
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.flash-success {
  background: #dcfce7;
  color: #166534;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
}

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

  .two-column,
  .bookkeeping-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .userbar {
    width: 100%;
    justify-content: flex-start;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .page {
    padding: 16px;
  }

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

  .detail-grid,
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .summary-pairs {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .actions,
  .status-actions,
  .inline-form,
  .inline-search {
    flex-direction: column;
    align-items: stretch;
  }

  .actions > *,
  .status-actions > *,
  .inline-form > *,
  .inline-search > * {
    width: 100%;
  }

  .link-button,
  button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }

  .pdf-frame {
    min-height: 460px;
  }

  .workplan-item {
    flex-direction: column;
  }

  .checkbox-button {
    width: 100%;
  }

  .mini-chart {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: auto;
  }

  .mini-chart-bars {
    height: 150px;
  }
}

@media (max-width: 720px) {
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .table thead,
  .table tbody,
  .table tr {
    white-space: nowrap;
  }

  .tab-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .tab-row::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-value-small {
    font-size: 20px;
  }

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

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

  .mini-bar {
    width: 18px;
  }
}
