@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #08090b;
  --bg-panel: #0e1013;
  --bg-panel-alt: #121519;
  --border: #1e2227;
  --border-light: #2a2f36;
  --cyan: #00b8f0;
  --cyan-dim: #0088b3;
  --cyan-glow: rgba(0, 184, 240, 0.15);
  --text: #e6eaee;
  --text-dim: #8a939f;
  --text-faint: #545c66;
  --green: #2ee6a6;
  --red: #ff5c72;
  --amber: #ffb84d;
  --radius: 6px;
  --font: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

body {
  background-image:
    linear-gradient(rgba(0, 184, 240, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 184, 240, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--cyan-glow); color: var(--cyan); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan-dim); }

/* ---------- Layout ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo-mark {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-brand .logo-name {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.sidebar-brand .logo-sub {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  margin-top: 2px;
  text-transform: uppercase;
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.sidebar-nav a .icon {
  width: 16px;
  text-align: center;
  color: inherit;
  font-size: 13px;
}

.sidebar-nav a:hover {
  background: var(--bg-panel-alt);
  color: var(--text);
}

.sidebar-nav a.active {
  background: var(--cyan-glow);
  color: var(--cyan);
  border-color: rgba(0, 184, 240, 0.25);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user .who {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user .who strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: var(--font);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 60px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
}

.page-header .subtitle {
  color: var(--text-faint);
  font-size: 12.5px;
}

.page-header .header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Cards / panels ---------- */

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card + .card { margin-top: 16px; }

.card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.stat-card .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.stat-card .value.cyan { color: var(--cyan); }
.stat-card .delta {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 12px;
  white-space: nowrap;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-panel-alt); }
tbody tr:last-child td { border-bottom: none; }

.table-wrap { overflow-x: auto; }

.empty-row td {
  text-align: center;
  color: var(--text-faint);
  padding: 30px 12px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge.status-actief, .badge.status-active { background: rgba(46, 230, 166, 0.1); color: var(--green); border-color: rgba(46, 230, 166, 0.25); }
.badge.status-inactief { background: rgba(255, 92, 114, 0.1); color: var(--red); border-color: rgba(255, 92, 114, 0.25); }
.badge.status-prospect { background: rgba(255, 184, 77, 0.1); color: var(--amber); border-color: rgba(255, 184, 77, 0.25); }
.badge.status-gepauzeerd { background: rgba(255, 184, 77, 0.1); color: var(--amber); border-color: rgba(255, 184, 77, 0.25); }
.badge.status-opgezegd { background: rgba(255, 92, 114, 0.1); color: var(--red); border-color: rgba(255, 92, 114, 0.25); }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  background: var(--bg-panel-alt);
  color: var(--cyan);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input::placeholder, textarea::placeholder { color: var(--text-faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

textarea { resize: vertical; min-height: 70px; }

.field { margin-bottom: 14px; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
}

.form-error {
  background: rgba(255, 92, 114, 0.1);
  border: 1px solid rgba(255, 92, 114, 0.3);
  color: var(--red);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  margin-bottom: 14px;
  display: none;
}

.form-error.show { display: block; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.12s ease;
}

.btn-primary {
  background: var(--cyan);
  color: #04151c;
  border-color: var(--cyan);
}
.btn-primary:hover { background: #33c7f4; box-shadow: 0 0 14px var(--cyan-glow); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: rgba(255, 92, 114, 0.3);
}
.btn-danger:hover { background: rgba(255, 92, 114, 0.1); }

.btn-sm { padding: 6px 10px; font-size: 11.5px; }
.btn-icon { padding: 6px 9px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.actions-cell { display: flex; gap: 6px; white-space: nowrap; }

/* ---------- Filters/toolbar ---------- */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

.toolbar input[type="text"], .toolbar input[type="search"] {
  max-width: 260px;
}

.toolbar select { max-width: 190px; }

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 4, 0.7);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  z-index: 100;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: 24px;
  box-shadow: 0 0 40px rgba(0, 184, 240, 0.06);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-header h2 { font-size: 15px; margin: 0; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--red); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Login page ---------- */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 36px 32px;
  box-shadow: 0 0 60px rgba(0, 184, 240, 0.04);
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand .logo-mark {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.login-brand .logo-name {
  font-size: 21px;
  font-weight: 700;
}

.login-brand .logo-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.login-box .btn-primary { width: 100%; margin-top: 6px; padding: 12px; }

.login-hint {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.6;
}

/* ---------- Activity feed ---------- */

.activity-list { list-style: none; margin: 0; padding: 0; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.activity-item:last-child { border-bottom: none; }

.activity-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-item .msg { color: var(--text); }
.activity-item .time { color: var(--text-faint); font-size: 10.5px; margin-top: 2px; }

/* ---------- Misc ---------- */

.muted { color: var(--text-faint); }
.mono { font-family: var(--font); }
.right { text-align: right; }
.center { text-align: center; }

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 184, 77, 0.08);
  border: 1px solid rgba(255, 184, 77, 0.25);
  color: var(--amber);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 14px;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--cyan);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 12.5px;
  min-width: 240px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toast-in 0.15s ease;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.mobile-topbar { display: none; }

@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .sidebar-brand { display: none; }
  .sidebar-nav { flex-direction: row; padding: 10px; }
  .sidebar-footer { border-top: none; }
  .main { padding: 20px; }
}
