/* ============================================================
   RSW Portaal — main.css
   Licht thema, navy + goud — geïnspireerd op RSWSysteem
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS-variabelen ── */
:root {
  --color-bg:           #f0f4f8;
  --color-surface:      #ffffff;
  --color-surface-alt:  #e8eef5;
  --color-primary:      #1e3a5f;
  --color-primary-dark: #162d4a;
  --color-accent:       #e8a020;
  --color-accent-dark:  #c98c18;
  --color-text:         #1a2b3c;
  --color-text-muted:   #6b7d90;
  --color-border:       #d1dae6;
  --color-success:      #22c55e;
  --color-warning:      #f59e0b;
  --color-error:        #ef4444;
  --color-info:         #3b82f6;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.16);

  --header-height:     60px;
  --sidebar-width:     240px;
  --sidebar-collapsed: 60px;

  --transition: 0.15s ease;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Layout ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout-body {
  display: flex;
  flex: 1;
  margin-top: var(--header-height);
}

.content-area {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: var(--sidebar-width);
  padding: 24px;
  min-height: calc(100vh - var(--header-height) - 48px);
  transition: margin-left var(--transition);
}

.content-area.sidebar-collapsed {
  margin-left: 0;
}

/* ── Header — donker navy zoals RSWSysteem ── */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-primary);
  border-bottom: none;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* Header tekst wit */
#header .header-logo,
#header .header-logo:hover,
#header .user-name,
#header .btn-icon {
  color: #fff;
}

#header .btn-icon:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

#header .user-menu:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

#header .user-avatar {
  background: var(--color-accent);
  color: var(--color-primary);
}

#header .role-badge-header {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
}

#header .editie-switcher {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

#header .editie-switcher:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition);
  z-index: 90;
}

#sidebar.collapsed {
  width: 0;
  border-right: none;
}

/* ── Footer ── */
#footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 12px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-left: var(--sidebar-width);
  box-sizing: border-box;
  max-width: 100%;
  transition: margin-left var(--transition);
}

#footer.sidebar-collapsed {
  margin-left: 0;
}

/* ── Typografie ── */
h1 { font-size: 1.6rem;  font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.95rem; font-weight: 600; }

.text-muted   { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error   { color: var(--color-error); }
.text-info    { color: var(--color-info); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }

/* ── Utility ── */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4           { gap: 4px; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.gap-24          { gap: 24px; }
.w-full          { width: 100%; }
.mt-8            { margin-top: 8px; }
.mt-16           { margin-top: 16px; }
.mt-24           { margin-top: 24px; }
.mb-8            { margin-bottom: 8px; }
.mb-16           { margin-bottom: 16px; }
.mb-24           { margin-bottom: 24px; }

/* ── Loading spinner ── */
.page-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Scrollbar ── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0bccf; }

/* ── Responsive ── */
@media (max-width: 768px) {
  #sidebar {
    width: 0;
    border-right: none;
  }
  #sidebar.open {
    width: 100vw;
    border-right: none;
  }
  .content-area {
    margin-left: 0;
    padding: 16px;
  }
  #footer {
    margin-left: 0;
  }
  /* Overlay achter open sidebar op mobiel */
  .sidebar-overlay {
    display: block;
  }
}

@media (max-width: 480px) {
  .content-area {
    padding: 12px;
  }
}

/* Overlay — verbergt content achter open sidebar op mobiel */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 89;
}
