/* ============================================================
   CAREVI v1.3 – Design System
   Estetika: Luxusní wellness/spa. Tmavé akcenty, teplá krémová,
   zlaté detaily. Čistá typografie, vzdušné mezery.
   Fonty: Cormorant Garamond (display) + Plus Jakarta Sans (UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Palette */
  --ink:       #1A1208;
  --deep:      #2E1F0F;
  --warm:      #5C3D1E;
  --muted:     #8B6D4A;
  --stone:     #B89B7A;
  --sand:      #D9C9B0;
  --cream:     #F5F0E8;
  --cream2:    #EDE7DA;
  --white:     #FDFAF5;

  --gold:      #C8941A;
  --gold-lt:   #F7EDD0;
  --gold-md:   #E8C878;

  --green:     #3D6142;
  --green-lt:  #E4EDE5;
  --red:       #7A2C2C;
  --red-lt:    #F5E8E8;
  --blue:      #2C4A6E;
  --blue-lt:   #E4ECF5;
  --sand-lt:   #EDE7DA;
  --danger:    #C0392B;

  /* Sidebar (dark) */
  --sb-bg:     #1A1208;
  --sb-border: rgba(200,148,26,.12);
  --sb-text:   rgba(253,250,245,.55);
  --sb-hover:  rgba(200,148,26,.08);
  --sb-active: rgba(200,148,26,.15);

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(26,18,8,.08);
  --sh-sm: 0 2px 10px rgba(26,18,8,.10);
  --sh-md: 0 6px 24px rgba(26,18,8,.12);
  --sh-lg: 0 16px 48px rgba(26,18,8,.18);

  /* Geometry */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;

  /* Layout */
  --sidebar-w: 268px;
  --topbar-h:  64px;

  /* Typography */
  --ff-display: 'Cormorant Garamond', Georgia, serif;
  --ff-ui:      'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-ui);
  font-size: 14px;
  line-height: 1.6;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font-family: inherit; }

/* ── App Shell ───────────────────────────────────────────── */
#app   { display: flex; min-height: 100vh; }
#main  { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; background: var(--cream); }

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sb-bg);
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 200;
  border-right: 1px solid var(--sb-border);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
#sidebar::-webkit-scrollbar { display: none; }

#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(26,18,8,.6);
  backdrop-filter: blur(2px);
  z-index: 199;
}

/* Logo */
.sb-logo {
  padding: 28px 24px 22px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-logo-name {
  font-family: var(--ff-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: .18em;
  color: var(--white);
  line-height: 1;
}
.sb-logo-sub {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 5px;
}

/* Nav */
.sb-section { padding: 20px 0 4px; }
.sb-label {
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted); padding: 0 24px 8px; font-weight: 600;
}
.sb-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px;
  color: var(--sb-text);
  font-size: 13px; font-weight: 400;
  cursor: pointer; transition: all .18s;
  border: none; background: none; width: 100%;
  text-decoration: none; position: relative;
  border-right: 2px solid transparent;
}
.sb-link:hover  { background: var(--sb-hover); color: var(--white); }
.sb-link.active {
  background: var(--sb-active);
  color: var(--gold-md);
  border-right-color: var(--gold);
}
.sb-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; opacity: .7; }
.sb-link.active .sb-icon { opacity: 1; }
.sb-badge {
  margin-left: auto; padding: 2px 7px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
  color: var(--white); flex-shrink: 0;
}
.sb-badge-gold { background: var(--gold); }
.sb-badge-red  { background: var(--red); }

.sb-divider { height: 1px; background: var(--sb-border); margin: 8px 24px; }

.sb-footer {
  margin-top: auto; padding: 16px 24px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
}
.sb-footer p { font-size: 11px; color: var(--muted); }

