/* ════════════════════════════════════════════════════
   C-TIX v2 — Dashboard CSS
   Gebaseerd op mockups: clean/modern (Stripe/Linear)
   Datum: 2026
════════════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --blue:         #3b9eff;
  --blue-dark:    #1a7fdb;
  --blue-light:   #e8f3ff;
  --blue-mid:     #c2dcff;
  --bg:           #f4f6f9;
  --sidebar-bg:   #0d1b2e;
  --sidebar-w:    230px;
  --white:        #fff;
  --text:         #1a2535;
  --muted:        #7a8899;
  --border:       #e2e8f0;
  --green:        #22c55e;
  --green-light:  #dcfce7;
  --orange:       #f59e0b;
  --orange-light: #fef3c7;
  --red:          #ef4444;
  --red-light:    #fee2e2;
  --purple:       #8b5cf6;
  --purple-light: #ede9fe;
  --radius:       10px;
  --shadow:       0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo img {
  height: 40px;
  
  
  
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 16px 20px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.6);
  border-radius: 6px;
  margin: 1px 8px;
  cursor: pointer;
  transition: all .15s;
  font-size: 13.5px;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nav-item.active {
  background: rgba(59,158,255,.18);
  color: var(--blue);
  font-weight: 500;
}

.nav-item svg { flex-shrink: 0; opacity: .8; }
.nav-item.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ── SIDEBAR USER ── */
.sidebar-bottom {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.07);
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.sidebar-user:hover { background: rgba(255,255,255,.06); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { color: rgba(255,255,255,.38); font-size: 11px; }

.user-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px; right: 8px;
  background: #1a2d45;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  overflow: hidden;
  z-index: 200;
}

.user-popup.open { display: block; }

.user-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: background .12s;
}

.user-popup-item:last-child { border-bottom: none; }
.user-popup-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.user-popup-item.logout { color: #f87171; }
.user-popup-item.logout:hover { background: rgba(239,68,68,.1); }

/* ── MAIN ── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.topbar-search input::placeholder { color: var(--muted); }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary  { background: var(--blue);    color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost    { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-green    { background: var(--green);   color: #fff; }
.btn-green:hover { background: #16a34a; }
.btn-danger   { background: var(--red-light); color: var(--red); border: 1px solid #fca5a5; }
.btn-sm       { padding: 5px 10px; font-size: 12px; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  float: right;
  margin-top: -2px;
}

.si-blue   { background: var(--blue-light);   color: var(--blue); }
.si-green  { background: var(--green-light);  color: var(--green); }
.si-orange { background: var(--orange-light); color: var(--orange); }
.si-red    { background: var(--red-light);    color: var(--red); }
.si-purple { background: var(--purple-light); color: var(--purple); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}

.stat-value { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--muted); margin-top: 5px; }
.stat-up    { color: var(--green); font-weight: 600; }
.stat-dn    { color: var(--red);   font-weight: 600; }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title   { font-size: 14px; font-weight: 600; }
.card-body    { padding: 20px; }
.card-footer  {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── TABLES ── */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: left;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: var(--blue-light); }

/* ── PILLS / STATUS ── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.pill-dot      { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-paid     { background: var(--green-light); color: #16a34a; }
.pill-free     { background: var(--blue-light);  color: var(--blue); }
.pill-cancel   { background: var(--red-light);   color: #dc2626; }
.pill-active   { background: var(--green-light); color: #16a34a; }
.pill-inactive { background: #f3f4f6; color: var(--muted); }

/* ── FORM ELEMENTS ── */
.form-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

label { font-size: 12px; font-weight: 600; color: var(--text); }

.hint { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }

input[type=text],
input[type=email],
input[type=number],
input[type=date],
input[type=time],
input[type=tel],
input[type=url],
input[type=password],
select,
textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,158,255,.12);
}

input:disabled, select:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

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

/* ── TOGGLE ── */
.tog { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.tog input { opacity: 0; width: 0; height: 0; }
.tog-sl { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 10px; transition: .2s; }
.tog-sl::before { position: absolute; content: ''; height: 14px; width: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.tog input:checked + .tog-sl { background: var(--blue); }
.tog input:checked + .tog-sl::before { transform: translateX(16px); }
.tog input:disabled + .tog-sl { background: #a0b8d0; cursor: not-allowed; }

/* ── MONO ── */
.mono { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--blue); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1a2535;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.toast.show { transform: translateY(0); opacity: 1; }

/* ── INFO BOXES ── */
.info-box {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--blue-dark);
  line-height: 1.6;
}

.warn-box {
  background: var(--orange-light);
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #92400e;
  line-height: 1.6;
}

.ok-box {
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #166534;
  line-height: 1.6;
}

/* ── RESPONSIVE (basis) ── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .sidebar {
    display: flex;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 4px;
  }
  .topbar-search { display: none; }
}

@media (min-width: 601px) {
  .hamburger { display: none; }
  .sidebar-overlay { display: none !important; }
}
