:root {
  --accent: #ff6d29;
  --accent-soft: #ff9a72;
  --accent-glow: rgba(255, 109, 41, 0.42);
  --brown: #453027;
  --brown-soft: #684333;
  --ink: #ffffff;
  --night: #161316;
  --muted: #bababa;
  --muted-soft: rgba(186, 186, 186, 0.72);
  --glass: rgba(69, 48, 39, 0.48);
  --glass-strong: rgba(69, 48, 39, 0.72);
  --glass-light: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.22);
  --border-warm: rgba(255, 109, 41, 0.26);
  --danger: #ff8f7d;
  --shadow-dark: rgba(0, 0, 0, 0.42);
  --shadow-warm: rgba(255, 109, 41, 0.16);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: "Neue Montreal", "Neue Haas Grotesk Text", "Satoshi", "Avenir Next", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 44%, rgba(255, 109, 41, 0.98) 0%, rgba(255, 109, 41, 0.55) 13%, rgba(120, 54, 30, 0.32) 31%, transparent 54%),
    radial-gradient(circle at 22% 72%, rgba(255, 109, 41, 0.34), transparent 34%),
    radial-gradient(circle at 78% 18%, rgba(104, 67, 51, 0.46), transparent 34%),
    linear-gradient(145deg, #27140f 0%, #453027 38%, #241713 66%, #161316 100%);
  background-attachment: fixed;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.08), transparent 36%);
  background-size: 72px 72px, 72px 72px, auto;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.08));
}

button, input, select { font: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  width: min(1480px, calc(100% - 36px));
  margin: 18px auto;
  position: relative;
  z-index: 1;
}

.side-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: auto;
  padding: 22px;
  border-radius: 34px;
  background: linear-gradient(155deg, rgba(69, 48, 39, 0.82), rgba(22, 19, 22, 0.62));
  border: 1px solid var(--border);
  box-shadow: 0 24px 68px var(--shadow-dark), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(24px) saturate(126%);
}

.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: -0.06em;
  background: radial-gradient(circle at 35% 28%, #ff9a72, var(--accent) 58%, #b63f13 100%);
  color: #ffffff;
  box-shadow: 0 0 34px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
.brand h1 { margin: 0; font-size: 1.32rem; line-height: 1.05; font-weight: 600; letter-spacing: -0.055em; }
.brand p { margin: 5px 0 0; color: var(--muted); }

.soft-card {
  border: 1px solid var(--border);
  background: linear-gradient(148deg, rgba(255, 255, 255, 0.11), rgba(69, 48, 39, 0.55) 48%, rgba(22, 19, 22, 0.46));
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 62px var(--shadow-dark), 0 0 36px var(--shadow-warm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(122%);
}

.source-card { padding: 20px; margin-bottom: 22px; }
.source-card strong { display: block; font-size: 1.65rem; margin-top: 8px; font-weight: 500; letter-spacing: -0.055em; }
.source-card p { color: var(--muted); min-height: 42px; }

.eyebrow {
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.72rem;
  font-weight: 650;
}

.tabs { display: grid; gap: 12px; }
.tab-button,
.ghost-button,
.primary-button,
.file-label {
  border: 1px solid var(--border);
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 28px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  text-align: center;
  font-weight: 520;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tab-button:hover,
.ghost-button:hover,
.primary-button:hover,
.file-label:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 109, 41, 0.52);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.25), 0 0 26px var(--shadow-warm);
}

