/* Inter (self-hosted, SIL OFL — static/fonts/LICENSE-Inter.txt); geen externe font-CDN */
@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2-variations"),
       url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════════════════════
   Design system — navy/goud PWA-taal (fase 1)
   Tokens via --brand-*; geen CDN-fonts.
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand-primary: #0D1B2A;
  --brand-primary-dark: #070E1C;
  --brand-primary-light: #EEF1F7;
  --brand-accent: #D4AF37;
  --brand-accent-dark: #B8932A;
  --brand-accent-light: #FBF5DD;
  --brand-primary-rgb: 13, 27, 42;
  --brand-accent-rgb: 212, 175, 55;

  --ds-radius-card: 16px;
  --ds-radius-pill: 999px;
  --ds-shadow-card: 0 4px 18px rgba(13, 27, 42, 0.07);
  --ds-shadow-nav: 0 -6px 24px rgba(13, 27, 42, 0.08);
  --ds-bg-app: #F3F5F9;
  /* goud als tekst op lichte achtergrond (WCAG AA ≥ 4.5:1) */
  --brand-accent-text: #8A6D1A;
  --ds-bottom-nav-h: 64px;
  --ds-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--ds-font);
}

.tabular-nums,
.stat-card-v2-value,
.ds-stat-value,
.zp-stat-value,
.mgr-hero-stat-value,
.klok-clock,
.klok-hero-time {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── Brand / logo (officieel PNG-logo, licht/donker via [data-theme]) ── */
.brand-img {
  display: block;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Donker thema: tweekleurig logo op witte plaat (geen hertekende variant) */
.brand-plate {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  border-radius: 10px;
}

[data-theme="dark"] .brand-plate {
  background: #fff;
  padding: 0.4rem 0.6rem;
}

[data-theme="dark"] .header-brand-plate {
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1.1rem 1.25rem 0.9rem;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand:hover,
.sidebar-brand:focus {
  text-decoration: none;
  color: inherit;
}

.sidebar-brand-logo {
  width: 150px;
  height: auto;
}

.sidebar-brand-sub {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted, #5a6a85);
  padding-left: 0.2rem;
}

.sidebar-brand-sub-accent {
  color: var(--brand-accent-text, #8A6D1A);
}

[data-theme="dark"] .sidebar-brand-sub-accent {
  color: var(--brand-accent);
}

.header-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  margin-left: 0.25rem;
}

.header-brand-mark {
  width: 34px;
  height: auto;
}

.login-app-logo {
  width: min(78vw, 280px);
  height: auto;
}

/* ── Cards ── */
.ds-card,
.card-saas,
.stat-card-v2,
.mobile-card,
.zp-stat,
.zp-days,
.zp-year-compact {
  background: var(--surface, #fff);
  border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-card);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.06);
}

.ds-card {
  padding: 1.125rem 1.25rem;
}

.ds-card + .ds-card {
  margin-top: 0.875rem;
}

.ds-card-title {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text, #2a3547);
  letter-spacing: -0.01em;
}

/* ── Segment pills ── */
.ds-segment,
.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(var(--brand-primary-rgb), 0.06);
  border-radius: var(--ds-radius-pill);
}

.ds-segment-btn,
.segmented-control-item {
  border: none;
  background: transparent;
  color: var(--text-muted, #5a6a85);
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--ds-radius-pill);
  min-height: 36px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.ds-segment-btn.is-active,
.ds-segment-btn.active,
.segmented-control-item.is-active,
.segmented-control-item.active {
  background: var(--brand-primary);
  color: #fff;
}

/* ── Status chips ── */
.ds-chip,
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--ds-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.ds-chip-success,
.badge-status.badge-aanwezig,
.badge-status.success {
  background: #ecfdf5;
  color: #059669;
}

.ds-chip-warn,
.badge-status.badge-verwacht,
.badge-status.warning {
  background: #fff7ed;
  color: #c2410c;
}

.ds-chip-danger,
.badge-status.badge-afwezig,
.badge-status.danger {
  background: #fef2f2;
  color: #dc2626;
}

.ds-chip-accent {
  background: var(--brand-accent-light);
  color: var(--brand-accent-dark);
}

.ds-chip-neutral {
  background: rgba(var(--brand-primary-rgb), 0.08);
  color: var(--brand-primary);
}

/* ── Progress ── */
.ds-progress {
  height: 10px;
  border-radius: var(--ds-radius-pill);
  background: rgba(var(--brand-primary-rgb), 0.08);
  overflow: hidden;
}

.ds-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #059669, #34d399);
  transition: width 0.35s ease;
}

.ds-progress-bar.is-accent {
  background: linear-gradient(90deg, var(--brand-accent-dark), var(--brand-accent));
}

/* ── CTA ── */
.ds-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 14px;
  background: var(--brand-accent);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(var(--brand-accent-rgb), 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ds-btn-gold:hover,
.ds-btn-gold:focus {
  color: var(--brand-primary);
  background: var(--brand-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(var(--brand-accent-rgb), 0.42);
}

.ds-btn-gold:active {
  transform: translateY(0);
}

/* ── Quick action grid ── */
.ds-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ds-quick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 1rem;
  border-radius: var(--ds-radius-card);
  background: var(--surface, #fff);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.06);
  box-shadow: var(--ds-shadow-card);
  text-decoration: none;
  color: var(--text, #2a3547);
  min-height: 96px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ds-quick-item:hover {
  color: var(--text, #2a3547);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(11, 20, 38, 0.1);
}

.ds-quick-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-size: 1rem;
}

.ds-quick-label {
  font-weight: 700;
  font-size: 0.875rem;
}

/* ── Bottom nav (PWA shell) ── */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1045;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: calc(var(--ds-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 0.35rem env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(var(--brand-primary-rgb), 0.08);
  box-shadow: var(--ds-shadow-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .app-bottom-nav {
  background: rgba(35, 42, 69, 0.96);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.app-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding: 0.35rem 0.2rem 0.45rem;
  color: var(--text-muted, #5a6a85);
  text-decoration: none;
  font-size: 0.625rem;
  font-weight: 700;
  border: none;
  background: transparent;
  transition: color 0.15s ease;
}

.app-bottom-nav .nav-item i {
  font-size: 1.15rem;
}

.app-bottom-nav .nav-item.active,
.app-bottom-nav .nav-item:hover {
  color: var(--brand-accent);
}

.app-bottom-nav .nav-item-center {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  top: -1.15rem;
}

.app-bottom-nav .nav-center-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-accent);
  color: var(--brand-primary);
  font-size: 1.35rem;
  text-decoration: none;
  box-shadow:
    0 0 0 5px var(--ds-bg-app, #F3F5F9),
    0 10px 22px rgba(var(--brand-accent-rgb), 0.45);
  transition: transform 0.15s ease;
}

[data-theme="dark"] .app-bottom-nav .nav-center-btn {
  box-shadow:
    0 0 0 5px #1a1f36,
    0 10px 22px rgba(var(--brand-accent-rgb), 0.45);
}

.app-bottom-nav .nav-center-btn:hover,
.app-bottom-nav .nav-center-btn:focus {
  color: var(--brand-primary);
  transform: scale(1.04);
}

.app-bottom-nav .nav-center-btn.active {
  box-shadow:
    0 0 0 5px var(--ds-bg-app, #F3F5F9),
    0 0 0 8px rgba(var(--brand-accent-rgb), 0.22),
    0 10px 22px rgba(var(--brand-accent-rgb), 0.5);
}

/* Page padding for fixed bottom nav */
@media (max-width: 991.98px) {
  body.has-app-nav .page-content,
  body.has-app-nav .main-panel {
    padding-bottom: calc(var(--ds-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
  }

  body.has-app-nav .zp-body,
  body.has-app-nav.zp-body {
    padding-bottom: calc(var(--ds-bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 1.25rem);
  }
}

@media (min-width: 992px) {
  .app-bottom-nav {
    display: none;
  }
}

/* Motion — subtle presence */
@keyframes ds-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ds-pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--brand-accent-rgb), 0.35); }
  50% { box-shadow: 0 0 0 12px rgba(var(--brand-accent-rgb), 0); }
}

.ds-animate-in {
  animation: ds-fade-up 0.4s ease;
}

.ds-animate-in-delay-1 { animation-delay: 0.06s; }
.ds-animate-in-delay-2 { animation-delay: 0.12s; }
.ds-animate-in-delay-3 { animation-delay: 0.18s; }

.nav-center-btn {
  animation: ds-pulse-ring 2.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ds-animate-in,
  .nav-center-btn {
    animation: none;
  }
}

/* ── Demo dashboard shell (simpele UI, mockup-inspired) ── */
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dash-head-date {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #7c8ba1);
}

.dash-head-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-primary);
}

[data-theme="dark"] .dash-head-title { color: #fff; }

.dash-head-sub { font-size: 0.9375rem; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.875rem;
}

.dash-stat-card {
  background: var(--surface, #fff);
  border: 1px solid rgba(var(--brand-primary-rgb), 0.06);
  border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-card);
  padding: 1rem 1.15rem;
}

[data-theme="dark"] .dash-stat-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}

.dash-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #7c8ba1);
  margin-bottom: 0.35rem;
}

.dash-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-primary);
  line-height: 1.1;
}

[data-theme="dark"] .dash-stat-value { color: #fff; }

.dash-stat-value.is-danger { color: #c0392b; }

.dash-stat-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted, #7c8ba1);
}

@media (max-width: 767.98px) {
  .dash-stats { grid-template-columns: 1fr; }
  .dash-head-cta { width: 100%; justify-content: center; }
}

/* ── Instellingen (minimaal: links naar inklokmiddelen) ── */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--brand-primary-rgb), 0.08);
  background: var(--surface, #fff);
  color: var(--text, #2a3547);
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-item:hover,
.settings-item:focus {
  color: var(--text, #2a3547);
  text-decoration: none;
  background: var(--brand-accent-light);
  border-color: rgba(var(--brand-accent-rgb), 0.45);
}

[data-theme="dark"] .settings-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .settings-item:hover,
[data-theme="dark"] .settings-item:focus {
  background: rgba(var(--brand-accent-rgb), 0.16);
}

.settings-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  flex-shrink: 0;
}

[data-theme="dark"] .settings-item-icon {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.settings-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.settings-item-text small {
  color: var(--text-muted, #5a6a85);
  font-size: 0.8125rem;
}

.settings-item-chevron {
  color: var(--text-muted, #5a6a85);
  font-size: 0.75rem;
}

.settings-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.settings-dl dt {
  color: var(--text-muted, #5a6a85);
  font-weight: 600;
}

.settings-dl dd {
  margin: 0;
  color: var(--text, #2a3547);
}
