/* HD Energy · Kundenportal — Clean SaaS-Dashboard, hell. Brand-Vars zentral. */
:root {
  --violet: #7b5cff;
  --cyan: #34d6e0;
  --grad: linear-gradient(120deg, #7b5cff, #34d6e0);
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6e9f2;
  --bg: #f5f7fc;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,30,60,.04), 0 8px 28px rgba(16,30,60,.06);
  --shadow-lg: 0 18px 50px rgba(16,30,60,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--violet); text-decoration: none; }

/* Header */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; display: block; }
.spacer { flex: 1; }
.hello { color: var(--muted); font-size: 14px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 22px 60px; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 26px; }

/* Kacheln */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-align: left; display: flex; flex-direction: column; gap: 10px;
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d8ddee; }
.tile.active { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123,92,255,.12), var(--shadow); }
.tile .ico {
  width: 46px; height: 46px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; font-size: 22px;
}
.tile h3 { margin: 0; font-size: 17px; }
.tile p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tile .count { color: var(--violet); font-weight: 700; font-size: 13px; }

/* Karten / Statistik */
.statbar { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin: 26px 0; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow); flex: 1; min-width: 200px;
}
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat .v.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons */
.btn {
  border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 14.5px;
  cursor: pointer; color: #fff; background: var(--grad); box-shadow: var(--shadow);
  transition: transform .12s ease, filter .12s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

/* Verträge */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; margin: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.card .head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #eef0fb; color: var(--violet);
}
.badge.gas { background: #fff1e6; color: #c2620e; }
.badge.strom { background: #e6f8fb; color: #0b8794; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 2px; background: var(--line); padding: 1px;
}
.cell { background: #fff; padding: 12px 16px; }
.cell .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cell .v { font-size: 14.5px; font-weight: 600; word-break: break-word; }
.cell input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 14px;
  font-family: inherit;
}
.price-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; padding: 16px 20px; }
.price-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.price-box.neu { border-color: var(--violet); background: linear-gradient(180deg,#faf9ff,#fff); }
.price-box.save { border-color: #bbf0c4; background: linear-gradient(180deg,#f3fdf5,#fff); }
.price-box .lbl { font-size: 12px; color: var(--muted); }
.price-box .big { font-size: 20px; font-weight: 800; }
.price-box .sub { font-size: 12.5px; color: var(--muted); }
@media (max-width: 620px){ .price-cols { grid-template-columns: 1fr; } }

/* Login */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, #ece9ff 0%, var(--bg) 55%); }
.auth-card {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 34px;
}
.auth-card img { height: 42px; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card p { color: var(--muted); margin: 0 0 22px; }
.field { display: block; margin-bottom: 14px; }
.field input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(123,92,255,.12); }
.note { font-size: 13px; padding: 12px 14px; border-radius: 12px; margin-top: 14px; }
.note.ok { background: #f0fdf4; color: #166534; }
.note.err { background: #fef2f2; color: #b91c1c; }
.full { width: 100%; justify-content: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Tabelle (Admin) */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbff; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center;
  padding: 20px; z-index: 50; }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  max-height: 88vh; overflow: auto; padding: 26px; }
.modal h3 { margin: 0 0 16px; }
label.lbl { font-size: 13px; color: var(--muted); display: block; margin: 10px 0 4px; }
input.in, select.in, textarea.in {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
  font-family: inherit;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 80; font-size: 14px; }
