/*
 * CGMpower Backoffice – Admin CSS
 *
 * KLEUREN AANPASSEN? Verander alleen de variabelen hieronder.
 * Alle kleuren in de hele backoffice worden automatisch bijgewerkt.
 */

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

:root {
  /* ── Primaire kleuren (aanpassen naar CGMpower huisstijl) ── */
  --primary:     #0D1B3E;   /* Donkerblauw – sidebar achtergrond */
  --primary-2:   #162550;   /* Iets lichter blauw */
  --primary-3:   #1e3063;   /* Nog lichter blauw */
  --accent:      #FF5C1F;   /* Oranje – knoppen, accenten */
  --accent-hover:#e84f10;   /* Oranje hover */

  /* ── Neutrale kleuren ── */
  --bg:          #F0F2F8;   /* Pagina achtergrond */
  --surface:     #FFFFFF;   /* Kaarten, panelen */
  --border:      #E2E8F0;   /* Randen */
  --border-2:    #CBD5E1;   /* Sterkere randen */

  /* ── Tekst ── */
  --text:        #0D1B3E;   /* Primaire tekst */
  --text-2:      #475569;   /* Secundaire tekst */
  --text-muted:  #94A3B8;   /* Placeholder, labels */
  --text-light:  #FFFFFF;

  /* ── Status kleuren ── */
  --green:       #16A34A;
  --green-bg:    #DCFCE7;
  --red:         #DC2626;
  --red-bg:      #FEE2E2;
  --yellow:      #D97706;
  --yellow-bg:   #FEF3C7;
  --blue:        #2563EB;
  --blue-bg:     #DBEAFE;

  /* ── Layout ── */
  --sidebar-width:    260px;
  --topbar-height:    64px;
  --border-radius:    10px;
  --border-radius-lg: 16px;

  /* ── Schaduwen ── */
  --shadow-sm:   0 1px 3px rgba(13,27,62,.08);
  --shadow:      0 4px 16px rgba(13,27,62,.1);
  --shadow-lg:   0 8px 32px rgba(13,27,62,.14);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ── Layout Shell ────────────────────────────────────────── */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--primary);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-mark svg { width: 22px; height: 22px; color: white; }
.sidebar-logo-text .brand {
  font-size: 16px; font-weight: 800; color: white; letter-spacing: -.4px;
}
.sidebar-logo-text .sub {
  font-size: 10px; color: rgba(255,255,255,.45); font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-group {
  margin-bottom: 4px;
}
.nav-group-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .8px;
  padding: 12px 20px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.6);
  font-size: 13.5px; font-weight: 600;
  border-left: 3px solid transparent;
  transition: all .15s;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.95);
}
.nav-item.active {
  background: rgba(255,92,31,.12);
  color: white;
  border-left-color: var(--accent);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
}
.nav-badge.green { background: var(--green); }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 20px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-info .name { font-size: 13px; font-weight: 700; color: white; }
.user-info .role { font-size: 11px; color: rgba(255,255,255,.4); }
.logout-btn {
  margin-left: auto;
  background: none; border: none;
  color: rgba(255,255,255,.4);
  padding: 6px;
  border-radius: 6px;
  transition: color .15s;
}
.logout-btn:hover { color: var(--accent); }
.logout-btn svg { width: 16px; height: 16px; }

