/* Admin (MainLayout) styles. Everything is scoped under .nb-admin so the public site's
   style.css and these rules never affect each other. Phone breakpoint: 768px. */

.nb-admin, .nb-rform {
  --nb-text: #111827;
  --nb-muted: #6b7280;
  --nb-border: #e5e7eb;
  --nb-surface: #ffffff;
  --nb-soft: #f3f4f6;
  --nb-success: #22c55e;
  --nb-warning: #f59e0b;
  --nb-danger: #ef4444;
  --nb-radius: 14px;
}

/* ---------- Bottom navigation (phones only, rendered by MobileBottomNav) ---------- */
.nb-admin .nb-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  background: var(--nb-surface);
  border-top: 1px solid var(--nb-border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nb-admin .nb-bottomnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--nb-muted);
  text-decoration: none;
  background: none;
  border: 0;
}
.nb-admin .nb-bottomnav-item.active { color: var(--rz-primary); }
.nb-admin .nb-bottomnav-item .rzi { font-size: 24px; }
.nb-admin.nb-has-bottomnav .rz-body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ---------- Full-screen dialogs on phones (Radzen renders dialogs outside .nb-admin) ---------- */
.nb-dialog-fullscreen.rz-dialog {
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none;
  max-height: none;
  top: 0 !important;
  left: 0 !important;
  border-radius: 0;
}
.nb-dialog-fullscreen input,
.nb-dialog-fullscreen textarea,
.nb-dialog-fullscreen .rz-inputtext {
  font-size: 16px; /* stops iOS zooming into inputs */
}

/* ---------- Chips ---------- */
.nb-admin .nb-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.nb-admin .nb-chip-pending { background: #fef3c7; color: #92400e; }
.nb-admin .nb-chip-done { background: #dcfce7; color: #166534; }
.nb-admin .nb-chip-out { background: #fee2e2; color: #991b1b; }
.nb-admin .nb-src {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fce7f3;
  color: #9d174d;
  margin-left: 4px;
  vertical-align: middle;
}

/* ---------- Reservation card (phones) ---------- */
.nb-admin .nb-card-list { display: flex; flex-direction: column; gap: 10px; }
.nb-admin .nb-rcard {
  background: var(--nb-surface);
  border-radius: var(--nb-radius);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  color: var(--nb-text);
  position: relative;
}
.nb-admin .nb-rcard:has(.nb-rcard-link:focus-visible) { outline: 2px solid var(--rz-primary); outline-offset: 2px; }
.nb-admin .nb-rcard-head { display: flex; justify-content: space-between; gap: 8px; }
.nb-admin .nb-rcard-name { font-weight: 700; font-size: 16px; }
.nb-admin .nb-rcard-link { color: inherit; text-decoration: none; }
.nb-admin .nb-rcard-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.nb-admin .nb-rcard-link:focus-visible { outline: none; }
.nb-admin .nb-rcard-sub { font-size: 13px; color: var(--nb-muted); margin-top: 2px; }
.nb-admin .nb-rcard-total { font-weight: 700; font-size: 15px; white-space: nowrap; }
.nb-admin .nb-rcard-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.nb-admin .nb-muted { color: var(--nb-muted); font-weight: 400; }
.nb-admin .nb-steps { display: flex; gap: 4px; margin: 8px 0 4px; }
.nb-admin .nb-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--nb-border); }
.nb-admin .nb-steps i.done { background: var(--nb-success); }
.nb-admin .nb-steps i.next { background: var(--nb-warning); }
.nb-admin .nb-rcard-step { font-size: 12px; color: var(--nb-muted); }
.nb-admin .nb-rcard-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; position: relative; z-index: 1; }
.nb-admin .nb-rcard-primary { flex: 1; min-height: 44px; }
.nb-admin .nb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--nb-border);
  color: var(--nb-text);
  background: var(--nb-surface);
  text-decoration: none;
}

