/* ===== ADC Montage – Design system ===== */
:root {
  /* Brand */
  --adc-primary: #123c28;
  --adc-primary-hover: #0f3322;
  --adc-accent: #eabe54;
  --adc-accent-hover: #e5b43d;
  --adc-accent-bg: rgba(234, 190, 84, 0.12);

  /* Neutrals */
  --color-bg: #f7f8f9;
  --color-surface: #ffffff;
  --color-border: #e1e4e8;
  --color-border-focus: #123c28;
  --color-text: #1a1d21;
  --color-text-secondary: #5c6370;
  --color-text-muted: #8b919a;

  /* States */
  --color-success: #2d7d4a;
  --color-success-bg: #e8f5ec;
  --color-error: #c62828;
  --color-error-bg: #ffebee;
  --color-inactive: #9e9e9e;
  --color-inactive-bg: #f0f0f0;

  /* Layout */
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --topbar-height: 56px;
  --sidebar-width: 240px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-sans); background: var(--color-bg); color: var(--color-text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; padding-top: 1.5rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
  background: var(--adc-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--adc-primary-hover); }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover:not(:disabled) { background: var(--color-bg); }
.btn-danger {
  background: var(--color-surface);
  color: var(--color-error);
  border-color: var(--color-error);
}
.btn-danger:hover:not(:disabled) {
  background: var(--color-error-bg);
}
.btn-block { width: 100%; }

/* ===== Form controls ===== */
.input-wrap { margin-bottom: 1rem; }
.input-wrap label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}
.input-wrap label .required { color: var(--color-error); }
.input-wrap .hint { font-size: 12px; color: var(--color-text-muted); margin-top: 0.25rem; }
.input-wrap.error .hint,
.input-wrap .error-text { color: var(--color-error); font-size: 12px; margin-top: 0.25rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--adc-primary);
  box-shadow: 0 0 0 3px rgba(18, 60, 40, 0.12);
}
input::placeholder,
textarea::placeholder { color: var(--color-text-muted); }
.input-wrap.error input,
.input-wrap.error select,
.input-wrap.error textarea {
  border-color: var(--color-error);
}
input:read-only,
input[readonly] {
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: default;
}

select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c6370' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--adc-primary);
  cursor: pointer;
}
.checkbox-wrap label { margin: 0; cursor: pointer; }

/* ===== Cards ===== */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

/* ===== Chips / Badges ===== */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.chip-active { background: var(--color-success-bg); color: var(--color-success); }
.chip-inactive { background: var(--color-inactive-bg); color: var(--color-inactive); }

/* ===== Alerts ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 1rem;
}
.alert-error { background: var(--color-error-bg); color: var(--color-error); border: 1px solid rgba(198, 40, 40, 0.2); }

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--adc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.topbar .logo {
  height: 32px;
  width: auto;
  display: block;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
/* Voor een logo met transparante achtergrond: witte variant op groen */
.topbar .logo--light {
  filter: brightness(0) invert(1);
}
.topbar .logo-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}
.topbar .logo-wrap .logo { box-shadow: none; }
.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar .user-email { font-size: 13px; color: rgba(255,255,255,0.9); }
.topbar .btn-ghost {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
}
.topbar .btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Terug naar mockup-overzicht (alle mockup-pagina's) */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar .mockup-back {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.topbar .mockup-back:hover { color: #fff; text-decoration: underline; }
.topbar-mobile .mockup-back {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 14px;
  padding: 0.35rem 0;
}
.topbar-mobile .mockup-back:hover { color: #fff; }
.mockup-back-standalone {
  color: var(--adc-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.mockup-back-standalone:hover { text-decoration: underline; }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 1rem 0;
  flex-shrink: 0;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar-nav a:hover { background: var(--color-bg); color: var(--color-text); }
.sidebar-nav a.active {
  background: var(--adc-accent-bg);
  color: var(--adc-primary);
  border-left-color: var(--adc-accent);
}

/* ===== Content area ===== */
.content {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 1.5rem;
  overflow: auto;
  min-height: 0;
}
.page-header { margin-bottom: 1.5rem; }
.page-title { margin: 0 0 0.25rem; font-size: 1.5rem; font-weight: 600; }
.page-subtitle { margin: 0; font-size: 14px; color: var(--color-text-secondary); }

/* ===== App layout (desktop) ===== */
.app { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }
.app-body { display: flex; flex: 1; min-height: 0; min-width: 0; width: 100%; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th {
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
tr:hover td { background: var(--color-bg); }
.table-actions { display: flex; gap: 0.5rem; }

/* ===== Dialog ===== */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.dialog {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 440px;
  width: 100%;
  padding: 1.5rem;
}
.dialog-title { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 600; }
.dialog-body { margin: 0 0 1.5rem; color: var(--color-text-secondary); font-size: 14px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ===== Utility ===== */
.flex { display: flex; }
.flex-between { justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 1rem; }

/* ===== Filter bar ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
.filter-bar .search-input { width: 200px; }
.filter-bar select { min-width: 140px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; font-size: 13px; color: var(--color-text-secondary); }
.pagination-btns { display: flex; gap: 0.25rem; }
.pagination-btns .btn { padding: 0.4rem 0.65rem; font-size: 13px; }
.pagination-btns .btn:disabled { opacity: 0.5; cursor: default; }

/* ===== Skeleton ===== */
.skeleton { background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%); background-size: 200% 100%; animation: skeleton 1.2s ease-in-out infinite; border-radius: 4px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; }
.skeleton-row td { padding: 0.75rem 1rem; vertical-align: middle; }
.skeleton-row td .skeleton { height: 14px; }

/* ===== Mobile overlay / slide menu ===== */
.mobile-menu-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; display: none; }
.mobile-menu-backdrop.open { display: block; }
.mobile-menu { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; max-width: 85vw; background: var(--color-surface); box-shadow: var(--shadow-md); z-index: 101; padding: 1rem 0; display: none; }
.mobile-menu.open { display: block; }
.mobile-menu .sidebar-nav a { padding: 0.75rem 1.25rem; }
.mobile-menu .user-menu-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--color-border); margin-top: 1rem; }

/* ===== Form grid ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; }
.form-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--color-text-muted); }
.empty-state .empty-title { font-size: 1rem; font-weight: 600; color: var(--color-text-secondary); margin: 0 0 0.25rem; }
.empty-state .empty-text { font-size: 14px; margin: 0 0 1rem; }

/* ===== Mobile viewport (phone frame voor desktop) ===== */
@media (min-width: 401px) {
  body.mobile-view-body { background: #374151; min-height: 100vh; }
  .mobile-viewport {
    width: 375px;
    min-height: 667px;
    max-height: 90vh;
    margin: 4rem auto 3rem;
    background: var(--color-bg);
    border-radius: 28px;
    box-shadow: 0 0 0 3px #1f2937, 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
  }
}
@media (max-width: 400px) {
  .mobile-viewport { width: 100%; min-height: 100vh; max-height: none; }
}
