/* Drobné doplňky k Tailwindu (CDN) — hlavně skrytí FOUC při Alpine load. */
[x-cloak] { display: none !important; }

/* iOS safe area (notch). */
header { padding-top: env(safe-area-inset-top); }

/* Lépe čitelný text v textarea pole. */
textarea { min-height: 4rem; line-height: 1.5; }

/* "Chip" tlačítka pro předefinované fráze činnosti.
   Mobile-first: dostatek prostoru pro palec, ne moc velké. */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background: rgb(241 245 249);  /* slate-100 */
  color: rgb(51 65 85);           /* slate-700 */
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid rgb(226 232 240);  /* slate-200 */
  cursor: pointer;
  transition: background-color 120ms, transform 80ms;
  user-select: none;
}
.chip:hover { background: rgb(226 232 240); }
.chip:active { transform: scale(0.96); }

/* Velké tap-friendly tlačítka pro Vyrážím / Přicházím / Odcházím. */
.action-btn {
  min-height: 56px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: white;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  transition: filter 120ms, transform 80ms;
}
.action-btn:hover { filter: brightness(1.05); }
.action-btn:active { transform: scale(0.98); }
.action-btn .lbl-time { font-size: 0.7rem; font-weight: 400; opacity: 0.8; }

/* Card – konzistentní styl pro panely v detailu. */
.card {
  background: white;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  padding: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}
.card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(30 41 59);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

/* Sticky bottom bar (pro detail na mobilu) — držíme akce vždy v dosahu. */
.sticky-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgb(248 250 252), rgb(248 250 252 / 0.85), rgb(248 250 252 / 0));
  padding-top: 0.75rem;
  padding-bottom: env(safe-area-inset-bottom, 0.5rem);
  margin-bottom: -1rem;  /* zruší main padding-bottom */
  z-index: 5;
}

/* Form inputs — jednotný styl, lepší tap targets. */
input.field, select.field, textarea.field {
  border-radius: 0.5rem;
  border: 1px solid rgb(203 213 225);
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  width: 100%;
  background: white;
  transition: border-color 120ms, box-shadow 120ms;
}
input.field:focus, select.field:focus, textarea.field:focus {
  outline: none;
  border-color: rgb(59 130 246);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.15);
}
@media (max-width: 640px) {
  /* Větší fonty na mobilu — palec na malé prvky neumí */
  input.field, select.field, textarea.field { font-size: 1rem; }
}

/* Mírná animace pro kartu/řádek */
.list-item { transition: transform 100ms, box-shadow 100ms; }
.list-item:active { transform: scale(0.99); }

/* Skrytí debug baru v produkci (toggle .debug-hide na body) */
body.debug-hide #debug-bar { display: none; }

/* Leaflet má vnitřní z-indexy až 700 (popupy, markery). Bez stacking
   contextu prosakují přes sticky header (z-10) i admin tab strip.
   `isolation: isolate` uvězní celé Leaflet uvnitř lokálního stacking
   contextu, externě se chová jako z-0. */
.leaflet-container { isolation: isolate; }

/* Modal — sjednocený styl pro "přidat X" / podpis. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 0.6);
  backdrop-filter: blur(2px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-panel {
  background: white;
  border-radius: 0.875rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.3);
  width: 100%;
  max-width: 30rem;
  padding: 1rem 1.25rem 1.25rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.modal-panel h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: rgb(30 41 59);
}
@media (max-width: 480px) {
  /* Plná obrazovka modal na malých displejích */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal-panel { max-width: 100%; max-height: 100%; border-radius: 0; padding: 1.25rem; }
}

/* Tlačítko "+ Přidat" v záhlaví sekcí */
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.875rem;
  border-radius: 9999px;
  background: rgb(29 78 216);  /* blue-700 */
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 120ms;
}
.btn-add:hover { background: rgb(30 64 175); }

/* Sekundární tlačítko (Zrušit). */
.btn-secondary {
  padding: 0.5rem 1rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 0.5rem;
  background: white;
  color: rgb(51 65 85);
  font-weight: 500;
  font-size: 0.875rem;
}
.btn-secondary:hover { background: rgb(248 250 252); }
.btn-primary {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgb(29 78 216);
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}
.btn-primary:hover { background: rgb(30 64 175); }
.btn-primary:disabled { background: rgb(148 163 184); cursor: not-allowed; }
