/* ============================================================
   EXTERUS Marketing Dashboard — huisstijl uit Brandguide (March 2026)
   Primary Green #0B4650 · EXTERUS Teal #167C87 · Orange #ED6D24
   Extra/Amber #FD9F02 · Beige #F2F0E4 · Midnight #161A24 · Font: Heebo
   ============================================================ */
:root {
  --green:      #0B4650;   /* Primary Green (donkerste) */
  --teal:       #167C87;   /* EXTERUS Teal */
  --teal-600:   #12697280;
  --orange:     #ED6D24;   /* EXTERUS Orange */
  --orange-dark:#cf5717;
  --amber:      #FD9F02;   /* Extra Orange / Amber */
  --beige:      #F2F0E4;
  --midnight:   #161A24;

  --bg:         #F4F1E8;   /* zachte beige achtergrond */
  --surface:    #ffffff;
  --surface-2:  #faf8f2;
  --sidebar:    #0B3138;   /* diep petrol (green-tint) */
  --sidebar-2:  #0f414a;
  --text:       #161A24;
  --muted:      #6b7280;
  --muted-2:    #9aa3ad;
  --border:     #e7e3d6;
  --border-2:   #efece1;

  --pos:        #167C87;
  --neg:        #c0492f;

  --radius:     16px;
  --radius-sm:  11px;
  --shadow:     0 1px 2px rgba(11,70,80,.05), 0 4px 14px rgba(11,70,80,.06);
  --shadow-lg:  0 18px 50px rgba(11,49,56,.22);
  --shadow-orange: 0 8px 20px rgba(237,109,36,.28);

  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
[x-cloak] { display: none !important; }
a { color: var(--teal); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 254px; background: var(--sidebar); color: #cfe0e2;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; height: 100vh;
  overflow: hidden; z-index: 20;
}
/* X-chevron watermark in de sidebar */
.sidebar::before {
  content: ""; position: absolute; right: -70px; top: 90px; width: 300px; height: 300px;
  background:
    linear-gradient(135deg, transparent 47%, rgba(255,255,255,.035) 47% 53%, transparent 53%),
    linear-gradient(45deg, transparent 47%, rgba(255,255,255,.035) 47% 53%, transparent 53%);
  pointer-events: none;
}
.sidebar::after {
  content: ""; position: absolute; left: -120px; bottom: -80px; width: 260px; height: 260px;
  background: radial-gradient(circle at 40% 40%, rgba(22,124,135,.4), transparent 60%);
  pointer-events: none;
}

.brand { padding: 24px 22px 20px; display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.brand .mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 3px 8px rgba(237,109,36,.35)); }
.brand .wordmark { font-size: 23px; font-weight: 800; letter-spacing: -.5px; color: var(--beige); line-height: 1; }
.brand .wordmark .x { color: var(--orange); }
.brand .tag { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #7fb0b6; margin-top: 3px; font-weight: 600; }

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; position: relative; z-index: 2; }
.nav .nav-label { font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: #5f8b91; padding: 6px 14px 8px; font-weight: 700; }
.nav button {
  width: 100%; text-align: left; background: none; border: none; color: #bcd3d6;
  padding: 11px 14px; border-radius: 11px; cursor: pointer; font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 12px; margin-bottom: 3px; transition: .16s; position: relative;
}
.nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav button.active { background: linear-gradient(90deg, var(--orange), #f0803f); color: #fff; font-weight: 700; box-shadow: var(--shadow-orange); }
.nav button.active .ico { transform: scale(1.05); }
.nav .ico { width: 20px; text-align: center; font-size: 16px; transition: .16s; }

.sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: #8fb3b8; position: relative; z-index: 2; }
.sidebar-foot .who { color: #cfe0e2; font-weight: 600; }
.sidebar-foot a { color: var(--amber); text-decoration: none; font-weight: 600; }
.sidebar-foot a:hover { color: #ffb733; }

.main { margin-left: 254px; flex: 1; padding: 30px 40px 70px; max-width: 1560px; }

/* ---------- Page header ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.pretitle { font-size: 11.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pretitle::after { content: ""; width: 46px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--amber), transparent); }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.8px; color: var(--midnight); }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--orange); color: #fff; border: none; padding: 10px 18px; border-radius: 11px;
  cursor: pointer; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px;
  transition: .16s; box-shadow: var(--shadow-orange); font-family: inherit;
}
.btn:hover { background: var(--orange-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.secondary { background: var(--surface); color: var(--midnight); border: 1px solid var(--border); box-shadow: var(--shadow); }
.btn.secondary:hover { background: var(--surface-2); border-color: #d9d3c2; }
.btn.ghost { background: none; color: var(--muted); border: 1px solid transparent; padding: 6px 10px; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--midnight); }
.btn.danger { background: var(--neg); box-shadow: none; }
.btn.danger:hover { background: #a23c26; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 18px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; transition: .18s;
}
.card.hover:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(11,49,56,.12); }
.card.pad-lg { padding: 26px 28px; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.kpi .value { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -1px; color: var(--midnight); line-height: 1.05; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.kpi .value.pos { color: var(--teal); }
.kpi .value.neg { color: var(--neg); }
.kpi-ico { position: absolute; right: 18px; top: 18px; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: rgba(22,124,135,.1); }
.kpi.accent-orange .kpi-ico { background: rgba(237,109,36,.12); }
.kpi.accent-amber .kpi-ico { background: rgba(253,159,2,.14); }

/* Hero KPI (omzet) */
.kpi-hero {
  background: linear-gradient(135deg, var(--green) 0%, #0e5560 60%, var(--teal) 130%);
  color: var(--beige); border: none; position: relative; overflow: hidden;
}
.kpi-hero::before {
  content: ""; position: absolute; right: -40px; top: -30px; width: 200px; height: 200px;
  background: linear-gradient(135deg, transparent 46%, rgba(237,109,36,.16) 46% 54%, transparent 54%),
              linear-gradient(45deg, transparent 46%, rgba(255,255,255,.05) 46% 54%, transparent 54%);
}
.kpi-hero .label { color: #9fc4c9; }
.kpi-hero .value { color: #fff; font-size: 34px; }
.kpi-hero .sub { color: #b8d4d7; }
.kpi-hero .kpi-ico { background: rgba(255,255,255,.12); }

.section-title { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--teal); margin: 34px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted-2); padding: 12px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; font-weight: 700; }
td { padding: 13px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: .12s; }
tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; opacity: .25; transition: .15s; }
tr:hover .row-actions { opacity: 1; }

/* ---------- Badges & pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.gepland    { background: rgba(22,124,135,.1); color: #0f6771; }
.badge.actief     { background: rgba(253,159,2,.16); color: #b5730a; }
.badge.gepauzeerd { background: #f3efe2; color: #8a7a4a; }
.badge.afgerond   { background: #eceef0; color: #55606b; }
.badge.prospect   { background: rgba(237,109,36,.12); color: var(--orange-dark); }
.badge.inactief   { background: #eceef0; color: #78828d; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: #55606b; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; }

.roi.pos { color: var(--teal); font-weight: 800; }
.roi.neg { color: var(--neg); font-weight: 800; }
.stars { color: var(--amber); letter-spacing: 2px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- Progress ---------- */
.progress { height: 9px; background: #eceadf; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 999px; transition: width .5s; }
.progress.big { height: 14px; }

/* ---------- Bar chart ---------- */
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 240px; padding-top: 18px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }
.bar-track { position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar-target { position: absolute; left: 6%; right: 6%; border-top: 2px dashed var(--orange); z-index: 3; }
.bar-target::after { content: attr(data-lbl); position: absolute; right: 0; top: -16px; font-size: 9.5px; color: var(--orange-dark); font-weight: 700; }
.bar-fill { width: 100%; max-width: 56px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--teal), var(--green)); transition: height .5s; min-height: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.bar-fill.current { background: linear-gradient(180deg, var(--orange), var(--orange-dark)); }
.bar-label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bar-value { font-size: 11.5px; color: var(--midnight); font-weight: 800; }
.legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend b { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }

/* ---------- Forms / modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(11,49,56,.55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 44px 16px; z-index: 60; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; overflow: hidden; }
.modal-head { padding: 20px 26px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); }
.modal-head h3 { margin: 0; font-size: 19px; font-weight: 800; color: var(--midnight); }
.modal-body { padding: 24px 26px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 700; color: #3c4650; }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text); width: 100%; transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,124,135,.15); }
input[type=color] { padding: 4px; height: 42px; }
textarea { resize: vertical; min-height: 70px; }
.hint { font-size: 12px; color: var(--muted); }
.hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar select { max-width: 250px; }
.spacer { flex: 1; }
.count-chip { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--midnight); color: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 100; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--teal); }
.toast.err { border-left-color: var(--neg); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 10px; opacity: .8; }

/* ---------- Integrations ---------- */
.integ { display: flex; align-items: center; gap: 16px; }
.integ .ilogo { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 18px; flex: none; box-shadow: var(--shadow); }
.integ .imeta { flex: 1; }
.integ .imeta strong { font-size: 15px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.on { background: var(--teal); box-shadow: 0 0 0 3px rgba(22,124,135,.15); }
.status-dot.off { background: #c9c3b2; }
.status-dot.err { background: var(--neg); }

/* channel card mini */
.chan-card { position: relative; overflow: hidden; }
.chan-card .barline { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .brand .wordmark, .brand .tag, .nav button span.lbl, .nav .nav-label, .sidebar-foot { display: none; }
  .brand { justify-content: center; padding: 20px 0; }
  .nav button { justify-content: center; padding: 12px 0; }
  .main { margin-left: 68px; padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 24px; }
}
