/* ==========================================================
   FlowCRM Dashboard — stylesheet
   ========================================================== */

:root{
  --bg-1:#eef1fb;
  --bg-2:#e6ebfa;
  --navy:#231f3d;
  --navy-soft:#4a4570;
  --white:#ffffff;
  --muted:#8b8aa3;
  --line:#eceafb;

  --blue-tile:#dcebfb;
  --blue-tile-text:#1f5c94;
  --lav-tile:#e8e4fb;
  --lav-tile-text:#4d3fa3;
  --peach-tile:#fbe3d5;
  --peach-tile-text:#a15220;
  --red-tile:#fbdcdc;
  --red-tile-text:#b23a3a;

  --green:#3fb27f;
  --amber:#e0a638;
  --red:#e05a5a;

  --radius-lg:28px;
  --radius-md:20px;
  --radius-sm:14px;

  --font-body:'Plus Jakarta Sans','Poppins',sans-serif;
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:var(--font-body);
  background:linear-gradient(90deg,rgba(246, 246, 246, 1) 0%, rgba(240, 234, 239, 1) 50%, rgba(245, 229, 243, 1) 100%);
  min-height:100vh;
  padding:28px;
  color:var(--navy);
}

.shell{
  max-width:1440px;
  margin:0 auto;
}

/* ===== Page header ===== */
.page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 0 0 20px;
  margin-bottom:32px;
}
.page-header h1{
  font-family:var(--font-body);
  font-weight:800;
  font-size:26px;
  margin:0 0 4px 0;
  letter-spacing:-0.02em;
}
.page-header p{
  margin:0;
  font-size:13px;
  color:var(--muted);
}
.btn-primary{
  background:var(--navy);
  color:#fff;
  border:none;
  border-radius:100px;
  padding:12px 20px;
  font-family:var(--font-body);
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
  transition:background 0.15s ease;
}
.btn-primary:hover{
  background:var(--lav-tile);
  color:var(--navy);
}

/* ===== Grid ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:20px;
  margin-bottom:32px;
}
.col-3{grid-column:span 3;}
.col-4{grid-column:span 4;}
.col-6{grid-column:span 6;}
.col-8{grid-column:span 8;}
.col-9{grid-column:span 9;}
.col-12{grid-column:span 12;}

.card{
  background:var(--white);
  border-radius:var(--radius-lg);
  padding:22px;
  box-shadow:0 10px 30px -14px rgba(35,31,61,0.10);
}
.card-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}
.card-header h2{
  font-family:var(--font-body);
  font-weight:800;
  font-size:16px;
  margin:0;
  letter-spacing:-0.01em;
}
.see-all{
  font-size:12px;
  font-weight:700;
  color:var(--navy-soft);
  background:var(--bg-1);
  border-radius:100px;
  padding:8px 14px;
  text-decoration:none;
}

.seg-toggle{
  display:flex;
  background:var(--bg-1);
  border-radius:100px;
  padding:3px;
}
.seg-toggle a{
  border:none;
  background:none;
  padding:7px 14px;
  font-size:12px;
  font-weight:600;
  color:var(--navy-soft);
  border-radius:100px;
  cursor:pointer;
  font-family:var(--font-body);
  text-decoration:none;
  white-space:nowrap;
}
.seg-toggle a.active{
  background:var(--navy);
  color:#fff;
}

/* ==========================================================
   Header
   assets/header.php is uitsluitend voor dashboard.php, dus geen
   cascade-conflict met de rest van flowCRM. Gewone classes, geen
   !important nodig.
   ========================================================== */
.header{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:20px;
  background:var(--white);
  border-radius:100px;
  margin-bottom:22px;
  box-shadow:0 10px 30px -12px rgba(35,31,61,0.08);
  font-family:var(--font-body);
}

.header-logo{
  display:flex;
  align-items:center;
  color:var(--navy-soft);
}
.header-logo:hover{
  color:var(--lav-tile);
}
.header-logo-img{
  width:85px;
  height:auto;
  display:block;
}

.header-nav{
  display:flex;
  justify-content:center;
  gap:6px;
}
.header-nav a{
  text-decoration:none;
  color:var(--navy-soft);
  font-family:var(--font-body);
  font-weight:600;
  font-size:14px;
  padding:10px 16px;
  border-radius:100px;
}
.header-nav a:hover{
  color:var(--navy);
}
.header-nav a.active,
.header-nav a.active:hover{
  background:var(--navy);
  color:#fff;
}