/* ── Topbar ──────────────────────────────────────────────── */
#topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--sand);
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  gap: 16px;
  box-shadow: var(--sh-xs);
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.page-title  {
  font-family: var(--ff-display);
  font-size: 22px; font-weight: 400; color: var(--ink);
  letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Hamburger */
#menu-toggle {
  display: none;
  flex-direction: column; justify-content: space-between;
  width: 26px; height: 18px;
  background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
}
#menu-toggle span {
  height: 2px; width: 100%;
  background: var(--ink); border-radius: 2px; transition: all .25s;
}

/* ── Content ─────────────────────────────────────────────── */
#content { padding: 32px 36px; max-width: 1200px; width: 100%; flex: 1; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r-sm);
  font-family: var(--ff-ui); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .18s;
  border: 1px solid transparent;
  text-decoration: none; white-space: nowrap; line-height: 1.3;
}
.btn-primary {
  background: var(--deep); color: var(--white);
  box-shadow: 0 2px 8px rgba(46,31,15,.25);
}
.btn-primary:hover { background: var(--ink); box-shadow: 0 4px 14px rgba(46,31,15,.35); transform: translateY(-1px); }

.btn-gold {
  background: var(--gold); color: var(--white);
  box-shadow: 0 2px 8px rgba(200,148,26,.3);
}
.btn-gold:hover { background: #b0800f; transform: translateY(-1px); }

.btn-outline {
  background: var(--white); border-color: var(--sand); color: var(--warm);
}
.btn-outline:hover { background: var(--cream2); border-color: var(--stone); }

.btn-danger { background: var(--red-lt); color: var(--red); border-color: #dfc8c8; }
.btn-danger:hover { background: #f0dada; }

.btn-green  { background: var(--green-lt); color: var(--green); border-color: #c0d4c2; }
.btn-green:hover { background: #d0e4d2; }

.btn-sm   { padding: 6px 13px; font-size: 12px; }
.btn-icon { padding: 7px 10px; }
.btn-xs   { padding: 4px 9px; font-size: 11px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--sand);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--sand);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--white);
}
.card-title {
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 500; color: var(--ink);
  letter-spacing: .01em;
}
.card-body { padding: 24px; }
.card-body-flush { padding: 0; }

/* ── Stats grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  box-shadow: var(--sh-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-md));
  opacity: 0; transition: opacity .2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-num {
  font-family: var(--ff-display);
  font-size: 40px; font-weight: 300;
  color: var(--deep); line-height: 1;
}
.stat-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-top: 8px; font-weight: 500;
}
.stat-icon { font-size: 28px; opacity: .15; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.form-full   { grid-column: 1 / -1; }
.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-label  {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
}
.form-control {
  padding: 11px 14px;
  border: 1.5px solid var(--sand);
  border-radius: var(--r-sm);
  font-size: 14px; font-family: var(--ff-ui);
  color: var(--ink); background: var(--cream);
  transition: border-color .18s, background .18s, box-shadow .18s;
  width: 100%;
  appearance: none; -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--warm);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(92,61,30,.1);
}
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B6D4A' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 88px; }
.form-hint { font-size: 11px; color: var(--stone); line-height: 1.4; }
.form-section { margin-bottom: 26px; }
.form-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: .18em;
  color: var(--stone); padding-bottom: 10px;
  border-bottom: 1px solid var(--sand); margin-bottom: 16px; font-weight: 600;
}

/* ── Checkboxes ──────────────────────────────────────────── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item  { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-item input { width: 16px; height: 16px; accent-color: var(--deep); cursor: pointer; flex-shrink: 0; }
.checkbox-item label { font-size: 13px; color: var(--ink); cursor: pointer; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--sand); }
th {
  padding: 11px 14px; text-align: left;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); font-weight: 600;
  white-space: nowrap; background: var(--cream);
}
tbody tr { border-bottom: 1px solid var(--cream2); transition: background .12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(200,148,26,.04); }
td { padding: 13px 14px; vertical-align: middle; font-size: 13px; }
.td-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 500; white-space: nowrap; gap: 4px;
}
.badge-green  { background: var(--green-lt); color: var(--green); }
.badge-red    { background: var(--red-lt);   color: var(--red);   }
.badge-blue   { background: var(--blue-lt);  color: var(--blue);  }
.badge-gold   { background: var(--gold-lt);  color: #7A5800;      }
.badge-sand   { background: var(--cream2);   color: var(--warm);  }
.badge-kontra {
  background: #FFF3CD; color: #7A4500;
  border: 1px solid #F0B042;
  font-weight: 600; text-decoration: none;
  animation: kontra-pulse 2.5s ease-in-out infinite;
}
.badge-kontra:hover { background: #FFE8A0; color: #5A3200; }
@keyframes kontra-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(240,176,66,.0); }
  50%      { box-shadow: 0 0 0 4px rgba(240,176,66,.35); }
}

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border-radius: var(--r-md);
  font-size: 13px; margin-bottom: 20px; border: 1px solid;
  line-height: 1.55;
}
.alert-body    { flex: 1; }
.alert-close   { background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1; opacity: .5; padding: 2px; flex-shrink: 0; transition: opacity .15s; }
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--green-lt); color: var(--green); border-color: #c0d4c2; }
.alert-error   { background: var(--red-lt);   color: var(--red);   border-color: #dfc8c8; }
.alert-info    { background: var(--blue-lt);  color: var(--blue);  border-color: #c0d4e8; }
.alert-warning { background: var(--gold-lt);  color: #7A5800;      border-color: #e8d090; }

/* ── Search ──────────────────────────────────────────────── */
.search-bar   { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 200px;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid var(--sand); border-radius: var(--r-sm);
  font-size: 14px; font-family: var(--ff-ui);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23B89B7A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 13px center;
  transition: border-color .18s, box-shadow .18s;
}
.search-input:focus { outline: none; border-color: var(--warm); box-shadow: 0 0 0 3px rgba(92,61,30,.1); }

/* ── Client header ───────────────────────────────────────── */
.client-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 24px;
  background: var(--white);
  border-radius: var(--r-xl);
  border: 1px solid var(--sand);
  padding: 28px;
  box-shadow: var(--sh-sm);
  flex-wrap: wrap;
}
.client-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--deep), var(--warm));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-size: 26px; color: var(--white);
  font-weight: 400; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(46,31,15,.25);
}
.client-avatar-sm { width: 38px; height: 38px; font-size: 14px; box-shadow: none; }
.client-info h2   { font-family: var(--ff-display); font-size: 26px; font-weight: 400; letter-spacing: .02em; }
.client-meta      { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.client-meta-item { font-size: 13px; color: var(--muted); display: flex; gap: 5px; align-items: center; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--sand); margin-bottom: 24px; flex-wrap: wrap; }
.tab {
  padding: 11px 20px; font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border: none; background: none; font-family: var(--ff-ui);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all .18s; text-decoration: none; display: inline-block;
}
.tab:hover  { color: var(--ink); }
.tab.active { color: var(--deep); border-bottom-color: var(--gold); font-weight: 600; }