/* ---------- Shared page pieces ---------- */
.nb-admin .nb-panel {
  background: var(--nb-surface);
  border-radius: var(--nb-radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.nb-admin .nb-panel h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--nb-muted);
  margin: 0 0 10px;
}
.nb-admin .nb-empty { text-align: center; padding: 48px 16px; color: var(--nb-muted); }
.nb-admin .nb-empty h2 { font-size: 18px; color: var(--nb-text); }
.nb-admin .nb-center { display: flex; justify-content: center; padding: 48px 0; }

/* ---------- Booking detail ---------- */
.nb-admin .nb-detail { max-width: 760px; margin: 0 auto; }
.nb-admin .nb-detail-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.nb-admin .nb-detail-bar h1 { flex: 1; font-size: 20px; font-weight: 700; margin: 0; }
.nb-admin .nb-detail-name { font-size: 20px; font-weight: 700; color: var(--nb-text); }
.nb-admin .nb-contact { display: flex; gap: 8px; margin-top: 12px; }
.nb-admin .nb-contact a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.nb-admin .nb-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nb-admin .nb-kv span { display: block; font-size: 12px; color: var(--nb-muted); }
.nb-admin .nb-kv b { font-size: 15px; color: var(--nb-text); }
.nb-admin .nb-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--nb-soft);
}
.nb-admin .nb-step-row:last-child { border-bottom: 0; }
.nb-admin .nb-step-text { flex: 1; min-width: 0; }
.nb-admin .nb-step-text b { display: block; font-size: 14px; color: var(--nb-text); }
.nb-admin .nb-step-text small { font-size: 12px; color: var(--nb-muted); }
.nb-admin .nb-dot {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  background: var(--nb-border);
}
.nb-admin .nb-dot.done { background: var(--nb-success); }
.nb-admin .nb-dot.next { background: var(--nb-warning); }
.nb-admin .nb-doc {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--nb-text);
  text-decoration: none;
  border-bottom: 1px solid var(--nb-soft);
}

