/* ============================================================
   Rollution – Basis-Stylesheet
   ============================================================ */
:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1e293b;
  --muted:     #64748b;
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --accent:    #f59e0b;
  --ok:        #16a34a;
  --warn:      #f59e0b;
  --danger:    #e11d48;
  --radius:    12px;
  --shadow:    0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Topbar / Navigation ---- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; height: 58px;
}
.brand { font-weight: 700; font-size: 19px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 14px;
}
.nav a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.nav a.active { color: var(--primary); background: rgba(37,99,235,.08); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar-right .who { color: var(--muted); }
.topbar-right .who b { color: var(--text); }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 24px; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-2 { grid-template-columns: 1fr; } }

/* ---- KPI-Kacheln ---- */
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: 32px; font-weight: 700; line-height: 1; }
.kpi .value.danger { color: var(--danger); }
.kpi .value.warn { color: var(--warn); }
.kpi .value.ok { color: var(--ok); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  padding: 10px 16px; border-radius: 9px; font-weight: 600; font-size: 14px; font-family: inherit;
}
.btn:hover { background: var(--primary-d); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--danger); }
.btn.block { width: 100%; }

/* ---- Formulare ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ---- Tabellen ---- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:hover td { background: var(--bg); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.gray   { background: #f1f5f9; color: #475569; }
.badge.green  { background: #dcfce7; color: #15803d; }
.badge.amber  { background: #fef3c7; color: #b45309; }
.badge.red    { background: #ffe4e6; color: #be123c; }
.badge.blue   { background: #dbeafe; color: #1d4ed8; }

/* ---- Flash / Meldungen ---- */
.flash { padding: 12px 16px; border-radius: 9px; margin-bottom: 16px; font-size: 14px; border: 1px solid transparent; }
.flash.info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.flash.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash.error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ---- Auth-Seiten (Login/Setup) ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 24px; }
.auth-card .tagline { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }

.muted { color: var(--muted); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }

/* ---- Reiter (Verwaltung) ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tabs .tab {
  padding: 10px 16px; color: var(--muted); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--text); text-decoration: none; }
.tabs .tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---- kleine Inline-Formulare / Buttons in Tabellen ---- */
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; border: 1px solid rgba(0,0,0,.12); }
input.color-inp { padding: 2px; height: 38px; width: 52px; }
.tag-you { font-size: 11px; color: var(--muted); font-weight: 600; }
