/* ============================================================
   DE SYSTEEM_BEHEERDER — Telefonie Portal
   Dark Theme — Enterprise Clean
   ============================================================ */

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

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

:root {
  /* ── Basis ── */
  --black:       #111318;
  --surface:     #1a1d24;
  --surface-2:   #21242e;
  --surface-3:   #282b38;
  --border:      #2a2d3a;
  --border-bright: #363a4a;
  --white:       #f1f5f9;
  --text-primary: #f1f5f9;
  --text-muted:  #64748b;
  --text-dim:    #3a4050;

  /* ── Statusaccenten ── */
  --neon-green:  #22c55e;
  --neon-green-bg: #14532d;
  --neon-cyan:   #3b82f6;
  --neon-cyan-bg: #1e3a8a;
  --neon-purple: #a78bfa;
  --neon-purple-bg: #4c1d95;
  --neon-red:    #f87171;
  --neon-red-bg: #7f1d1d;
  --neon-amber:  #fbbf24;
  --neon-amber-bg: #78350f;

  /* ── Badge/avatar varianten ── */
  --blue-bg:     #1e3a8a;
  --blue-fg:     #93c5fd;
  --green-bg:    #14532d;
  --green-fg:    #22c55e;
  --amber-bg:    #78350f;
  --amber-fg:    #fbbf24;
  --rose-bg:     #7f1d1d;
  --rose-fg:     #f87171;
  --purple-bg:   #4c1d95;
  --purple-fg:   #a78bfa;
  --teal-bg:     #134e4a;
  --teal-fg:     #2dd4bf;
  --gray-200:    #2a2d3a;
  --gray-800:    #94a3b8;

  /* Legacy grays */
  --gray-50:     #1a1d24;
  --gray-100:    #21242e;
  --gray-300:    #2a2d3a;
  --gray-400:    #64748b;
  --gray-600:    #94a3b8;

  --font-title:  'Quantico', sans-serif;
  --font-body:   'Open Sans', sans-serif;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;

  --glow-green:  0 0 6px rgba(34,197,94,0.25);
  --glow-cyan:   0 0 6px rgba(59,130,246,0.3);
  --glow-red:    0 0 6px rgba(248,113,113,0.25);
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-title { font-family: var(--font-title); }

/* ── Layout ── */
.app-wrapper {
  display: grid;
  grid-template-rows: 56px 1fr;
  min-height: 100vh;
}
.app-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.main-content {
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--black);
}

/* ── Topnav ── */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav-logo {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
  color: var(--white);
}
.topnav-logo span { color: var(--neon-cyan); }
.topnav-right { display: flex; align-items: center; gap: 1rem; }
.topnav-company { font-size: 12px; color: var(--text-muted); }
.topnav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--neon-cyan-bg);
  color: var(--neon-cyan);
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-section {
  font-family: var(--font-title);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 8px 12px 4px;
  margin-top: 8px;
}
.sidebar-section:first-child { margin-top: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-body);
  border-left: 2px solid transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--white); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--neon-cyan);
  font-weight: 600;
  border-left-color: var(--neon-cyan);
}
.nav-item i { font-size: 17px; flex-shrink: 0; }
.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
}

