/* Kalio — dunkles Theme */
:root {
  --bg:        #15171c;
  --bg-2:      #1d2027;
  --bg-3:      #262a33;
  --line:      #323743;
  --text:      #e7eaf0;
  --muted:     #9aa3b2;
  --accent:    #6c8cff;
  --accent-2:  #5577f0;
  --danger:    #ff6b6b;
  --radius:    14px;
  --shadow:    0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--accent); color: #fff; border: 0;
  padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-danger {
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger); padding: 9px 14px; border-radius: 10px;
}
.ghost-btn {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px;
}
.ghost-btn:hover { border-color: var(--accent); }
.icon-btn {
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  width: 38px; height: 38px; border-radius: 10px; font-size: 20px; line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 4px 0 0; }

/* ---------- Auth ---------- */
.auth {
  min-height: 100%; display: grid; place-items: center; padding: 20px;
}
.auth-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; width: 100%; max-width: 380px; box-shadow: var(--shadow);
}
.brand { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: var(--accent); color: #fff; border-radius: 10px; font-weight: 800;
}
.brand-sub { color: var(--muted); margin: 4px 0 18px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  flex: 1; background: var(--bg-3); border: 1px solid var(--line); color: var(--muted);
  padding: 8px; border-radius: 10px; font-size: 13px;
}
.tab.active { color: #fff; border-color: var(--accent); background: rgba(108,140,255,.15); }
form label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
form input, form textarea, form select {
  display: block; width: 100%; margin-top: 5px; background: var(--bg-3);
  border: 1px solid var(--line); color: var(--text); padding: 10px 12px;
  border-radius: 10px; font: inherit;
}
form input:focus, form textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 5;
}
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav h1 { font-size: 18px; margin: 0; min-width: 150px; text-align: center; }
.topbar-actions { display: flex; gap: 8px; }

/* ---------- Legende ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 16px; font-size: 13px; }
.legend .who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* ---------- Kalender ---------- */
.cal { padding: 0 8px 24px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { padding: 8px 8px 6px; }
.cal-head div { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; }
.cal-grid { padding: 0 8px; }
.day {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  min-height: 92px; padding: 6px; display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; overflow: hidden;
}
.day:hover { border-color: var(--accent); }
.day.other { opacity: .4; }
.day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day .num { font-size: 13px; color: var(--muted); align-self: flex-end; }
.day.today .num { color: var(--accent); font-weight: 700; }
.ev {
  font-size: 12px; padding: 3px 7px; border-radius: 6px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-left: 3px solid rgba(255,255,255,.5);
}
.ev .t { opacity: .85; font-variant-numeric: tabular-nums; }
.more { font-size: 11px; color: var(--muted); }

/* ---------- Dialoge ---------- */
dialog {
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  border-radius: var(--radius); padding: 22px; width: min(480px, 94vw);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h2 { margin: 0 0 14px; font-size: 19px; }
.time-row { display: flex; gap: 10px; }
.time-row label { flex: 1; }
.row-check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.row-check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 12px; padding: 10px 12px; }
legend { color: var(--muted); font-size: 12px; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg-3);
  color: var(--muted); font-size: 13px; user-select: none;
}
.chip.on { color: #fff; border-color: var(--accent); background: rgba(108,140,255,.18); }
.dialog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.settings { display: flex; flex-direction: column; gap: 12px; }
.invite-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-box code {
  background: var(--bg-3); border: 1px solid var(--line); padding: 6px 10px;
  border-radius: 8px; letter-spacing: 1px; font-size: 15px;
}

/* ---------- Schmal ---------- */
@media (max-width: 560px) {
  .day { min-height: 64px; }
  .month-nav h1 { min-width: 110px; font-size: 16px; }
  .ev .t { display: none; }
}
