/* Smart Energy — BKW Auftragsportal
   Design-System 1:1 aus dem CI der Hauptwebsite (smrtenrgy.de) uebernommen:
   dunkles Layout, Schriftart "Outfit", Mint-Tuerkis (#4ECDC4) als Markenfarbe. */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');
:root {
  --bg: #06080A;
  --surface: #111820;
  --border: rgba(255,255,255,0.10);
  --navy: #0B0F14;
  --navy-2: #141C26;
  --text: rgba(255,255,255,0.92);
  --text-muted: rgba(255,255,255,0.55);
  --text-faint: rgba(255,255,255,0.35);
  --cyan: #4ECDC4;
  --cyan-light: rgba(78,205,196,0.12);
  --cyan-dark: #3DBFB5;
  --amber-bg: rgba(245,166,35,0.14);
  --amber-text: #F5A623;
  --green-bg: rgba(52,199,89,0.16);
  --green-text: #3ADB7D;
  --red-bg: rgba(255,90,82,0.16);
  --red-text: #FF7A73;
  --grey-bg: rgba(255,255,255,0.07);
  --grey-text: rgba(255,255,255,0.5);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.5);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }
svg { display: block; }
.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 70px; }

/* ---------- Topbar & Navigation ---------- */
.app-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.app-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; text-decoration: none; }
.app-brand .logo-chip {
  width: 32px; height: 32px; border-radius: 9px; background: var(--cyan-light); border: 1px solid rgba(78,205,196,0.3);
  display: flex; align-items: center; justify-content: center; color: var(--cyan); flex: none; padding: 5px;
}
.app-brand .logo-chip img { width: 100%; height: 100%; object-fit: contain; }
.app-brand span.accent { color: var(--cyan); }
.app-user { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.app-user .avatar {
  width: 28px; height: 28px; border-radius: 999px; background: var(--cyan-light); color: var(--cyan-dark);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.app-user a.logout { color: var(--text-faint); text-decoration: none; display: flex; align-items: center; }

.app-nav {
  display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px; overflow-x: auto; box-shadow: var(--shadow); margin-bottom: 22px;
}
.app-nav a {
  appearance: none; border: none; background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 9px 15px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.app-nav a:hover { color: var(--text); }
.app-nav a.active { background: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  border-radius: var(--radius-lg); padding: 26px 28px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(78,205,196,0.28), transparent 70%);
}
.hero-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); margin-bottom: 6px; }
.hero h1 { font-size: 24px; font-weight: 800; }
.hero p.sub { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 6px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: none; font-family: inherit; cursor: pointer;
  border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--cyan); color: #06231F; }
.btn-primary:hover { background: #6BD9D0; }
.btn-dark { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.16); }
.btn-dark:hover { background: rgba(255,255,255,0.16); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: #C9CFD8; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-danger { background: var(--red-bg); color: var(--red-text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 13px; font-size: 12px; }

/* ---------- KPI Kacheln ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow); }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.kpi-icon.cyan { background: var(--cyan-light); color: var(--cyan-dark); }
.kpi-icon.amber { background: var(--amber-bg); color: var(--amber-text); }
.kpi-icon.green { background: var(--green-bg); color: var(--green-text); }
.kpi-icon.grey { background: var(--grey-bg); color: var(--grey-text); }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.card-title .ic-wrap { width: 30px; height: 30px; border-radius: 9px; background: var(--cyan-light); color: var(--cyan-dark); display: flex; align-items: center; justify-content: center; }
.card-link { font-size: 12.5px; font-weight: 700; color: var(--cyan-dark); text-decoration: none; display: flex; align-items: center; gap: 4px; }

.status-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 800px) { .status-row { grid-template-columns: 1fr; } }
.status-chip { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; }
.status-chip .left { display: flex; align-items: center; gap: 8px; }
.status-chip.grey { background: var(--grey-bg); color: var(--grey-text); }
.status-chip.amber { background: var(--amber-bg); color: var(--amber-text); }
.status-chip.green { background: var(--green-bg); color: var(--green-text); }
.status-chip.red { background: var(--red-bg); color: var(--red-text); }

/* ---------- Tabellen ---------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); padding: 0 10px 10px; }
td { padding: 14px 10px; border-top: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: rgba(255,255,255,0.03); }
.cell-name { font-weight: 700; }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.chev { color: var(--text-faint); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.badge.entwurf { background: var(--grey-bg); color: var(--grey-text); }
.badge.gesendet { background: var(--amber-bg); color: var(--amber-text); }
.badge.unterschrieben { background: var(--green-bg); color: var(--green-text); }
.badge.storniert { background: var(--red-bg); color: var(--red-text); }
.badge.aktiv { background: var(--green-bg); color: var(--green-text); }
.badge.inaktiv { background: var(--grey-bg); color: var(--grey-text); }
.badge.offen { background: var(--amber-bg); color: var(--amber-text); }
.badge.ausgezahlt { background: var(--green-bg); color: var(--green-text); }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* Kennzeichnung "Auftrag kommt von Vertriebspartner X" - bewusst andersfarbig
   (cyan) als die Status-Badges, damit auf einen Blick klar ist: das ist eine
   Partner-Zuordnung, kein Auftragsstatus. */
.badge-partner { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--cyan-light); color: var(--cyan-dark); }
.badge-direkt { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--grey-bg); color: var(--grey-text); }

