/* Wäschemann Producer – Web-Frontend
   Farbschema aus core/constants.py / index.html */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1d71d4;
  --primary-dark: #1558b0;
  --cyan: #06b6d4;
  --indigo: #6366f1;
  --amber: #f59e0b;
  --emerald: #10b981;
  --danger: #ef4444;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --border-soft: #f1f5f9;
  --text: #0f172a;
  --text-med: #475569;
  --text-muted: #94a3b8;
}
body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── Header ─────────────────────────────────────────── */
header.app-header {
  background: var(--white); border-bottom: 1px solid var(--border);
  height: 64px; display: flex; align-items: center;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  background: var(--primary); color: white;
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 700;
}
.brand-text { font-size: 17px; font-weight: 700; color: #1e293b; }
.brand-text span { color: var(--primary); }
.copy { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.spacer { flex: 1; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-info .name { font-weight: 600; }
.user-info .role { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  background: transparent; color: var(--text-med); border: none;
  font-size: 13px; padding: 6px 12px; cursor: pointer; border-radius: 6px;
}
.btn-logout:hover { color: var(--danger); }

/* ── Main / Layout ──────────────────────────────────── */
main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.subnav {
  display: flex; gap: 4px; margin-bottom: 18px;
  background: white; padding: 6px; border-radius: 10px;
  border: 1px solid var(--border-soft); flex-wrap: wrap;
}
.subnav a {
  padding: 8px 14px; border-radius: 7px; color: var(--text-muted);
  font-size: 13px; font-weight: 500;
}
.subnav a:hover { background: var(--border-soft); color: var(--primary); }
.subnav a.active { background: #eff6ff; color: var(--primary); font-weight: 600; }

h1.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

/* ── Karten ─────────────────────────────────────────── */
.card {
  background: white; border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 20px; margin-bottom: 18px;
}
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat-card { background: white; padding: 18px; border-radius: 12px;
  border: 1px solid var(--border-soft); }
.stat-card .label { font-size: 12px; color: var(--text-med); font-weight: 500; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-card .meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-card.accent { background: linear-gradient(135deg, var(--primary), var(--indigo)); color: white; }
.stat-card.accent .label, .stat-card.accent .meta { color: rgba(255,255,255,0.85); }

/* ── Area-Kacheln (Hauptmenü) ───────────────────────── */
.area-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.area-card {
  background: white; border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 22px; display: flex; align-items: center; gap: 16px;
  transition: all 0.15s; cursor: pointer; color: inherit;
}
.area-card:hover { border-color: #cbd5e1; background: #fafcff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,23,42,0.06); }
.area-card .icon { width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; font-size: 24px; color: white; flex-shrink: 0; }
.area-card .title { font-size: 15px; font-weight: 700; color: #1e293b; }
.area-card .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Forms ──────────────────────────────────────────── */
form .row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
form .field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
form label { font-size: 12px; font-weight: 500; color: var(--text-med); }
input[type=text], input[type=number], input[type=password], input[type=date],
input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; background: white; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); border-width: 1.5px;
}
textarea { resize: vertical; min-height: 60px; }

.btn {
  background: var(--primary); color: white; border: none;
  border-radius: 8px; padding: 9px 18px; font-weight: 600;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: #cbd5e1; color: var(--text-muted); cursor: not-allowed; }
.btn-secondary { background: white; color: var(--text-med); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-soft); color: var(--primary); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 11px; }

/* ── Tabellen ───────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; background: white; }
table th { text-align: left; font-size: 11px; color: var(--text-muted);
  font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
table tr:hover td { background: #f8fafc; }
.table-wrap { background: white; border-radius: 12px; border: 1px solid var(--border-soft); overflow-x: auto; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 600; }
.badge-ok { background: #dcfce7; color: #16a34a; }
.badge-warn { background: #fef3c7; color: #b45309; }
.badge-info { background: #eff6ff; color: var(--primary); }
.badge-muted { background: var(--border-soft); color: var(--text-med); }

/* ── Login ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #eef2ff, var(--bg));
  padding: 24px;
}
.login-card { background: white; padding: 32px; border-radius: 16px;
  border: 1px solid var(--border-soft); width: 100%; max-width: 380px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06); }
.login-card .brand { justify-content: center; margin-bottom: 24px; }
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; text-align: center; }
.login-card .sub { color: var(--text-muted); text-align: center;
  font-size: 13px; margin-bottom: 20px; }
.login-card .btn { width: 100%; padding: 11px; margin-top: 8px; }
.login-card .err {
  background: #fef2f2; color: #b91c1c; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px; border: 1px solid #fecaca;
}

/* ── Mangel-Produktraster ───────────────────────────── */
.product-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.product-grid .field { background: var(--bg); padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--border-soft); }
.product-grid input { background: white; }

/* ── Inline-Detail ──────────────────────────────────── */
details { background: white; border-radius: 10px; border: 1px solid var(--border-soft);
  padding: 10px 14px; margin-bottom: 10px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--text-med); }
details[open] { padding-bottom: 16px; }

footer.footer {
  text-align: center; padding: 24px;
  color: var(--text-muted); font-size: 11px;
}