/* ── Session cards ───────────────────────────────────────── */
.session-card {
  background: var(--white); border: 1px solid var(--sand);
  border-radius: var(--r-lg); padding: 22px;
  margin-bottom: 14px; transition: box-shadow .18s, transform .18s;
}
.session-card:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.session-date  { font-family: var(--ff-display); font-size: 17px; color: var(--deep); }
.session-type  { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-top: 2px; }
.session-grid  { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.field-label   { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--stone); margin-bottom: 4px; font-weight: 600; }
.field-val     { font-size: 13px; color: var(--ink); line-height: 1.6; }

/* ── Health records ──────────────────────────────────────── */
.health-record      { background: var(--white); border: 1px solid var(--sand); border-radius: var(--r-lg); padding: 22px; margin-bottom: 14px; }
.health-record-date { font-size: 11px; color: var(--stone); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px; font-weight: 500; }
.health-tag         { display: inline-block; padding: 4px 11px; background: var(--red-lt); color: var(--red); border-radius: 20px; font-size: 11px; margin: 3px; border: 1px solid #dfc8c8; font-weight: 500; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state       { text-align: center; padding: 64px 20px; color: var(--stone); }
.empty-state-icon  { font-size: 52px; margin-bottom: 16px; opacity: .4; }
.empty-state h3,
.empty-state-title { font-family: var(--ff-display); font-size: 22px; color: var(--muted); font-weight: 400; margin-bottom: 8px; }
.empty-state p,
.empty-state-text  { font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.empty-state a     { color: var(--deep); font-weight: 500; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: var(--deep); color: var(--white);
  border-radius: var(--r-md);
  font-size: 13px; z-index: 9999;
  box-shadow: var(--sh-lg);
  transform: translateY(80px) scale(.95); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none; max-width: 340px;
  border-left: 3px solid var(--gold);
}
.toast.show { transform: translateY(0) scale(1); opacity: 1; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,18,8,.55);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white); border-radius: var(--r-xl);
  box-shadow: var(--sh-lg); width: 100%; max-width: 460px;
  animation: modalIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { transform: scale(.92) translateY(12px); opacity: 0; } }
