@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600&display=swap');

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

/* ═══════════════════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --primary:   #006085;
  --primary-d: #004e6e;   /* darker – hover & active */
  --primary-l: #e0f4fb;   /* light tint – backgrounds */
  --accent:    #e84545;

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --danger:  #dc2626;

  /* Neutrals */
  --bg:     #eef2f5;
  --card:   #ffffff;
  --text:   #1a1a2e;
  --muted:  #6b7280;
  --border: #d1d5db;

  /* Radii */
  --radius-sm: 5px;
  --radius:    8px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.11), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.16), 0 4px 12px rgba(0,0,0,.08);
}

/* ═══════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .page-title {
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  line-height: 1.25;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4cdd8; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ═══════════════════════════════════════════════════════
   NAV
═══════════════════════════════════════════════════════ */
nav {
  position: sticky; top: 0; z-index: 200;
  background: #fff;
  border-bottom: 3px solid var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 58px;
  box-shadow: var(--shadow);
}

nav .logo { display: flex; align-items: center; gap: .4rem; text-decoration: none; }
nav .logo-img { height: 36px; width: auto; display: block; }
nav .logo-admin-label {
  font-family: 'Poppins', sans-serif; font-size: .7rem; font-weight: 700;
  color: var(--primary); letter-spacing: .8px; text-transform: uppercase; opacity: .7;
}

/* nav-links is the flex row that holds all links + the user chip */
nav .nav-links { display: flex; align-items: center; gap: 1.25rem; }
nav .nav-links a {
  display: inline-flex; align-items: center;
  color: var(--muted); text-decoration: none;
  font-size: .88rem; font-weight: 500;
  white-space: nowrap; transition: color .18s;
  padding: .2rem 0;          /* gives click-area without affecting height */
}
nav .nav-links a:hover,
nav .nav-links a.active { color: var(--primary); }
nav .nav-links a.logout { color: var(--accent); }

