/* CommonBase huisstijl:
   knoppen/accenten: #ed3e5b
   achtergronden:    #ffffff
   donker accent:    #07071f
*/
:root {
  --primary: #ed3e5b;
  --primary-hover: #d02c49;
  --sidebar-bg: #07071f;
  --sidebar-hover: #15152e;
  --sidebar-text: #a8a8c0;
  --sidebar-active: #ffffff;
  --bg: #f7f7fa;
  --card-bg: #ffffff;
  --border: #e8e8f0;
  --text: #07071f;
  --text-muted: #6b6b80;
  --success: #00BDA5;
  --warning: #FFB400;
  --danger: #ed3e5b;
  --shadow: 0 1px 2px rgba(7,7,31,0.05), 0 1px 3px rgba(7,7,31,0.08);
  --input-bg: #FFFFFF;
}

html.dark {
  --primary: #ed3e5b;
  --primary-hover: #f45773;
  --sidebar-bg: #05051a;
  --sidebar-hover: #1a1a35;
  --sidebar-text: #a0a0bc;
  --sidebar-active: #ffffff;
  --bg: #0a0a1f;
  --card-bg: #15152e;
  --border: #252545;
  --text: #e8e8f5;
  --text-muted: #8080a0;
  --input-bg: #0f0f25;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.4);
}
html.dark form input[type=text], html.dark form input[type=email], html.dark form input[type=password],
html.dark form input[type=number], html.dark form input[type=date], html.dark form input[type=datetime-local],
html.dark form textarea, html.dark form select { background: var(--input-bg); color: var(--text); }
html.dark table.table tr:hover td { background: #232A36; }
html.dark .kanban-col { background: #141A24; }
html.dark .kanban-col.drag-over { background: #1E2632; }
html.dark .email-day.empty { background: #111820; }
html.dark .flash-success { background: #0F3A32; color: #89E6CF; }
html.dark .flash-error { background: #3A1216; color: #F8A0A5; }

.link-btn { background: none; border: none; color: inherit; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--sidebar-bg); color: var(--sidebar-text); flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .brand { padding: 20px; font-weight: 700; font-size: 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar nav { padding: 12px 0; flex: 1; }
.sidebar a { display: block; padding: 10px 20px; color: var(--sidebar-text); font-weight: 500; }
.sidebar a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar a.active { background: var(--sidebar-hover); color: var(--sidebar-active); border-left: 3px solid var(--primary); padding-left: 17px; }
.sidebar .bottom { padding: 16px 20px; font-size: 12px; color: var(--text-muted); border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar .bottom a { display: inline; padding: 0; color: var(--sidebar-text); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: var(--card-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 16px; }
.topbar h1 { flex: 0 0 auto; margin-right: auto; }
.topbar-search { flex: 0 1 320px; }
.topbar-search input { width: 100%; padding: 6px 12px; border-radius: 4px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-size: 13px; }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.content { padding: 24px; flex: 1; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border-radius: 4px; border: 1px solid transparent; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.4; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Forms */
form .field { margin-bottom: 14px; }
form label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; color: var(--text); }
form input[type=text], form input[type=email], form input[type=password], form input[type=number], form input[type=date], form textarea, form select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; background: #fff; font-family: inherit;
}
form textarea { min-height: 100px; resize: vertical; }
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 12px; font-size: 13px; }
.flash-success { background: #D5F5EF; color: #006D5B; border-left: 3px solid var(--success); }
.flash-error { background: #FDE2E4; color: #98292F; border-left: 3px solid var(--danger); }

/* Tables */
table.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
table.table th, table.table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.table th { background: var(--bg); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
table.table tr:hover td { background: #FAFBFC; }
table.table tr.clickable { cursor: pointer; }
table.table tr:last-child td { border-bottom: none; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 18px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--text); }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { min-width: 240px; background: #eef0f5; border-radius: 6px; padding: 10px; flex: 0 0 240px; }
.kanban-col h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; font-weight: 700; display: flex; justify-content: space-between; }
.kanban-col .total { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.kanban-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kanban-card:hover { border-color: var(--primary); }
.kanban-card .title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.kanban-card .sub { font-size: 12px; color: var(--text-muted); }
.kanban-card .amount { font-size: 12px; color: var(--success); font-weight: 600; }
.kanban-card.dragging { opacity: 0.5; }
.kanban-col.drag-over { background: #dde0e9; }

/* Topbar actions */
.actions { display: flex; gap: 8px; }

/* Page title row */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-header h2 { margin: 0; font-size: 20px; }

/* Search */
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; }

/* Toolbar */
.toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* Misc */
.muted { color: var(--text-muted); }
.text-right { text-align: right; }
.hidden { display: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-muted); }
.badge-primary { background: rgba(237,62,91,0.15); color: var(--primary); }
.badge-success { background: #D5F5EF; color: #006D5B; }
.badge.stale { background: rgba(255,180,0,0.2); color: #8B6A00; }
html.dark .badge.stale { background: rgba(255,180,0,0.15); color: #FFCC54; }

/* Combo / searchable select */
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: #fff; padding: 32px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); width: 360px; }
.login-box h1 { margin: 0 0 20px; text-align: center; color: var(--primary); }

/* Quill editor */
.ql-container { min-height: 300px; font-size: 14px; }
.ql-editor { min-height: 300px; }

/* Timeline */
.timeline { position: relative; margin-left: 8px; border-left: 2px solid var(--border); padding-left: 14px; }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-dot { position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.tl-summary { font-size: 13px; }

/* Bulk bar */
.bulk-bar { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow); }
.bulk-bar select { width: auto; }

/* Email day grid */
.email-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.email-day { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 10px; text-align: center; font-size: 12px; }
.email-day.filled { background: #D5F5EF; border-color: var(--success); }
.email-day.empty { background: #FAFBFC; }
.email-day .day-num { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