.tab-button.active,
.primary-button {
  background: linear-gradient(145deg, var(--accent), #ff8e5f 58%, #c64b19);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 18px 42px rgba(255, 109, 41, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ghost-button.danger { color: #ffd0c7; border-color: rgba(255, 143, 125, 0.38); }

.content { display: grid; gap: 24px; min-width: 0; }
.hero {
  padding: 34px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  overflow: visible;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -16% -56% 18%;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 109, 41, 0.5), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 {
  font-size: clamp(2.35rem, 6vw, 5.85rem);
  line-height: 1;
  margin: 10px 0 18px;
  max-width: 900px;
  font-weight: 440;
  letter-spacing: -0.075em;
  color: #ffffff;
}
.hero p { color: var(--muted); max-width: 760px; font-size: 1.08rem; font-weight: 420; }

.latest-card {
  min-width: 250px;
  flex: 0 0 auto;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 0 30px rgba(0, 0, 0, 0.16);
}
.latest-card span { color: var(--muted); }
.latest-card strong { display: block; margin: 10px 0; font-size: 1.2rem; font-weight: 560; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
  margin-bottom: 20px;
}

label { display: grid; gap: 8px; color: var(--muted); font-weight: 560; }
input, select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  outline: 0;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--ink);
  background: rgba(22, 19, 22, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 18px rgba(0, 0, 0, 0.2);
}
input::placeholder { color: rgba(186, 186, 186, 0.58); }
select option { color: #161316; background: #ffffff; }
input:focus, select:focus {
  border-color: rgba(255, 109, 41, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 109, 41, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.draw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.draw-card { padding: 18px; }
.draw-date { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; letter-spacing: -0.045em; }
.balls { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0; }
.ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: radial-gradient(circle at 34% 28%, #ffb08d, var(--accent) 58%, #b64014 100%);
  color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 109, 41, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.44);
}
.ball.euro,
.ball.euro-ball,
.euro-balls .ball {
  background: radial-gradient(circle at 34% 28%, #ffffff, #bababa 62%, #7f7f7f 100%);
  color: #161316;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.ball.main-ball,
.main-balls .ball {
  background: radial-gradient(circle at 34% 28%, #ffb08d, var(--accent) 58%, #b64014 100%);
  color: #ffffff;
}
.source-tag { color: var(--muted-soft); font-size: 0.82rem; margin-top: 12px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 24px 0; }

.add-form { padding: 28px; display: grid; gap: 22px; max-width: 900px; }
.form-head h3, .data-panel h3 { margin: 8px 0 6px; font-size: 2rem; font-weight: 500; letter-spacing: -0.065em; }
.form-head p, .data-panel p { color: var(--muted); }
.number-inputs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.euro-row { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 360px; }
.actions, .data-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-message { min-height: 24px; font-weight: 650; }
.form-message.ok { color: #ffd2bd; }
.form-message.error { color: #ffb5a8; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.stat-card { padding: 22px; }
.stat-card span { color: var(--muted); }
.stat-card strong { display: block; font-size: 2.2rem; margin-top: 8px; font-weight: 500; letter-spacing: -0.07em; }

.analysis-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}
.chart-card, .list-card, .data-panel { padding: 22px; }
.chart-card { grid-column: span 2; }
.card-head { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-weight: 520; letter-spacing: -0.055em; }
.card-head span { color: var(--muted); }
canvas { width: 100%; height: auto; border-radius: 18px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
ol { margin: 0; padding-left: 22px; }
li { padding: 8px 0; color: rgba(255, 255, 255, 0.9); }
code, pre {
  background: rgba(22, 19, 22, 0.42);
  color: #ffffff;
  border-radius: 14px;
}
pre { padding: 16px; overflow: auto; max-height: 260px; }
.file-label input { display: none; }

.mini-status {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.admin-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 18px 0;
}

.admin-box label { min-width: 0; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-panel { position: static; height: auto; max-height: none; overflow: visible; }
  .hero, .toolbar { grid-template-columns: 1fr; flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr; }
  .chart-card { grid-column: auto; }
  .number-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .admin-box { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 18px, 1480px); margin: 9px auto; }
  .hero { padding: 24px; }
  .hero h2 { font-size: clamp(2.35rem, 12vw, 3.6rem); line-height: 1.03; }
  .stats-grid { grid-template-columns: 1fr; }
  .number-inputs { grid-template-columns: 1fr; }
}

/* Desktop: linker menu en rechter content scrollen onafhankelijk. */
@media (min-width: 981px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body { min-height: 100%; }

  .app-shell {
    height: calc(100dvh - 36px);
    max-height: calc(100dvh - 36px);
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
  }

  .side-panel {
    position: relative;
    top: auto;
    align-self: stretch;
    height: 100%;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .content {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 8px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    max-height: none;
  }

  .content {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}


/* Header visibility fix */
.hero {
  min-height: max-content;
}

.hero h2 {
  overflow: visible;
}

.tab-panel.active {
  position: relative;
  z-index: 0;
}

/* Definitieve header overlap fix 2026-06-06
   De hero krijgt nu vaste ruimte en blijft boven de filterbalk staan. */
.content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.hero {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 240px;
  overflow: hidden;
  z-index: 2;
}

.hero h2 {
  display: block;
  max-width: 880px;
  margin: 12px 0 16px;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.065em;
  white-space: normal;
}

.hero p {
  margin: 0;
}

.tab-panel.active {
  position: relative;
  z-index: 1;
}

.toolbar {
  position: relative;
  z-index: 1;
}

@media (max-width: 980px) {
  .content {
    display: grid;
  }

  .hero {
    display: flex;
    min-height: auto;
    overflow: hidden;
  }
}

@media (max-width: 560px) {
  .hero h2 {
    font-size: clamp(2.25rem, 11vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.055em;
  }
}

/* Warme grafiekkleuren voor de analyse canvassen.
   Dit verandert alleen de visuele weergave van de getekende canvas pixels. */
#mainFrequencyChart {
  filter: sepia(1) saturate(3.1) hue-rotate(342deg) brightness(0.98) contrast(1.06);
}

#euroFrequencyChart {
  filter: sepia(1) saturate(2.05) hue-rotate(356deg) brightness(0.78) contrast(1.1);
}
