/* ============================================ */
/* ZenWorker Blue – Base styles                 */
/* ============================================ */

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

/* Skjul body indtil sidebar.js har monteret layoutet → ingen FOUC-flash */
html:not(.zw-ready) body { visibility: hidden; }

:root {
  --bg-1: #ffffff;
  --bg-2: #f8f9fb;
  --ink: #1f272c;
  --muted: #50606a;
  --surface: #ffffff;
  --stroke: #e2e4ea;
  --accent: #3BA9FF;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --blue: #0ea5e9;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; min-height: 100vh; background: #1E5F9E; }
body {
  margin: 0; padding: 0;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 17px; line-height: 1.6;
  background: var(--bg-1); color: var(--ink);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
html, body { overflow-x: hidden; max-width: 100vw; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4,h5,h6 { margin: 0; font-family: 'Archivo Black','Manrope',sans-serif; }
p { margin: 0 0 8px; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ─── Top bar ─── */
.ec-topbar {
  background: linear-gradient(135deg, #1E5F9E 0%, #2A7BBF 100%);
  position: sticky; top: 0; z-index: 100;
  padding: 0 40px; display: flex; align-items: center; gap: 10px; height: 72px;
}
.ec-topbar .breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: rgba(255,255,255,0.85);
  font-weight: 600; flex: 1; margin: 0; padding: 0; line-height: 72px;
}
.ec-topbar .breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; }
.ec-topbar .breadcrumb a:hover { color: #fff; }
.ec-topbar .breadcrumb .sep { color: rgba(255,255,255,0.35); margin: 0 2px; }

/* ─── Search ─── */
.ec-search-btn {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7); border-radius: 8px; padding: 6px 10px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; transition: background 0.2s;
}
.ec-search-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.ec-search-tooltip { font-size: 0.7rem; background: rgba(255,255,255,0.1); padding: 1px 6px; border-radius: 4px; }

/* ─── User block ─── */
.ec-user-wrap { position: relative; margin-left: auto; }
.ec-user-block {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 6px 12px 6px 0; border-radius: 10px; transition: background .15s;
  user-select: none;
}
.ec-user-block:hover { background: rgba(255,255,255,0.12); }
.ec-user-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #3BA9FF;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0; letter-spacing: 0.02em;
}
.ec-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.ec-user-name { color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.ec-user-role { color: rgba(255,255,255,0.6); font-size: 0.72rem; white-space: nowrap; text-transform: capitalize; }
.ec-user-chevron { color: rgba(255,255,255,0.55); flex-shrink: 0; transition: transform .15s; }
.ec-user-menu.open ~ .ec-user-block .ec-user-chevron,
.ec-user-block:has(+ .ec-user-menu.open) .ec-user-chevron { transform: rotate(180deg); }

.ec-user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid #e2e4ea; padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 200;
}
.ec-user-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ec-user-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; border: none; background: none;
  font-family: inherit; font-size: 0.88rem; font-weight: 500; color: #1f272c;
  border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: background .12s, color .12s;
}
.ec-user-menu-item:hover { background: #f0f3f7; color: #1f272c; text-decoration: none; }
.ec-user-menu-item--danger { color: #dc2626; }
.ec-user-menu-item--danger:hover { background: #fef2f2; color: #b91c1c; }
.ec-user-menu-sep { height: 1px; background: #e2e4ea; margin: 4px 2px; }

/* ─── Shell ─── */
.shell {
  max-width: none; margin: 0 auto; padding: 12px 40px 48px;
  flex: 1 0 auto; width: 100%; box-sizing: border-box;
}

/* ─── Hero ─── */
.eyebrow {
  color: #3BA9FF; font-size: 0.78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
}
h1 {
  font-family: 'Archivo Black', sans-serif; color: #1f272c;
  font-size: 2.4rem; margin: 8px 0 6px;
}
.subtitle { color: #50606a; font-size: 1rem; line-height: 1.6; }

/* ─── Card grid ─── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 28px;
}
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ─── Role card ─── */
.role-card {
  background: #fff; border: 1.5px solid #e2e4ea; border-radius: 16px;
  padding: 24px; text-decoration: none; color: #1f272c;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease; display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.role-card:hover {
  transform: translateY(-4px); box-shadow: 0 12px 32px rgba(59,169,255,0.12);
  border-color: #3BA9FF; text-decoration: none;
}
.role-card h2 { font-size: 1.1rem; font-weight: 800; margin: 12px 0 6px; color: #1f272c; }
.role-card p { font-size: 0.88rem; color: #50606a; line-height: 1.5; margin: 0; }

/* ─── Chip ─── */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 0.85rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #3BA9FF, #B8DEFF);
}
.chip--vvs { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.chip--el { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.chip--toemrer { background: linear-gradient(135deg, #10b981, #059669); }
.chip--murer { background: linear-gradient(135deg, #64748b, #475569); }
.chip--maler { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.chip--lead { background: linear-gradient(135deg, #f59e0b, #eab308); }
.chip--faktura { background: linear-gradient(135deg, #3BA9FF, #B8DEFF); }
.chip--tid { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.chip--mat { background: linear-gradient(135deg, #10b981, #34d399); }
.chip--sim { background: linear-gradient(135deg, #B8DEFF, #3BA9FF); }
.chip--kunde { background: linear-gradient(135deg, #f59e0b, #eab308); }
.chip--sag { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.chip--kalender { background: linear-gradient(135deg, #ef4444, #f59e0b); }

/* ─── GC Section ─── */
.gc-section {
  background: #fff; border: 1.5px solid #e2e4ea; border-radius: 16px;
  padding: 24px; margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s ease;
  min-width: 0; overflow: hidden;
}
.gc-section:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.gc-section > h2 {
  font-size: 1.1rem; font-weight: 800; color: #1f272c;
  margin: 0; cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.gc-section > h2::after {
  content: ''; display: inline-block; width: 8px; height: 8px;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(45deg); transition: transform .25s ease;
  flex-shrink: 0; margin-left: auto; margin-top: -2px;
}
.gc-section.collapsed > h2::after { transform: rotate(-45deg); }
.gc-section-body { overflow: hidden; min-width: 0; transition: max-height .35s ease, opacity .25s ease; opacity: 1; }
.gc-section.collapsed .gc-section-body { max-height: 0 !important; opacity: 0; pointer-events: none; }
.gc-section > h2:hover { color: #3BA9FF; }
.gc-section > h2:hover::after { border-color: #3BA9FF; }
.gc-section-link {
  margin-left: auto; font-size: 0.78rem; font-weight: 700;
  color: #3BA9FF; text-decoration: none; padding: 4px 10px;
  border-radius: 6px; transition: background 0.15s;
}
.gc-section-link:hover { background: rgba(59,169,255,0.1); text-decoration: none; }
.gc-section > h2:has(.gc-section-link)::after { margin-left: 0; }

/* ─── Stat row ─── */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%); border: 1.5px solid #e2e4ea; border-radius: 14px;
  padding: 16px 18px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.06); }
.stat-value { display: block; font-size: 1.5rem; font-weight: 800; color: #1f272c; }
.stat-value--green { color: #22c55e; }
.stat-value--orange { color: #f59e0b; }
.stat-value--red { color: #ef4444; }
.stat-value--blue { color: #0ea5e9; }
.stat-label {
  display: block; font-size: 0.75rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px;
}

/* ─── Data tables ─── */
.table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th {
  text-align: left; padding: 10px 14px; font-size: 0.75rem; font-weight: 700;
  color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px;
  border-bottom: 2px solid #e2e4ea; white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f0f1f4; color: #1f272c; vertical-align: top; }
.data-table tbody tr:hover { background: rgba(59,169,255,0.04); }
.data-table tbody tr { cursor: pointer; transition: background 0.12s ease; }

/* ─── Badges ─── */
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.2px;
}
.badge--igangvaerende { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.badge--planlagt { background: rgba(59,169,255,0.1); color: #3BA9FF; }
.badge--afsluttet { background: rgba(34,197,94,0.1); color: #22c55e; }
.badge--tilbud { background: rgba(234,179,8,0.1); color: #ca8a04; }
.badge--lead { background: rgba(245,158,11,0.1); color: #d97706; }
.badge--betalt { background: rgba(34,197,94,0.1); color: #16a34a; }
.badge--kladde { background: rgba(234,179,8,0.15); color: #b45309; }
.badge--forfalden { background: rgba(239,68,68,0.1); color: #dc2626; }
.badge--afsendt { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.badge--oprettet { background: rgba(245,158,11,0.12); color: #d97706; }
.badge--accepteret { background: rgba(34,197,94,0.1); color: #22c55e; }
.badge--service { background: rgba(59,169,255,0.1); color: #3BA9FF; }
.badge--projekt { background: rgba(14,165,233,0.1); color: #0ea5e9; }
.badge--entreprise { background: rgba(239,68,68,0.1); color: #ef4444; }
.badge--serviceaftale { background: rgba(34,197,94,0.1); color: #22c55e; }
.badge--privat { background: rgba(59,169,255,0.1); color: #3BA9FF; }
.badge--erhverv { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge--offentlig { background: rgba(245,158,11,0.1); color: #d97706; }

/* ─── Activity log ─── */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid #f0f1f4; font-size: 0.85rem;
  min-width: 0;
}
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 6px;
  flex-shrink: 0; background: #94a3b8;
}
.activity-dot--tid { background: #0ea5e9; }
.activity-dot--materiale { background: #10b981; }
.activity-dot--lead { background: #f59e0b; }
.activity-dot--advarsel { background: #ef4444; }
.activity-dot--tilbud { background: #3BA9FF; }
.activity-dot--faktura { background: #22c55e; }
.activity-time { color: #94a3b8; font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }
.activity-text { color: #50606a; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }

/* ─── Filter chips ─── */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chip {
  display: inline-block; padding: 5px 14px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600; background: #f0f1f4;
  color: #50606a; border: none; cursor: pointer; transition: background 0.15s;
}
.filter-chip:hover { background: #e2e4ea; }
.filter-chip--active { background: #3BA9FF; color: #fff; }

/* ─── Toggle switch ─── */
.zw-toggle { position:relative; display:inline-block; width:44px; height:24px; vertical-align:middle; }
.zw-toggle input { opacity:0; width:0; height:0; }
.zw-toggle .zw-slider { position:absolute; cursor:pointer; inset:0; background:#cbd5e1; border-radius:24px; transition:.2s; }
.zw-toggle .zw-slider:before { content:""; position:absolute; height:18px; width:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,0.2); }
.zw-toggle input:checked + .zw-slider { background:#3BA9FF; }
.zw-toggle input:checked + .zw-slider:before { transform:translateX(20px); }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.78rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; font-size: 0.95rem;
  border: 1.5px solid #e2e4ea; border-radius: 8px; color: #1f272c;
  background: #fff; transition: border-color 0.15s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #3BA9FF;
}
.gc-section-body textarea:focus, .gc-section-body input:focus, .gc-section-body select:focus {
  outline: none !important; border-color: #3BA9FF !important;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; font-size: 0.88rem; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: all 0.2s ease; text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.btn:active { transform: scale(0.97); }
.btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); transform: translateY(-1px); }
.btn--primary { background: linear-gradient(135deg, #3BA9FF, #B8DEFF); color: #fff; }
.btn--primary:hover { background: linear-gradient(135deg, #1D8FE8, #3BA9FF); }
.btn--secondary { background: #f0f1f4; color: #50606a; box-shadow: none; }
.btn--secondary:hover { background: #e2e4ea; box-shadow: none; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 1rem; line-height: 1; opacity: 0.5; transition: opacity .15s, background .15s; }
.btn-icon:hover { opacity: 1; background: rgba(239,68,68,0.1); }
.btn--danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn--danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.btn--success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.btn--success:hover { background: linear-gradient(135deg, #16a34a, #15803d); }
.btn--sm { font-size: .75rem; padding: 5px 12px; border-radius: 8px; }
.btn--back { background: none; color: #50606a; box-shadow: none; padding: 6px 12px; }
.btn--back:hover { background: #f0f1f4; box-shadow: none; }

/* ─── Top KPI bar ─── */
.kpi-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.kpi-card {
  background: #fff; border: 1.5px solid #e2e4ea; border-radius: 14px;
  padding: 20px; position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
}
.kpi-card--blue::before { background: #0ea5e9; }
.kpi-card--green::before { background: #22c55e; }
.kpi-card--orange::before { background: #f59e0b; }
.kpi-card--red::before { background: #ef4444; }
.kpi-card--purple::before { background: #3BA9FF; }
.kpi-label { font-size: 0.75rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.3px; }
.kpi-value { font-size: 1.8rem; font-weight: 800; color: #1f272c; margin: 4px 0 2px; }
.kpi-change { font-size: 0.78rem; font-weight: 600; }
.kpi-change--up { color: #22c55e; }
.kpi-change--down { color: #ef4444; }

/* ─── Detail header ─── */
.detail-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.detail-header h1 { font-size: 1.8rem; }
.detail-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.detail-meta-item { font-size: 0.85rem; color: #50606a; }
.detail-meta-item strong { color: #1f272c; }
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ─── Bottom bar ─── */
.ec-bottombar {
  background: linear-gradient(135deg, #1E5F9E 0%, #2A7BBF 100%);
  width: 100%; padding: 0 40px; margin-top: auto; flex-shrink: 0;
}
.ec-bottombar-inner {
  max-width: 1200px; margin: 0 auto; padding: 28px 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); font-size: 0.9rem;
}

/* ─── Simulation wizard ─── */
.sim-wizard { max-width: 700px; margin: 0 auto; }
.sim-steps {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 32px;
}
.sim-step {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 0.85rem; font-weight: 700; color: #94a3b8;
}
.sim-step--active { color: #3BA9FF; }
.sim-step--done { color: #22c55e; }
.sim-step-num {
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
  background: #f0f1f4; color: #94a3b8;
}
.sim-step--active .sim-step-num { background: #3BA9FF; color: #fff; }
.sim-step--done .sim-step-num { background: #22c55e; color: #fff; }
.sim-connector { width: 40px; height: 2px; background: #e2e4ea; }
.sim-panel {
  background: #fff; border: 1.5px solid #e2e4ea; border-radius: 16px;
  padding: 32px; display: none;
}
.sim-panel--active { display: block; }
.sim-panel h2 { font-size: 1.3rem; margin-bottom: 20px; }
.sim-result-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.sim-result-card {
  background: #f8f9fb; border: 1.5px solid #e2e4ea; border-radius: 12px;
  padding: 16px; text-align: center;
}
.sim-result-value { font-size: 1.5rem; font-weight: 800; color: #1f272c; }
.sim-result-label { font-size: 0.75rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; margin-top: 2px; }

/* ─── Two-column layout ─── */
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; min-width: 0; }
.two-col > * { min-width: 0; overflow: hidden; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Modal ─── */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 9000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff; border-radius: 20px; padding: 32px; max-width: 560px;
  width: 90%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal h2 { font-size: 1.3rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 24px; }

/* ─── Tab bar ─── */
.tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid #e2e4ea; margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 16px; font-size: 0.88rem; font-weight: 700;
  color: #94a3b8; cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: #3BA9FF; }
.tab-btn--active { color: #3BA9FF; border-bottom-color: #3BA9FF; }
.tab-item {
  padding: 10px 20px; font-size: 0.88rem; font-weight: 700;
  color: #94a3b8; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab-item:hover { color: #3BA9FF; }
.tab-item--active { color: #3BA9FF; border-bottom-color: #3BA9FF; }

/* ─── Progress bar ─── */
.progress-bar {
  width: 100%; height: 8px; background: #f0f1f4;
  border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-fill--green { background: #22c55e; }
.progress-fill--orange { background: #f59e0b; }
.progress-fill--red { background: #ef4444; }
.progress-fill--blue { background: #0ea5e9; }

/* ─── Back button in topbar ─── */
.tp-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,0.8); text-decoration: none;
  font-size: 0.82rem; font-weight: 600;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px; padding: 4px 10px 4px 6px; margin-right: 12px;
  transition: background 0.2s;
}
.tp-back-btn:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }

/* ─── Empty state ─── */
.empty-state {
  text-align: center; padding: 60px 20px; color: #94a3b8;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state-text { font-weight: 700; font-size: 1rem; color: #50606a; }
.empty-state-sub { font-size: 0.85rem; margin-top: 4px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .ec-topbar { padding: 0 16px; height: 60px; }
  .shell { padding: 16px; }
  h1 { font-size: 1.6rem !important; }
  .kpi-bar { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.4rem; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .tab-bar { overflow-x: auto; flex-wrap: nowrap; gap: 4px; }
  .tab-btn { font-size: 0.8rem; padding: 8px 12px; white-space: nowrap; }
  .gc-section { margin-bottom: 16px; }
  .gc-section-body { padding: 14px; }
  .filter-bar { flex-wrap: wrap; gap: 6px; }
  .filter-chip { font-size: 0.78rem; padding: 5px 10px; }
  .hero { padding: 24px 0 16px; }
  .hero .subtitle { font-size: 0.88rem; }
  .breadcrumb { font-size: 0.8rem; }
  .vms-sidebar { width: 60px; }
  .vms-sidebar .vms-sidebar-title, .vms-sidebar .nav-label, .vms-sidebar .vms-nav-group-title span, .vms-sidebar .vms-user-info, .vms-sidebar .vms-logout-btn .nav-label, .vms-sidebar .vms-tier-badge span { display: none; }
  .vms-sidebar .vms-nav-item { justify-content: center; padding: 9px 0; }
  .vms-sidebar .vms-user-block { justify-content: center; }
  .vms-sidebar .vms-logout-btn { justify-content: center; padding: 8px 0; }
  .vms-main { margin-left: 60px; }
}

/* ─── VMS Sidebar ─── */
.vms-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 180px;
  background: #1E5F9E; color: #fff; display: flex; flex-direction: column;
  z-index: 200; overflow: hidden;
}

.vms-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; box-sizing: border-box;
  padding: 0 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.vms-sidebar-logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.vms-sidebar-logo svg { flex-shrink: 0; }
.vms-sidebar-title {
  font-family: 'Archivo Black','Manrope',sans-serif;
  font-size: 1.05rem; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap;
}
.vms-sidebar-title-light { font-weight: 400; opacity: 0.7; font-family: 'Manrope',sans-serif; }
.vms-sidebar.collapsed .vms-sidebar-title { display: none; }

.vms-sidebar-toggle {
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.vms-sidebar-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.vms-sidebar.collapsed .vms-sidebar-toggle svg { transform: rotate(180deg); }

.vms-sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.vms-nav-group-title {
  padding: 8px 20px 4px; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,0.35);
  white-space: nowrap; cursor: pointer; user-select: none;
  display:flex; align-items:center; justify-content:space-between; gap:8px;
}
.vms-nav-group-title:hover { color: rgba(255,255,255,0.6); }
.vms-nav-group-title .vms-nav-caret { opacity:.6; transition: transform .15s ease; flex-shrink:0; }
.vms-nav-group-title.is-collapsed .vms-nav-caret { transform: rotate(-90deg); }
.vms-sidebar.collapsed .vms-nav-group-title .vms-nav-caret { display:none; }
.vms-nav-group-items.collapsed { display: none; }
.vms-nav-sub-items.collapsed { display: none; }
.vms-sidebar.collapsed .vms-nav-group-items.collapsed { display: block; }
.vms-sidebar.collapsed .vms-nav-sub-items { display: none; }
.vms-sidebar.collapsed .vms-nav-group-title { cursor: default; }
.vms-sidebar.collapsed .vms-nav-group-title span { display: none; }

.vms-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 20px;
  color: rgba(255,255,255,0.7); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  transition: background 0.12s, color 0.12s; white-space: nowrap;
}
.vms-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.vms-nav-item.active { background: rgba(59,169,255,0.18); color: #fff; font-weight: 600; }
.vms-nav-item svg { flex-shrink: 0; opacity: 0.7; }
.vms-nav-item.active svg { opacity: 1; }
.vms-nav-item.vms-nav-sub { padding-left: 48px; font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.vms-nav-item.vms-nav-sub:hover { color: #fff; }
.vms-sidebar.collapsed .vms-nav-item.vms-nav-sub { display: none; }
.vms-sidebar.collapsed .nav-label { display: none; }
.vms-sidebar.collapsed .vms-nav-item { justify-content: center; padding: 9px 0; }

.vms-sidebar-footer { padding: 16px 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.vms-tier-badge { font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.4); white-space: nowrap; }
.vms-sidebar.collapsed .vms-tier-badge span { display: none; }

.vms-user-block { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.vms-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(59,169,255,0.25); color: #fff; font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vms-user-info { display: flex; flex-direction: column; overflow: hidden; }
.vms-user-name { font-size: 0.8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vms-user-role { font-size: 0.68rem; color: rgba(255,255,255,0.5); text-transform: capitalize; }
.vms-sidebar.collapsed .vms-user-info { display: none; }
.vms-sidebar.collapsed .vms-user-block { justify-content: center; }

.vms-logout-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: none; border-radius: 6px; background: rgba(239,68,68,0.1); color: rgba(255,255,255,0.6); font-size: 0.8rem; font-family: inherit; cursor: pointer; transition: background .15s, color .15s; }
.vms-logout-btn:hover { background: rgba(239,68,68,0.25); color: #fff; }
.vms-logout-btn svg { flex-shrink: 0; opacity: 0.7; }
.vms-sidebar.collapsed .vms-logout-btn .nav-label { display: none; }
.vms-sidebar.collapsed .vms-logout-btn { justify-content: center; padding: 8px 0; }

.vms-main {
  margin-left: 180px; min-height: 100vh;
  display: flex; flex-direction: column; transition: margin-left 0.2s ease;
  min-width: 0; overflow-x: hidden;
}
.vms-sidebar.collapsed ~ .vms-main { margin-left: 60px; }

/* ─── Tilpas-knap i topbar (tandhjul, samme størrelse som JK-avatar) ─── */
.ec-customize-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  color: #fff;
  background: #3BA9FF;
  border: none;
  margin-right: 10px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: background .2s;
}
.ec-customize-btn:hover { background: #2E97EB; }
.ec-customize-btn svg { flex-shrink: 0; }
/* Sørg for user-wrap ikke tager margin-left:auto væk fra Tilpas */
.ec-topbar .ec-customize-btn ~ .ec-user-wrap { margin-left: 0; }

/* ─── Customize – Edit Bar ─── */
.cust-editbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9100;
  height: 48px;
  background: #dc2626;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(220,38,38,0.35);
  transform: translateY(-100%);
  transition: transform .3s ease;
}
.cust-editbar--active { transform: translateY(0); }
.cust-editbar-label { font-weight: 800; letter-spacing: 0.02em; }
.cust-editbar-hint { font-weight: 400; opacity: 0.85; font-size: 0.82rem; }
.cust-editbar-exit {
  background: #fff;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  transition: background .2s, transform .1s;
}
.cust-editbar-exit:hover { background: #fee2e2; }
.cust-editbar-exit:active { transform: scale(0.97); }

/* ─── Section/card toolbar i edit-mode ─── */
.cust-sec-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 6px 8px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
}
.cust-sec-arrow, .cust-sec-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e2e4ea;
  border-radius: 6px;
  color: #64748b;
  cursor: pointer;
  padding: 5px;
  transition: background .15s, color .15s, border-color .15s;
}
.cust-sec-arrow:hover {
  background: #3BA9FF;
  color: #fff;
  border-color: #3BA9FF;
}
.cust-sec-eye { color: #22c55e; }
.cust-sec-eye:hover { background: #f1f5f9; }
.cust-sec-eye--off { color: #dc2626; }
.cust-sec-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cust-sec-dimmed {
  opacity: 0.35;
  outline: 2px dashed #dc2626;
  outline-offset: -2px;
}
.cust-editing .role-card, .cust-editing .kpi-card { position: relative; }
/* Tilpas-knap + edit-mode */
/* override: tandhjul circle */
.ec-customize-btn{display:inline-flex;align-items:center;justify-content:center;gap:0;width:34px;height:34px;border-radius:50%;padding:0;color:#fff;background:#3BA9FF;border:none;cursor:pointer;font-family:inherit;flex-shrink:0;transition:background .2s}
.ec-topbar .ec-msg-btn{margin-left:auto}
.ec-topbar .ec-msg-btn ~ .ec-customize-btn{margin-left:0}
.ec-customize-btn:hover{background:#2E97EB;color:#fff}
.ec-customize-btn svg{flex-shrink:0}
.ec-topbar .ec-customize-btn ~ .ec-user-wrap{margin-left:0}
.cust-editbar{position:fixed;top:0;left:0;right:0;z-index:9100;height:48px;background:#dc2626;color:#fff;display:flex;align-items:center;gap:16px;padding:0 24px;font-size:.88rem;font-weight:600;box-shadow:0 2px 12px rgba(220,38,38,.35);transform:translateY(-100%);transition:transform .3s ease}
.cust-editbar--active{transform:translateY(0)}
.cust-editbar-label{font-weight:800;letter-spacing:.02em}
.cust-editbar-hint{font-weight:400;opacity:.85;font-size:.82rem}
.cust-editbar-exit{background:#fff;color:#dc2626;border:none;border-radius:8px;padding:7px 18px;font-size:.82rem;font-weight:700;cursor:pointer;margin-left:auto;transition:background .2s,transform .1s}
.cust-editbar-exit:hover{background:#fee2e2}
.cust-editbar-exit:active{transform:scale(.97)}
.cust-sec-toolbar{display:flex;align-items:center;gap:6px;margin-bottom:10px;padding:6px 8px;background:#fef2f2;border:1px solid #fca5a5;border-radius:8px}
.cust-sec-arrow,.cust-sec-eye{display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid #e2e4ea;border-radius:6px;color:#64748b;cursor:pointer;padding:5px;transition:background .15s,color .15s,border-color .15s}
.cust-sec-arrow:hover{background:#3BA9FF;color:#fff;border-color:#3BA9FF}
.cust-sec-eye{color:#22c55e}
.cust-sec-eye:hover{background:#f1f5f9}
.cust-sec-eye--off{color:#dc2626}
.cust-sec-label{font-size:.8rem;font-weight:600;color:#94a3b8;margin-left:6px;text-transform:uppercase;letter-spacing:.03em}
.cust-sec-dimmed{opacity:.35;outline:2px dashed #dc2626;outline-offset:-2px}
.cust-editing .role-card,.cust-editing .kpi-card{position:relative}

/* ─── Kunde søgefelt (matcher .btn højde) ─── */
.kunde-search { padding: 10px 16px; font-size: 0.88rem; border: 1px solid #e2e6ea; border-radius: 10px; background: #fff; color: #1f2937; width: 240px; outline: none; transition: border-color .15s, box-shadow .15s; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.kunde-search:focus { border-color: #3BA9FF; box-shadow: 0 0 0 3px rgba(59,169,255,0.15); }

/* --- Customize: kolonne-toolbar i TH + form-group dim --- */
.cust-col-toolbar { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.cust-col-toolbar .cust-sec-arrow, .cust-col-toolbar .cust-sec-eye { padding: 3px; }
.cust-col-dimmed { opacity: .45; outline: 2px dashed #dc2626; outline-offset: -2px; }
.cust-editing .form-group { position: relative; }
.cust-editing .form-group.cust-sec-dimmed { opacity: .4; outline: 2px dashed #dc2626; outline-offset: -2px; }

/* --- Paen Tilbage-knap (kunde-detalje m.fl.) --- */
.btn--back-pretty { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #3BA9FF; border: 1px solid #d6e6f5; border-radius: 10px; padding: 7px 14px; font-size: 0.82rem; font-weight: 700; box-shadow: 0 1px 3px rgba(59,169,255,0.12); cursor: pointer; transition: all 0.2s ease; margin-bottom: 14px; }
.btn--back-pretty:hover { background: #3BA9FF; color: #fff; border-color: #3BA9FF; box-shadow: 0 4px 12px rgba(59,169,255,0.25); transform: translateY(-1px); }
.btn--back-pretty:active { transform: scale(0.97); }
.btn--back-pretty svg { flex-shrink: 0; }

/* --- Sub-tabs (Noter/Interne kunde noter) --- */
.sub-tabbar { display: flex; gap: 0; border-bottom: 1px solid #e2e6ea; margin-bottom: 12px; }
.sub-tab { background: none; border: none; padding: 10px 18px; font-size: 0.88rem; font-weight: 600; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.sub-tab:hover { color: #3BA9FF; }
.sub-tab--active { color: #22c55e; border-bottom-color: #22c55e; }

/* --- Form checkbox label --- */
.form-group label.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; color: #50606a; }
.form-group label.chk input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* --- Tab-bar wrap (mange faner) --- */
.tab-bar { flex-wrap: wrap; row-gap: 4px; }

/* Adresser tabel - inline cell-edit input */
#adresseTabel td { padding: 6px 8px; vertical-align: middle; }
#adresseTabel input.adr-cell {
  display: block; box-sizing: border-box;
  width: 100%; padding: 9px 12px; font-size: 0.92rem;
  border: 1.5px solid #e2e4ea; border-radius: 8px; color: #1f272c;
  background: #fff; transition: border-color 0.15s; outline: none; font-family: inherit;
}
#adresseTabel input.adr-cell:focus { border-color: #3BA9FF; }

/* zwConfirm dialog */
.zw-confirm-ov {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; transition: opacity .15s ease;
}
.zw-confirm-ov.open { opacity: 1; }
.zw-confirm-box {
  background: #fff; border-radius: 14px; padding: 24px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); width: 100%; max-width: 420px;
  transform: scale(.96); transition: transform .15s ease;
}
.zw-confirm-ov.open .zw-confirm-box { transform: scale(1); }
.zw-confirm-title { font-size: 1.1rem; font-weight: 700; color: #1f272c; margin-bottom: 8px; }
.zw-confirm-msg { font-size: .95rem; color: #475569; margin-bottom: 22px; line-height: 1.45; }
.zw-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.zw-confirm-actions .btn { font-size: .9rem; padding: 9px 18px; }

/* Kontakter tabel - inline cell-edit input */
#kontaktTabel td { padding: 6px 8px; vertical-align: middle; }
#kontaktTabel input.kon-cell {
  display: block; box-sizing: border-box;
  width: 100%; padding: 9px 12px; font-size: 0.92rem;
  border: 1.5px solid #e2e4ea; border-radius: 8px; color: #1f272c;
  background: #fff; transition: border-color 0.15s; outline: none; font-family: inherit;
}
#kontaktTabel input.kon-cell:focus { border-color: #3BA9FF; }

/* Rabat-niveau tabeller - cell inputs */
#timeRabatTabel td, #matRabatTabel td { padding: 6px 8px; vertical-align: middle; }
#timeRabatTabel input.rabat-cell, #matRabatTabel input.rabat-cell {
  display: block; box-sizing: border-box;
  width: 100%; padding: 9px 12px; font-size: 0.92rem;
  border: 1.5px solid #e2e4ea; border-radius: 8px; color: #1f272c;
  background: #fff; transition: border-color 0.15s; outline: none; font-family: inherit;
}
#timeRabatTabel input.rabat-cell:focus, #matRabatTabel input.rabat-cell:focus { border-color: #3BA9FF; }

/* Priser tabel - inline cell-edit input */
#priserTabel td { padding: 6px 8px; vertical-align: middle; }
#priserTabel input.pris-cell {
  display: block; box-sizing: border-box;
  width: 100%; padding: 9px 12px; font-size: 0.92rem;
  border: 1.5px solid #e2e4ea; border-radius: 8px; color: #1f272c;
  background: #fff; transition: border-color 0.15s; outline: none; font-family: inherit;
}
#priserTabel input.pris-cell:focus { border-color: #3BA9FF; }

.add-zone{margin-top:10px;padding:18px;border:2px dashed #d4d8e2;border-radius:10px;text-align:center;color:#7a8194;font-size:.92rem;cursor:pointer;transition:all .15s;user-select:none}
.add-zone:hover{border-color:#3BA9FF;color:#3BA9FF;background:#f4faff}

.zw-modal-ov{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;z-index:9000;padding:20px}
.zw-modal-box{background:#fff;border-radius:14px;padding:22px 26px;width:100%;box-shadow:0 20px 60px rgba(15,23,42,.25)}
.zw-modal-title{font-size:1.15rem;font-weight:700;color:#0f172a;margin-bottom:14px}
.zw-modal-body .form-group{margin-bottom:12px}
.zw-modal-body label{display:block;font-size:.78rem;color:#64748b;margin-bottom:4px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.zw-modal-body input,.zw-modal-body select{width:100%;box-sizing:border-box;padding:9px 12px;border:1.5px solid #e2e4ea;border-radius:8px;font-size:.92rem;background:#fff;color:#0f172a}
.zw-modal-body input:focus,.zw-modal-body select:focus{outline:0;border-color:#3BA9FF}
.zw-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