.modal-header { padding: 22px 26px; border-bottom: 1px solid var(--sand); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-family: var(--ff-display); font-size: 20px; color: var(--ink); }
.modal-body   { padding: 22px 26px; font-size: 14px; line-height: 1.65; color: var(--warm); }
.modal-footer { padding: 16px 26px; border-top: 1px solid var(--sand); display: flex; justify-content: flex-end; gap: 10px; background: var(--cream); border-radius: 0 0 var(--r-xl) var(--r-xl); }

/* ── Dashboard grid ──────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-row  {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--cream2); gap: 12px;
}
.dash-row:last-child { border-bottom: none; }

/* ── GDPR ────────────────────────────────────────────────── */
.gdpr-doc { background: white; padding: 48px; max-width: 820px; margin: 0 auto; font-family: var(--ff-ui); }
.gdpr-doc h1 { font-family: var(--ff-display); font-size: 24px; margin-bottom: 8px; }
.gdpr-doc h2 { font-size: 13px; font-weight: 600; margin: 20px 0 8px; text-transform: uppercase; letter-spacing: .05em; color: #333; }
.gdpr-doc p, .gdpr-doc li { font-size: 13px; line-height: 1.7; color: #333; margin-bottom: 6px; }
.gdpr-doc ul { padding-left: 20px; margin-bottom: 10px; }
.gdpr-info { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 24px; font-size: 13px; border: 1px solid #ddd; border-radius: 8px; padding: 16px; }
.gdpr-info div { display: flex; gap: 8px; }
.gdpr-info span:first-child { color: #888; min-width: 160px; }
.gdpr-info span:last-child  { font-weight: 600; }
.gdpr-notice  { background: #fffbef; border: 1px solid #e8d090; border-radius: 8px; padding: 14px; margin: 20px 0; }
.sig-line  { display: flex; gap: 60px; margin-top: 50px; flex-wrap: wrap; }
.sig-field { flex: 1; min-width: 200px; }
.sig-field p { font-size: 12px; color: #888; margin-bottom: 6px; }
.sig-line-el { border-bottom: 1px solid #999; margin: 36px 0 8px; }

/* ── Stav radio buttons ──────────────────────────────────── */
.stav-options { display: flex; gap: 8px; flex-wrap: wrap; }
.stav-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--sand); border-radius: var(--r-sm);
  cursor: pointer; transition: all .18s; font-size: 13px;
  user-select: none;
}
.stav-opt input { accent-color: var(--deep); }
.stav-opt:hover { border-color: var(--stone); background: var(--cream); }
.stav-opt.selected { border-color: var(--warm); background: var(--cream2); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn { padding: 7px 13px; border: 1px solid var(--sand); border-radius: var(--r-sm); font-size: 13px; font-family: var(--ff-ui); background: var(--white); color: var(--warm); cursor: pointer; text-decoration: none; transition: all .15s; }
.page-btn:hover { background: var(--cream2); }
.page-btn.active { background: var(--deep); color: var(--white); border-color: var(--deep); }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #main { margin: 0; }
  #content { padding: 0; max-width: 100%; }
  body { background: white; }
  .gdpr-doc { box-shadow: none; border: none; }
}

/* ── Responsive: tablet ──────────────────────────────────── */
/* ── Mapa bolesti ────────────────────────────────────────── */
.body-map-wrap {
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
}
.body-map-view {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.body-map-view-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--stone); font-weight: 600;
}
.body-map-view svg {
  height: 380px; width: auto; display: block;
  border: 1.5px solid var(--sand); border-radius: var(--r-md);
  background: #fff;
  filter: drop-shadow(0 2px 8px rgba(60,40,20,.12));
  transition: border-color .15s, filter .15s;
}
.body-map-view svg:hover {
  border-color: var(--stone);
  filter: drop-shadow(0 3px 12px rgba(60,40,20,.20));
}
.body-map-list {
  flex: 1; min-width: 200px;
}
.body-map-list-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .12em;
  color: var(--stone); font-weight: 600; margin-bottom: 8px;
}
.body-map-empty {
  font-size: 13px; color: var(--stone); padding: 10px 0; font-style: italic;
}
.marker-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--sand);
}
.marker-item:last-child { border-bottom: none; }
.marker-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  color: white; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.marker-info { flex: 1; min-width: 0; }
.marker-type { font-size: 12px; font-weight: 600; }
.marker-popis { font-size: 12px; color: var(--muted); margin-top: 2px; }
.marker-del {
  background: none; border: none; cursor: pointer;
  color: var(--stone); font-size: 15px; padding: 0; line-height: 1;
  transition: color .15s;
}
.marker-del:hover { color: var(--red); }

/* Dialog */
.body-map-dialog {
  display: none; position: fixed; inset: 0; z-index: 1000;
  align-items: center; justify-content: center;
  background: rgba(30,20,10,.45);
}
.body-map-dialog-inner {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 24px 28px;
  width: 340px; max-width: 90vw;
}
.body-map-dialog-inner h4 {
  font-family: var(--font-display); font-size: 18px;
  color: var(--deep); margin: 0 0 16px;
}
.body-map-dialog-inner select,
.body-map-dialog-inner textarea {
  width: 100%; margin-bottom: 12px;
}
.body-map-dialog-btns {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px;
}

/* Read-only map in session cards */
.body-map-readonly { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.body-map-readonly svg {
  height: 260px; width: auto; display: block;
  border: 1px solid var(--sand); border-radius: var(--r-sm);
  background: #fff;
  filter: drop-shadow(0 1px 5px rgba(60,40,20,.10));
}

/* ══════════════════════════════════════════════════════════
   KALENDÁŘ
   ══════════════════════════════════════════════════════════ */

/* ── Navigační lišta ─────────────────────────────────────── */
.cal-navbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.cal-title {
  font-family: var(--ff-display);
  font-size: 22px; font-weight: 400;
  color: var(--ink); letter-spacing: .02em;
  flex: 1; text-align: center;
  min-width: 160px;
}
.cal-view-switch { display: flex; gap: 6px; margin-left: auto; }

/* ── Měsíční pohled ──────────────────────────────────────── */
.cal-month {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.cal-month-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--cream);
  border-bottom: 2px solid var(--sand);
}
.cal-month-head > div {
  padding: 10px 8px; text-align: center;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted);
}
.cal-month-head .cal-weekend { color: var(--stone); }

