/* ============================================================
   Kundenportal — Design System
   Markenfarbe kommt pro Kunde über --brand/--brand-dark (inline auf
   <html>, siehe includes/header.php) — Rest ist markenneutral.
   ============================================================ */
:root {
  --brand:        #FFA500;
  --brand-dark:   #FF8C00;
  --bg-base:      #f4f5f7;
  --bg-card:      rgba(255,255,255,0.98);
  --bg-input:     rgba(0,0,0,0.04);
  --bg-hover:     rgba(0,0,0,0.04);
  --text-primary: #111827;
  --text-secondary:#374151;
  --text-muted:   #6b7280;
  --border:       rgba(209,213,219,0.9);
  --danger:       #dc2626;
  --warning:      #d97706;
  --success:      #16a34a;
  --radius:       10px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.08);
  --transition:   all 0.2s cubic-bezier(0.4,0,0.2,1);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base); color: var(--text-primary); line-height: 1.6; min-height: 100vh;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand img { height: 32px; }
.topbar-brand .name { font-weight: 800; font-size: 16px; }
.topbar-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-nav a { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.topbar-nav a:hover { background: var(--bg-hover); text-decoration: none; }
.topbar-nav a.active { background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand-dark); }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.topbar-user a { color: var(--text-muted); }

.content { max-width: 1100px; margin: 0 auto; padding: 32px 24px 80px; }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 24px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 800; }
.card-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); transition: var(--transition); display: block; }
.tile:hover { transform: translateY(-2px); text-decoration: none; }
.tile-icon { font-size: 24px; margin-bottom: 8px; }
.tile-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.tile-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; transition: var(--transition); border: 1px solid transparent; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn-ghost { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.btn-ghost:hover { text-decoration: none; }
.btn-outline { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn-outline:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-control { width: 100%; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 14px; outline: none; }
.form-control:focus { border-color: var(--brand); }

.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.list-row-title { font-size: 14px; font-weight: 700; }
.list-row-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.pw-dots { font-family: monospace; letter-spacing: 2px; color: var(--text-muted); }
.pw-value { font-family: monospace; font-weight: 700; }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg-hover); color: var(--text-secondary); border: 1px solid var(--border); }
.badge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-green { background: rgba(22,163,74,.12); color: #16a34a; }
.badge-yellow { background: rgba(217,119,6,.12); color: #d97706; }
.badge-red { background: rgba(220,38,38,.12); color: #dc2626; }
.badge-grey { background: rgba(107,114,128,.12); color: #6b7280; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; font-size: 14px; vertical-align: middle; border-bottom: 1px solid var(--border); }

.flash-success, .flash-error, .flash-warning, .flash-info { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; border: 1px solid; }
.flash-success { background: rgba(22,163,74,.08); color: #16a34a; border-color: rgba(22,163,74,.3); }
.flash-error { background: rgba(220,38,38,.08); color: #dc2626; border-color: rgba(220,38,38,.3); }
.flash-warning { background: rgba(217,119,6,.08); color: #d97706; border-color: rgba(217,119,6,.3); }
.flash-info { background: rgba(37,99,235,.08); color: #2563eb; border-color: rgba(37,99,235,.3); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* Login/Aktivieren/Reset */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow); }
.auth-box h1 { font-size: 20px; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-box p.sub { color: var(--text-muted); font-size: 13px; text-align: center; margin-bottom: 24px; }
.auth-box .btn-primary { width: 100%; justify-content: center; padding: 11px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar-nav { justify-content: center; }
  .content { padding: 20px 14px 60px; }
}