/* ── Main content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-breadcrumb {
  flex: 1;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.topbar-breadcrumb .current { color: var(--text); font-weight: 600; }
.topbar-breadcrumb svg { width: 14px; height: 14px; }
.topbar-right {
  display: flex; align-items: center; gap: 10px;
}
.topbar-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.topbar-btn svg { width: 15px; height: 15px; }
.topbar-btn-primary {
  background: var(--accent);
  color: white; border-color: var(--accent);
}
.topbar-btn-primary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  color: white;
}

/* ── Page content ────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px;
}
.page-header {
  margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.page-header h1 {
  font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -.5px;
}
.page-header p {
  font-size: 13.5px; color: var(--text-2); margin-top: 3px;
}
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
}
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ── KPI Widgets ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-lg);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.kpi-card:hover { box-shadow: var(--shadow); }
.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.kpi-icon.green  { background: var(--green-bg);  color: var(--green); }
.kpi-icon.orange { background: rgba(255,92,31,.1); color: var(--accent); }
.kpi-icon.red    { background: var(--red-bg);    color: var(--red); }
.kpi-value {
  font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.5px;
  line-height: 1;
}
.kpi-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.kpi-trend {
  margin-left: auto; align-self: flex-start;
  font-size: 12px; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
}
.kpi-trend.up   { background: var(--green-bg); color: var(--green); }
.kpi-trend.down { background: var(--red-bg);   color: var(--red); }

/* ── Tabellen ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #F8FAFC; }

/* ── Badges / Status ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.badge-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.badge.green  { background: var(--green-bg);  color: var(--green); }
.badge.red    { background: var(--red-bg);    color: var(--red); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.blue   { background: var(--blue-bg);   color: var(--blue); }
.badge.gray   { background: var(--bg);        color: var(--text-2); border: 1px solid var(--border); }
.badge.orange { background: rgba(255,92,31,.1); color: var(--accent); }

/* ── Formulieren ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.form-label .required { color: var(--accent); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--border-2);
  border-radius: var(--border-radius);
  font-size: 14px; font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,92,31,.12);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; gap: 18px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Knoppen ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--border-radius);
  font-size: 13.5px; font-weight: 700;
  border: 1.5px solid transparent;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary   { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-2); }
.btn-outline   { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger    { background: var(--red); color: white; border-color: var(--red); }
.btn-danger:hover { background: #B91C1C; }
.btn-sm        { padding: 6px 12px; font-size: 12.5px; }
.btn-lg        { padding: 12px 26px; font-size: 15px; }

/* ── AI Veld ─────────────────────────────────────────────── */
.ai-field-wrap {
  border: 2px dashed var(--border-2);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  background: linear-gradient(135deg, rgba(13,27,62,.02), rgba(255,92,31,.02));
  transition: border-color .2s;
}
.ai-field-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(255,92,31,.03);
}
.ai-field-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--primary);
  margin-bottom: 12px;
}
.ai-field-label .ai-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.ai-result {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  font-size: 14px; line-height: 1.7;
  white-space: pre-wrap;
  min-height: 200px;
}
.ai-loading {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: 13.5px; padding: 40px 0;
  justify-content: center;
}
.ai-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--border-radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(255,92,31,.04);
}
.upload-zone svg { width: 36px; height: 36px; color: var(--text-muted); margin-bottom: 10px; }
.upload-zone p { font-size: 13.5px; color: var(--text-2); }
.upload-zone small { font-size: 12px; color: var(--text-muted); }

/* ── Flash berichten ─────────────────────────────────────── */
.flash {
  padding: 12px 18px;
  border-radius: var(--border-radius);
  font-size: 13.5px; font-weight: 600;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 9px;
}
.flash svg { width: 16px; height: 16px; flex-shrink: 0; }
.flash.success { background: var(--green-bg); color: var(--green); }
.flash.error   { background: var(--red-bg);   color: var(--red); }
.flash.warning { background: var(--yellow-bg); color: var(--yellow); }
.flash.info    { background: var(--blue-bg);  color: var(--blue); }

/* ── Lege staat ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 14px; opacity: .4; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; max-width: 300px; margin: 0 auto 18px; }

/* ── Hulpklassen ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.flex   { display: flex; }
.flex-center  { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.ml-auto { margin-left: auto; }
.mt-4   { margin-top: 4px; }
.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; }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-sm     { font-size: 12.5px; }
.font-bold   { font-weight: 700; }

/* ── Paginering ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding-top: 16px;
}
.page-link {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  transition: all .15s;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-link.disabled { opacity: .4; pointer-events: none; }

/* ── Zoekbalk in topbar ──────────────────────────────────── */
.search-bar {
  display: flex; align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px; gap: 8px;
  transition: border-color .15s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
  border: none; background: transparent; outline: none;
  font-size: 13.5px; font-family: inherit; color: var(--text);
  width: 200px;
}
.search-bar input::placeholder { color: var(--text-muted); }

/* ── Login pagina ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-3) 100%);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-logo-mark {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.login-logo-mark svg { width: 26px; height: 26px; color: white; }
.login-logo-text .brand { font-size: 20px; font-weight: 800; color: var(--text); }
.login-logo-text .sub   { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.login-card h1 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-card p  { font-size: 13.5px; color: var(--text-2); margin-bottom: 28px; }