/* ── Stat blokken ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--neon-cyan); }
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  color: var(--neon-cyan);
  line-height: 1;
}
.stat-value.small { font-size: 15px; padding-top: 6px; color: var(--white); }

/* ── Knoppen ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-title);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-dark {
  background: var(--neon-cyan);
  color: #fff;
  border: 1px solid var(--neon-cyan);
}
.btn-dark:hover { opacity: 0.9; }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-bright);
}
.btn-outline:hover {
  background: var(--surface-2);
  color: var(--white);
  border-color: var(--neon-cyan);
  opacity: 1;
}
.btn-danger {
  background: transparent;
  color: var(--neon-red);
  border: 1px solid var(--neon-red-bg);
}
.btn-danger:hover { background: var(--neon-red-bg); opacity: 1; }

/* ── Contact lijst ── */
.contact-list { display: flex; flex-direction: column; }
.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:hover {
  background: var(--surface-2);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-radius: var(--radius-sm);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title);
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.avatar-blue   { background: #1e3a8a; color: #93c5fd; }
.avatar-green  { background: #14532d; color: #22c55e; }
.avatar-amber  { background: #78350f; color: #fbbf24; }
.avatar-rose   { background: #7f1d1d; color: #f87171; }
.avatar-purple { background: #4c1d95; color: #a78bfa; }
.avatar-teal   { background: #134e4a; color: #2dd4bf; }
.avatar-gray   { background: var(--surface-3); color: var(--text-muted); }

.contact-info { flex: 1; min-width: 0; }
.contact-name {
  font-size: 13px; font-weight: 600;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.contact-phone { font-size: 12px; color: var(--text-muted); }
.contact-actions { display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.contact-row:hover .contact-actions { opacity: 1; }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; padding: 3px 9px;
  border-radius: 99px;
  font-weight: 700; font-family: var(--font-title);
  letter-spacing: 0.04em; white-space: nowrap;
}
.badge-personal { background: #1e3a8a; color: #93c5fd; }
.badge-company  { background: #14532d; color: #22c55e; }

/* ── Formulieren ── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: 12px;
  color: var(--text-muted); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-body);
  color: var(--white); background: var(--surface-2);
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none; border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}
.form-input::placeholder { color: var(--text-dim); }
.form-select {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; font-family: var(--font-body);
  color: var(--white); background: var(--surface-2); cursor: pointer;
}
.form-select:focus { outline: none; border-color: var(--neon-cyan); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }

/* ── Alerts ── */
.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(248,113,113,0.08); color: var(--neon-red);   border-color: var(--neon-red); }
.alert-success { background: rgba(34,197,94,0.08);   color: var(--neon-green); border-color: var(--neon-green); }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 1.5rem;
  width: 480px; max-width: 95vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border); padding-bottom: 0.75rem;
}
.modal-title { font-family: var(--font-title); font-size: 16px; font-weight: 700; color: var(--white); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-close:hover { color: var(--neon-red); }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--border);
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
.empty-state i { font-size: 40px; margin-bottom: 0.75rem; display: block; }
.empty-state p { font-size: 13px; }

/* ── Login ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--black); padding: 1rem;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg); padding: 2rem; width: 360px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.login-logo-wrap {
  background: var(--surface-3); border: 1px solid var(--border-bright);
  border-radius: var(--radius-md); padding: 12px 20px;
  display: inline-block; margin-bottom: 1rem;
}
.login-logo-text { font-family: var(--font-title); font-weight: 700; font-size: 14px; line-height: 1.2; color: var(--white); }
.login-logo-text span { color: var(--neon-cyan); }
.login-product { font-family: var(--font-title); font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 4px; }
.login-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 1.5rem; }
.login-btn {
  width: 100%; padding: 10px; background: var(--neon-cyan);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: var(--font-title); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.login-btn:hover { opacity: 0.85; }
.login-divider { text-align: center; font-size: 11px; color: var(--text-dim); margin: 0.85rem 0; position: relative; }
.login-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.login-divider span { background: var(--surface); padding: 0 8px; position: relative; }
.passkey-btn {
  width: 100%; padding: 9px; background: transparent;
  color: var(--text-muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-body);
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.15s;
}
.passkey-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

/* ── Zoekveld ── */
.search-wrap { position: relative; margin-bottom: 0.75rem; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; }
.search-input {
  width: 100%; padding: 7px 12px 7px 34px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface-2); color: var(--white);
}
.search-input:focus { outline: none; border-color: var(--neon-cyan); }

/* ── Tabs ── */
.tab-row { display: flex; gap: 4px; margin-bottom: 0.75rem; }
.tab {
  padding: 5px 14px; border-radius: var(--radius-sm); font-size: 12px;
  cursor: pointer; border: 1px solid transparent;
  background: transparent; color: var(--text-muted);
  text-decoration: none; transition: all 0.15s;
}
.tab:hover { background: var(--surface-2); color: var(--white); }
.tab.active { background: var(--surface-2); color: var(--neon-cyan); border-color: var(--neon-cyan); font-weight: 600; }

/* ── Skeleton loader ── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text  { height: 13px; margin-bottom: 6px; }
.skeleton-title { height: 18px; margin-bottom: 8px; width: 60%; }
.skeleton-badge { height: 20px; width: 70px; border-radius: 99px; }

/* ── Status dots ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.status-dot.online  { background: var(--neon-green); box-shadow: var(--glow-green); animation: pulse 2s infinite; }
.status-dot.offline { background: var(--neon-red);   box-shadow: var(--glow-red); }
.status-dot.unknown { background: var(--text-dim); }
.status-dot.warning { background: var(--neon-amber); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Utility ── */
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.page-title { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 1.25rem; }
.divider-line { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ── Bezig-indicator (herstart / updaten) ── */
@keyframes badge-spin { to { transform: rotate(360deg); } }
.badge-busy i { animation: badge-spin 1.2s linear infinite; display: inline-block; }
