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

:root {
  --ink: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e1db;
  --bg: #f7f5f2;
  --white: #ffffff;
  --accent: #1a3a5c;
  --accent-light: #e8eef5;
  --orange: #92400e;
  --orange-bg: #fffbeb;
  --orange-border: #fcd34d;
  --blue: #1e40af;
  --blue-bg: #eff6ff;
  --green: #166534;
  --green-bg: #f0fdf4;
  --panel-w: 260px;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Lora', Georgia, serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

/* Shell */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Left panel */
.left-panel {
  width: var(--panel-w);
  min-width: var(--panel-w);
  background: var(--accent);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem;
  overflow: hidden;
}

.brand {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  margin-bottom: 2rem;
}

.brand strong {
  color: white;
  font-size: 0.9rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tab {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
}

.tab.active {
  background: white;
  color: var(--accent);
  border-color: white;
}

/* Upload */
.upload-section { margin-bottom: 1.25rem; }

.input-group { margin-bottom: 0.75rem; }

label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="file"] { display: none; }

.file-name {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 3px;
  transition: all 0.15s;
}

.file-name:hover {
  border-color: rgba(255,255,255,0.6);
  color: white;
}

.file-name.has-file {
  border-style: solid;
  border-color: rgba(255,255,255,0.5);
  color: white;
}

input[type="url"] {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: white;
  outline: none;
}

input[type="url"]::placeholder { color: rgba(255,255,255,0.4); }
input[type="url"]:focus { border-color: rgba(255,255,255,0.7); }

.btn-primary {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  width: 100%;
  padding: 0.65rem;
  background: white;
  color: var(--accent);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Status */
.status-msg {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin-top: 1rem;
}

.status-msg.error { color: #fca5a5; }

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Voorstel info blok (gemeente + type) */
.voorstel-info {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Gemeente badge */
.gemeente-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: white;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
}

/* Classificatie blok */
.classificatie-blok {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
}

.classificatie-hoofd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.classificatie-hoofd {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.3;
}

.classificatie-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.4;
  font-style: italic;
}

.complex-pill {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  flex-shrink: 0;
}

.complex-pill.laag   { background: rgba(34,197,94,0.2);  color: #86efac; }
.complex-pill.middel { background: rgba(245,158,11,0.2); color: #fcd34d; }
.complex-pill.hoog   { background: rgba(239,68,68,0.2);  color: #fca5a5; }

/* Score panel */
.score-panel {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.score-gauge {
  position: relative;
  width: 80px;
  height: 80px;
}

.score-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

.score-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-cats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  margin-top: 0.25rem;
}

.score-cat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.65);
}

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

.score-dot.groen  { background: #22c55e; }
.score-dot.oranje { background: #f59e0b; }
.score-dot.rood   { background: #ef4444; }

.left-footer {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Dashboard main */
.dashboard {
  flex: 1;
  overflow: hidden;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto;
  gap: 0;
}

.empty-icon-svg {
  width: 72px;
  height: 72px;
  margin-bottom: 1.5rem;
}

.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.empty-state > p {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.empty-checks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.empty-checks span {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  background: var(--white);
  letter-spacing: 0.02em;
}

/* Result grid */
.result-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
  overflow: hidden;
  height: 100%;
}

.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1rem 1.1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Card plaatsing */
.card-beslispunten { grid-column: 1; grid-row: 1; }
.card-kern         { grid-column: 2; grid-row: 1; }
.card-vragen       { grid-column: 3; grid-row: 1; }
.card-rapport      { grid-column: 1 / 3; grid-row: 2; }
.card-side         { grid-column: 3; grid-row: 2; display: flex; flex-direction: column; gap: 0.75rem; background: none; border: none; padding: 0; }
.card-side .dash-card { flex: 1; }

/* Card content */
.dash-card ol,
.dash-card ul {
  overflow-y: auto;
  flex: 1;
}

.dash-card ol {
  padding-left: 1.1rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.dash-card ol li { margin-bottom: 0.4rem; }

.card-kern p {
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.65;
  overflow-y: auto;
  flex: 1;
}

/* Verbeterpunten */
.card-verbeter ul {
  list-style: none;
  padding: 0;
}

.card-verbeter ul li {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
  border-radius: 3px;
  border-left: 3px solid var(--orange-border);
  background: var(--orange-bg);
  color: var(--orange);
}

/* Raadsvragen */
.card-vragen ol {
  font-style: italic;
  color: var(--accent);
}

.vragen-leeg {
  font-family: 'Inter', sans-serif;
  font-style: normal !important;
  font-size: 0.82rem;
  color: var(--muted);
  list-style: none;
  padding-left: 0;
}

/* Bevoegdheid */
.bevoegdheid-oordeel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.bevoegdheid-oordeel.ja         { background: var(--green-bg); color: var(--green); }
.bevoegdheid-oordeel.onduidelijk { background: var(--orange-bg); color: var(--orange); }
.bevoegdheid-oordeel.nee        { background: #fef2f2; color: #991b1b; }

.bevoegdheid-toelichting {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.bevoegdheid-grondslag {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* Rapport */
.rapport-scroll {
  overflow-y: auto;
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.7;
}

.rapport-sectie { margin-bottom: 1rem; }

.rapport-sectie h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.rapport-sectie p { white-space: pre-wrap; }

.hidden { display: none !important; }
