/* ═══════════════════════════════════════════════════════════════
   BELLADE OFFERTE CRM — MAIN CSS
   Gebaseerd op Bellade Design System v1.0
═══════════════════════════════════════════════════════════════ */

:root {
  --g-electric:   #3AFF72;
  --g-primary:    #1E8A44;
  --g-mid:        #2EA859;
  --g-light:      #E6F5EC;
  --dark-900:     #090E0A;
  --dark-800:     #0F1A12;
  --dark-700:     #1A2C1E;
  --dark-600:     #243528;
  --light-0:      #FFFFFF;
  --light-50:     #F7FAF8;
  --light-100:    #EDF5F0;
  --light-200:    #D4EBD9;
  --light-300:    #B8D9C0;
  --text-dark:    #0C1912;
  --text-muted:   #4A6355;
  --text-subtle:  #7A9080;
  --border:       #D4EBD9;
  --font-display: 'Bricolage Grotesque', -apple-system, sans-serif;
  --font-body:    'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.08);
  --shadow-md: 0 2px 12px rgba(0,0,0,.08), 0 8px 28px rgba(0,0,0,.10);
}

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

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--light-50);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
.link { color: var(--g-primary); text-decoration: underline; }
.link-truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
.text-muted { color: var(--text-subtle); font-size: 12px; }
.green-text { color: var(--g-primary); font-weight: 600; }
.right { text-align: right; }

/* ── Admin layout ─────────────────────────────────────────────── */
.admin-body { background: var(--light-50); }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--dark-800);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-img { height: 32px; width: auto; }
.logo-text {
  color: var(--g-electric);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.logo-text small { color: rgba(255,255,255,0.45); font-size: 10px; font-family: var(--font-body); font-weight: 400; }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(58,255,114,0.12); color: var(--g-electric); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-name { color: rgba(255,255,255,0.55); font-size: 12px; }
.logout-link { color: rgba(255,255,255,0.4); font-size: 12px; transition: color 0.15s; }
.logout-link:hover { color: #fff; }

/* Main content */
.admin-main { margin-left: 220px; flex: 1; }
.admin-content { padding: 28px 32px; max-width: 1200px; }

/* ── Page header ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--light-50);
}
.card-title { font-weight: 600; font-size: 15px; color: var(--text-dark); }
.form-card { border-radius: var(--r-lg); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary  { background: var(--g-primary); color: #fff; }
.btn-primary:hover { background: var(--g-mid); }
.btn-ghost    { background: transparent; color: var(--text-dark); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--light-100); }
.btn-danger   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fca5a5; }
.btn-sm  { padding: 6px 14px; font-size: 13px; }
.btn-xs  { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-lg { padding: 5px 14px; font-size: 13px; }
.badge-draft    { background: var(--light-100); color: var(--text-muted); }
.badge-sent     { background: #eff6ff; color: #1d4ed8; }
.badge-viewed   { background: #fff7ed; color: #c2410c; }
.badge-accepted { background: #dcfce7; color: #15803d; }
.badge-declined { background: #fee2e2; color: #991b1b; }
.badge-expired  { background: #f1f5f9; color: #64748b; }

/* ── Tables ───────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table thead th {
  background: var(--light-50);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.data-table thead th.right { text-align: right; }
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-100);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--light-50); }
.row-inactive td { opacity: 0.5; }
.empty-state { text-align: center; color: var(--text-subtle); padding: 32px !important; font-size: 14px; }
.actions { text-align: right; white-space: nowrap; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-dark);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--g-primary); box-shadow: 0 0 0 3px rgba(30,138,68,0.12); }
.form-control-sm { padding: 6px 9px; font-size: 13px; }
textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-card .form-grid-2, .form-card .form-grid-3, .form-card .form-group, .form-card .form-section-title, .form-card .form-actions {
  padding: 0 20px;
}
.form-card > form > .form-section-title:first-of-type { margin-top: 20px; }
.form-card .form-actions { padding-bottom: 20px; }

/* ── Quote form layout ────────────────────────────────────────── */
.form-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.form-sidebar { display: flex; flex-direction: column; gap: 0; }
.form-main { display: flex; flex-direction: column; gap: 16px; }

/* ── Toggle switch ────────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--g-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Totals preview (in form) ─────────────────────────────────── */
.totals-preview {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: 16px;
  min-width: 300px;
  float: right;
}
.totals-row-preview {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--light-100);
}
.totals-row-preview:last-child { border-bottom: none; }
.totals-grand {
  background: var(--dark-800);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

/* ── Detail layout ────────────────────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; }
.detail-sidebar { display: flex; flex-direction: column; }

/* Info labels */
.info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-subtle); margin-bottom: 6px; }
.info-value-lg { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.info-value { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.meta-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--light-100); font-size: 13px; }
.meta-row:last-child { border-bottom: none; }

