/* ==========================================================================
   CEPA ZPĚTNÁ VAZBA - MODERN DESIGN SYSTEM
   Barvy: CEPA Vibrant Orange (#FF5E14), Deep Charcoal (#0F172A), Slate
   ========================================================================== */

:root {
  --cepa-orange: #FF5E14;
  --cepa-orange-hover: #E04E0B;
  --cepa-orange-light: rgba(255, 94, 20, 0.08);
  --cepa-orange-glow: rgba(255, 94, 20, 0.25);
  --cepa-gradient: linear-gradient(135deg, #FF5E14 0%, #FF8438 100%);
  --cepa-gradient-subtle: linear-gradient(135deg, rgba(255,94,20,0.1) 0%, rgba(255,132,56,0.03) 100%);
  
  --bg-main: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F1F5F9;
  --bg-elevated: #FFFFFF;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  
  --border-subtle: #E2E8F0;
  --border-strong: #CBD5E1;
  --border-accent: rgba(255, 94, 20, 0.3);
  
  --grade-1: #10B981; /* 1.0 - 1.49 Excellent (Green) */
  --grade-2: #3B82F6; /* 1.5 - 2.49 Very Good (Blue) */
  --grade-3: #F59E0B; /* 2.5 - 3.49 Average (Amber) */
  --grade-4: #F97316; /* 3.5 - 4.49 Below Average (Orange) */
  --grade-5: #EF4444; /* 4.5 - 5.0 Poor (Red) */

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Základní nastavení */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   HLAVIČKA & NAVIGACE
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 0.75rem;
  gap: 1.5rem;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.cepa-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cepa-logo-svg {
  height: 38px;
  width: auto;
}

.brand-divider {
  height: 28px;
  width: 1px;
  background: var(--border-subtle);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-title .main-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-title .sub-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cepa-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Horní ovládací prvky a přepínač */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  row-gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.training-select-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  gap: 0.4rem;
  transition: var(--transition-fast);
  max-width: 340px;
  min-width: 160px;
}

.training-select-wrapper:focus-within {
  border-color: var(--cepa-orange);
  box-shadow: 0 0 0 3px var(--cepa-orange-glow);
}

.training-select-icon {
  color: var(--cepa-orange);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.training-select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  width: 100%;
  max-width: 245px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Tlačítka akcí */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--cepa-gradient);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px var(--cepa-orange-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--cepa-orange-glow);
  background: linear-gradient(135deg, #E04E0B 0%, #FF7A00 100%);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.btn-outline-orange {
  background: var(--cepa-orange-light);
  color: var(--cepa-orange);
  border-color: var(--border-accent);
}

.btn-outline-orange:hover {
  background: var(--cepa-orange);
  color: var(--text-inverse);
  border-color: var(--cepa-orange);
}

.btn-icon-only {
  padding: 0.55rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   HLAVNÍ OBSAHOVÁ OBLAST
   ========================================================================== */
.main-wrapper {
  max-width: 1800px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.5rem 3rem;
  flex: 1;
}

/* Záložkový přepínač zobrazení (Report vs. Formulář) */
.view-tabs-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.tabs-group {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius-md);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--cepa-orange);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
  color: var(--text-primary);
}

.quick-stats-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

/* ==========================================================================
   REPORT VIEW: EXECUTIVE HERO BANNER
   ========================================================================== */
.report-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.report-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--cepa-gradient);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.hero-main-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-pretitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cepa-orange);
}

.customer-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
}

.course-topic-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.hero-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.meta-icon {
  color: var(--cepa-orange);
  font-size: 1.1rem;
}

.meta-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 700;
}

/* Skórekarta celkového hodnocení kurzu */
.hero-score-badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  min-width: 220px;
  text-align: center;
  position: relative;
}

.score-badge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.score-badge-grade {
  font-size: 3rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  color: var(--cepa-orange);
  margin: 0.25rem 0;
}

