/* ═══════════════════════════════════════════════════════
   Zarlar Portal — Gedeelde stijl
   April 2026 — FiDel
   ═══════════════════════════════════════════════════════ */

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

/* ── CSS Variabelen ─────────────────────────────────── */
:root {
  /* Kleuren */
  --bg:          #080c10;
  --bg-card:     #0e1419;
  --bg-card2:    #141a21;
  --border:      #1e2832;
  --border-lit:  #2a3848;

  --text:        #dce8f0;
  --text-muted:  #8fb0c0;
  --text-dim:    #608090;

  --green:       #00c896;
  --green-dim:   #00402e;
  --red:         #ff4558;
  --red-dim:     #3a0a10;
  --amber:       #ffb830;
  --amber-dim:   #3a2a00;
  --blue:        #4a9eff;
  --blue-dim:    #0a1a38;
  --purple:      #b060ff;
  --teal:        #00dca8;

  /* Typografie */
  --font-ui:     'Syne', sans-serif;
  --font-data:   'IBM Plex Mono', monospace;

  /* Afmetingen */
  --sidebar-w:   220px;
  --radius:      8px;
  --radius-sm:   4px;
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

/* Subtiele scanline achtergrond */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,200,150,0.012) 2px,
    rgba(0,200,150,0.012) 4px
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ─────────────────────────────────────────── */
.zarlar-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-mark {
  font-family: var(--font-data);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}

.sidebar-logo .logo-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

.nav-section {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-card2);
  border-left-color: var(--border-lit);
}

.nav-link.active {
  color: var(--green);
  background: rgba(0,200,150,0.06);
  border-left-color: var(--green);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-link.active .nav-icon { opacity: 1; }

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

.sidebar-footer .server-info {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.8;
}

.sidebar-footer .server-ip {
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Hoofdinhoud ─────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* ── Topbalk ─────────────────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-clock {
  color: var(--text);
  font-weight: 500;
}

.topbar-refresh {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 11px;
  transition: all 0.15s;
}

.topbar-refresh:hover {
  border-color: var(--border-lit);
  color: var(--text);
}

.refresh-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: none;
}

.refresh-dot.polling {
  animation: pulse-green 1s ease-in-out infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Pagina inhoud ───────────────────────────────────── */
.page {
  padding: 28px;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ── Kaartgrid ───────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }

/* ── Kaart ───────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.card:hover { border-color: var(--border-lit); }

.card.card-online  { border-color: rgba(0,200,150,0.25); }
.card.card-offline { border-color: rgba(255,69,88,0.25); }
.card.card-pending { border-color: rgba(255,184,48,0.2); }

.card-header {
  padding: 14px 16px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.card-title-group {}

.card-name {
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
}

.card-ip {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Status badge */
.status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.status-badge.online  { background: var(--green-dim);  color: var(--green); }
.status-badge.offline { background: var(--red-dim);    color: var(--red); }
.status-badge.pending { background: var(--amber-dim);  color: var(--amber); }
.status-badge.inactive{ background: rgba(0,0,0,0.3);   color: var(--text-dim); }

.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.online  .status-dot { background: var(--green); box-shadow: 0 0 4px var(--green); }
.offline .status-dot { background: var(--red); }
.pending .status-dot { background: var(--amber); animation: pulse-amber 1.5s infinite; }

@keyframes pulse-amber {
  0%,100% { opacity:1; } 50% { opacity:0.3; }
}

/* Kaart body */
.card-body {
  padding: 12px 16px 14px;
}

/* Data-rij */
.data-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.data-row:last-child { border-bottom: none; }

.data-label {
  font-size: 12px;
  color: var(--text-muted);
}

.data-value {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.data-value.green  { color: var(--green); }
.data-value.red    { color: var(--red); }
.data-value.amber  { color: var(--amber); }
.data-value.blue   { color: var(--blue); }
.data-value.purple { color: var(--purple); }
.data-value.muted  { color: var(--text-muted); }

/* Grote waarde display */
.big-value {
  font-family: var(--font-data);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.big-unit {
  font-size: 14px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Mini-bars */
.mini-bars {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  align-items: flex-end;
  height: 20px;
}

.mini-bar {
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  min-height: 4px;
  transition: background 0.3s, height 0.3s;
}

.mini-bar.on  { background: var(--green); }
.mini-bar.off { background: var(--border); }

/* Progress bar */
.progress-wrap {
  background: var(--border);
  border-radius: 3px;
  height: 5px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.green  { background: var(--green); }
.progress-fill.amber  { background: var(--amber); }
.progress-fill.blue   { background: var(--blue); }
.progress-fill.red    { background: var(--red); }

/* Pixel grid (voor room controller) */
.pixel-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pixel-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.pixel-dot.on { /* kleur via inline style */ }

/* Kaart footer */
.card-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer .ts {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-dim);
}

.card-footer a {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.card-footer a:hover { color: var(--green); }

/* ── Scheidingslijn met label ────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 16px;
}

.section-divider span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Foutmelding ─────────────────────────────────────── */
.error-banner {
  background: var(--red-dim);
  border: 1px solid rgba(255,69,88,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--red);
  margin-bottom: 16px;
}

/* ── Laad-spinner ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-card2) 50%, var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
  height: 14px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Knoppen ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn:hover {
  border-color: var(--border-lit);
  color: var(--text);
}

.btn-green {
  border-color: rgba(0,200,150,0.4);
  color: var(--green);
  background: rgba(0,200,150,0.06);
}

.btn-green:hover {
  background: rgba(0,200,150,0.12);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .page { padding: 16px; }
  .card-grid { grid-template-columns: 1fr; }
}