.header-right{
  justify-self:end;
  display:flex;
  align-items:center;
  gap:10px;
}

.header-hamburger{
  display:none;
  width:38px;height:38px;border-radius:50%;
  background:var(--bg-1);
  border:none;
  cursor:pointer;
  align-items:center;justify-content:center;
  color:var(--navy);
  flex-shrink:0;
}

/* Mobiel menu-paneel: standaard verborgen op desktop */
.mobile-nav{
  display:none;
}

/* ===== Notificatie-belletje ===== */
.notif-bell-wrap{ position:relative; }
.notif-bell-btn{
  position:relative;
  width:38px;
  height:38px;
  border-radius:50%;
  border:none;
  background:var(--bg-1);
  color:var(--navy-soft);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.notif-bell-btn:hover{ background:var(--lav-tile); color:var(--navy); }

/* Ongelezen notificaties: de hele bel kleurt rood, zodat je het ook vanuit
   je ooghoek ziet. header.js toont en verbergt de badge via style.display,
   dus we kijken of die badge zichtbaar is (geen "none" in de style). Zo
   hoeft header.js niet aangepast te worden. */
.notif-bell-btn:has(.notif-badge:not([style*="none"])){
  background:var(--red-tile);
  color:var(--red-tile-text);
}
.notif-bell-btn:has(.notif-badge:not([style*="none"])):hover{
  background:#f7caca;
  color:var(--red-tile-text);
}

.notif-badge{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:100px;
  background:#e5484d;
  color:#fff;
  font-size:11px;
  font-weight:800;
  line-height:1;
  align-items:center;
  justify-content:center;
  border:2px solid var(--white);
  box-shadow:0 2px 6px -1px rgba(178,58,58,0.45);
}

.notif-panel{
  display:none;
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:340px;
  max-width:90vw;
  background:var(--white);
  border-radius:var(--radius-lg);
  box-shadow:0 20px 50px -20px rgba(35,31,61,0.35);
  z-index:200;
  overflow:hidden;
}
.notif-panel.open{ display:block; }

.notif-panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  font-size:13px;
  font-weight:700;
  color:var(--navy);
}
.notif-panel-header a{ font-size:11.5px; font-weight:600; color:var(--navy-soft); text-decoration:none; }
.notif-panel-header a:hover{ color:var(--navy); text-decoration:underline; }

.notif-panel-list{ max-height:360px; overflow-y:auto; }
.notif-empty{ padding:32px 18px; text-align:center; font-size:13px; color:var(--muted); }

.notif-item{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:12px 18px;
  border-bottom:1px solid var(--line);
}
.notif-item:last-child{ border-bottom:none; }
.notif-item:hover{ background:var(--bg-1); }
.notif-item.unread{ background:var(--lav-tile); }
.notif-item.unread:hover{ background:var(--lav-tile); filter:brightness(0.97); }
.notif-item-link{ flex:1; min-width:0; text-decoration:none; color:inherit; }
.notif-item-title{ font-size:13px; font-weight:700; color:var(--navy); }
.notif-item-body{ font-size:12px; color:var(--navy-soft); margin-top:2px; }
.notif-item-time{ font-size:10.5px; color:var(--muted); margin-top:4px; }
.notif-item-dismiss{
  flex-shrink:0;
  width:20px;
  height:20px;
  border:none;
  background:none;
  color:var(--muted);
  font-size:16px;
  line-height:1;
  cursor:pointer;
  border-radius:50%;
}
.notif-item-dismiss:hover{ background:var(--white); color:var(--navy); }

/* ===== Toggle-schuifje (bijv. Mijn profiel > Notificaties) ===== */
.toggle-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  font-size:13px;
  color:var(--navy);
  cursor:pointer;
  margin-bottom:16px;
}
.toggle-switch{
  position:relative;
  display:inline-block;
  width:40px;
  height:22px;
  flex-shrink:0;
}
.toggle-switch input{
  opacity:0;
  width:0;
  height:0;
}
.toggle-slider{
  position:absolute;
  inset:0;
  background:var(--line);
  border-radius:100px;
  transition:background 0.15s ease;
}
.toggle-slider::before{
  content:"";
  position:absolute;
  width:16px;
  height:16px;
  left:3px;
  top:3px;
  background:#fff;
  border-radius:50%;
  transition:transform 0.15s ease;
  box-shadow:0 1px 3px rgba(35,31,61,0.3);
}
.toggle-switch input:checked + .toggle-slider{ background:var(--navy); }
.toggle-switch input:checked + .toggle-slider::before{ transform:translateX(18px); }

