*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:      #1e40af;
  --brand-light:#dbeafe;
  --brand-dark: #1e3a8a;
  --success:    #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #86efac;
  --danger:     #dc2626;
  --danger-bg:  #fef2f2;
  --danger-border: #fca5a5;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-400:   #94a3b8;
  --gray-600:   #475569;
  --gray-800:   #1e293b;
  --radius:     6px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08);
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── Navbar ── */
.navbar {
  background: var(--brand);
  color: white;
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.navbar-brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  flex: 1;
}
.navbar-brand span { opacity: 0.7; font-weight: 400; }
.navbar-user {
  font-size: 0.85rem;
  opacity: 0.9;
}
.navbar form { margin: 0; }
.navbar button {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.navbar button:hover { background: rgba(255,255,255,0.22); }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.5rem; }

/* ── Calendar header ── */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.calendar-header h2 {
  flex: 1;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}
.calendar-header a {
  text-decoration: none;
  color: var(--brand);
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  background: white;
  transition: background 0.15s;
}
.calendar-header a:hover { background: var(--brand-light); }

/* ── Day-of-week header row ── */
.dow-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.dow-header div {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}
.dow-header div.weekend { color: #f97316; }

/* ── Calendar grid ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
}

.calendar-day {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-height: 110px;
  box-shadow: var(--shadow);
}
.calendar-day.empty {
  background: var(--gray-50);
  border-color: var(--gray-100);
  box-shadow: none;
}
.calendar-day.day-weekend { background: #fef3c7; }
.calendar-day.day-holiday { background: #fda4af; }
.day-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-400);
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}
.day-label .day-num {
  font-size: 0.85rem;
  color: var(--gray-600);
}
.day-label.weekend .day-num { color: #ea580c; }
/* Holidays carry both .weekend and .holiday; .holiday is defined last so it
   wins the equal-specificity tie and renders distinct from plain weekends. */
.calendar-day .day-label.weekend { background: #f0f9ff; color: #1e40af; }
.calendar-day .day-label.holiday { background: #fef2f2; color: #991b1b; }
.calendar-day .day-label.holiday .day-num { color: #991b1b; }
.day-label.today .day-num {
  background: var(--brand);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* ── Shift cards ── */
.shift-card {
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  margin-bottom: 0.3rem;
  font-size: 0.76rem;
  border: 1px solid transparent;
}
.shift-available {
  background: var(--brand-light);
  border-color: #93c5fd;
}
.shift-booked {
  background: #fce7f3;
  border-color: #f9a8d4;
}
.shift-mine {
  background: #fef9c3;
  border-color: #eab308;
}
.shift-time {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.78rem;
}
.shift-doctor {
  display: block;
  color: #9d174d;
  font-size: 0.72rem;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shift-mine-label {
  display: block;
  color: #854d0e;
  font-size: 0.72rem;
  font-weight:600;
  margin-top: 0.1rem;
}

.btn-book {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.2rem 0;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-book:hover { background: var(--brand-dark); }

.btn-cancel {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.2rem 0;
  background: white;
  color: var(--danger);
  border: 1px solid var(--danger-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background 0.15s;
}
.btn-cancel:hover { background: var(--danger-bg); }

/* ── Login ── */
.login-box {
  max-width: 380px;
  margin: 6rem auto;
  text-align: center;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.login-box h1 {
  font-size: 1.4rem;
  color: var(--brand);
  margin-bottom: 0.4rem;
}
.login-box p { color: var(--gray-600); margin-bottom: 2rem; font-size: 0.9rem; }
.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--brand);
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-google:hover { background: var(--brand-dark); }

/* ── Alerts ── */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error   { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: var(--danger); }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }

/* ── HTMX loading ── */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator { opacity: 1; }
button.htmx-request { opacity: 0.6; cursor: wait; }

/* ── Cards ── */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Forms ── */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.25rem;
}
.form-input {
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--brand); }

/* ── Buttons ── */
.btn-primary {
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-sm {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid;
  transition: background 0.15s;
}
.btn-outline {
  background: white;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover { background: var(--brand-light); }
.btn-danger {
  background: white;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover { background: var(--danger-bg); }

/* ── Table ── */
tbody tr:hover { background: var(--gray-50); }
td { padding: 0.6rem 0.75rem; font-size: 0.875rem; border-bottom: 1px solid var(--gray-100); }
/* ==========================================================================
   ShiftR — Mobile responsive extensions
   Append to or @import after your existing app.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom properties
   -------------------------------------------------------------------------- */
:root {
  --touch-target: 48px;
}

/* --------------------------------------------------------------------------
   Responsive visibility toggles
   desktop-only: visible on ≥768px, hidden on mobile
   mobile-only:  visible on <768px, hidden on desktop
   -------------------------------------------------------------------------- */
.mobile-only  { display: none; }
.desktop-only { display: block; }

@media (max-width: 767px) {
  .mobile-only  { display: block; }
  .desktop-only { display: none; }

  .container { padding: 0.75rem; }
  .navbar    { padding: 0 1rem; }
}

/* --------------------------------------------------------------------------
   Agenda view — mobile calendar layout
   -------------------------------------------------------------------------- */

/* Sticky day header sits below the navbar (navbar is 56px tall).
   The markup tags this with .sticky-top/.border-bottom (Bootstrap names),
   but no framework is loaded, so the positioning lives here. */
.day-header {
  position: sticky;
  top: 56px;
  background: #f1f5f9; /* gray-100 */
  margin-top: 1rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  z-index: 10;
  font-size: 0.9rem;
  color: var(--gray-600);
  letter-spacing: 0.01em;
}

/* No extra top margin on the very first day group */
.day-group:first-child .day-header {
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   Agenda card internals — the markup uses framework-style utility class
   names (Bootstrap) but no framework stylesheet is loaded, so define the
   ones the agenda relies on here. Scoped to .agenda-view so the desktop
   calendar grid is never affected.
   -------------------------------------------------------------------------- */
.agenda-view .card {
  /* override generic .card padding; card-body handles inner padding */
  padding: 0;
  overflow: hidden;
}
.agenda-view .card.border-success { border-left: 4px solid var(--success); }
.agenda-view .card.border-warning { border-left: 4px solid #d97706; }
.agenda-view .card-body { padding: 0.75rem; }

/* Flex row: time/status on the left, action button on the right */
.agenda-view .d-flex { display: flex; }
.agenda-view .justify-content-between { justify-content: space-between; }
.agenda-view .align-items-center { align-items: center; }

.agenda-view .h5 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-800);
}
.agenda-view .text-muted { color: var(--gray-600); }
.agenda-view .small { font-size: 0.8rem; }
.agenda-view .shadow-sm { box-shadow: var(--shadow); }

/* Action buttons — full-width within their right-hand column, 48px tall */
.agenda-view .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--touch-target); /* 48px */
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.agenda-view .btn-success { background: var(--success); color: #fff; }
.agenda-view .btn-success:hover { background: #15803d; }
.agenda-view .btn-outline-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.agenda-view .btn-outline-danger:hover { background: var(--danger-bg); }

/* Locked-slot badge mirrors the button footprint so rows stay aligned */
.agenda-view .badge.bg-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--touch-target);
  background: var(--gray-400);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Doctor billing report (Elszámolás) — mobile touch targets.
   Scoped to .report-* classes so admin report views are never affected.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .report-header { flex-wrap: wrap; }
  .report-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--touch-target); /* 48px */
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
  }
}

/* --------------------------------------------------------------------------
   Card touch enhancements
   -------------------------------------------------------------------------- */
.card {
  border-radius: 10px;
  transition: transform 0.1s ease;
}

/* Subtle press feedback on tap */
.card:active {
  transform: scale(0.98);
}

/* Container cards (data tables, forms) must not shrink on click/tap. */
.card.static-card,
.card.static-card:active {
  transform: none;
}

/* --------------------------------------------------------------------------
   Utility classes used in agenda cards
   -------------------------------------------------------------------------- */
.fw-bold    { font-weight: 700 !important; }
.z-index-10 { z-index: 10; }
.w-100      { width: 100%; }
.mb-1       { margin-bottom: 0.25rem; }
.mb-2       { margin-bottom: 0.5rem; }
.mb-3       { margin-bottom: 1rem; }
.mb-4       { margin-bottom: 1.5rem; }
.p-2        { padding: 0.5rem; }
.p-3        { padding: 0.75rem; }

/* --------------------------------------------------------------------------
   Desktop calendar grid — minor consistency tweaks
   -------------------------------------------------------------------------- */
.calendar-grid {
  gap: 0.5rem;
}

.shift-card {
  padding: 0.5rem;
}