.score-badge-sub {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.score-satisfaction-pill {
  margin-top: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================================
   6 HLAVNÍCH KPI - POLO-KRUHOVÉ RYCHLOMĚRY (GAUGES)
   ========================================================================== */
.section-heading-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0 1rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.gauge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.gauge-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.gauge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}

.gauge-header {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.gauge-chart-wrapper {
  position: relative;
  width: 140px;
  height: 80px;
  margin: 0 auto;
}

.gauge-svg {
  width: 140px;
  height: 80px;
  overflow: visible;
}

.gauge-bg-arc {
  fill: none;
  stroke: var(--bg-surface-alt);
  stroke-width: 12;
  stroke-linecap: round;
}

.gauge-value-arc {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-out;
}

.gauge-center-value {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-number {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-range-labels {
  display: flex;
  justify-content: space-between;
  width: 140px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.gauge-evaluation-tag {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Barevné stupnice pro známky */
.grade-tag-1 {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.grade-tag-2 {
  background: rgba(59, 130, 246, 0.12);
  color: #2563EB;
}
.grade-tag-3 {
  background: rgba(245, 158, 11, 0.12);
  color: #D97706;
}
.grade-tag-4, .grade-tag-5 {
  background: rgba(239, 68, 68, 0.12);
  color: #DC2626;
}

/* ==========================================================================
   GRAFY A ANALYTICKÉ SOUHRNY
   ========================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chart-container-box {
  position: relative;
  flex: 1;
  min-height: 280px;
  width: 100%;
}

/* ==========================================================================
   KVALITATIVNÍ KARTY: ZPĚTNÁ VAZBA & APLIKAČNÍ ZÁVAZEK
   ========================================================================== */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.insight-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.icon-circle-orange {
  background: var(--cepa-orange-light);
  color: var(--cepa-orange);
}

.icon-circle-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #2563EB;
}

.icon-circle-green {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.icon-circle-purple {
  background: rgba(147, 51, 234, 0.1);
  color: #7E22CE;
}

.insight-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.insight-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.insight-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-surface-alt);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--cepa-orange);
}

.insight-list-item.action-item {
  border-left-color: #10B981;
}

.insight-list-item.clarify-item {
  border-left-color: #F59E0B;
}

.item-bullet {
  color: var(--cepa-orange);
  font-weight: bold;
  font-size: 1.1rem;
  line-height: 1;
}

/* Dvousloupcová tabulka pro Aplikační závazek (Co zavedou vs Jak poznají) */
.action-commitment-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.5rem;
}

.action-commitment-table th {
  background: var(--bg-surface-alt);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border-subtle);
}

.action-commitment-table th:first-child {
  border-top-left-radius: var(--radius-md);
}

.action-commitment-table th:last-child {
  border-top-right-radius: var(--radius-md);
}

.action-commitment-table td {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  vertical-align: top;
}

.action-commitment-table tr:hover td {
  background: var(--bg-surface-alt);
}

/* Citace / Slovní hodnocení lektora */
.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.quote-card {
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  position: relative;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-style: italic;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.quote-author-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================================================
   FORMULÁŘ PRO VYPLNĚNÍ NOVÉ ZPĚTNÉ VAZBY
   ========================================================================== */
.form-container-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  max-width: 900px;
  margin: 0 auto;
}

.form-header {
  margin-bottom: 2rem;
  text-align: center;
}

.form-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-primary);
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.form-step-group {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.step-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--cepa-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.rating-item-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.rating-item-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.rating-scale-buttons {
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

.rating-btn {
  flex: 1;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.rating-btn:hover {
  background: var(--cepa-orange-light);
  border-color: var(--cepa-orange);
  color: var(--cepa-orange);
}

.rating-btn.selected {
  background: var(--cepa-gradient);
  border-color: var(--cepa-orange);
  color: #FFFFFF;
  box-shadow: 0 2px 6px var(--cepa-orange-glow);
}

.form-input-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--cepa-orange);
  box-shadow: 0 0 0 3px var(--cepa-orange-glow);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* ==========================================================================
   MODÁLNÍ OKNA (ODESLÁNÍ ZÁKAZNÍKOVI & EXPORT)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: all var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: var(--border-subtle);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.email-preview-box {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.share-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.share-option-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.share-option-card:hover {
  border-color: var(--cepa-orange);
  background: var(--cepa-orange-light);
}

.share-option-card.selected {
  border-color: var(--cepa-orange);
  background: var(--cepa-orange-light);
  box-shadow: 0 0 0 2px var(--cepa-orange-glow);
}

.share-option-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   TOAST NOTIFIKACE
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  border-left: 4px solid var(--cepa-orange);
}

@keyframes toastIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   PATIČKA STRÁNKY
   ========================================================================== */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--cepa-orange);
}

/* ==========================================================================
   RESPONSIVITA & MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }
  
  .charts-grid, .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0.75rem 1rem;
  }
  
  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .header-controls {
    justify-content: space-between;
  }
  
  .training-select {
    min-width: 180px;
  }
  
  .main-wrapper {
    padding: 0 1rem 2rem;
  }
  
  .view-tabs-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .customer-name {
    font-size: 1.4rem;
  }
  
  .share-options-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   FIREBASE STATUS & EMPTY STATE
   ========================================================================== */
.firebase-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(241, 245, 249, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.firebase-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94A3B8;
  display: inline-block;
  transition: background 0.3s ease;
}

.firebase-status-pill .status-dot.online {
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.firebase-status-pill .status-dot.connecting {
  background: #F59E0B;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.firebase-status-pill .status-dot.error {
  background: #EF4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.empty-state-card {
  background: var(--bg-surface);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  text-align: center;
  max-width: 600px;
  margin: 3rem auto;
  box-shadow: var(--shadow-sm);
}

.empty-state-card .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  display: block;
}

.empty-state-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.empty-state-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* ==========================================================================
   ROLE SWITCHER & PERMISSION STYLES
   ========================================================================== */
.role-selector-pill {
  display: inline-flex;
  background: var(--bg-surface-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.role-switch-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.role-switch-btn:hover {
  color: var(--text-primary);
}

.role-switch-btn.active {
  background: #0F172A;
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

body.role-trainer .admin-only {
  display: none !important;
}

body.role-admin .portal-tab,
body.role-guest .portal-tab,
body.role-admin .no-admin,
body.role-trainer .order-tab,
body.role-guest .order-tab,
body.role-guest .admin-only {
  display: none !important;
}

/* Zákazník (kontaktní osoba firmy): nevidí admin ani lektorské prvky */
body.role-customer .admin-only,
body.role-customer .staff-only,
body:not(.role-customer) .customer-only {
  display: none !important;
}

/* ==========================================================================
   PROFIL PŘIHLÁŠENÉHO UŽIVATELE & PŘIHLAŠOVACÍ DIALOG
   ========================================================================== */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.6rem 0.3rem 0.85rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.user-profile-badge:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.user-avatar {
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cepa-orange);
}

.btn-user-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.btn-user-logout:hover {
  background: #FEE2E2;
  color: #DC2626;
}

/* Auth Modal Design */
.auth-modal-card {
  max-width: 520px !important;
}

.auth-method-box {
  background: #FFFFFF;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition-fast);
}

.auth-method-box:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.admin-auth-box {
  border-color: #E0E7FF;
  background: #FAFBFF;
}

.trainer-auth-box {
  border-color: #FED7AA;
  background: #FFFDF9;
}

.auth-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.auth-method-header h4 {
  margin: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.auth-badge-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.auth-badge-pill.admin-badge {
  background: #EEF2FF;
  color: #4F46E5;
  border: 1px solid #C7D2FE;
}

.auth-badge-pill.trainer-badge {
  background: #FFF7ED;
  color: #EA580C;
  border: 1px solid #FFEDD5;
}

.auth-method-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

/* Microsoft Login Button */
.btn-msal-login {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #2F2F2F;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid #1F1F1F;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transition: all var(--transition-fast);
}

.btn-msal-login:hover {
  background: #181818;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.ms-logo-svg {
  flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Participant Notice Card */
.participant-notice-card {
  display: flex;
  gap: 0.85rem;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  color: #166534;
  font-size: 0.85rem;
  line-height: 1.4;
}

.participant-notice-card .notice-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.participant-notice-card strong {
  display: block;
  margin-bottom: 0.2rem;
  color: #14532D;
}

.auth-status-msg {
  font-size: 0.85rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #DBEAFE;
}

.auth-status-msg.error {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: #FEE2E2;
}

.auth-status-msg.success {
  background: #F0FDF4;
  color: #15803D;
  border-color: #DCFCE7;
}

.trainer-select-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFF7ED;
  border: 1px solid #FFD8A8;
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem;
}

.trainer-select {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cepa-orange);
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   STATUS DISTRIBUCE REPORTU (POWER AUTOMATE / DISPATCH)
   ========================================================================== */
.dispatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.dispatch-badge.Planovano {
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
}

.dispatch-badge.SberDat {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.dispatch-badge.PripravenoKOdeslani {
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.dispatch-badge.Odeslano {
  background: #D1FAE5;
  color: #047857;
  border: 1px solid #6EE7B7;
}

/* ==========================================================================
   HLOUBKOVÝ PŘEHLED (DRILL-DOWN) DOTAZNÍKŮ
   ========================================================================== */
.drilldown-card {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.drilldown-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.drilldown-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #F1F5F9;
}

.drilldown-author {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drilldown-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drilldown-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.drilldown-score-item {
  background: #F8FAFC;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid #E2E8F0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.drilldown-score-val {
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.drilldown-section-row {
  margin-bottom: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

.drilldown-section-row strong {
  color: var(--text-primary);
}

.drilldown-section-row span {
  color: var(--text-secondary);
}

/* ==========================================================================
   POKROČILÝ FILTRAČNÍ PANEL A ŘAZENÍ PŘEHLEDU KURZŮ
   ========================================================================== */
.overview-filters-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.filter-controls-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 0.85rem;
}

.filter-secondary-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

@media (max-width: 1024px) {
  .filter-controls-grid,
  .filter-secondary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .filter-controls-grid,
  .filter-secondary-grid {
    grid-template-columns: 1fr;
  }
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.filter-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-results-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.filter-results-badge.is-filtered {
  background: rgba(249, 115, 22, 0.12);
  color: var(--primary-orange);
  border-color: rgba(249, 115, 22, 0.3);
}

/* Výběr viditelných sloupců přehledové tabulky */
.column-picker-wrapper {
  position: relative;
}

.column-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 50;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 20px rgba(0,0,0,0.12));
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 180px;
}

.column-picker-panel label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

#overviewTable.hide-col-id [data-col="id"],
#overviewTable.hide-col-customer [data-col="customer"],
#overviewTable.hide-col-topic [data-col="topic"],
#overviewTable.hide-col-trainer [data-col="trainer"],
#overviewTable.hide-col-date [data-col="date"],
#overviewTable.hide-col-week [data-col="week"],
#overviewTable.hide-col-participants [data-col="participants"],
#overviewTable.hide-col-score [data-col="score"],
#overviewTable.hide-col-status [data-col="status"] {
  display: none;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sortable-th:hover {
  background: rgba(249, 115, 22, 0.08);
  color: var(--primary-orange);
}

.sort-indicator {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.75rem;
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sortable-th.active-sort .sort-indicator {
  opacity: 1;
  color: var(--primary-orange);
  font-weight: 900;
}

/* ==========================================================================
   TISKOVÝ STYL PRO PDF EXPORT (A4)
   ========================================================================== */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 9pt;
  }
  
  .app-header,
  .view-tabs-container,
  .app-footer,
  .modal-overlay,
  .toast-container,
  .no-print {
    display: none !important;
  }
  
  .main-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .report-hero-card,
  .gauge-card,
  .chart-card,
  .insight-card {
    box-shadow: none !important;
    border: 1px solid #CBD5E1 !important;
    page-break-inside: avoid;
  }
  
  .gauge-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 0.5rem !important;
  }
  
  .charts-grid {
    grid-template-columns: 1fr 1fr !important;
    page-break-inside: avoid;
  }
  
  .insights-grid {
    grid-template-columns: 1fr 1fr !important;
    page-break-inside: avoid;
  }

  .print-footer-info {
    display: block !important;
    text-align: center;
    margin-top: 1rem;
    font-size: 8pt;
    color: #64748B;
  }
}

/* ==========================================================================
   BEZPEČNOSTNÍ ZÁMEK: PŘIHLAŠOVACÍ BRÁNA ADMINISTRÁTORA (ADMIN LOCK GATE)
   ========================================================================== */
.admin-lock-gate {
  padding: 3rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.lock-gate-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 2.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lock-gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-orange), #FF8A00);
}

.lock-gate-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  background: rgba(255, 94, 20, 0.1);
  color: var(--primary-orange);
  border-radius: 50%;
  font-size: 2.25rem;
  margin-bottom: 1.25rem;
  border: 2px solid rgba(255, 94, 20, 0.2);
}

.lock-gate-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.lock-gate-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.gate-existing-box {
  background: rgba(255, 94, 20, 0.06);
  border: 1px solid rgba(255, 94, 20, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.gate-existing-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.gate-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.gate-divider::before,
.gate-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.gate-divider span {
  padding: 0 0.75rem;
}

.lock-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lock-gate-section {
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: left;
  transition: all var(--transition-fast);
}

.lock-gate-section:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-sm);
}

.lock-gate-section.admin-gate-section {
  border-color: #E0E7FF;
  background: #FAFBFF;
}

.lock-gate-section.trainer-gate-section {
  border-color: #FED7AA;
  background: #FFFDF9;
}

.gate-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.gate-section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0 0 1rem 0;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font-size: 0.98rem;
}

.lock-gate-footer-note {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}


/* === REALIZACE: tři panely (tento týden / příští týden / resty) podle návrhu "new design/Designer (2).png" === */
#realizationPanels { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 1.25rem; align-items: start; }
.rz-panel { --rz: #2563EB; --rz-soft: #EFF6FF; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.1rem; }
.rz-next { --rz: #059669; --rz-soft: #ECFDF5; }
.rz-rest { --rz: #DC2626; --rz-soft: #FEF2F2; border-color: #FECACA; background: linear-gradient(180deg, #FFF5F5 0, var(--bg-surface) 7rem); }
.rz-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.rz-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 0.6rem; background: var(--rz-soft); font-size: 1.25rem; flex: none; }
.rz-title { flex: 1; min-width: 0; }
.rz-title strong { font-size: 1.15rem; }
.rz-badge { padding: 0.3rem 0.7rem; border-radius: 0.5rem; background: #F1F5F9; color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap; }
.rz-rest .rz-badge { background: #FEE2E2; color: #DC2626; font-weight: 600; }
.rz-table-wrap { overflow-x: auto; }
.rz-table { margin-top: 0; }
.rz-table th { font-size: 0.72rem; white-space: nowrap; }
.rz-table th, .rz-table td { padding: 0.6rem 0.45rem; }
.rz-table td { font-size: 0.82rem; }
.rz-sub { font-size: 0.8rem; color: var(--text-muted); }
.rz-nowrap { white-space: nowrap; }
.rz-late { color: #DC2626; }
.rz-empty { text-align: center; color: var(--text-muted); }
.rz-pill { padding: 0.2rem 0.65rem; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; }
.rz-pill-planned { background: #FFF7ED; color: #C2410C; }
.rz-pill-done { background: #ECFDF5; color: #047857; }
.rz-pill-pending { background: #FEF3C7; color: #92400E; }
.rz-pill-late { background: #FEF2F2; color: #DC2626; }
.rz-filter summary { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; cursor: pointer; font-weight: 600; }
.rz-filter[open] summary { margin-bottom: 0.75rem; }
.rz-panel:not(.expanded) [data-extra] { display: none; }
.rz-course-head { cursor: pointer; }
.rz-course-head td:first-child strong::before { content: "▸ "; }
.rz-course.open .rz-course-head td:first-child strong::before { content: "▾ "; }
.rz-course:not(.open) .rz-day { display: none; }
.rz-day td { background: var(--bg-surface-alt); }
.rz-panel.expanded .rz-more { display: none; }
.rz-more { margin-top: 0.9rem; padding: 0.5rem 0.9rem; border: 1px solid var(--rz); border-radius: 0.5rem; background: var(--rz-soft); color: var(--rz); font-weight: 600; font-size: 0.88rem; cursor: pointer; }

.rz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.rz-tile { --rz: #F97316; --rz-soft: #FFF7ED; display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; text-align: left; font: inherit; cursor: pointer; background: linear-gradient(90deg, var(--rz-soft), var(--bg-surface)); border: 1px solid color-mix(in srgb, var(--rz) 25%, transparent); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.rz-tile-green { --rz: #059669; --rz-soft: #ECFDF5; }
.rz-tile-purple { --rz: #7C3AED; --rz-soft: #F5F3FF; }
.rz-tile-blue { --rz: #2563EB; --rz-soft: #EFF6FF; }
.rz-tile > span:nth-child(2) { flex: 1; display: grid; }
.rz-tile strong { font-size: 1.1rem; color: var(--text-primary); }
.rz-tile-blue strong { color: var(--rz); }
.rz-tile small { font-size: 0.85rem; color: var(--text-secondary); }
.rz-tile-icon { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--rz, #FFF7ED); color: #fff; font-size: 1.4rem; flex: none; }
.rz-tile-arrow { color: var(--rz); font-size: 1.8rem; line-height: 1; }
.rz-tile:hover:not(:disabled) { box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.08)); }
.rz-tile:disabled { opacity: 0.55; cursor: default; }
.rz-tip { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; padding: 0.9rem 1.25rem; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); color: var(--text-secondary); }
.rz-tip strong { color: var(--text-primary); }
.rz-tip .rz-tile-icon { width: 2.6rem; height: 2.6rem; font-size: 1.2rem; }

/* === MASKOT: nápověda v pravém dolním rohu (mascot.js) === */
#mascot { position: fixed; right: 1rem; bottom: 1rem; z-index: 900; width: 128px; pointer-events: none; }
#mascot[hidden], body.role-guest #mascot, body.role-guest #btnMascotToggle { display: none; }
.mascot-dog { display: block; width: 128px; height: 128px; }
.mascot-bubble { position: absolute; right: 0; bottom: calc(100% + 0.5rem); width: 260px; padding: 0.7rem 0.9rem; border: 1px solid var(--border-subtle); border-radius: 0.75rem; background: var(--bg-surface); box-shadow: var(--shadow-sm); color: var(--text-primary); font-size: 0.88rem; line-height: 1.4; }
.mascot-close { position: absolute; top: 0; right: 0; width: 1.5rem; height: 1.5rem; border: 1px solid var(--border-subtle); border-radius: 50%; background: var(--bg-surface); color: var(--text-secondary); font-size: 1rem; line-height: 1; cursor: pointer; pointer-events: auto; }
.mascot-toggle-off { opacity: 0.5; }
@media (hover: none) { #mascot, #btnMascotToggle { display: none; } }

/* Přehled všech kurzů: sbalení po ID */
.course-row { cursor: pointer; }
.course-row:hover td { background: var(--cepa-orange-light); }
.course-day td { background: var(--bg-surface-alt); }
#alertBanner { margin-bottom: 1rem; padding: 0.75rem 1rem; border: 2px solid #DC2626; border-radius: var(--radius-lg); background: #FEF2F2; color: #B91C1C; }
#alertBanner[hidden] { display: none; }
.alert-item { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.3rem 0; font-weight: 600; }
.mascot-bubble-alarm { border: 2px solid #DC2626; background: #FEF2F2; color: #B91C1C; font-weight: 600; }
.mascot-close[hidden] { display: none; }
.mascot-demo { position: absolute; top: 0; left: 0; width: 1.5rem; height: 1.5rem; border: 1px solid var(--border-subtle); border-radius: 50%; background: var(--bg-surface); color: var(--cepa-orange); font-size: 0.7rem; line-height: 1; cursor: pointer; pointer-events: auto; }
.rz-alert { display: block; margin-top: 0.3rem; font-size: 0.8rem; }
.rz-alert-btn { padding: 0.15rem 0.5rem; border: 1px solid #DC2626; border-radius: 0.4rem; background: #FEF2F2; color: #B91C1C; font-size: 0.78rem; cursor: pointer; }
.training-id-search { width: 4.5rem; flex-shrink: 0; padding: 0.15rem 0.35rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm, 0.25rem); background: var(--bg-surface); font: inherit; font-size: 0.8125rem; }
body.role-guest .training-id-search { display: none; }
.rz-week-sub { background: var(--rz-soft); color: var(--rz); font-weight: 700; font-size: 0.8rem; }
.mascot-bubble-left { right: auto; left: 0; }
.customer-manual { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 0.75rem 1rem; margin-bottom: 1rem; }
.customer-manual summary { cursor: pointer; font-weight: 700; }
.customer-manual h4 { margin: 1rem 0 0.4rem; }
.customer-manual li { margin-bottom: 0.3rem; }
.course-card { max-width: 1100px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.5rem; }
.course-card-table { width: 100%; border-collapse: collapse; }
.course-card-table th { text-align: left; font-weight: 600; color: var(--text-secondary); padding: 0.35rem 0.75rem 0.35rem 0; white-space: nowrap; vertical-align: top; width: 1%; }
.course-card-table td { padding: 0.35rem 0; }
.course-chat-list { max-height: 320px; overflow-y: auto; margin-bottom: 0.75rem; }
.course-chat-msg { padding: 0.5rem 0.75rem; margin-bottom: 0.5rem; border-radius: 8px; border-left: 3px solid var(--border-subtle); background: var(--bg-surface-alt); font-size: 0.9rem; }
.course-chat-customer { border-left-color: #2563EB; }
.course-chat-trainer { border-left-color: var(--primary-orange); }
.course-chat-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.participants-table { border-collapse: collapse; font-size: 0.8rem; }
.participants-table th { text-align: left; padding: 0.25rem; white-space: nowrap; color: var(--text-secondary); }
.participants-table td { padding: 0.15rem; }
.participants-table input { padding: 0.25rem 0.4rem; font-size: 0.8rem; min-width: 90px; }
.chats-row { cursor: pointer; }
.chats-row:hover { background: var(--bg-surface-alt); }
.chats-author { font-size: 0.85rem; }
.chats-preview { font-size: 0.85rem; color: var(--text-muted); max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chats-unread { background: rgba(37, 99, 235, 0.08); box-shadow: inset 4px 0 0 #2563EB; }
.chats-unread td, .chats-unread .chats-preview { font-weight: 700; color: var(--text-primary); }
.chats-overdue { box-shadow: inset 4px 0 0 #DC2626; }
.chats-overdue td:last-child { color: #DC2626; font-weight: 700; }
.mascot-bubble { pointer-events: auto; }
.mascot-tour-next { margin-left: 0.25rem; padding: 0.15rem 0.6rem; border: 0; border-radius: 999px; background: var(--primary-orange, #FF5E14); color: #fff; font-weight: 700; cursor: pointer; }
.mascot-spot { outline: 3px solid var(--primary-orange, #FF5E14); outline-offset: 3px; border-radius: 6px; position: relative; z-index: 2; }
@media (max-width: 700px) {
  .course-card { padding: 0.9rem; border-radius: 0; margin: 0 -0.75rem; }
  .course-card-table th, .course-card-table td { display: block; width: auto; padding: 0.15rem 0; }
  .course-card-table tr { display: block; padding: 0.4rem 0; border-bottom: 1px solid var(--border-subtle); }
  .course-chat-list { max-height: 55vh; }
  #courseChatText { font-size: 16px; } /* iOS nezoomuje do pole */
  .chats-preview { max-width: 60vw; }
  .participants-table input { min-width: 120px; }
  .view-tabs-container .tabs-group { overflow-x: auto; flex-wrap: nowrap; }
}
.course-chat-file { margin: 0.35rem 0.35rem 0 0; padding: 0.2rem 0.6rem; font-size: 0.8rem; }
.participants-table .is-invalid { border-color: #EF4444; background: #FEF2F2; }
.chats-owner { min-width: 130px; padding: 0.2rem 0.4rem; font-size: 0.8rem; }
.display-pref { padding: 0.35rem 0.6rem; font-weight: 700; }
/* Tmavý režim: inverze celé stránky (barvy jsou i natvrdo v šablonách), obrázky a grafy se vrací do původních barev */
html.theme-dark { filter: invert(0.9) hue-rotate(180deg); background: #fff; }
html.theme-dark img, html.theme-dark video, html.theme-dark canvas, html.theme-dark iframe { filter: invert(1) hue-rotate(180deg); }
html.font-big body { zoom: 1.15; }
.col-filter-row th { padding: 0.25rem 0.3rem; }
.col-filter-row .col-filter { padding: 0.25rem 0.4rem; font-size: 0.78rem; min-width: 3.5rem; }
.order-box { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1rem; margin-bottom: 1rem; }
.order-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem 1rem; }
.order-grid label, .order-day label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--text-muted); gap: 0.2rem; }
.order-grid .wide { grid-column: 1 / -1; }
.order-day { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.order-topics { display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 260px; overflow-y: auto; }
.order-topics button { font-size: 0.8rem; padding: 0.25rem 0.6rem; }

/* Moje školení: měsíční kalendář */
.cal-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.cal-grid > div { background: var(--bg-surface); min-height: 5.5rem; padding: 0.25rem; font-size: 0.75rem; }
.cal-grid .cal-dow { min-height: 0; font-weight: 700; text-align: center; color: var(--text-secondary); }
.cal-grid .cal-out { opacity: 0.4; }
.cal-grid .cal-today { outline: 2px solid var(--primary-orange); outline-offset: -2px; }
.cal-ev { display: block; margin-top: 0.2rem; padding: 0.15rem 0.3rem; border-radius: 4px; background: #FFF7ED; color: #C2410C; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.done { background: #ECFDF5; color: #047857; }
@media (max-width: 640px) { .cal-grid > div { min-height: 3.5rem; font-size: 0.65rem; } }

/* Menu: jedna posuvná lišta záložek (prstem / kolečkem), aktivní záložka se sama posune do středu */
.view-tabs-container .tabs-group { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scroll-snap-type: x proximity; scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%); padding: 0.25rem 1rem; }
.view-tabs-container .tabs-group::-webkit-scrollbar { display: none; }
.view-tabs-container .tab-btn { flex: none; white-space: nowrap; scroll-snap-align: center; border-radius: 999px; }
.view-tabs-container .tab-btn.active { background: var(--cepa-orange); color: #fff; }
.filter-actions-bar .tabs-group .tab-btn { border-radius: 999px; white-space: nowrap; }
/* Moje školení: dlaždice */
.portal-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.portal-stats:empty { display: none; }
.stat-tile { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.9rem 1rem; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: var(--transition-fast); }
.stat-tile.clickable { cursor: pointer; }
.stat-tile.clickable:hover { border-color: var(--cepa-orange); transform: translateY(-2px); }
.stat-tile:first-child { background: linear-gradient(135deg, #FFF7ED, var(--bg-surface)); border-color: #FDBA74; }
.stat-icon { font-size: 1.5rem; line-height: 1; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); font-weight: 700; }
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }
.stat-sub { font-size: 0.8rem; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 640px) { .portal-stats { grid-template-columns: 1fr 1fr; } .portal-stats .stat-tile:first-child { grid-column: 1 / -1; } }
