/* DSB MSP Portal — huisstijl, afgeleid van de Yealink-portal */

:root {
  --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;

  --neon-green:  #22c55e;
  --neon-cyan:   #3b82f6;
  --neon-purple: #a78bfa;
  --neon-red:    #f87171;
  --neon-amber:  #fbbf24;
  --neon-cyan-bg:#1e3a8a;

  --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;

  --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-red:   0 0 6px rgba(248,113,113,0.25);
}

* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0;
  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); }
a { color: var(--neon-cyan); }

/* ── Layout-shell ── */
.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; }
button.nav-item { width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; cursor: pointer; }
.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 + .card { margin-top: 1rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title, .card h2 { font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--white); margin: 0 0 0.75rem; }
.card h3 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 1rem 0 0.4rem; }

/* ── 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; }

/* ── 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-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(--rose-bg); }
.btn-danger:hover { background: var(--rose-bg); opacity: 1; }
.link-danger { background: none; border: 0; color: var(--neon-red); cursor: pointer; font-size: 12px; padding: 0; font-family: var(--font-body); }
.link-danger:hover { text-decoration: underline; }
form.inline { display: inline; }

/* ── 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; vertical-align: middle;
}
.badge-dsb      { background: var(--blue-bg);   color: var(--blue-fg); }
.badge-ih       { background: var(--purple-bg); color: var(--purple-fg); }
.badge-active   { background: var(--green-bg);  color: var(--green-fg); }
.badge-prospect { background: var(--amber-bg);  color: var(--amber-fg); }
.badge-former   { background: var(--surface-3); color: var(--text-muted); }

/* ── Avatars (contacten) ── */
.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: var(--blue-bg); color: var(--blue-fg); }
.avatar-green { background: var(--green-bg); color: var(--green-fg); }
.avatar-purple { background: var(--purple-bg); color: var(--purple-fg); }
.avatar-gray { background: var(--surface-3); color: var(--text-muted); }

/* ── Tabel ── */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 12px; font-size: 13px; }
.table thead th { background: var(--surface-2); color: var(--text-muted); font-family: var(--font-title); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.table tbody tr { border-top: 1px solid var(--border); }
.table tbody tr:hover { background: var(--surface-2); }
.table a { color: var(--white); text-decoration: none; }
.table a:hover { color: var(--neon-cyan); }

/* ── Contacten / opmerkingen ── */
.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); }
.contact-row:last-child { border-bottom: none; }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 13px; font-weight: 600; color: var(--white); }
.contact-sub { font-size: 12px; color: var(--text-muted); }

.notes { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 0.5rem; }
.note-client { border-left: 3px solid var(--neon-cyan); }
.note-body { white-space: pre-wrap; font-size: 13px; }
.note-meta { font-size: 11px; color: var(--text-muted); margin-top: 0.35rem; display: flex; gap: 0.5rem; align-items: center; }

/* ── Formulieren ── */
.form-group { margin-bottom: 1rem; }
.form-label, label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input, input[type=text], input[type=email], input[type=password], input[type=search], textarea, 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); transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 2px rgba(59,130,246,0.12); }
::placeholder { color: var(--text-dim); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.check label { text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 0.45rem; color: var(--text-primary); margin: 0.5rem 0 0; }
.check input { width: auto; }

/* ── Alerts ── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 1rem; border-left: 3px solid; display: flex; gap: 8px; align-items: center; }
.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); }
.alert-warn { background: rgba(251,191,36,0.08); color: var(--neon-amber); border-color: var(--neon-amber); }

/* ── 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: 380px; max-width: 95vw; 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; margin-top: 0.5rem; 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; }
.auth-alt { margin-top: 1.2rem; font-size: 12px; }
.qr-wrap { display: flex; justify-content: center; margin: 1.2rem auto; padding: 0.8rem; background: #fff; border-radius: var(--radius-md); width: max-content; }
.manual { font-size: 12px; color: var(--text-muted); margin: 0.5rem 0; }
.manual summary { cursor: pointer; }
.secret { display: inline-block; margin-top: 0.4rem; padding: 0.4rem 0.6rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); letter-spacing: 0.12em; word-break: break-all; color: var(--white); }
.codes { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.codes code { display: block; padding: 0.5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; letter-spacing: 0.08em; text-align: center; color: var(--white); }

/* ── Pagina-onderdelen ── */
.page-title { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: var(--white); margin-bottom: 1.25rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-head h1, .page-head .page-title { margin: 0; }
.head-actions { display: flex; gap: 0.5rem; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 0.35rem 0.8rem; margin: 0; }
.kv dt { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.kv dd { margin: 0; font-size: 13px; color: var(--text-primary); }
.bill { font-size: 13px; padding: 0.6rem 0.7rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.bill-brand { border-left: 3px solid var(--neon-purple); }
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.filters .filter-search { flex: 1; min-width: 200px; }
.filters select { width: auto; }
.result-count { color: var(--text-muted); font-size: 13px; margin: 0 0 1rem; }
.pager { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; color: var(--text-muted); font-size: 13px; }
.add summary { cursor: pointer; color: var(--neon-cyan); font-size: 13px; margin: 0.5rem 0; }
.add form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.muted, .text-muted { color: var(--text-muted); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

@media (max-width: 820px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .cols, .form-grid, .stats-grid { grid-template-columns: 1fr; }
}
