/* ixt-layout.css — IXT referentie zijbalkopmaak
   Opt-in: apps breiden ixt_core/base.html uit om dit te gebruiken.
   Geen hardgecodeerde kleuren — alles via --theme-* variabelen uit een themabestand.
   Thema's: laad een van /ixt-core/css/themes/theme-*.css in je basistemplate. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--theme-bg, #f8fafc);
  color: var(--theme-text, #1e293b);
}

/* ── Wrapper ── */
.ixt-wrapper { min-height: 100vh; }

/* ── Zijbalk ── */
.sidebar {
  width: var(--layout-sidebar-width, 220px);
  min-height: 100vh;
  background: var(--theme-sidebar-bg, #0f172a);
  color: var(--theme-sidebar-text, #f1f5f9);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-brand {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--theme-sidebar-border, #1e293b);
  margin-bottom: 1.5rem !important;
}

.brand-sub {
  font-size: 0.62rem;
  color: var(--theme-sidebar-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

/* Navigatielinks */
.sidebar .nav-link {
  color: var(--theme-sidebar-muted, #94a3b8);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  transition: background 0.15s, color 0.15s;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.sidebar .nav-link:hover {
  background: var(--theme-sidebar-hover, #1e293b);
  color: var(--theme-sidebar-text, #f1f5f9);
}

.sidebar .nav-link.active {
  background: var(--theme-primary, #1d4ed8);
  color: #fff;
}

.sidebar .nav-link i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

/* Zijbalkvoettekst */
.sidebar-footer {
  border-top: 1px solid var(--theme-sidebar-border, #1e293b);
  padding-top: 1rem;
}

/* ── Topbalk ── */
.top-header {
  height: 60px;
  background: var(--theme-header-bg, #ffffff);
  border-bottom: 1px solid var(--theme-border, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ── Inhoudsgebied ── */
#content-wrapper {
  min-height: 100vh;
  background: var(--theme-bg, #f8fafc);
}

main { max-width: 1400px; }

/* ── Mobiele zijbalk ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--layout-sidebar-width, 220px));
    z-index: 1000;
    transition: left 0.25s ease;
  }

  .sidebar.open { left: 0; }

  /* Header: groeit mee als de twee blokken (periodes + datums) wrappen */
  .top-header {
    height: auto;
    min-height: 60px;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* Inhoudsgebied: geen horizontale overflow door brede charts/tabellen */
  #content-wrapper {
    overflow-x: hidden;
    max-width: 100vw;
  }

  main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    overflow-x: hidden;
  }
}

/* Flex/grid items kunnen altijd krimpen tot 0 — voorkomt overflow door min-width:auto */
.chart-card,
.kpi-card,
.stat-card,
.stat-card-security {
  min-width: 0;
}