/* ---------- Reservations list ---------- */
.nb-admin .nb-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.nb-admin .nb-list-head h1 { font-size: 24px; font-weight: 700; margin: 0; }
.nb-admin .nb-list-head-actions { display: flex; gap: 8px; }
.nb-admin .nb-search { display: block; width: 100%; min-height: 44px; font-size: 16px; }
.nb-admin .nb-tabs {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: var(--nb-soft);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nb-admin .nb-tabs::-webkit-scrollbar { display: none; }
.nb-admin .nb-tab {
  flex: 1 0 auto;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--nb-muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nb-admin .nb-tab.on { background: var(--nb-surface); color: var(--nb-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.nb-admin .nb-tab-count { font-size: 11px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--nb-border); color: var(--nb-text); }
.nb-admin .nb-tab-count.alert { background: var(--nb-danger); color: #fff; }
.nb-admin .nb-chips { display: flex; gap: 6px; margin: 10px 0 14px; }
.nb-admin .nb-chip-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--nb-border);
  background: var(--nb-surface);
  color: var(--nb-text);
  font-size: 13px;
  font-weight: 600;
}
.nb-admin .nb-chip-btn.on { background: var(--nb-text); border-color: var(--nb-text); color: #fff; }
.nb-admin .nb-show-more { display: block; width: 100%; margin-top: 12px; min-height: 44px; }
.nb-admin .nb-grid .rz-data-row { cursor: pointer; }
.nb-admin .nb-grid-guest b { display: inline; }
.nb-admin .nb-grid-guest small { display: block; color: var(--nb-muted); }
.nb-admin .nb-grid-actions { display: inline-flex; gap: 2px; }

@media (max-width: 767.98px) {
  .nb-admin .nb-list-head h1 { font-size: 22px; }
  .nb-admin .nb-tabs { gap: 2px; }
  .nb-admin .nb-tab { font-size: 12px; padding: 0 4px; }
  .nb-admin .nb-tab-count { margin-left: 2px; padding: 0 5px; }
}

/* ---------- Dashboard ---------- */
.nb-admin .nb-dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.nb-admin .nb-dash-head h1 { font-size: 24px; font-weight: 700; margin: 0; }
.nb-admin .nb-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.nb-admin .nb-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--nb-surface);
  border-radius: var(--nb-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.nb-admin .nb-kpi-title { font-size: 12px; color: var(--nb-muted); text-transform: uppercase; letter-spacing: .06em; }
.nb-admin .nb-kpi-value { font-size: 24px; font-weight: 700; color: var(--nb-text); }
.nb-admin .nb-kpi-big .nb-kpi-value { font-size: 28px; }
.nb-admin .nb-dash-grid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.nb-admin .nb-occ-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.nb-admin .nb-occ-name { flex: 0 0 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-admin .nb-occ-bar { flex: 1; height: 10px; background: var(--nb-soft); border-radius: 999px; overflow: hidden; }
.nb-admin .nb-occ-bar i { display: block; height: 100%; background: var(--rz-primary); border-radius: 999px; }
.nb-admin .nb-occ-pct { flex: 0 0 44px; text-align: right; font-weight: 600; }
.nb-admin .nb-today-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  border-bottom: 1px solid var(--nb-soft);
  color: var(--nb-text);
  text-decoration: none;
}
.nb-admin .nb-today-row b { display: block; font-size: 14px; }
.nb-admin .nb-today-row small { color: var(--nb-muted); font-size: 12px; }
.nb-admin .nb-link { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--rz-primary); text-decoration: none; }

@media (min-width: 768px) {
  .nb-admin .nb-kpis { grid-template-columns: repeat(3, 1fr); }
  .nb-admin .nb-dash-grid { grid-template-columns: 1fr 1fr; }
  .nb-admin .nb-dash-today { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .nb-admin .nb-kpis { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Add/Edit reservation form (renders inside Radzen dialogs, outside .nb-admin) ---------- */
.nb-rform { display: flex; flex-direction: column; gap: 12px; color: var(--nb-text); min-height: 100%; }
.nb-rform-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "stay guest" "price guest";
  gap: 12px;
  align-items: start;
}
.nb-dialog-fullscreen .nb-rform-body { grid-template-columns: 1fr; grid-template-areas: "stay" "guest" "price"; }
.nb-rform-stay { grid-area: stay; }
.nb-rform-guest { grid-area: guest; }
.nb-rform-price { grid-area: price; }
.nb-rform-sec { background: var(--nb-surface); border: 1px solid var(--nb-border); border-radius: var(--nb-radius); padding: 14px; }
.nb-rform-sec h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--nb-muted);
  margin: 0 0 10px;
}
.nb-rform-field { display: block; margin-bottom: 10px; }
.nb-rform-field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.nb-rform-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nb-rform-seg { display: flex; padding: 3px; background: var(--nb-soft); border-radius: 10px; margin-bottom: 10px; }
.nb-rform-seg button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--nb-muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nb-rform-seg button.on { background: var(--nb-surface); color: var(--nb-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.nb-rform-status { border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; }
.nb-rform-status.ok { background: #dcfce7; color: #166534; }
.nb-rform-status.warn { background: #fef3c7; color: #92400e; }
.nb-rform-err { color: var(--nb-danger); font-size: 12px; margin: -6px 0 8px; }
.nb-rform-hint { color: #92400e; font-size: 12px; margin: -6px 0 8px; }
.nb-rform-link {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--rz-primary);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.nb-rform-error { background: #fee2e2; color: #991b1b; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.nb-rform-foot {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 0 calc(4px + env(safe-area-inset-bottom));
  background: var(--nb-surface);
  border-top: 1px solid var(--nb-border);
}
.nb-rform-sum { flex: 1; min-width: 0; font-size: 13px; color: var(--nb-muted); }
.nb-rform-sum b { display: block; font-size: 16px; color: var(--nb-text); }
.nb-dialog-fullscreen .nb-rform input, .nb-dialog-fullscreen .nb-rform .rz-inputtext { font-size: 16px; }
