@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800;900&family=DM+Sans:wght@400;500;700&display=swap');

/* Food-Clash-Palette (übernommen aus dem Hitschis-Clash-Dashboard). */
:root {
  --bg: #ff8db6;
  --bg-deep: #ff7cad;
  --panel: #ffffff;
  --panel-2: #fff6e6;
  --brand-pink: #ff1d25;
  --brand-yellow: #ffce2b;
  --brand-cyan: #8597ff;
  --brand-maroon: #510021;
  --brand-cream: #ffecb6;
  --text: #510021;
  --muted: rgba(81, 0, 33, .66);
  --line: rgba(81, 0, 33, .14);
  --soft: rgba(81, 0, 33, .05);
  --radius: 18px;
  --shadow: 0 18px 44px rgba(81, 0, 33, .16);
}

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

body {
  min-height: 100svh;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 710 670'%3E%3Cpolygon fill='%23ffce2b' points='297,3 348,230 403,112 399,249 613,147 432,291 699,257 440,335 706,446 424,384 621,646 391,416 412,538 332,430 176,641 257,385 57,356 241,318 24,222 253,280 121,141 293,242'/%3E%3C/svg%3E") no-repeat calc(min(52vw,760px) * -0.32) calc(min(52vw,760px) * -0.34) / min(52vw,760px) min(52vw,760px) fixed,
    var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  padding: 24px;
  overflow-y: auto;
}

a { color: var(--brand-pink); }

.shell { width: min(1680px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.shell-narrow { width: min(560px, 100%); margin: 6vh auto 0; display: flex; flex-direction: column; gap: 18px; }

.topbar, .panel, .kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; border-radius: 20px; flex-wrap: wrap; }
.brand { font-family: 'Poppins', sans-serif; font-size: 1.7rem; font-weight: 900; display: flex; align-items: center; gap: 10px; }
.brand .dot { color: var(--brand-pink); }
.brand small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.panel { border-radius: var(--radius); padding: 22px; }
.panel h1 { font-family: 'Poppins', sans-serif; font-size: 1.5rem; font-weight: 900; margin-bottom: 6px; }
.panel h2 { font-family: 'Poppins', sans-serif; font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }
.panel h3 { font-family: 'Poppins', sans-serif; font-size: .95rem; font-weight: 800; margin: 16px 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Formulare */
label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; background: #fff; color: var(--text);
  border: 1px solid rgba(81, 0, 33, .24); border-radius: 12px; padding: 12px 14px; font: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-cyan); box-shadow: 0 0 0 3px rgba(133, 151, 255, .25); }
.field { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }

/* Buttons */
button, .btn { border: none; border-radius: 14px; padding: 12px 18px; font-family: 'Poppins', sans-serif; font-weight: 800; cursor: pointer; font-size: .92rem; }
.primary { background: var(--brand-pink); color: #fff; }
.primary:hover { filter: brightness(1.05); }
.ghost { background: var(--soft); color: var(--text); border: 1px solid rgba(81, 0, 33, .2); }
.danger { background: #7b103b; color: #fff; }
.mini { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.full { width: 100%; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* Status / Meldungen */
.status { font-size: .86rem; min-height: 20px; margin-top: 8px; }
.status.ok { color: #128a3e; }
.status.err { color: var(--brand-pink); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: .88rem; margin-bottom: 14px; }
.notice.warn { background: rgba(255, 206, 43, .3); }
.notice.info { background: rgba(133, 151, 255, .18); }

/* KPI-Karten */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { border-radius: 16px; padding: 16px; }
.kpi .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.kpi .value { font-family: 'Poppins', sans-serif; font-size: 1.7rem; font-weight: 900; margin-top: 6px; }
.kpi .sub { font-size: .74rem; color: var(--muted); margin-top: 4px; }

/* Tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn { flex: 1; min-width: 120px; background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-family: 'Poppins', sans-serif; font-weight: 700; cursor: pointer; transition: background .18s, color .18s; }
.tab-btn.active { background: var(--brand-pink); color: #fff; border-color: transparent; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Tabelle */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-family: 'Poppins', sans-serif; font-size: .74rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); cursor: pointer; }
tbody tr:hover { background: var(--soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 206, 43, .4); color: var(--text); font-size: .74rem; font-weight: 700; }
.badge.green { background: rgba(18, 138, 62, .16); color: #0f7a37; }
.badge.grey { background: var(--soft); color: var(--muted); }
.badge.blue { background: rgba(133, 151, 255, .22); color: #4453c9; }

/* Charts */
.chart-wrap { position: relative; height: 300px; border-radius: 16px; background: var(--soft); padding: 12px; }
.chart-wrap.short { height: 240px; }

/* Toolbar / Filter */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.toolbar > div { display: flex; flex-direction: column; }
.toolbar label { margin-bottom: 4px; }
.toolbar input, .toolbar select { min-width: 150px; }

/* Code / API-Doku */
pre { background: #2c0016; color: #ffe8f0; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .82rem; line-height: 1.5; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--soft); padding: 2px 6px; border-radius: 6px; font-size: .85em; }
.endpoint { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.method { font-family: 'Poppins', sans-serif; font-weight: 800; padding: 3px 9px; border-radius: 8px; font-size: .74rem; color: #fff; }
.method.get { background: #128a3e; } .method.post { background: var(--brand-cyan); }
.method.put { background: #d18b00; } .method.patch { background: #8a5a00; } .method.delete { background: #7b103b; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(81, 0, 33, .45); display: none; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.modal-backdrop.show { display: flex; }
.modal { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); width: min(640px, 100%); padding: 24px; }
.modal h2 { margin-bottom: 16px; }
.row-actions { display: flex; gap: 6px; }

.hidden { display: none !important; }
.spacer { flex: 1; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

@media (max-width: 1100px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { body { padding: 14px; } .grid-2 { grid-template-columns: 1fr; } .metrics { grid-template-columns: 1fr; } .brand { font-size: 1.4rem; } }