/* ── Totals block (in detail) ─────────────────────────────────── */
.totals-block { min-width: 280px; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.totals-row-detail { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--light-100); }
.totals-row-detail:last-child { border-bottom: none; }
.totals-grand-detail { background: var(--dark-800); color: #fff; font-weight: 700; font-size: 15px; }

/* ── Simulation cards ─────────────────────────────────────────── */
.sim-summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.sim-card { background: var(--dark-800); border-radius: var(--r-sm); padding: 14px 16px; text-align: center; }
.sim-card-label { color: rgba(255,255,255,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.sim-card-value { color: #fff; font-size: 18px; font-weight: 700; margin-top: 6px; }
.sim-card-value.green { color: var(--g-electric); }
.sim-explanation-box { background: var(--light-50); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 16px; color: var(--text-muted); font-size: 14px; margin-bottom: 16px; line-height: 1.6; }
.sim-data-table { margin-bottom: 0; }

/* ── Tracking timeline ────────────────────────────────────────── */
.track-stat { display: flex; flex-direction: column; align-items: center; background: var(--light-50); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 16px; flex: 1; }
.track-stat-val { font-size: 22px; font-weight: 700; color: var(--text-dark); }
.track-stat-val.green { color: var(--g-primary); }
.track-stat-lbl { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.5px; }

.tracking-timeline { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.timeline-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--light-100); }
.timeline-item:last-child { border-bottom: none; }
.timeline-badge { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; flex-shrink: 0; }
.badge-view { background: #eff6ff; color: #1d4ed8; }
.badge-pdf  { background: #dcfce7; color: #15803d; }
.timeline-info { flex: 1; min-width: 0; }
.timeline-time { font-size: 12px; font-weight: 600; color: var(--text-dark); }
.timeline-ip   { font-size: 11px; color: var(--text-subtle); font-family: monospace; }

/* ── Dashboard stats ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card-link { transition: transform 0.15s, box-shadow 0.15s; display: block; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-subtle); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-dark); }
.stat-card.status-accepted .stat-value { color: var(--g-primary); }
.stat-card.status-viewed   .stat-value { color: #c2410c; }
.stat-card.status-declined .stat-value { color: #991b1b; }

/* ── Filter tabs ──────────────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-tab {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab:hover { background: var(--light-100); }
.filter-tab.active { background: var(--dark-800); color: var(--g-electric); border-color: var(--dark-800); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-md);
}
.modal-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Login page ───────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-900);
}
.login-card {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 48px; margin-bottom: 12px; }
.login-logo h1 { font-family: var(--font-display); font-size: 22px; color: var(--text-dark); }
.login-logo p { color: var(--text-subtle); font-size: 13px; margin-top: 4px; }
.login-card .form-group { margin-bottom: 16px; }

/* ── Public pages ─────────────────────────────────────────────── */
.public-body { background: var(--light-50); }

.public-header {
  background: var(--dark-800);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.public-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.public-logo img { height: 28px; }
.public-header-meta { display: flex; align-items: center; gap: 12px; }

.public-main { padding: 32px 24px; }
.public-container { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.public-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.public-card-dark { background: var(--dark-800); border-color: var(--dark-700); }

.public-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.public-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: rgba(255,255,255,0.45); margin-bottom: 6px; }
.public-quote-number { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--g-electric); }
.public-value-lg { font-size: 16px; font-weight: 700; color: #fff; }
.public-value-sm { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.public-value { font-size: 14px; color: rgba(255,255,255,0.8); }

.public-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g-electric);
}

.public-table-wrap { overflow-x: auto; }
.public-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.public-table thead th {
  background: var(--dark-800);
  color: rgba(255,255,255,0.8);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.public-table thead th.right { text-align: right; }
.public-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--light-100); }
.public-table tbody td.right { text-align: right; }
.public-table tbody tr:last-child td { border-bottom: none; }
.public-table tbody tr:hover td { background: var(--light-50); }

.public-totals { display: flex; justify-content: flex-end; margin-top: 20px; }
.public-totals-inner { min-width: 300px; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.public-totals-row { display: flex; justify-content: space-between; padding: 9px 16px; font-size: 14px; border-bottom: 1px solid var(--light-100); }
.public-totals-row:last-child { border-bottom: none; }
.public-totals-grand { background: var(--dark-800); color: #fff; font-weight: 700; font-size: 16px; }

.public-sim-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.public-sim-box { background: var(--light-50); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; text-align: center; }
.public-sim-box-green { background: var(--dark-800); border-color: var(--dark-700); }
.public-sim-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-subtle); margin-bottom: 6px; }
.public-sim-box-green .public-sim-label { color: rgba(255,255,255,0.45); }
.public-sim-value { font-size: 18px; font-weight: 700; color: var(--text-dark); }
.public-sim-box-green .public-sim-value { color: var(--g-electric); }

.public-explanation { background: var(--light-50); border-left: 3px solid var(--g-electric); padding: 14px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-muted); font-size: 14px; line-height: 1.7; margin-bottom: 20px; }
.public-disclaimer { font-size: 12px; color: var(--text-subtle); margin-top: 16px; line-height: 1.6; }
.public-terms { font-size: 13px; color: var(--text-muted); line-height: 1.7; white-space: pre-wrap; }

/* ── Error page ───────────────────────────────────────────────── */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--dark-900); padding: 24px; }
.error-card { background: #fff; border-radius: var(--r-lg); padding: 48px; text-align: center; max-width: 440px; box-shadow: var(--shadow-md); }
.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-card h1 { font-family: var(--font-display); font-size: 22px; color: var(--text-dark); margin-bottom: 12px; }
.error-card p { color: var(--text-muted); line-height: 1.6; }

/* ── Tab panels ───────────────────────────────────────────────── */
.tab-panel { display: block; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 60px; min-width: 60px; }
  .logo-text, .nav-item span, .admin-name, .logout-link, .sidebar-footer { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .admin-main { margin-left: 60px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .public-meta-grid { grid-template-columns: 1fr 1fr; }
  .public-sim-summary { grid-template-columns: 1fr 1fr; }
  .sim-summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .admin-content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .public-meta-grid { grid-template-columns: 1fr; }
  .public-sim-summary { grid-template-columns: 1fr; }
}
