:root {
  --bg: #0d0f0c;
  --bg-elev: #14170f;
  --card: #181c13;
  --line: #2a3020;
  --text: #f2f4ec;
  --muted: #9aa38a;
  --accent: #c6f24e;
  --accent-dim: #9bbf3a;
  --danger: #ff6b5e;
  --warn: #ffcc55;
  --ok: #7fdc7f;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.4em; }
h1 { font-size: 1.6rem; text-transform: uppercase; letter-spacing: 0.02em; }
a { color: var(--accent); }
button { font-family: inherit; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.right { text-align: right; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* --- Login --- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.brand { font-size: 1.4rem; font-weight: 700; text-transform: uppercase; }
.brand b { color: var(--accent); }

/* --- App-Shell --- */
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar .brand { padding: 6px 10px 18px; font-size: 1.1rem; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 0.95rem;
}
.nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-btn.active { background: var(--accent); color: #10130a; font-weight: 600; }
.nav-section { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 14px 12px 4px; opacity: 0.65; }
.sidebar .nav-section:first-of-type { padding-top: 4px; }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 0.82rem; color: var(--muted); }

.main { padding: 26px 30px; overflow-x: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* --- Cards / KPI --- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.kpi .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .value { font-size: 1.9rem; font-weight: 700; margin-top: 6px; }
.kpi .value.accent { color: var(--accent); }
.kpi .value.danger { color: var(--danger); }
.kpi .sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.charts { grid-template-columns: 1fr 1fr; margin-top: 16px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .sidebar { flex-direction: row; overflow-x: auto; } .sidebar-foot { display:none; } }

/* --- Tabelle --- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-wrap { overflow-x: auto; }

/* --- Controls --- */
input, select, textarea {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; font-size: 0.92rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dim); border-color: transparent; }
label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 140px; }

.btn {
  background: var(--accent); color: #10130a; border: 0;
  padding: 9px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
.btn:hover { background: #d5ff5f; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.small { padding: 5px 10px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.badge.ok { background: rgba(127,220,127,0.15); color: var(--ok); }
.badge.warn { background: rgba(255,204,85,0.15); color: var(--warn); }
.badge.danger { background: rgba(255,107,94,0.15); color: var(--danger); }
.badge.muted { background: rgba(154,163,138,0.15); color: var(--muted); }

.checkbox { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.checkbox input { width: auto; }

/* --- Sektionen / Blöcke --- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; gap: 12px; flex-wrap: wrap; }
.block { margin-bottom: 22px; }
.block-title { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.block-title .day { background: var(--accent); color:#10130a; border-radius:8px; padding: 3px 10px; font-weight:700; }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  padding: 12px 16px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px;
}
.toast.err { border-left-color: var(--danger); }

/* --- Modal --- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 90; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; padding: 24px; }
.modal h2 { margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.notice { background: rgba(198,242,78,0.08); border: 1px solid var(--accent-dim); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; font-size: 0.9rem; }
.notice.warn { background: rgba(255,204,85,0.08); border-color: var(--warn); }

/* Blinkendes Upsell-Feld / Badge */
.blink {
  margin-left: auto; background: var(--accent); color: #10130a; border-radius: 999px;
  min-width: 20px; height: 20px; padding: 0 6px; font-size: 0.72rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; animation: pulse 1.1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(198,242,78,0.55); }
  50% { opacity: 0.55; box-shadow: 0 0 0 7px rgba(198,242,78,0); }
}
.upsell-banner {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: rgba(198,242,78,0.1); border: 1px solid var(--accent);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600;
  animation: glow 1.4s infinite;
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,242,78,0.4); }
  50% { box-shadow: 0 0 14px 2px rgba(198,242,78,0.35); }
}
.upsell-banner .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: pulse 1.1s infinite; }

.task-card { border-left: 4px solid var(--line); }
.task-card.sales { border-left-color: var(--accent); }
.task-card.office { border-left-color: #7aa2ff; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