.cal-month-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.cal-day {
  min-height: 110px; padding: 6px 8px;
  border-right: 1px solid var(--cream2);
  border-bottom: 1px solid var(--cream2);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.cal-day:hover { background: rgba(200,148,26,.04); }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day-other { background: var(--cream); cursor: default; }
.cal-day-other .cal-day-num { color: var(--stone); }
.cal-day-today { background: var(--gold-lt) !important; }
.cal-day-past   { background: #FAFAF8; }
.cal-day-past .cal-day-num { color: var(--stone); }
.cal-weekend    { background: rgba(200,148,26,.03); }

.cal-day-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; font-weight: 500; color: var(--ink);
  margin-bottom: 4px;
}
.cal-day-today .cal-day-num {
  background: var(--gold); color: white;
}

.cal-pill {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 6px; border-radius: 4px;
  font-size: 11px; color: white;
  text-decoration: none; margin-bottom: 2px;
  overflow: hidden; white-space: nowrap;
  transition: opacity .12s, transform .12s;
  max-width: 100%;
}
.cal-pill:hover { opacity: .88; transform: translateX(1px); }
.cal-pill-time  { font-weight: 600; flex-shrink: 0; }
.cal-pill-name  { overflow: hidden; text-overflow: ellipsis; }
.cal-more {
  font-size: 10px; color: var(--muted); text-decoration: none;
  display: block; margin-top: 2px; padding: 1px 4px;
}
.cal-more:hover { color: var(--warm); text-decoration: underline; }

/* ── Týdenní pohled ──────────────────────────────────────── */
.cal-week-wrap {
  background: var(--white);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

/* Záhlaví */
.cal-week-head {
  display: flex;
  border-bottom: 2px solid var(--sand);
  background: var(--cream);
}
.cal-week-corner {
  width: 56px; flex-shrink: 0;
  border-right: 1px solid var(--cream2);
}
.cal-week-head-cell {
  flex: 1; padding: 10px 8px; text-align: center;
  border-left: 1px solid var(--cream2);
}
.cal-week-head-cell.cal-weekend { background: rgba(200,148,26,.04); }
.cal-week-head-cell.cal-wh-today { background: var(--gold-lt); }
.cal-wh-dow {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em;
}
.cal-wh-date {
  font-size: 20px; font-family: var(--ff-display); font-weight: 400;
  color: var(--ink); margin-top: 2px; line-height: 1;
}
.cal-wh-date-today {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: white;
}

/* Tělo */
.cal-week-body {
  display: flex;
  overflow-y: auto;
  max-height: 700px;
}
.cal-week-times {
  width: 56px; flex-shrink: 0;
  background: var(--cream);
  border-right: 1px solid var(--cream2);
}
.cal-time-slot {
  height: 64px; padding: 4px 8px 0 0;
  text-align: right; font-size: 10px; color: var(--stone);
  border-bottom: 1px solid var(--cream2);
  line-height: 1;
}
.cal-week-day {
  flex: 1; position: relative;
  border-left: 1px solid var(--cream2);
  cursor: pointer;
  transition: background .1s;
}
.cal-week-day:hover { background: rgba(200,148,26,.025); }
.cal-week-day.cal-weekend { background: rgba(200,148,26,.025); }
.cal-week-day.cal-wd-today { background: rgba(200,148,26,.06) !important; }
.cal-hour-line {
  position: absolute; left: 0; right: 0; height: 64px;
  border-bottom: 1px solid var(--cream2);
}

/* Blok události v týdenním pohledu */
.cal-event-block {
  position: absolute; left: 2px; right: 2px;
  border-radius: 6px;
  padding: 4px 7px;
  color: white; text-decoration: none;
  overflow: hidden; cursor: pointer;
  border-left: 3px solid rgba(0,0,0,.2);
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: opacity .12s, box-shadow .12s, transform .12s;
  z-index: 2;
}
.cal-event-block:hover {
  opacity: .9;
  box-shadow: 0 3px 10px rgba(0,0,0,.28);
  transform: translateX(1px);
}
.cal-ev-time  { font-size: 10px; font-weight: 700; opacity: .9; }
.cal-ev-name  { font-size: 12px; font-weight: 600; line-height: 1.3; margin-top: 1px; }
.cal-ev-type  { font-size: 10px; opacity: .8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Legenda ─────────────────────────────────────────────── */
.cal-legend {
  display: flex; gap: 20px; margin-top: 14px;
  font-size: 12px; color: var(--muted); flex-wrap: wrap;
}
.cal-legend-item { display: flex; align-items: center; gap: 6px; }
.cal-legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Responzivita kalendáře ──────────────────────────────── */
@media (max-width: 768px) {
  .cal-title { font-size: 17px; }
  .cal-day   { min-height: 72px; padding: 4px 5px; }
  .cal-day-num { font-size: 12px; width: 22px; height: 22px; }
  .cal-pill  { font-size: 10px; padding: 1px 4px; }
  .cal-pill-time { display: none; }
  .cal-week-times { width: 40px; }
  .cal-time-slot  { font-size: 9px; padding-right: 4px; }
  .cal-week-head-cell .cal-wh-date { font-size: 16px; }
}

@media (max-width: 1100px) {
  :root { --sidebar-w: 240px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  #content { padding: 24px 28px; }
}

/* ── Responsive: mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 272px; }

  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); box-shadow: var(--sh-lg); }
  #sidebar-overlay.open { display: block; }
  #main { margin-left: 0; }
  #menu-toggle { display: flex; }

  #topbar { padding: 0 18px; }
  .page-title { font-size: 18px; }
  #content { padding: 18px 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-num { font-size: 30px; }

  .dash-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }
  .session-grid { grid-template-columns: 1fr; }
  .client-info h2 { font-size: 20px; }
  .client-header { padding: 18px; gap: 14px; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 18px; }
  th, td { padding: 10px 11px; font-size: 12px; }
  .btn { font-size: 12px; padding: 8px 13px; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }
  .gdpr-doc { padding: 20px 14px; }
  .gdpr-info { grid-template-columns: 1fr; }
  .toast { bottom: 16px; right: 14px; left: 14px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar-actions .btn:not(:last-child) { display: none; }
}

/* ── Licenční bannery ────────────────────────────────────── */
.lic-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  flex-wrap: wrap;
}
.lic-banner-warn {
  background: var(--gold-lt);
  border-bottom: 1px solid var(--gold-md);
  color: var(--warm);
}
.lic-banner-info {
  background: var(--blue-lt);
  border-bottom: 1px solid #c0cfe0;
  color: var(--blue);
}
.lic-banner-error {
  background: var(--red-lt);
  border-bottom: 1px solid #ddb0b0;
  color: var(--red);
}
.lic-banner-btn {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255,255,255,.6);
  border: 1px solid currentColor;
  color: inherit;
  transition: background .15s;
}
.lic-banner-btn:hover { background: rgba(255,255,255,.9); }

/* ── Pricing cards (registrace) ─────────────────────────── */
.plan-info-box { margin-top: 10px; }

/* ── Licence sidebar badge ───────────────────────────────── */
.sb-badge-gold {
  background: var(--gold-lt);
  color: var(--gold);
  border: 1px solid var(--gold-md);
}
.sb-badge-red {
  background: var(--red-lt);
  color: var(--red);
  border: 1px solid #ddb0b0;
}

/* ── Hlasový vstup (voice.js) ────────────────────────────── */
.voice-wrap { position: relative; }

.voice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.voice-bar-status {
  font-size: 12px;
  color: var(--stone);
  flex: 1;
  min-height: 18px;
  transition: color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-bar-status--on  { color: var(--red);   font-weight: 500; }
.voice-bar-status--ok  { color: var(--green); font-weight: 500; }
.voice-bar-status--err { color: var(--red); }

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--sand);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, color .15s, background .15s;
  font-family: inherit;
}
.voice-btn:hover {
  border-color: var(--gold-md);
  color: var(--deep);
  background: var(--gold-lt);
}
.voice-btn--active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-lt);
  animation: voice-pulse-border 1.4s ease-in-out infinite;
}
.voice-btn--active:hover {
  background: var(--red-lt);
  color: var(--red);
}
.voice-btn-label { line-height: 1; }

@keyframes voice-pulse-border {
  0%, 100% { box-shadow: 0 0 0 0   rgba(122,44,44,.30); }
  50%       { box-shadow: 0 0 0 4px rgba(122,44,44,0); }
}