.header-user-dropdown{ position:relative; }

.header-user{
  display:flex;
  align-items:center;
  gap:10px;
  background:none;
  border:none;
  cursor:pointer;
  font-family:var(--font-body);
  font-size:13px;
}
.dropdown-user-name{
  padding:10px 16px 8px;
  font-size:13px;
  font-weight:700;
  color:var(--navy);
}
.header-chevron{
  opacity:0.5;
  margin-left:2px;
}

.header-avatar{
  width:38px;height:38px;border-radius:50%;
  background:#f0d9a8;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;color:#8a5a1c;
  font-family:var(--font-body);
}

.user-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  width:300px;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:0 10px 30px -14px rgba(35,31,61,0.16);
  z-index:500;
  padding:8px 0;
}
.user-dropdown.open{ display:block; }

.dropdown-divider{
  height:1px;
  background:var(--line);
  margin:8px 0;
}
.dropdown-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 16px;
  font-size:13px;
  color:var(--navy);
  text-decoration:none;
}
.dropdown-item:hover{ background:var(--bg-1); }
.dropdown-item svg{ opacity:0.5; flex-shrink:0; }
.dropdown-item:hover svg{ opacity:1; }
.dropdown-item-danger{ color:#b23a3a; }
.dropdown-item-danger:hover{ background:var(--red-tile); color:#b23a3a; }
.dropdown-item-danger svg{ stroke:#b23a3a; }

/* ===== Row 1: actiebalk ===== */
/* .actiebalk-grid stretcht .col-3 via CSS Grid altijd al even hoog per rij,
   maar tile-link (een <a>, display:block) vulde die hoogte tot nu toe niet
   door — een tegel met een langere titel (bijv. "Gewonnen orders augustus")
   kon zo lager/hoger uitvallen dan de rest in dezelfde rij. Met flexbox door
   de hele keten (col-3 -> tile-link -> tile) vult elke tegel altijd de volle
   rijhoogte, op elke schermbreedte. */
.actiebalk-grid .col-3{
  display:flex;
}
.actiebalk-grid .tile-link{
  flex:1;
  display:flex;
}
.actiebalk-grid .tile-link .tile{
  flex:1;
}
.tile-link{
  display:block;
  text-decoration:none;
  color:inherit;
  transition:transform 0.15s ease, box-shadow 0.15s ease;
  border-radius:var(--radius-md);
}
.tile-link:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 24px -14px rgba(35,31,61,0.18);
  color:inherit;
}
.tile-link:focus-visible{
  outline:2px solid var(--navy);
  outline-offset:3px;
}
.tile{
  border-radius:var(--radius-md);
  padding:18px;
  min-height:118px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
}
.tile.blue{background:var(--blue-tile);}
.tile.lav{background:var(--lav-tile);}
.tile.peach{background:var(--peach-tile);}
.tile.red{background:var(--red-tile);}
.tile-label{
  font-size:12px;
  font-weight:700;
  opacity:0.85;
}
.tile.blue .tile-label{color:var(--blue-tile-text);}
.tile.lav .tile-label{color:var(--lav-tile-text);}
.tile.peach .tile-label{color:var(--peach-tile-text);}
.tile.red .tile-label{color:var(--red-tile-text);}
.tile-number{
  font-family:var(--font-body);
  font-weight:800;
  font-size:34px;
  letter-spacing:-0.02em;
  color:var(--navy);
}
.tile-sub{
  font-size:11px;
  color:var(--navy-soft);
  opacity:0.75;
}

/* ===== Row 2: werklijst ===== */
#worklist-rows{ transition:opacity 0.15s ease; }
.worklist-footer-link{
  display:inline-block;
  margin-top:14px;
  padding:8px 16px;
  border-radius:100px;
  background:var(--bg-1);
  color:var(--navy-soft);
  font-size:12.5px;
  font-weight:700;
  text-decoration:none;
}
.worklist-footer-link:hover{ background:var(--lav-tile); color:var(--navy); }

/* Utility: tonen/verbergen via classList.toggle, geen inline style.display */
.hidden{ display:none; }

/* De kolom naast de werklijst (Laatste orders + Laatste offertes) moet exact
   even hoog worden als de werklijst-kaart ernaast. .col-4 stretcht al mee
   via de grid-row (default align-items:stretch), dus hier alleen de twee
   kaarten daarbinnen gelijk laten meegroeien i.p.v. op hun eigen
   inhoudshoogte te blijven staan met loze ruimte eronder. */
.row-2-quicklinks{
  display:flex;
  flex-direction:column;
  gap:20px;
}
.row-2-quicklinks .card{
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

/* Tijdshorizon hergebruikt pipeline.css se opp-card/pipeline-board, maar
   kent geen drag-and-drop — cursor moet dus 'pointer' zijn, niet 'grab'. */
#tijdshorizon-board .opp-card{ cursor:pointer; }

.worklist-row{
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.worklist-row:last-child{border-bottom:none;}
.worklist-action:hover{
  color:var(--navy);
}
.badge{
  font-size:10px;
  font-weight:800;
  text-transform:none;
  letter-spacing:0.03em;
  padding:5px 10px;
  border-radius:100px;
  flex-shrink:0;
  width:85px;
  text-align:center;
}
.badge.lead{background:var(--blue-tile);color:var(--blue-tile-text);}
.badge.kans{background:var(--lav-tile);color:var(--lav-tile-text);}
.badge.kto{background:var(--red-tile);color:var(--red-tile-text);}
.badge.taak{background:var(--peach-tile);color:var(--peach-tile-text);}
.worklist-name{
  flex:1;
  font-size:13.5px;
  font-weight:600;
}
.worklist-next-action{
  display:block;
  font-size:11.5px;
  font-weight:400;
  color:var(--navy-soft);
  margin-top:2px;
}
.worklist-meta{
  font-size:12px;
  color:var(--muted);
  width:125px;
}
.worklist-action{
  font-size:12px;
  font-weight:700;
  color:var(--navy);
  background:var(--bg-1);
  border:none;
  border-radius:100px;
  padding:7px 14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
  flex-shrink:0;
}

/* ===== Snelkoppelingen ===== */
.quicklink{
  display:flex;
  align-items:center;
  gap:12px;
  background:var(--bg-1);
  border-radius:var(--radius-sm);
  padding:14px 16px;
  margin-bottom:10px;
  font-weight:700;
  font-size:13px;
  color:var(--navy);
  text-decoration:none;
  cursor:pointer;
}
.quicklink:last-child{margin-bottom:0;}
.quicklink .plus{
  width:26px;height:26px;border-radius:50%;
  background:var(--navy);color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:15px;line-height:1;flex-shrink:0;
  padding-bottom:1px;
}

/* ===== Pipeline funnel ===== */
.funnel-stage{
  margin-bottom:14px;
}
.funnel-stage:last-child{margin-bottom:0;}
.funnel-top{
  display:flex;
  justify-content:space-between;
  font-size:12.5px;
  margin-bottom:6px;
}
.funnel-top .stage-name{font-weight:700;}
.funnel-top .stage-value{color:var(--muted);}
.funnel-bar-bg{
  background:var(--bg-1);
  border-radius:100px;
  height:10px;
  overflow:hidden;
}
.funnel-bar-fill{
  height:100%;
  border-radius:100px;
  background:linear-gradient(90deg,#4d3fa3,#8a7fe0);
}

/* ===== Mailflow ===== */
.flow-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:11px 0;
  border-bottom:1px solid var(--line);
}
.flow-row:last-child{border-bottom:none;}
.flow-name{font-size:13.5px;font-weight:600;}
.flow-sub{font-size:11.5px;color:var(--muted);}
.flow-count{
  font-family:var(--font-body);
  font-weight:800;
  font-size:18px;
  color:var(--navy);
}

/* ===== Relatiebeheer ===== */
.relatie-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:11px 0;
  border-bottom:1px solid var(--line);
}
.relatie-row:last-child{border-bottom:none;}
.relatie-name{font-size:13.5px;font-weight:600;}
.relatie-sub{font-size:11.5px;color:var(--muted);}
.relatie-days{
  font-size:12px;
  font-weight:700;
  padding:6px 12px;
  border-radius:100px;
  background:var(--peach-tile);
  color:var(--peach-tile-text);
}

/* ===== Pijplijn gezondheid ===== */
/* Beide kaarten in deze rij even hoog, ongeacht hoeveel badges er zijn —
   zelfde flex-langs-de-keten-truc als .actiebalk-grid hierboven. */
.row-health-kpi .col-6{ display:flex; }
.row-health-kpi .card{ flex:1; display:flex; flex-direction:column; }

.health-gauge-wrap{
  display:flex;
  margin-bottom:6px;
}
.health-gauge{
  width:150px;
  flex-shrink:0;
}
.health-gauge-track{ stroke:var(--bg-1); }
.health-gauge-fill{ transition:stroke-dashoffset 0.6s ease; }
.health-gauge-fill.ok{ stroke:var(--green); }
.health-gauge-fill.warn{ stroke:var(--amber); }
.health-gauge-fill.err{ stroke:var(--red); }
.health-gauge-pct{
  font-family:var(--font-body);
  font-weight:800;
  font-size:28px;
}
.health-gauge-pct.ok{ fill:var(--green); }
.health-gauge-pct.warn{ fill:var(--amber); }
.health-gauge-pct.err{ fill:var(--red); }

.health-badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:auto;
}
.health-badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  white-space:nowrap;
  font-size:12px;
  font-weight:700;
  padding:7px 12px;
  border-radius:100px;
  background:var(--red-tile);
  color:var(--red-tile-text);
}
.health-badge strong{ font-weight:800; }

/* ===== KPI-doel ===== */
.kpi-card{
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.kpi-label{
  font-size:16px;
  font-weight:700;
  color:var(--navy);
  margin-bottom:4px;
}
.kpi-period{
  font-size:11px;
  color:var(--muted);
  margin-bottom:16px;
}
.kpi-amount{
  font-family:var(--font-body);
  font-weight:800;
  font-size:30px;
  color:var(--navy);
  letter-spacing:-0.02em;
  margin-bottom:2px;
}
.kpi-target{
  font-size:11px;
  color:var(--muted);
  margin-bottom:16px;
}
.kpi-bar-bg{
  background:var(--bg-1);
  border-radius:100px;
  height:10px;
  overflow:hidden;
  margin-bottom:8px;
}
.kpi-bar-fill{
  height:100%;
  border-radius:100px;
  background:linear-gradient(90deg,#4d3fa3,#8a7fe0);
  transition:width 0.8s ease;
}
.kpi-bar-fill-done{
  background:linear-gradient(90deg,#1f7a4d,#3fb27f);
}
.kpi-footer{
  display:flex;
  justify-content:space-between;
  font-size:11px;
  color:var(--muted);
}
.kpi-empty{
  text-align:center;
  padding:24px 0;
}
.kpi-empty-text{
  font-size:13px;
  color:var(--muted);
  margin-bottom:14px;
}

/* ===== KTO trend (bar chart) ===== */
.chart-legend{
  display:flex;
  gap:16px;
  margin-bottom:16px;
  font-size:11.5px;
  color:var(--navy-soft);
  font-weight:600;
}
.legend-dot{
  display:inline-block;
  width:9px;height:9px;border-radius:50%;
  margin-right:6px;
}
.bars{
  display:flex;
  align-items:flex-end;
  gap:8px;
  height:120px;
}
.bar-group{
  flex:1;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  gap:5px;
  height:100%;
}
.bar{
  width:12px;
  border-radius:100px 100px 0 0;
}
.bar.nps{background:linear-gradient(180deg,#8a7fe0,#4d3fa3);}
.bar.kto{background:linear-gradient(180deg,#f0c68a,#e0a638);}
.bar-label{
  text-align:center;
  font-size:10.5px;
  color:var(--muted);
  margin-top:8px;
}

/* ===== Row 5: systeemstatus ===== */
.status-strip{
  display:flex;
  align-items:center;
  gap:26px;
  padding:14px 22px;
}
.status-item{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--navy-soft);
  font-weight:600;
}
.status-dot{
  width:8px;height:8px;border-radius:50%;
}
.status-dot.ok{background:var(--green);}
.status-dot.warn{background:var(--amber);}
.status-dot.err{background:var(--red);}
.status-strip .divider{
  width:1px;height:16px;background:var(--line);
}

/* ==========================================================
   Responsive
   ========================================================== */

/* Tablet: actiebalk 2x2, brede content-cards worden vol breed */
@media (max-width: 1024px){
  .col-3{grid-column:span 6;}
  .col-8{grid-column:span 12;}
  .col-9{grid-column:span 12;}
  .col-4{grid-column:span 12;}

  .header{
    position:relative;
    border-radius:100px;
  }

  /* Desktop-menu weg, hamburger + uitklappaneel ervoor in de plaats */
  .header-nav{ display:none; }
  .header-hamburger{ display:flex; }
  .mobile-nav.open{
    display:flex;
    flex-direction:column;
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    background:var(--white);
    border-radius:20px;
    box-shadow:0 10px 30px -14px rgba(35,31,61,0.2);
    padding:8px;
    z-index:400;
  }
  .mobile-nav a{
    text-decoration:none;
    color:var(--navy-soft);
    font-family:var(--font-body);
    font-weight:600;
    font-size:14px;
    padding:12px 16px;
    border-radius:12px;
  }
  .mobile-nav a.active{
    background:var(--navy);
    color:#fff;
  }

  /* Dropdown van de gebruiker gelijktrekken met het mobiele menu hierboven.
     header-user-dropdown was zelf de positioneringscontext (position:relative),
     waardoor left/right hierop zich richtten in plaats van op de hele balk —
     die zetten we hier plat, zodat .header (net als bij .mobile-nav) de
     context wordt. */
  .header-user-dropdown{ position:static; }
  .user-dropdown{
    left:0;
    right:0;
    width:auto;
    border-radius:20px;
    padding:8px;
  }
  .dropdown-item{
    font-weight:600;
    font-size:14px;
    padding:12px 16px;
    border-radius:12px;
  }

  /* Zelfde behandeling voor het notificatiepaneel, anders hangt dat op
     mobiel nog los relatief aan het kleine belletje i.p.v. aan de hele
     balk zoals de andere twee popups. */
  .notif-bell-wrap{ position:static; }
  .notif-panel{
    left:0;
    right:0;
    width:auto;
    max-width:none;
    border-radius:20px;
    padding:0;
  }

  /* Gebruikersnaam weg, alleen de ronde avatar met initialen — scheelt ruimte */
  .header-user span,
  .header-chevron{
    display:none;
  }
}

/* Mobiel: alles vol breed, onder elkaar. Snelkoppelingen boven werklijst. */
@media (max-width: 640px){
  body{padding:16px;}

  .col-3,.col-4,.col-6,.col-8,.col-9,.col-12{grid-column:span 12;}

  /* De 4 tegels van de actiebalk blijven 2x2 i.p.v. helemaal onder elkaar */
  .actiebalk-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
  }
  .actiebalk-grid .col-3{ grid-column:span 1; }

  .grid{gap:14px;margin-bottom:14px;}

  .header{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    border-radius:24px;
    gap:12px;
    padding:14px 16px;
  }
  .header-right{justify-content:flex-end;}

  .page-header{
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
  }
  .page-header h1{font-size:21px;}
  .btn-primary{width:100%;}

  .card{padding:18px;border-radius:22px;}

  .row-2-quicklinks{order:1;}
  .row-2-worklist{order:2;}

  .worklist-row{
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
  }
  .worklist-row .badge.kans{ display:none; }
  .worklist-name{ width:100%; }
  .worklist-meta{ width:auto; }
  .worklist-action{ margin-left:0; margin-top:4px; }

  .bars{height:100px;}

  /* KTO/NPS trend toont normaal 10 weken; op mobiel is dat te druk, dus
     verbergen we de oudste 5 en tonen we alleen de laatste 5. De labels-rij
     eronder is een aparte .bars met dezelfde 10 bar-groups in dezelfde
     volgorde, dus dezelfde regel raakt daar automatisch de juiste 5. */
  #kto-trend-card .bar-group:nth-child(-n+5){
    display:none;
  }

  .status-strip{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  .status-strip .divider{display:none;}
}

/* ===== Verplicht-wachtwoord-modal (eerste keer inloggen) ===== */
.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(35,31,61,0.45);
  z-index:1000;
  align-items:flex-start;
  justify-content:center;
  padding:60px 20px;
}
.modal-overlay.open{ display:flex; }
.modal{
  background:var(--white);
  border-radius:var(--radius-lg);
  width:100%;
  max-width:480px;
  box-shadow:0 20px 50px -20px rgba(35,31,61,0.35);
}
.modal-body{ padding:24px; }
.modal-footer{ padding:16px 24px; border-top:1px solid var(--line); display:flex; justify-content:flex-end; gap:8px; }

.alert{ padding:12px 18px; border-radius:var(--radius-sm); font-size:13px; }
.alert-error{ background:var(--red-tile); color:var(--red-tile-text); }
.alert-stale{ background:var(--peach-tile); color:var(--peach-tile-text); margin-bottom:16px; }

.form-group{ margin-bottom:0; }
.form-group label{
  display:block;
  font-size:12px;
  font-weight:700;
  color:var(--navy);
  margin-bottom:6px;
}
.form-group input{
  width:100%;
  font-family:var(--font-body);
  font-size:13px;
  color:var(--navy);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  padding:9px 12px;
  background:var(--white);
}