/* ── Nav user chip ────────────────────────────────────── */
.nav-user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer; position: relative;
  padding: .28rem .65rem; border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  transition: background .15s, box-shadow .15s, border-color .15s;
  user-select: none; margin-left: .25rem;
}
.nav-user-chip:hover {
  background: var(--primary-l);
  border-color: rgba(0,96,133,.4);
  box-shadow: 0 2px 8px rgba(0,96,133,.12);
}
.nav-user-chip .nav-user-name {
  font-size: .82rem; font-weight: 600; color: var(--text);
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-user-chip .nav-user-role { font-size: .67rem; color: var(--muted); }
.nav-user-chip .nav-chevron { font-size: .68rem; color: var(--muted); transition: transform .2s; }
.nav-user-chip.open .nav-chevron { transform: rotate(180deg); }

/* ── Dropdown ─────────────────────────────────────────── */
.nav-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 230px; overflow: hidden; z-index: 9999;
  opacity: 0; transform: translateY(-6px) scale(.98);
  pointer-events: none; transition: opacity .15s, transform .15s;
}
.nav-user-chip.open .nav-user-dropdown {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: all;
}
.nav-user-dropdown .nud-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
  background: linear-gradient(135deg, var(--primary-l) 0%, #e8f4f8 100%);
}
.nav-user-dropdown .nud-info { flex: 1; min-width: 0; }
.nav-user-dropdown .nud-name {
  font-weight: 700; font-size: .9rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-user-dropdown .nud-email {
  font-size: .72rem; color: var(--muted); margin-top: .1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-user-dropdown .nud-role-badge {
  font-size: .64rem; font-weight: 700; padding: .15rem .45rem; border-radius: 999px;
  background: var(--primary); color: #fff; margin-top: .25rem; display: inline-block;
}
.nav-user-dropdown a, .nav-user-dropdown button.nud-btn {
  display: flex; align-items: center; gap: .65rem;
  padding: .68rem 1.25rem .68rem 1.5rem; font-size: .875rem; color: var(--text);
  text-decoration: none; background: transparent; border: none; width: 100%;
  cursor: pointer; transition: background .12s; text-align: left; font-family: inherit;
}
/* ikony v položkách – fixní šířka zajistí zarovnání pod sebou */
.nav-user-dropdown a > span:first-child,
.nav-user-dropdown button.nud-btn > span:first-child {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.3rem; flex-shrink: 0; font-size: 1rem;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button.nud-btn:hover { background: var(--primary-l); }
.nav-user-dropdown .nud-separator { height: 1px; background: var(--border); margin: .25rem 0; }
.nav-user-dropdown .nud-logout { color: var(--accent); }
.nav-user-dropdown .nud-logout:hover { background: #fff1f1; color: var(--danger); }

/* ── Studio switcher ──────────────────────────────────── */
.nav-studio-wrap { display: flex; align-items: center; }
.studio-sel {
  background: rgba(0,96,133,.07); color: var(--primary);
  border: 1px solid rgba(0,96,133,.25); border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; outline: none; transition: background .15s;
}
.studio-sel:hover { background: rgba(0,96,133,.13); }
.studio-sel option { background: #fff; color: var(--primary); }
.studio-label { color: var(--primary); font-size: .82rem; font-weight: 600; padding: 4px 8px; }
.studio-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--primary); color: #fff; border-radius: 999px;
  padding: 3px 12px; font-size: .75rem; font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════ */
.container { max-width: 960px; margin: 2rem auto; padding: 0 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   CARD
═══════════════════════════════════════════════════════ */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem; margin-bottom: 1rem;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow); }
.card h3 { margin-bottom: .75rem; color: var(--primary); }

/* Scroll offset pro sticky nav při scrollIntoView */
#customer-detail { scroll-margin-top: 72px; }

/* ═══════════════════════════════════════════════════════
   GRID
═══════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════
   FORM
═══════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
label {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px;
}
input, select, textarea {
  padding: .55rem .75rem;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .18s, box-shadow .18s;
  line-height: 1.5;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,96,133,.15);
}
input:disabled, select:disabled {
  background: #f3f4f6; color: var(--muted); cursor: not-allowed;
}
textarea { resize: vertical; min-height: 70px; }

/* ═══════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.25rem; border: none; border-radius: var(--radius);
  cursor: pointer; font-size: .9rem; font-weight: 600;
  font-family: inherit; text-decoration: none;
  transition: filter .15s, box-shadow .15s, background .15s, color .15s;
  white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(0,96,133,.32);
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(232,69,69,.32);
}
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-l); }
.btn-sm { padding: .32rem .85rem; font-size: .82rem; }
.btn:disabled { opacity: .44; cursor: not-allowed; filter: none !important; box-shadow: none !important; }

/* ═══════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .18rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700;
}
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }

/* ═══════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  background: var(--primary); color: #fff;
  padding: .65rem 1rem; text-align: left;
  font-size: .77rem; text-transform: uppercase;
  letter-spacing: .5px; font-weight: 700;
}
td {
  padding: .6rem 1rem; border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td:not(.wc-closed):not(.wc-outside) { background: #f7fafc; }

/* ═══════════════════════════════════════════════════════
   TABS
═══════════════════════════════════════════════════════ */
.tabs {
  display: flex; gap: .5rem; margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.tab {
  padding: .6rem 1.25rem; cursor: pointer; font-weight: 600;
  color: var(--muted); border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: color .18s; font-size: .9rem;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.sub-tabs {
  display: flex; gap: .35rem; margin-bottom: 1.25rem;
  border-bottom: 1.5px solid var(--border); flex-wrap: wrap;
}
.sub-tab {
  padding: .45rem 1rem; cursor: pointer; font-weight: 600;
  font-size: .88rem; color: var(--muted);
  border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; transition: color .18s;
}
.sub-tab:hover { color: var(--primary); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ═══════════════════════════════════════════════════════
   PROFILE TABS  (zákaznický profil)
═══════════════════════════════════════════════════════ */
.profile-tabs {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border); padding-bottom: .75rem;
}
.profile-tab {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem 1rem; border: 1.5px solid var(--border); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: .875rem; font-family: inherit;
  color: var(--muted); transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.profile-tab:hover {
  background: var(--primary-l); border-color: rgba(0,96,133,.35); color: var(--primary);
}
.profile-tab.active {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   BADGE CARDS  (odznaky – profil)
═══════════════════════════════════════════════════════ */
.badges-section-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin: 0 0 .75rem; display: flex; align-items: center; gap: .4rem;
}

.badge-card {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem; margin-bottom: .6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s;
}
.badge-card.earned { border-left: 4px solid var(--success); }
.badge-card.locked { opacity: .6; }
.badge-card:hover  { box-shadow: var(--shadow); }

.badge-card-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.55rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.badge-card-icon.locked {
  filter: grayscale(1); opacity: .65;
}

.badge-card-body { flex: 1; min-width: 0; }
.badge-card-name { font-weight: 700; font-size: .95rem; color: var(--text); }
.badge-card-desc { font-size: .83rem; color: var(--muted); margin-top: .15rem; line-height: 1.4; }
.badge-card-date { font-size: .78rem; color: var(--success); font-weight: 600; margin-top: .3rem; }
.badge-card-cond { font-size: .78rem; color: var(--muted); margin-top: .3rem; font-style: italic; }

/* Progress bar (uvnitř locked badge) */
.badge-card-progress {
  display: flex; align-items: center; gap: .6rem; margin-top: .45rem;
}
.badge-progress-bar {
  flex: 1; height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden;
}
.badge-progress-fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .4s ease;
}
.badge-progress-label {
  font-size: .75rem; color: var(--muted); white-space: nowrap; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════
   GREETING ROW  (pozdrav + odznaky)
═══════════════════════════════════════════════════════ */
.greeting-row {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.greeting-row .page-title { margin: 0; }
.greeting-badge {
  font-size: 1.5rem; text-decoration: none;
  cursor: pointer; transition: transform .15s;
  display: inline-block;
}
.greeting-badge:hover { transform: scale(1.25); }

/* ═══════════════════════════════════════════════════════
   BADGE TEASER  (dashboard widget)
═══════════════════════════════════════════════════════ */
.badge-teaser-card {
  display: flex; align-items: center; gap: 1.25rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: .9rem 1.25rem;
}
.badge-teaser-left {
  display: flex; flex-direction: column; align-items: center;
  gap: .1rem; min-width: 52px;
}
.badge-teaser-count {
  font-family: 'Poppins', sans-serif; font-size: 2rem; font-weight: 700;
  color: var(--primary); line-height: 1;
}
.badge-teaser-label {
  font-size: .68rem; color: var(--muted); text-align: center; line-height: 1.3;
}
.badge-teaser-middle {
  flex: 1; min-width: 0;
}
.badge-teaser-emojis {
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-bottom: .4rem;
}
.badge-teaser-next {
  display: flex; align-items: center; gap: .6rem;
}
.badge-teaser-link { flex-shrink: 0; }

@media (max-width: 520px) {
  .badge-teaser-card { flex-wrap: wrap; }
  .badge-teaser-link { width: 100%; text-align: center; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════
   OFFER CARDS  (speciální nabídky)
═══════════════════════════════════════════════════════ */
.offer-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: .75rem;
  background: #fff; position: relative;
  box-shadow: var(--shadow-sm); transition: box-shadow .18s;
}
.offer-card:hover { box-shadow: var(--shadow); }
.offer-card.unread { border-left: 4px solid var(--primary); background: #f7fbff; }
.offer-card .offer-title {
  font-weight: 600; font-size: 1rem; margin-bottom: .25rem;
  display: flex; align-items: center; gap: .35rem;
}
.offer-card .offer-perex {
  color: var(--muted); font-size: .88rem;
  margin-bottom: .5rem; line-height: 1.5;
}
.offer-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 99px;
  font-size: .77rem; font-weight: 700;
}
.offer-badge.percent { background: #dbeafe; color: #1d4ed8; }
.offer-badge.fixed   { background: #dcfce7; color: #15803d; }
.offer-badge.free    { background: #fef9c3; color: #854d0e; }
.offer-badge.info    { background: #f3f4f6; color: #374151; }

.offer-promo-box {
  margin-top: .65rem; background: #f8fafc;
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: .55rem .75rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; flex-wrap: wrap;
}
.offer-promo-code {
  font-family: 'Courier New', monospace;
  font-size: 1rem; font-weight: 700; letter-spacing: .08em; color: #1d4ed8;
}
.new-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--primary); flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   REFERRAL  (doporuč kamaráda)
═══════════════════════════════════════════════════════ */
.referral-code-box {
  background: var(--primary-l); border: 2px dashed #93c5fd;
  border-radius: var(--radius); padding: 1.25rem;
  text-align: center; margin: 1rem 0;
}
.referral-code {
  font-family: 'Courier New', monospace;
  font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; color: var(--primary-d);
}
.referral-stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .75rem; margin: 1rem 0;
}
.referral-stat-box {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .85rem .75rem; text-align: center; box-shadow: var(--shadow-sm);
}
.referral-stat-value {
  font-size: 1.6rem; font-weight: 700; color: var(--primary); line-height: 1.1;
}
.referral-stat-label { font-size: .73rem; color: var(--muted); margin-top: .25rem; line-height: 1.3; }
@media (max-width: 480px) { .referral-stats-grid { grid-template-columns: 1fr; } }

/* ═══════════════════════════════════════════════════════
   AUTH PAGE
═══════════════════════════════════════════════════════ */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 1rem;
  background: linear-gradient(135deg, #005577 0%, #1e73be 100%);
}
.auth-box {
  background: #fff; border-radius: var(--radius-lg);
  padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-box h1 { text-align: center; margin-bottom: .25rem; }
.auth-box h1 .auth-logo { height: 56px; width: auto; display: inline-block; }
.auth-box .subtitle { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.auth-toggle { text-align: center; margin-top: 1rem; font-size: .9rem; }
.auth-toggle a { color: var(--primary); cursor: pointer; font-weight: 600; text-decoration: none; }
.auth-toggle a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════
   SLOTS
═══════════════════════════════════════════════════════ */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px,1fr)); gap: .5rem; margin-top: 1rem; }
.slot {
  padding: .45rem; text-align: center;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: .9rem; transition: all .18s;
}
.slot.available:hover { border-color: var(--primary); background: var(--primary-l); }
.slot.selected { border-color: var(--primary); background: var(--primary); color: #fff; }
.slot.unavailable { background: #f3f4f6; color: #b0b7c3; cursor: not-allowed; text-decoration: line-through; }

/* ═══════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════ */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: .9rem; border: 1px solid;
}
.alert-error   { background: #fff1f1; color: #991b1b; border-color: #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #86efac; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

/* ═══════════════════════════════════════════════════════
   RESERVATION CARD
═══════════════════════════════════════════════════════ */
.res-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; margin-bottom: .6rem;
  box-shadow: var(--shadow-sm); transition: box-shadow .18s;
}
.res-card:hover { box-shadow: var(--shadow); }
.res-card .res-info .date { font-weight: 700; font-size: 1rem; }
.res-card .res-info .meta { font-size: .85rem; color: var(--muted); }
.res-card .res-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   CALENDAR
═══════════════════════════════════════════════════════ */
.cal-nav { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.cal-nav .cal-month { font-weight: 700; font-size: 1.05rem; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-header {
  text-align: center; font-size: .73rem; font-weight: 700;
  color: var(--muted); padding: .3rem 0; text-transform: uppercase;
}
.cal-day {
  text-align: center; padding: .5rem .3rem; border-radius: var(--radius-sm);
  cursor: pointer; font-size: .88rem; transition: background .15s;
}
.cal-day:hover:not(.empty):not(.past) { background: var(--primary-l); }
.cal-day.today { background: var(--primary); color: #fff; font-weight: 700; }
.cal-day.selected { background: var(--accent); color: #fff; }
.cal-day.empty, .cal-day.past { color: #c8d0db; cursor: default; }
.cal-day.has-res { position: relative; }
.cal-day.has-res::after {
  content: ''; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%); width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════ */
.spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid #e5e7eb; border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: .4; }

/* ═══════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════ */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.open { display: flex; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.modal-box {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  padding: 1.75rem; width: 95%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-header h3 { color: var(--primary); font-size: 1.15rem; }
.modal-close {
  background: none; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .28rem .7rem; cursor: pointer; font-size: .85rem; transition: background .15s;
}
.modal-close:hover { background: #f3f4f6; }

/* ═══════════════════════════════════════════════════════
   WEEKLY CALENDAR  (admin)
═══════════════════════════════════════════════════════ */
.week-cal-outer { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.week-cal-table { border-collapse: collapse; font-size: .72rem; white-space: nowrap; }
.week-cal-table th, .week-cal-table td { border: 1px solid #e5e7eb; padding: 0; }
.week-cal-table thead tr { border-bottom: 3px solid var(--primary); }
.week-cal-table tbody tr { border-bottom: 2px solid #94a3b8; }
.wc-corner { width: 72px; min-width: 72px; background: var(--primary); }
.wc-time-th { width: 140px; min-width: 140px; text-align: center; padding: 5px 2px; font-size: .72rem; color: var(--muted); background: #f8f9fa; font-weight: 600; }
.wc-day-td { width: 72px; min-width: 72px; height: 72px; padding: 6px 8px; background: #f8f9fa; font-size: .75rem; font-weight: 700; color: var(--primary); position: sticky; left: 0; z-index: 1; border-right: 2px solid var(--border); line-height: 1.3; vertical-align: middle; }
.wc-cell { width: 140px; min-width: 140px; height: 72px; cursor: pointer; text-align: center; vertical-align: top; }
.wc-cell:hover:not(.wc-outside):not(.wc-closed) { box-shadow: inset 0 0 0 9999px rgba(0,0,0,.07); }
.wc-outside { background: repeating-linear-gradient(45deg,#e5e7eb,#e5e7eb 3px,#f3f4f6 3px,#f3f4f6 8px); cursor: default; position: relative; z-index: 2; }
.wc-closed  { background: repeating-linear-gradient(-45deg,#d1d5db,#d1d5db 3px,#f3f4f6 3px,#f3f4f6 8px); cursor: pointer; position: relative; z-index: 2; }
.wc-closed-day { background: #f3f4f6; color: var(--muted); text-align: center; font-size: .8rem; padding: 8px; font-style: italic; }
.wc-cell-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; gap: 0; padding: 4px 5px; }
.wc-name { font-size: .74rem; line-height: 1.35; white-space: normal; word-break: break-word; width: 100%; text-align: center; color: #1e293b; font-weight: 600; }
.wc-name + .wc-name { border-top: 1px solid rgba(0,0,0,.12); margin-top: 3px; padding-top: 3px; }
.wc-count { font-size: .68rem; font-weight: 700; line-height: 1; }
.wc-tdot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   TRAINER
═══════════════════════════════════════════════════════ */
.trainer-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-block; vertical-align: middle; margin-right: .4rem;
  border: 2px solid rgba(0,0,0,.12);
}

/* ═══════════════════════════════════════════════════════
   SLOT DETAIL RESERVATION CARD
═══════════════════════════════════════════════════════ */
.slot-res-card {
  display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .65rem 1rem; margin-bottom: .5rem; background: #fafafa;
}
.slot-res-card .info { display: flex; flex-direction: column; gap: 1px; }
.slot-res-card .info strong { display: block; font-size: .9rem; }
.slot-res-card .info small { color: var(--muted); font-size: .8rem; display: block; }
.slot-trainer-avatar { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════
   AVATAR  (profil)
═══════════════════════════════════════════════════════ */
#profile-avatar-preview { transition: opacity .15s; cursor: pointer; }
#profile-avatar-preview:hover { opacity: .83; }
#profile-avatar-picker { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ═══════════════════════════════════════════════════════
   HAMBURGER NAVIGACE
═══════════════════════════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay (zatmavení pozadí) při otevřeném menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 198;
}
.nav-overlay.open { display: block; }

/* ═══════════════════════════════════════════════════════
   MOBILNÍ BREAKPOINTY
═══════════════════════════════════════════════════════ */

/* ── 768 px: tablet/mobil ── */
@media (max-width: 768px) {

  /* NAV – hamburger layout */
  nav { padding: 0 1rem; }

  .nav-hamburger { display: flex; }

  #nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow-md);
    padding: .75rem 1.25rem 1rem;
    z-index: 199;
    flex-direction: column;
    gap: 0;
  }
  nav { position: relative; }
  nav.nav-open #nav-links { display: flex; }

  /* Studio wrap v mobilním menu */
  #nav-links .nav-studio-wrap { order: -1; margin-bottom: .75rem; padding-bottom: .65rem; border-bottom: 1px solid var(--border); }

  /* Navigační linky v mobilním menu */
  #nav-links > a {
    padding: .7rem .25rem;
    font-size: .95rem;
    border-bottom: 1px solid #f0f2f5;
  }
  #nav-links > a:last-of-type { border-bottom: none; }

  /* User chip – celá šířka */
  .nav-user-chip {
    width: 100%;
    margin: .65rem 0 0;
    border-radius: var(--radius);
    padding: .5rem .85rem;
  }
  .nav-user-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    min-width: 0;
    max-height: 85vh;
    overflow-y: auto;
  }

  /* LAYOUT */
  .container { padding: 0 .85rem; margin: 1.25rem auto; }

  /* GRIDS */
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  /* PAGE TITLE */
  .page-title { font-size: 1.25rem; }

  /* TABS – scrollovat vodorovně místo wrappování */
  .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: .25rem;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: .55rem .9rem; font-size: .83rem; }

  .sub-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sub-tabs::-webkit-scrollbar { display: none; }
  .sub-tab { white-space: nowrap; flex-shrink: 0; }

  /* Profile tabs – scrollovat */
  .profile-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .5rem;
    gap: .35rem;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .profile-tab { flex-shrink: 0; }

  /* MODÁLY – fullscreen na mobilu */
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: auto 0 0;
    overflow-y: auto;
    padding: 1.25rem 1rem 2rem;
  }
  .modal { align-items: flex-end; }

  /* Rezervační modal v dashboard.html (inline styled) */
  #slot-modal > div.card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin: auto 0 0;
    padding: 1rem .85rem 1.5rem;
  }

  /* GRID-2 uvnitř modálního kalendáře */
  .modal-box .grid-2,
  .modal-box > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr;
  }

  /* TABLE – horizontální scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap::after {
    content: '← →';
    display: block;
    text-align: right;
    font-size: .68rem;
    color: var(--muted);
    padding: .2rem .5rem;
    opacity: .7;
  }

  /* RES-CARD – stack na mobilu */
  .res-card { flex-direction: column; align-items: flex-start; gap: .6rem; }
  .res-card .res-actions { width: 100%; justify-content: flex-end; }

  /* Slot detail card */
  .slot-res-card { flex-wrap: wrap; }

  /* Autentizační stránka */
  .auth-box { padding: 1.75rem 1.1rem; }

  /* Admin: přepsat inline max-width:1300px na full-width */
  .container[style*="max-width:1300px"],
  .container[style*="max-width: 1300px"] {
    max-width: 100% !important;
  }

  /* Greeting badge row */
  .greeting-row { gap: .4rem; }

  /* Admin studio selector wrap */
  div[style*="display:flex"][style*="STUDIO"] {
    flex-wrap: wrap; gap: .5rem;
  }
}

/* ── 480 px: malý telefon ── */
@media (max-width: 480px) {

  /* Gridy → 1 sloupec */
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Inputy – zabránit automatickému zoomu na iOS */
  input, select, textarea { font-size: 16px !important; }

  /* Tlačítka v řadě – zabalit na nový řádek */
  .modal-box > div[style*="display:flex"][style*="gap"] { flex-wrap: wrap; }

  /* Card */
  .card { padding: 1rem .85rem; }

  /* Badge teaser */
  .badge-teaser-card { flex-direction: column; gap: .75rem; }

  /* Auth box */
  .auth-box { margin: 0; border-radius: 0; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
  .auth-wrap { padding: 0; align-items: stretch; }

  /* Grids in admin reports */
  div[style*="grid-template-columns:1fr 1fr"] { display: flex !important; flex-direction: column !important; }
}

/* ── Mobilní týdenní kalendář (list view) ── */
.mobile-cal-wrap { display: none; }

@media (max-width: 768px) {
  #cal-wrap .week-cal-outer { display: none; }
  .mobile-cal-wrap { display: block; }
}

.mobile-day-block {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mobile-day-header {
  background: var(--primary);
  color: #fff;
  padding: .5rem 1rem;
  font-weight: 700;
  font-size: .88rem;
}
.mobile-slot-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background .12s;
}
.mobile-slot-row:last-child { border-bottom: none; }
.mobile-slot-row:hover { background: var(--primary-l); }
.mobile-slot-row.slot-closed { background: #f3f4f6; cursor: pointer; opacity: .75; }
.mobile-slot-row.slot-outside { background: repeating-linear-gradient(45deg,#f3f4f6,#f3f4f6 3px,#e5e7eb 3px,#e5e7eb 8px); cursor: default; pointer-events: none; }
.mobile-slot-time { font-size: .82rem; font-weight: 700; color: var(--primary); min-width: 44px; padding-top: 2px; }
.mobile-slot-body { flex: 1; min-width: 0; }
.mobile-slot-names { font-size: .85rem; font-weight: 600; }
.mobile-slot-trainer { font-size: .75rem; color: var(--muted); margin-top: .1rem; }
.mobile-slot-empty { font-size: .8rem; color: var(--muted); font-style: italic; }
