/* wir-branden Pro-Reporting — Master Stylesheet */

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

:root {
  --primary: #9e2654;
  --primary-dark: #7a1d42;
  --primary-light: #b3305f;
  --secondary: #2d6a2e;
  --accent: #f5c518;
  --alert: #8b1a1a;
  --text: #444;
  --text-light: #666;
  --text-muted: #999;
  --bg: #f5f5f5;
  --surface: #fff;
  --border: #e0e0e0;
  --border-soft: #f0f0f0;
}

html, body { height: 100%; }
body {
  font-family: 'Quicksand', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

/* ============== LOGIN ============== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08);
  width: 100%;
  max-width: 420px;
  border-top: 4px solid var(--primary);
  text-align: center;
}
.login-card h1 { font-weight: 300; font-size: 1.6em; color: var(--text); margin-bottom: 8px; }
.login-card .muted { color: var(--text-light); margin-bottom: 28px; font-size: 0.92em; }
.login-logo {
  width: 200px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}
.login-logo-fallback {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-card label { display: block; text-align: left; font-weight: 600; margin: 16px 0 6px; font-size: 0.9em; }
.login-card input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font: inherit; transition: all 0.15s;
}
.login-card input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(158,38,84,0.15);
}
.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  text-decoration: none;
  font: inherit;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(158,38,84,.35); transform: translateY(-1px); }
.btn-block { width: 100%; }
.btn-outline {
  border: 1.5px solid var(--border); background: white; color: var(--text);
}
.btn-outline:hover { background: #fafafa; }
.btn-danger {
  background: var(--alert); color: white;
}
.btn-sm { padding: 6px 12px; font-size: 0.85em; }
.error {
  background: #fef0f0; color: var(--alert);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0;
  border-left: 3px solid var(--alert); font-size: 0.9em;
}
.success {
  background: #f0faf0; color: var(--secondary);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0;
  border-left: 3px solid var(--secondary); font-size: 0.9em;
}
.footnote { color: var(--text-muted); font-size: 0.8em; margin-top: 24px; text-align: center; }

/* ============== ADMIN LAYOUT ============== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo-img {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 6px;
}
.sidebar-brand-sub { font-size: 0.72em; color: var(--text-muted); margin-top: 4px; letter-spacing:0.05em; text-transform:uppercase; font-weight:600; }
.sidebar-nav { padding: 14px 10px; flex: 1; }
.sidebar-group { margin-bottom: 14px; }
.sidebar-group-label {
  font-size: 0.68em; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 14px 4px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 1px 0;
  border-radius: 8px; color: #555;
  font-weight: 600; font-size: 0.92em;
  transition: all 0.15s;
}
.sidebar-link:hover {
  background: #faf3f6; color: var(--primary); text-decoration: none;
  transform: translateX(2px);
}
.sidebar-link.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 3px 10px rgba(158,38,84,.3);
}
.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px 14px;
}
.user-info {
  padding: 8px 4px 12px;
  font-size: 0.85em;
}
.user-info .uname { font-weight: 600; color: var(--text); }
.user-info .uemail { color: var(--text-muted); font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; }

.main-content {
  padding: 30px 40px;
  max-width: 1400px;
  width: 100%;
  overflow-x: auto;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}
.page-header h1 {
  font-weight: 300; font-size: 1.8em; color: var(--text);
}
.page-header .subtitle { color: var(--text-light); font-size: 0.95em; margin-top: 4px; }
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.9em; color: var(--text-light); margin-bottom: 12px;
}
.back-link:hover { color: var(--primary); }

/* ============== KPI CARDS ============== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.kpi-card {
  background: white;
  border-radius: 10px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}
.kpi-label {
  font-size: 0.72em; font-weight: 700;
  color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-value {
  font-size: 1.9em; font-weight: 300; color: var(--text); margin: 6px 0 4px;
}
.kpi-delta { font-size: 0.85em; color: var(--text-light); }
.kpi-delta.up { color: var(--secondary); font-weight: 600; }
.kpi-delta.down { color: var(--alert); font-weight: 600; }

/* ============== CARDS / TABLES ============== */
.card {
  background: white;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.card-title { font-size: 1.05em; font-weight: 600; color: var(--text); }
.card-body { padding: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
table th {
  background: #fafafa;
  text-align: left; padding: 12px 18px;
  font-size: 0.72em; font-weight: 700;
  color: var(--text-light); text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}
table tbody tr:hover { background: #fafafa; }
table .right { text-align: right; }
table .center { text-align: center; }

.badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.75em; font-weight: 700;
}
.badge.green { background: #e3f3e3; color: #2d6a2e; }
.badge.red   { background: #fde6e6; color: #8b1a1a; }
.badge.yellow{ background: #fff5d6; color: #806600; }
.badge.gray  { background: #eee; color: #666; }

/* ============== FORMS ============== */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block; font-weight: 600; font-size: 0.88em;
  color: var(--text); margin-bottom: 6px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 7px;
  font: inherit; transition: all 0.15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(158,38,84,0.15);
}
.form-row .helper { font-size: 0.8em; color: var(--text-light); margin-top: 4px; }
.form-actions {
  margin-top: 24px; padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
}

/* ============== TOKEN URL BOX ============== */
.token-box {
  background: linear-gradient(135deg, rgba(158,38,84,0.05), rgba(179,48,95,0.05));
  border: 2px solid rgba(158,38,84,0.2);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 22px;
}
.token-box h3 {
  font-size: 0.78em; font-weight: 700;
  color: var(--primary); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 8px;
}
.token-url-row {
  background: white; padding: 12px;
  border-radius: 8px; border: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.token-url-row code {
  flex: 1; font-family: monospace; font-size: 0.9em;
  color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============== CUSTOMER VIEW (öffentlich) ============== */
.customer-page { min-height: 100vh; }
.customer-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; padding: 30px 20px;
}
.customer-header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.customer-header h1 { font-weight: 300; font-size: 2em; }
.customer-header .domain { color: rgba(255,255,255,0.85); font-size: 0.95em; margin-top: 4px; }
.customer-header .brand { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.customer-header .brand-logo {
  height: 40px;
  width: auto;
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
}
.customer-header .brand-sub { font-weight: 600; font-size: 0.85em; opacity: 0.9; letter-spacing: 0.05em; text-transform: uppercase; }
.customer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 20px;
}
.customer-footer {
  text-align: center; color: var(--text-muted);
  font-size: 0.8em; padding: 30px 20px;
}

/* ============== UTILS ============== */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85em; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.right { text-align: right; }
.empty-state {
  padding: 60px 30px; text-align: center;
}
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 18px; }

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  .admin-layout { grid-template-columns: 1fr; }
  .

/* ========== AMPEL STATUS-INDIKATOREN ========== */
.ampel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85em;
}
.ampel-status img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.ampel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ampel-row img { width: 16px; height: 16px; }
