:root {
  --bg: #f9f9f7; --surface: #fff; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --line: #e1e0d9; --accent: #1e293b; --accent-dark: #0f172a;
  --good: #006300; --bad: #d03b3b; --free: #e8f4e8; --busy: #fbe4e4; --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.container { max-width: 640px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }

.admin-nav {
  background: var(--accent); color: #e2e8f0; padding: 12px 0;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.admin-nav .container { display: flex; align-items: center; gap: 14px; }
.admin-nav .brand { font-weight: 700; color: #fff; }
.admin-nav .spacer { flex: 1; }
.admin-nav .nav-link { color: rgba(226,232,240,.75); text-decoration: none; font-size: 14px; }
.admin-nav .nav-link:hover { color: #fff; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; padding: 10px 16px; font: inherit; font-weight: 600;
  font-size: 14px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f0efec; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fecaca; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink);
}
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-ok { background: var(--free); color: #145214; }
.alert-err { background: var(--busy); color: #7a1f1f; }

.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; flex-wrap: wrap; }
.page-title h1 { font-size: 21px; margin: 0; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-confirmed { background: var(--free); color: #145214; }
.badge-cancelled { background: var(--busy); color: #7a1f1f; }
.badge-other { background: #ede9fe; color: #5b21b6; }

/* ============ Zadania sprzątania (te same style co portal ekipy NovaRent) ============ */
.clean-bucket-title { margin: 22px 0 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.clean-bucket-title span { background: #f0efec; color: var(--muted); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 20px; }
.clean-tag-overdue { color: var(--bad); }
.clean-tag-today { color: #92400e; }
.clean-tag-tomorrow { color: var(--accent); }
.clean-tag-later { color: var(--muted); }
.clean-tag-done { color: var(--good); }

.clean-card { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.clean-card-done { background: var(--free); border-color: #bfdebf; }
.clean-toggle-form { flex-shrink: 0; }
.clean-check {
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; border: 2px solid var(--line); background: #fff;
  color: transparent; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.clean-card-done .clean-check { background: var(--good); border-color: var(--good); color: #fff; }
.clean-body { flex: 1; min-width: 0; }
.clean-title { font-weight: 700; font-size: 16px; color: var(--ink); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.clean-date { font-weight: 400; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.clean-source {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: #fff; padding: 2px 8px; border-radius: 5px; margin-top: 3px;
}
.clean-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.clean-access { display: inline-block; font-size: 13px; font-family: ui-monospace, monospace; color: #8a6100; background: #fdf1d7; padding: 3px 9px; border-radius: 6px; margin-top: 6px; }
.clean-done-info { font-size: 12px; color: var(--good); margin-top: 6px; }
.clean-note-form { display: flex; gap: 6px; margin-top: 9px; }
.clean-note-form input[type=text] { flex: 1; font-size: 13px; padding: 8px 10px; }
.clean-note-form button { font-size: 12px; padding: 8px 12px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.clean-note-form button:hover { background: #f7f6f3; }
@media (max-width: 420px) {
  .clean-check { width: 42px; height: 42px; font-size: 19px; }
  .clean-title { font-size: 15px; }
}

/* linki (zarządcy podłączeni) */
.link-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 8px; }
.link-status-ok { color: var(--good); font-size: 12px; }
.link-status-err { color: var(--bad); font-size: 12px; }

/* ============ Nawigacja dniami + mapa trasy ============ */
.day-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-top: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.day-chips::-webkit-scrollbar { display: none; }
.day-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.day-chip span { background: #f0efec; color: var(--muted); font-size: 11px; padding: 1px 6px; border-radius: 20px; }
.day-chip-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.day-chip-active span { background: rgba(255,255,255,.2); color: #fff; }
.day-chip-overdue:not(.day-chip-active) { border-color: var(--bad); color: var(--bad); }

.route-map { width: 100%; height: 240px; border-radius: var(--radius); margin-top: 6px; border: 1px solid var(--line); z-index: 0; }
.route-pin { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.3); border: 2px solid #fff; }
.route-pin-start { background: #fff; font-size: 18px; box-shadow: none; border: none; }