/* ---------- Formulare ---------- */
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--text); font-size: 13.5px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cyan); background: rgba(255,255,255,0.07); }
.field select option { background: var(--surface); color: var(--text); }
.field input[readonly] { color: var(--text-muted); }
.row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.row:first-of-type { margin-top: 0; }
.row > div { flex: 1; min-width: 190px; }

.section-label { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.section-label .num { width: 22px; height: 22px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; }

.progressbar { display: flex; gap: 5px; margin-bottom: 22px; }
.progressbar div { flex: 1; height: 5px; border-radius: 999px; background: var(--border); }
.progressbar div.done { background: var(--cyan); }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .summary-grid { grid-template-columns: 1fr; } }
.summary-grid label { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); margin-bottom: 8px; }
.summary-grid p { font-size: 14px; line-height: 1.6; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -26px; top: 1px; width: 18px; height: 18px; border-radius: 999px; background: var(--cyan-light); color: var(--cyan); display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.timeline-dot svg { width: 10px; height: 10px; }
.timeline-title { font-size: 13.5px; font-weight: 700; }
.timeline-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Produktkarten ---------- */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .product-grid { grid-template-columns: 1fr; } }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow); position: relative; cursor: pointer; transition: border-color .15s; }
.product-card:hover { border-color: var(--cyan); }
.product-card.selected { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-light); }
.product-card .top-badge { position: absolute; top: 14px; right: 14px; background: var(--amber-bg); color: var(--amber-text); font-size: 10.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; }
.product-card h4 { font-size: 14px; margin-bottom: 6px; padding-right: 50px; }
.product-card .specs { font-size: 12px; color: var(--text-muted); display: flex; gap: 10px; margin-bottom: 12px; }
.product-card .price { font-size: 20px; font-weight: 800; }
.product-card .rate { display: inline-block; background: var(--cyan-light); color: var(--cyan-dark); font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-top: 8px; }
.product-card .desc { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; }

/* ---------- Bottom-Nav (mobile Vorschau-Element) ---------- */
.bottom-nav { display: flex; justify-content: space-around; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px; margin-top: 26px; box-shadow: var(--shadow); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text-faint); font-size: 10.5px; font-weight: 700; padding: 6px 14px; border-radius: 12px; }
.bottom-nav a.active { color: var(--cyan-dark); background: var(--cyan-light); }
.bottom-nav a .fab { width: 34px; height: 34px; margin-bottom: -2px; border-radius: 999px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------- Kundenansicht (extern) ---------- */
.customer-wrap { max-width: 640px; margin: 0 auto; }
.customer-topbar { display: flex; align-items: center; gap: 10px; padding: 18px 4px 26px; }
.trust-strip { display: flex; align-items: center; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.trust-item .ic { width: 15px; height: 15px; color: var(--cyan-dark); }

.sig-pad-wrap { background: #fff; border: 1.5px dashed #D3D8E0; border-radius: var(--radius-md); touch-action: none; overflow: hidden; }
canvas#sigpad { width: 100%; height: 180px; display: block; cursor: crosshair; }
.sig-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); margin-top: 10px; }

.success-box { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.success-box .check { width: 46px; height: 46px; border-radius: 999px; background: var(--green-bg); color: var(--green-text); display: flex; align-items: center; justify-content: center; flex: none; }
.success-box .check svg { width: 22px; height: 22px; }

/* ---------- Login-Karte (Partner) ---------- */
.login-wrap { max-width: 400px; margin: 60px auto; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.login-logo { width: 44px; height: 44px; border-radius: 12px; background: var(--cyan-light); border: 1px solid rgba(78,205,196,0.3); color: var(--cyan); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; padding: 7px; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Utility ---------- */
.muted { color: var(--text-muted); font-size: 13px; }
.small-muted { color: var(--text-faint); font-size: 12px; }
.error { color: var(--red-text); font-size: 13px; margin-top: 10px; }
.success-msg { color: var(--cyan-dark); font-size: 13px; margin-top: 10px; font-weight: 600; }
.notice-yellow { display: flex; gap: 12px; background: var(--amber-bg); border-radius: var(--radius-md); padding: 16px 18px; margin-top: 14px; }
.notice-yellow .ic { color: var(--amber-text); flex: none; margin-top: 1px; }
.notice-yellow p { font-size: 12.5px; color: var(--amber-text); line-height: 1.6; }
.notice-cyan { display: flex; gap: 12px; background: var(--cyan-light); border-radius: var(--radius-md); padding: 16px 18px; margin-top: 14px; }
.notice-cyan .ic { color: var(--cyan-dark); flex: none; margin-top: 1px; }
.notice-cyan p { font-size: 12.5px; color: var(--cyan-dark); line-height: 1.6; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); font-size: 13px; }
