/* ==========================================================================
   MobiRoute · Apple iOS 18 System Design
   Navrženo pro iPhone, čistý Apple ekosystém (Light & Dark CarPlay)
   ========================================================================== */

:root {
  /* Apple iOS 18 System Colors */
  --ios-blue: #007aff;
  --ios-green: #34c759;
  --ios-indigo: #5856d6;
  --ios-orange: #ff9500;
  --ios-pink: #ff2d55;
  --ios-purple: #af52de;
  --ios-red: #ff3b30;
  --ios-teal: #5ac8fa;
  --ios-yellow: #ffcc00;

  /* B2B Entreprise & White-label Brand Colors */
  --brand-color: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-light: rgba(37, 99, 235, 0.08);
  --brand-border: rgba(37, 99, 235, 0.25);
  --accent: #2563eb;

  /* Světlý režim (iOS System Light) */
  --bg-system: #f2f2f7;
  --bg-grouped: #f2f2f7;
  --bg-card: #ffffff;
  --bg-secondary: rgba(118, 118, 128, 0.12);
  --separator: rgba(60, 60, 67, 0.18);
  --separator-opaque: #c6c6c8;
  --label-primary: #000000;
  --label-secondary: #8e8e93;
  --label-tertiary: #c7c7cc;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

  /* Barvy výkazu MobiFrance */
  --mobi-blue-header: #85b8cb;
  --mobi-orange-banner: #f8af7e;
  --chip-gazole: #dcfce7;
  --chip-lavage: #bae6fd;
  --chip-parents: #ffedd5;
  --chip-absent: #fee2e2;
  --chip-deplacement: #fef9c3;
  --chip-ns: #f3e8ff;
  --chip-stage: #ccfbf1;

  --font-ios: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ==========================================================================
   TÉMA 2 : APPLE iOS 18 DARK (OLED Black & CarPlay)
   ========================================================================== */
body.theme-ios-dark {
  --bg-system: #000000;
  --bg-grouped: #000000;
  --bg-card: #1c1c1e;
  --bg-secondary: #2c2c2e;
  --separator: rgba(84, 84, 88, 0.36);
  --separator-opaque: #38383a;
  --label-primary: #ffffff;
  --label-secondary: #98989d;
  --label-tertiary: #48484a;
  --card-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
  --ios-blue: #0a84ff;
  --ios-green: #30d158;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: clip;
  width: 100%;
  max-width: 100vw;
  overscroll-behavior-x: none !important;
  overscroll-behavior-y: auto;
}

body {
  font-family: var(--font-ios);
  background-color: var(--bg-system);
  color: var(--label-primary);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--safe-bottom) + 70px);
}

/* ==========================================================================
   APPLE TOP NAVIGATION (Navigační lišta ve stylu iOS)
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  padding: calc(var(--safe-top) + 10px) 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0.5px solid var(--separator);
}

body.theme-ios-dark .top-nav {
  background: rgba(28, 28, 30, 0.85);
  border-bottom: 0.5px solid var(--separator);
}

.nav-brand {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.brand-logo {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--label-primary);
  white-space: nowrap;
}

.brand-accent {
  color: var(--ios-blue);
}

.top-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
}

/* PILULKA PRO CLOUD: 🟢 Cloud */
.cloud-pill-badge,
.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  border: 1px solid #22c55e;
  background: #f0fdf4;
  color: #15803d;
  box-shadow: none;
}

.cloud-pill-badge.offline,
.badge-status.offline {
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #b45309;
  box-shadow: none;
}

/* Tmavý režim pro pilulku cloudu */
body.dark-mode .cloud-pill-badge,
body[data-theme="dark"] .cloud-pill-badge {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
}

/* ==========================================================================
   ROZBALOVACÍ TLAČÍTKO JAZYKA (Čtvercová dlaždice se zaoblenými rohy bez ikon)
   ========================================================================== */
.lang-switcher-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1000;
  margin-left: 4px;
}

.btn-lang-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 43px;
  height: 43px;
  min-width: 43px;
  min-height: 43px;
  max-width: 43px;
  max-height: 43px;
  padding: 0;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-sizing: border-box;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.btn-lang-switcher:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-lang-switcher:active {
  transform: scale(0.95);
}

.lang-code {
  letter-spacing: 0.04em;
  font-weight: 800;
  font-size: 0.82rem;
  color: #0f172a;
  line-height: 1;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 84px;
  width: 84px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10000;
  animation: langDropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes langDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-dropdown-menu.hidden {
  display: none !important;
}

.lang-menu-header {
  padding: 6px 10px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #f1f5f9;
}

.lang-menu-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 320px;
  overflow-y: auto;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
  text-align: left;
}

.lang-menu-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.lang-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-item-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.lang-item-name {
  font-size: 0.82rem;
}

.lang-item-code {
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lang-item-check {
  display: none;
  color: #2563eb;
  font-weight: 900;
  font-size: 0.88rem;
}

.lang-menu-item.is-active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.lang-menu-item.is-active .lang-item-code {
  color: #3b82f6;
}

.lang-menu-item.is-active .lang-item-check {
  display: inline-block;
}

/* iOS Toggle Switch */
.form-row-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.ios-switch input:checked + .ios-slider {
  background-color: #34c759;
}

.ios-switch input:checked + .ios-slider:before {
  transform: translateX(20px);
}



/* ==========================================================================
   APPLE NATIVE BOTTOM TAB BAR (Plovoucí frosted sklo)
   ========================================================================== */
.ios-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(54px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-top: 0.5px solid var(--separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 16px var(--safe-bottom);
  z-index: 1000;
}

body.theme-ios-dark .ios-tab-bar {
  background: rgba(28, 28, 30, 0.92);
  border-top: 0.5px solid var(--separator);
}

.ios-tab-item {
  flex: 1;
  max-width: 110px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--label-secondary);
  cursor: pointer;
  padding: 2px 0;
  transition: transform 0.1s ease, color 0.15s ease;
}

.ios-tab-item:active {
  transform: scale(0.93);
}

.ios-tab-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.ios-tab-text {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.ios-tab-item.active {
  color: var(--ios-blue);
}

.ios-tab-item.active .ios-tab-text {
  font-weight: 700;
}

/* ==========================================================================
   OBSAH A ZÁLOŽKY
   ========================================================================== */
.tab-view {
  display: none;
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.tab-view.active {
  display: block;
}

/* ==========================================================================
   VUE 1 : REŽIM VOLANT (APPLE COCKPIT)
   ========================================================================== */

/* Apple Segmented Controls pro Dny v týdnu */
.shift-selector-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 8px 10px;
  border: 0.5px solid var(--separator);
  box-shadow: var(--card-shadow);
  margin-bottom: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shift-selector-card.collapsed {
  padding: 10px 14px;
  margin-bottom: 12px;
}

.shift-selector-card.collapsed .card-collapsible-body {
  display: none;
}

.card-collapse-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  user-select: none;
  border-radius: 12px;
  padding: 4px 6px 0;
  transition: opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.shift-selector-card.collapsed .card-collapse-header {
  padding: 2px 6px;
}

.card-collapse-header:active {
  opacity: 0.65;
}

.card-toggle-btn {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary);
  border: none;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--label-secondary);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

.card-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--label-primary);
}

body.theme-ios-dark .card-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.card-toggle-btn .chevron-down {
  display: none;
}

.card-toggle-btn .chevron-up {
  display: block;
}

.collapsible-card.collapsed .card-toggle-btn .chevron-down {
  display: block;
}

.collapsible-card.collapsed .card-toggle-btn .chevron-up {
  display: none;
}

.day-pills {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 2.5px;
  gap: 2px;
  margin-bottom: 5px;
}

.day-pill {
  flex: 1;
  padding: 8px 1px;
  background: transparent;
  border: none;
  border-radius: 9.5px;
  font-family: var(--font-ios);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--label-primary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-pill.active {
  background: var(--bg-card);
  color: var(--label-primary);
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
}

body.theme-ios-dark .day-pill.active {
  background: #3a3a3c;
  color: #ffffff;
}

.day-pill.has-data::after {
  content: ' •';
  color: var(--ios-green);
  font-weight: bold;
}

/* Apple Segmented Control pro Ráno / Odpoledne */
.shift-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 2.5px;
  gap: 2px;
  margin-bottom: 10px;
}

.shift-btn {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 9.5px;
  background: transparent;
  font-family: var(--font-ios);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--label-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.shift-btn.active {
  background: var(--ios-blue, #007aff) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0, 122, 255, 0.35);
}

body.theme-ios-dark .shift-btn.active {
  background: var(--ios-blue, #0a84ff) !important;
  color: #ffffff !important;
}

.week-header-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 0;
}

.btn-week-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--separator, #e2e8f0);
  background: var(--bg-card, #ffffff);
  color: var(--label-primary, #1e293b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

body.theme-ios-dark .btn-week-step {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.btn-week-step:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: scale(1.05);
}

.btn-week-step:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

.week-title-badge-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 125px;
}

#current-date-display {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--label-primary, #1e293b);
  letter-spacing: 0.2px;
  line-height: 1.15;
}

.week-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1.5px 7px;
  border-radius: 999px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.week-status-badge.current {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #86efac;
}

body.theme-ios-dark .week-status-badge.current {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.week-status-badge.past {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

body.theme-ios-dark .week-status-badge.past {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.week-status-badge.future {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

body.theme-ios-dark .week-status-badge.future {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.btn-week-today-jump {
  font-size: 0.72rem;
  font-weight: 700;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 3px 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-week-today-jump:hover {
  background: #1d4ed8;
}

.btn-week-today-jump:active {
  transform: scale(0.95);
}

/* Varianta B: Segmentový přepínač týdnů pro řidiče */
.driver-week-segment-bar {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 3px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 3px;
}

body.theme-ios-dark .driver-week-segment-bar {
  background: #1e293b;
  border-color: #334155;
}

.week-segment-btn {
  border: none;
  border-radius: 11px;
  padding: 5px 3px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 38px;
}

body.theme-ios-dark .week-segment-btn {
  color: #94a3b8;
}

.week-segment-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

body.theme-ios-dark .week-segment-btn.active {
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.week-segment-btn .tab-title {
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
}

/* Zmenšení zeleného puntíku 🟢 u nápisu Tento týden */
.week-dot-icon {
  font-size: 0.55rem;
  line-height: 1;
  vertical-align: middle;
}

.week-segment-btn .tab-dates {
  font-size: 0.70rem;
  font-weight: 600;
  color: #2563eb;
  line-height: 1.2;
  white-space: nowrap;
}

body.theme-ios-dark .week-segment-btn .tab-dates {
  color: #60a5fa;
}

.week-segment-btn:active {
  transform: scale(0.97);
}

.vehicle-badge {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--label-primary);
  white-space: nowrap;
  flex: 1 1 0;
  display: inline-flex;
  justify-content: flex-end;
  min-width: 0;
}

/* HERO KARTA ZASTÁVKY (APPLE MAPS / CARPLAY STYL) */
.active-stop-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 6px 12px;
  border: 0.5px solid var(--separator);
  box-shadow: var(--card-shadow);
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.active-stop-name {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--label-primary);
  line-height: 1.2;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.active-stop-hint {
  font-size: 0.82rem;
  color: var(--label-secondary);
  margin-bottom: 16px;
}

/* BLOKY ČASU A KILOMETRŮ */
.driver-action-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.action-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--label-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: block;
}

.time-action-box, .km-action-box {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 12px;
  border: 0.5px solid var(--separator);
}

.time-display-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.time-input, .km-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-ios);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  border: none;
  border-radius: 12px;
  padding: 8px 4px;
  background: var(--bg-card);
  color: var(--label-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Zelené tlačítko "MAINTENANT" (⚡ Nyní v Apple stylu) */
.btn-now {
  flex: 1.1;
  min-width: 0;
  height: 54px;
  border: none;
  background: var(--ios-green);
  color: white;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(52, 199, 89, 0.35);
  transition: transform 0.1s active, opacity 0.2s ease;
  white-space: nowrap;
}

.btn-now:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.icon-zap {
  font-size: 1.3rem;
}

/* Kilometráž (Čisté a přehledné pole pro tachometr) */
.km-input-wrapper {
  display: flex;
  width: 100%;
}

.km-input-wrapper .km-input {
  width: 100%;
}

/* MŘÍŽKA DLAŽDIC SE STEJNOU DÉLKOU, VÝŠKOU A ZAOBLENÝMI ROHY */
.status-tags-selector {
  margin-bottom: 18px;
}

.status-tags-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--label-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.status-tile {
  height: 58px;
  border-radius: 14px;
  border: 1px solid var(--separator);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 6px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.status-tile:active {
  transform: scale(0.95);
}

.status-tile.selected {
  outline: 2.5px solid var(--ios-blue);
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

.tile-code {
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: -0.2px;
  color: var(--label-primary);
  line-height: 1.1;
}

.tile-sub {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--label-secondary);
  line-height: 1.1;
}

/* Oficiální barevné akcenty pro dlaždice podle jízdního spisu MobiFrance */
.status-tile[data-status="none"] {
  background: #ffffff;
  border-color: #007aff;
}
.status-tile[data-status="none"] .tile-code { color: #000000; }
.status-tile[data-status="none"] .tile-sub { color: #1c1c1e; }

/* Élève absent (Červená) */
.tile-x, .cell-status-x, .chip-x, .cell-status-absent, .chip-absent {
  background-color: #fee2e2 !important;
  border-color: #fca5a5;
  color: #991b1b !important;
}
.tile-x .tile-code { color: #b91c1c; }
.tile-x .tile-sub, .chip-x, .chip-absent { color: #991b1b !important; }

/* Par parents (Teplá broskvová / karamel) */
.tile-p, .cell-status-p, .chip-p, .cell-status-parents, .chip-parents {
  background-color: #ffedd5 !important;
  border-color: #fed7aa;
  color: #9a3412 !important;
}
.tile-p .tile-code { color: #c2410c; }
.tile-p .tile-sub, .chip-p, .chip-parents { color: #9a3412 !important; }

/* Gazole & Essence (Mátová / smaragdová zelená) */
.tile-gazole, .cell-status-gazole, .chip-gazole, .cell-status-essence, .chip-essence {
  background-color: #dcfce7 !important;
  border-color: #86efac;
  color: #166534 !important;
}
.tile-gazole .tile-code { color: #15803d; }
.tile-gazole .tile-sub, .chip-gazole, .chip-essence { color: #166534 !important; }

/* Lavage (Nebeská modrá) */
.tile-lavage, .cell-status-lavage, .chip-lavage {
  background-color: #bae6fd !important;
  border-color: #7dd3fc;
  color: #0369a1 !important;
}
.tile-lavage .tile-code { color: #0284c7; }
.tile-lavage .tile-sub, .chip-lavage { color: #0369a1 !important; }

/* Trajet à vide / Inutile (Slunečně žlutá / oranžovo-červená) */
.tile-d, .cell-status-d, .chip-d, .cell-status-inutile, .chip-inutile {
  background-color: #fef9c3 !important;
  border-color: #fef08a;
  color: #854d0e !important;
}
.tile-d .tile-code { color: #a16207; }
.tile-d .tile-sub, .chip-d, .chip-inutile { color: #854d0e !important; }

/* Sans école (Levandulová fialová) */
.tile-ns, .cell-status-ns, .chip-ns, .cell-status-sans-ecole, .chip-sans-ecole {
  background-color: #f3e8ff !important;
  border-color: #d8b4fe;
  color: #6b21a8 !important;
}
.tile-ns .tile-code { color: #7e22ce; }
.tile-ns .tile-sub, .chip-ns, .chip-sans-ecole { color: #6b21a8 !important; }

/* En stage (Svěží mentolová) */
.tile-s, .cell-status-s, .chip-s, .cell-status-en-stage, .chip-en-stage {
  background-color: #ccfbf1 !important;
  border-color: #99f6e4;
  color: #0f766e !important;
}
.tile-s .tile-code { color: #0f766e; }
.tile-s .tile-sub, .chip-s, .chip-en-stage { color: #115e59 !important; }

/* Tmavý režim pro dlaždice */
body.theme-ios-dark .status-tile {
  background: #1c1c1e;
  border-color: #2c2c2e;
}
body.theme-ios-dark .status-tile[data-status="none"] {
  background: #1c1c1e;
  border-color: #0a84ff;
}
body.theme-ios-dark .status-tile[data-status="none"] .tile-code { color: #ffffff; }
body.theme-ios-dark .status-tile[data-status="none"] .tile-sub { color: #aeaeb2; }

body.theme-ios-dark .tile-x { background-color: rgba(239, 68, 68, 0.25) !important; border-color: #ef4444; }
body.theme-ios-dark .tile-x .tile-code { color: #fca5a5; }
body.theme-ios-dark .tile-x .tile-sub { color: #fecaca; }

body.theme-ios-dark .tile-p { background-color: rgba(59, 130, 246, 0.25) !important; border-color: #3b82f6; }
body.theme-ios-dark .tile-p .tile-code { color: #93c5fd; }
body.theme-ios-dark .tile-p .tile-sub { color: #bfdbfe; }

body.theme-ios-dark .tile-gazole { background-color: rgba(34, 197, 94, 0.25) !important; border-color: #22c55e; }
body.theme-ios-dark .tile-gazole .tile-code { color: #86efac; }
body.theme-ios-dark .tile-gazole .tile-sub { color: #bbf7d0; }

body.theme-ios-dark .tile-lavage { background-color: rgba(14, 165, 233, 0.25) !important; border-color: #0ea5e9; }
body.theme-ios-dark .tile-lavage .tile-code { color: #7dd3fc; }
body.theme-ios-dark .tile-lavage .tile-sub { color: #bae6fd; }

body.theme-ios-dark .tile-d { background-color: #2c2c2e !important; border-color: #48484a; }
body.theme-ios-dark .tile-d .tile-code { color: #e2e8f0; }
body.theme-ios-dark .tile-d .tile-sub { color: #cbd5e1; }

body.theme-ios-dark .tile-ns { background-color: rgba(168, 85, 247, 0.25) !important; border-color: #a855f7; }
body.theme-ios-dark .tile-ns .tile-code { color: #d8b4fe; }
body.theme-ios-dark .tile-ns .tile-sub { color: #e9d5ff; }

body.theme-ios-dark .tile-s { background-color: rgba(139, 92, 246, 0.25) !important; border-color: #8b5cf6; }
body.theme-ios-dark .tile-s .tile-code { color: #c4b5fd; }
body.theme-ios-dark .tile-s .tile-sub { color: #ddd6fe; }


.inputs-bypassed {
  opacity: 0.4;
  pointer-events: none;
}

/* Potvrzovací lišta */
.validation-bar {
  display: flex;
  gap: 10px;
}

.btn-prev-stop {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 0.5px solid var(--separator);
  background: var(--bg-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--label-primary);
}

.btn-clear-stop {
  height: 56px;
  padding: 0 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 59, 48, 0.3);
  background: rgba(255, 59, 48, 0.08);
  color: #dc2626;
  font-family: var(--font-ios);
  font-weight: 750;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.btn-clear-stop:active {
  transform: scale(0.96);
  background: rgba(255, 59, 48, 0.18);
}

body.theme-ios-dark .btn-clear-stop {
  background: rgba(255, 69, 58, 0.16);
  border-color: rgba(255, 69, 58, 0.4);
  color: #ff6961;
}

/* ==========================================================================
/* ==========================================================================
   BARRE DE CONTRÔLE : 3 IDENTICKÉ DLAŽDICE (SMAZAT · ČAS · KM)
   ========================================================================== */
.control-dock-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  background: var(--bg-card, #ffffff);
  border: 1.5px solid var(--separator, #cbd5e1);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  width: 100%;
}

body.theme-ios-dark .control-dock-bar {
  background: #1c1c1e;
  border-color: #38383a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dock-3tile {
  height: 52px;
  border-radius: 12px;
  border: 1.5px solid var(--separator, #cbd5e1);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 3px 2px;
  margin: 0;
  user-select: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-width: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease;
}

/* 1. DLAŽDICE: PŘEPÍNAČ SMĚN SE 2 FUNKCEMI UVNITŘ */
.dock-3tile.tile-shift-split {
  padding: 3px !important;
  background: #e2e8f0 !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 3px !important;
  cursor: default !important;
}

body.theme-ios-dark .dock-3tile.tile-shift-split {
  background: #2c2c2e !important;
  border-color: #38383a !important;
}

.dock-sub-shift-btn {
  flex: 1 1 0 !important;
  height: 100% !important;
  border: none !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #475569 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  gap: 1px !important;
  padding: 0 !important;
  min-width: 0 !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
}

body.theme-ios-dark .dock-sub-shift-btn {
  color: #94a3b8 !important;
}

.dock-sub-shift-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}

.dock-sub-shift-btn.active .sub-shift-txt {
  color: #ffffff !important;
}

body.theme-ios-dark .dock-sub-shift-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.5) !important;
}

body.theme-ios-dark .dock-sub-shift-btn.active .sub-shift-txt {
  color: #ffffff !important;
}

.sub-shift-icon {
  font-size: 0.95rem !important;
  line-height: 1 !important;
}

.sub-shift-txt {
  font-size: 0.60rem !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
}

/* 2. DLAŽDICE: ČAS & 3. DLAŽDICE: KM */
.dock-3tile.tile-data {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3px 2px;
}

.dock-data-mini-lbl {
  font-size: 0.60rem !important;
  font-weight: 800 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  line-height: 1 !important;
  margin-bottom: 2px !important;
  text-align: center !important;
}

body.theme-ios-dark .dock-data-mini-lbl {
  color: #94a3b8 !important;
}

body.theme-ios-dark .dock-3tile.tile-data {
  background: #2c2c2e;
  border-color: #38383a;
  color: #f8fafc;
}

.dock-3tile-input,
#dock-time-input,
#dock-km-input {
  width: 100% !important;
  height: 24px !important;
  border: none !important;
  background: transparent !important;
  text-align: center !important;
  font-family: inherit !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: inherit !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: text !important;
  box-shadow: none !important;
  line-height: 24px !important;
  letter-spacing: -0.02em !important;
}

/* ZÁMEK POTVRZENÉ ZASTÁVKY V OVLÁDACÍ LIŠTĚ */
.control-dock-bar.is-locked {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
}

body.theme-ios-dark .control-dock-bar.is-locked {
  background: #064e3b !important;
  border-color: #059669 !important;
}

.dock-locked-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.dock-locked-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-locked-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #22c55e;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.dock-locked-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #15803d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.theme-ios-dark .dock-locked-title {
  color: #a7f3d0;
}

.dock-locked-metrics {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--font-mono, monospace);
}

body.theme-ios-dark .dock-locked-metrics {
  color: #f8fafc;
}

.dock-btn-unlock {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.1s ease, background 0.15s ease;
  flex-shrink: 0;
}

.dock-btn-unlock:active {
  transform: scale(0.96);
  background: #f1f5f9;
}

body.theme-ios-dark .dock-btn-unlock {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

/* Obě tlačítka mají PŘESNĚ PEVNÝ TVAR A MENŠÍ KOMPAKTNÍ VELIKOST */
.dock-btn {
  width: 84px;
  height: 35px;
  border-radius: 10px;
  font-family: var(--font-ios);
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s ease, opacity 0.15s ease;
  letter-spacing: -0.2px;
  user-select: none;
  box-sizing: border-box;
}

.dock-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.dock-btn:active {
  transform: scale(0.96);
}

.dock-btn.btn-effacer {
  background: #ef4444;
  color: #ffffff;
  border: 1.5px solid #dc2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

body.theme-ios-dark .dock-btn.btn-effacer {
  background: #dc2626;
  color: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.dock-btn.btn-valider {
  background: var(--ios-green);
  color: #ffffff;
  border: 1.5px solid #15803d;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

body.theme-ios-dark .dock-btn.btn-valider {
  background: #30d158;
  color: #000000;
  border-color: #248a3d;
  box-shadow: 0 2px 6px rgba(48, 209, 88, 0.3);
}

/* Střed: Čas a kilometry – čistá čísla bez rámečků/dlaždic */
.dock-center-metrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  line-height: 1.15;
  padding: 0 4px;
  min-width: 0;
}

/* Čistý text bez dlaždic a bez modrého ohraničení */
.dock-time-pill,
.dock-km-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
}

.dock-time-pill:hover,
.dock-time-pill:focus-within,
.dock-km-pill:hover,
.dock-km-pill:focus-within {
  border: none;
  box-shadow: none;
  outline: none;
}

.dock-time-input {
  border: none;
  background: transparent;
  font-family: var(--font-ios);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--label-primary);
  letter-spacing: -0.4px;
  text-align: center;
  outline: none;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  padding: 0;
  margin: 0;
  width: 64px;
  caret-color: var(--label-primary);
}

.dock-km-pill {
  gap: 3px;
  margin-top: 1px;
}

.dock-km-input {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--label-primary);
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 68px;
  padding: 0;
  margin: 0;
  outline: none;
  cursor: text;
  caret-color: var(--label-primary);
}

.dock-km-input::selection,
.dock-time-input::selection,
.dock-km-input::-webkit-selection,
.dock-time-input::-webkit-selection,
.dock-km-input::-moz-selection,
.dock-time-input::-moz-selection {
  background: transparent;
  color: inherit;
}

.dock-km-unit {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--label-secondary);
  user-select: none;
}

/* INSET GROUPED LIST PRO ČASOVOU OSU */
.stops-timeline-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 8px 8px 16px 8px;
  border: 0.5px solid var(--separator);
  box-shadow: var(--card-shadow);
}

.completion-stats {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ios-blue);
  background: rgba(0, 122, 255, 0.12);
  padding: 2px 8px;
  border-radius: 8px;
}

/* Řazení zastávek: na volantu skryté, v nastavení přehledné a velké šipky */
#view-driver .item-reorder-group {
  display: none !important;
}

#view-settings .item-reorder-group,
.stops-edit-list .item-reorder-group {
  display: flex !important;
  flex-direction: column;
  gap: 3px;
  margin-right: 6px;
  flex-shrink: 0;
}

#view-settings .btn-move,
.stops-edit-list .btn-move {
  width: 32px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--separator, #cbd5e1);
  background: var(--bg-card, #ffffff);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--label-primary, #1e293b);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.1s ease;
  touch-action: manipulation;
}

#view-settings .btn-move:active:not(:disabled),
.stops-edit-list .btn-move:active:not(:disabled) {
  transform: scale(0.92);
  background: var(--ios-blue, #007aff);
  color: #ffffff;
  border-color: var(--ios-blue, #007aff);
}

#view-settings .btn-move:disabled,
.stops-edit-list .btn-move:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.stops-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
}

.timeline-item.active {
  background: rgba(0, 122, 255, 0.08);
  outline: 1.5px solid var(--ios-blue);
}

body.theme-ios-dark .timeline-item.active {
  background: rgba(10, 132, 255, 0.16);
  outline: 1.5px solid var(--ios-blue);
}

.timeline-item.completed {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.timeline-item.row-normal-done {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.theme-ios-dark .timeline-item.completed,
body.theme-ios-dark .timeline-item.row-normal-done {
  background: #1c1c1e !important;
  border-color: #38383a !important;
}

/* Řádky časové osy podbarvené přímo podle oficiálního statusu */
.timeline-item.row-status-x,
.timeline-item.row-status-absent {
  background-color: #fee2e2 !important;
  border: 1px solid #fca5a5 !important;
}
.timeline-item.row-status-x .item-name,
.timeline-item.row-status-absent .item-name { color: #991b1b !important; }

.timeline-item.row-status-p,
.timeline-item.row-status-parents {
  background-color: #ffedd5 !important;
  border: 1px solid #fed7aa !important;
}
.timeline-item.row-status-p .item-name,
.timeline-item.row-status-parents .item-name { color: #9a3412 !important; }

.timeline-item.row-status-ns,
.timeline-item.row-status-sans-ecole {
  background-color: #f3e8ff !important;
  border: 1px solid #d8b4fe !important;
}
.timeline-item.row-status-ns .item-name,
.timeline-item.row-status-sans-ecole .item-name { color: #6b21a8 !important; }

.timeline-item.row-status-s,
.timeline-item.row-status-en-stage {
  background-color: #ccfbf1 !important;
  border: 1px solid #99f6e4 !important;
}
.timeline-item.row-status-s .item-name,
.timeline-item.row-status-en-stage .item-name { color: #0f766e !important; }

.timeline-item.row-status-d,
.timeline-item.row-status-inutile {
  background-color: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
}
.timeline-item.row-status-d .item-name,
.timeline-item.row-status-inutile .item-name { color: #b91c1c !important; }

.timeline-item.row-status-gazole,
.timeline-item.row-status-essence {
  background-color: #dcfce7 !important;
  border: 1px solid #86efac !important;
}
.timeline-item.row-status-gazole .item-name,
.timeline-item.row-status-essence .item-name { color: #14532d !important; }

.timeline-item.row-status-lavage {
  background-color: #e0f2fe !important;
  border: 1px solid #7dd3fc !important;
}
.timeline-item.row-status-lavage .item-name { color: #0369a1 !important; }

/* Tmavý režim pro řádky v časové ose */
body.theme-ios-dark .timeline-item.row-status-x,
body.theme-ios-dark .timeline-item.row-status-absent { background-color: rgba(239, 68, 68, 0.22) !important; border-color: #ef4444 !important; }
body.theme-ios-dark .timeline-item.row-status-x .item-name,
body.theme-ios-dark .timeline-item.row-status-absent .item-name { color: #fca5a5 !important; }

body.theme-ios-dark .timeline-item.row-status-p,
body.theme-ios-dark .timeline-item.row-status-parents { background-color: rgba(249, 115, 22, 0.22) !important; border-color: #f97316 !important; }
body.theme-ios-dark .timeline-item.row-status-p .item-name,
body.theme-ios-dark .timeline-item.row-status-parents .item-name { color: #fdba74 !important; }

body.theme-ios-dark .timeline-item.row-status-ns,
body.theme-ios-dark .timeline-item.row-status-sans-ecole { background-color: rgba(168, 85, 247, 0.22) !important; border-color: #a855f7 !important; }
body.theme-ios-dark .timeline-item.row-status-ns .item-name,
body.theme-ios-dark .timeline-item.row-status-sans-ecole .item-name { color: #d8b4fe !important; }

body.theme-ios-dark .timeline-item.row-status-s,
body.theme-ios-dark .timeline-item.row-status-en-stage { background-color: rgba(20, 184, 166, 0.22) !important; border-color: #14b8a6 !important; }
body.theme-ios-dark .timeline-item.row-status-s .item-name,
body.theme-ios-dark .timeline-item.row-status-en-stage .item-name { color: #99f6e4 !important; }

body.theme-ios-dark .timeline-item.row-status-d,
body.theme-ios-dark .timeline-item.row-status-inutile { background-color: rgba(239, 68, 68, 0.22) !important; border-color: #ef4444 !important; }
body.theme-ios-dark .timeline-item.row-status-d .item-name,
body.theme-ios-dark .timeline-item.row-status-inutile .item-name { color: #fca5a5 !important; }

body.theme-ios-dark .timeline-item.row-status-gazole,
body.theme-ios-dark .timeline-item.row-status-essence { background-color: rgba(34, 197, 94, 0.22) !important; border-color: #22c55e !important; }
body.theme-ios-dark .timeline-item.row-status-gazole .item-name,
body.theme-ios-dark .timeline-item.row-status-essence .item-name { color: #86efac !important; }

body.theme-ios-dark .timeline-item.row-status-lavage { background-color: rgba(14, 165, 233, 0.22) !important; border-color: #0ea5e9 !important; }
body.theme-ios-dark .timeline-item.row-status-lavage .item-name { color: #7dd3fc !important; }

/* Elegantní pilulka se slovem [ Standard / Absent / Parents / Sans ecole / En stage / Inutile / Gazole / Lavage ] v každém řádku */
.row-status-tile {
  min-width: 66px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ios);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: -0.2px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  margin-right: 8px;
  flex-shrink: 0;
  user-select: none;
  text-transform: none;
  white-space: nowrap;
}

.row-status-tile:active {
  transform: scale(0.94);
}

/* Štítek v modálu pro výběr statusu */
.status-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  font-family: var(--font-ios);
  font-weight: 800;
  font-size: 0.92rem;
  border: 1.5px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.status-modal-opt.active-item .status-modal-badge {
  box-shadow: 0 0 0 2.5px var(--ios-blue);
}

/* ==========================================================================
   BAREVNÁ PALETA PRO BADGES (Standard, Absent, Parents, Sans ecole, En stage, Inutile, Gazole, Essence, Lavage)
   ========================================================================== */
.badge-standard, .row-status-tile.tile-n, .row-status-tile.badge-standard {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.badge-absent, .row-status-tile.tile-x, .row-status-tile.badge-absent {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.badge-parents, .row-status-tile.tile-p, .row-status-tile.badge-parents {
  background: #ffedd5;
  border-color: #fed7aa;
  color: #c2410c;
}

.badge-sans-ecole, .row-status-tile.tile-ns, .row-status-tile.badge-sans-ecole {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #7e22ce;
}

.badge-en-stage, .row-status-tile.tile-s, .row-status-tile.badge-en-stage {
  background: #ccfbf1;
  border-color: #99f6e4;
  color: #0f766e;
}

.badge-inutile, .row-status-tile.tile-d, .row-status-tile.badge-inutile {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.badge-gazole, .row-status-tile.tile-gazole, .row-status-tile.badge-gazole,
.badge-essence, .row-status-tile.badge-essence {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.badge-lavage, .row-status-tile.tile-lavage, .row-status-tile.badge-lavage {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* Drobný štítek ve velké tabulce pro záznamy s časem/km (Inutile, Gazole, Lavage) */
.cell-sub-badge {
  display: inline-block;
  font-size: 0.60rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid transparent;
  line-height: 1.1;
  margin-top: 1px;
}

/* Tmavý režim pro badges */
body.theme-ios-dark .badge-standard,
body.theme-ios-dark .row-status-tile.tile-n,
body.theme-ios-dark .row-status-tile.badge-standard {
  background: #1c1c1e;
  border-color: #3a3a3c;
  color: #f2f2f7;
}

body.theme-ios-dark .badge-absent,
body.theme-ios-dark .row-status-tile.tile-x,
body.theme-ios-dark .row-status-tile.badge-absent {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

body.theme-ios-dark .badge-parents,
body.theme-ios-dark .row-status-tile.tile-p,
body.theme-ios-dark .row-status-tile.badge-parents {
  background: rgba(249, 115, 22, 0.25);
  border-color: #f97316;
  color: #fdba74;
}

body.theme-ios-dark .badge-sans-ecole,
body.theme-ios-dark .row-status-tile.tile-ns,
body.theme-ios-dark .row-status-tile.badge-sans-ecole {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #d8b4fe;
}

body.theme-ios-dark .badge-en-stage,
body.theme-ios-dark .row-status-tile.tile-s,
body.theme-ios-dark .row-status-tile.badge-en-stage {
  background: rgba(20, 184, 166, 0.25);
  border-color: #14b8a6;
  color: #99f6e4;
}

body.theme-ios-dark .badge-inutile,
body.theme-ios-dark .row-status-tile.tile-d,
body.theme-ios-dark .row-status-tile.badge-inutile {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
}

body.theme-ios-dark .badge-gazole,
body.theme-ios-dark .row-status-tile.tile-gazole,
body.theme-ios-dark .row-status-tile.badge-gazole,
body.theme-ios-dark .badge-essence,
body.theme-ios-dark .row-status-tile.badge-essence {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #86efac;
}

body.theme-ios-dark .badge-lavage,
body.theme-ios-dark .row-status-tile.tile-lavage,
body.theme-ios-dark .row-status-tile.badge-lavage {
  background: rgba(14, 165, 233, 0.25);
  border-color: #0ea5e9;
  color: #7dd3fc;
}

/* Modál / Popover pro výběr statusu z řádku */
.row-status-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.row-status-modal-overlay.hidden {
  display: none !important;
}

.row-status-modal-card {
  width: 100%;
  max-width: 330px;
  background: #ffffff !important;
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.theme-ios-dark .row-status-modal-card {
  background: #1c1c1e !important;
  border-color: rgba(255, 255, 255, 0.15);
}

.status-modal-header {
  padding: 16px 16px 10px;
  text-align: center;
  border-bottom: 0.5px solid var(--separator);
}

.status-modal-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--label-secondary);
}

.status-modal-subtitle {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--label-primary);
  margin-top: 3px;
}

.status-modal-options {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(520px, 75vh);
  overflow-y: auto;
}

.status-modal-opt {
  display: flex;
  align-items: center;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.status-modal-opt:active {
  transform: scale(0.97);
}

.status-modal-tile {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.88rem;
}

.status-modal-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--label-primary);
}

.status-modal-cancel {
  border-top: 0.5px solid var(--separator);
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ios-blue);
  cursor: pointer;
  text-align: center;
}

/* Modale de sécurité pour réinitialisation des relevés (Safety Modal) */
.safety-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.18s ease-out;
}

.safety-modal-overlay.hidden {
  display: none !important;
}

.safety-modal-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

body.theme-ios-dark .safety-modal-card {
  background: rgba(28, 28, 30, 0.98);
  border-color: rgba(239, 68, 68, 0.3);
}

.safety-modal-icon {
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 12px;
}

.safety-modal-title {
  margin: 0 0 10px 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--label-primary);
  line-height: 1.3;
}

.safety-modal-text {
  margin: 0 0 14px 0;
  font-size: 0.9rem;
  color: var(--label-secondary);
  line-height: 1.45;
}

.safety-modal-warning {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

body.theme-ios-dark .safety-modal-warning {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.safety-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  width: 100%;
}

.btn-safety-cancel {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--separator);
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--label-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-safety-cancel:hover {
  background: #e2e8f0;
}

body.theme-ios-dark .btn-safety-cancel {
  background: #2c2c2e;
}

.btn-safety-confirm {
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
  transition: all 0.15s ease;
}

.btn-safety-confirm:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

.btn-safety-confirm:disabled,
.btn-safety-confirm.disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  background: #94a3b8 !important;
}

.safety-modal-verification {
  margin: 12px 0 16px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.safety-verif-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--label-primary, #0f172a);
}

.safety-verif-label strong {
  color: #dc2626;
  letter-spacing: 0.04em;
}

.safety-verif-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  background: #ffffff;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  color: #dc2626;
  letter-spacing: 0.05em;
  box-sizing: border-box;
  outline: none;
  transition: all 0.15s ease;
}

.safety-verif-input:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

/* Pravá strana: Čas nahoře, kilometry dole */
.metrics-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1.25;
  text-align: right;
  font-family: var(--font-mono);
}
.metric-time,
.metric-time-input {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--label-primary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  text-align: right;
}
.metric-time-input {
  border: 1px solid transparent;
  background: transparent;
  width: 52px;
  padding: 1px 3px;
  border-radius: 6px;
  cursor: text;
}
.metric-time-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  outline: none;
}
.metric-km,
.metric-km-input {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--label-primary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  text-align: right;
}

.metric-km-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 78px;
  padding: 2px 4px;
  margin: 0;
  outline: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
}

.metric-km-input::placeholder {
  color: var(--label-tertiary);
  font-weight: 700;
}

.metric-km-input:focus {
  background: var(--bg-secondary);
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  cursor: text;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

/* Tlačítko fajfky pro přímé a bezpečné potvrzení zastávky řidičem */
.row-check-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  line-height: 1;
}

.row-check-btn:active {
  transform: scale(0.92);
}

.row-check-btn.is-checked {
  background: #16a34a !important;
  border-color: #15803d !important;
  box-shadow: 0 2px 5px rgba(22, 163, 74, 0.3) !important;
}

.timeline-item.active .row-check-btn:not(.is-checked) {
  border-color: var(--ios-blue, #2563eb);
  background: #eff6ff;
  color: var(--ios-blue, #2563eb);
}

body.theme-ios-dark .row-check-btn {
  background: #2c2c2e;
  border-color: #48484a;
}

body.theme-ios-dark .row-check-btn.is-checked {
  background: #22c55e !important;
  border-color: #16a34a !important;
}

.item-badge-index {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(118, 118, 128, 0.2);
  color: var(--label-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-item.completed .item-badge-index {
  background: #64748b;
  color: white;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.item-time-km {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--label-secondary);
  white-space: nowrap;
}

/* ==========================================================================
   VUE 2 : FEUILLE DE ROUTE OFFICIELLE - PANNEAU DE CONTRÔLE SIMPLIFIÉ
   ========================================================================== */
.sheet-control-hero {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px 20px;
  border: 0.5px solid var(--separator);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sheet-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-toggle-sheet-overview {
  font-size: 0.76rem;
  font-weight: 750;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-toggle-sheet-overview:hover {
  background: #dbeafe;
}

/* Řízení zobrazení desktop vs mobil pro záložku Výkazy (Build 289) */
@media screen and (min-width: 861px) {
  .sheet-desktop-actions {
    display: block !important;
  }
  .sheet-mobile-actions {
    display: none !important;
  }
  .sheet-control-hero.is-collapsed {
    margin-bottom: 6px !important;
    padding-bottom: 8px !important;
  }
  .sheet-control-hero.is-collapsed .sheet-hero-collapsible-body {
    display: none !important;
  }
  .sheet-control-hero.is-collapsed ~ #printable-sheet .sheet-header-grid,
  .sheet-control-hero.is-collapsed ~ .official-sheet-wrapper .sheet-header-grid {
    display: none !important;
  }
}

/* Kompaktní 30px lišta pro Tabulku jízd VÝHRADNĚ NA MOBILU (Build 290) */
@media screen and (max-width: 860px) {
  .sheet-desktop-actions {
    display: none !important;
  }
  .sheet-mobile-actions {
    display: block !important;
  }

  /* Na mobilu je celá horní lišta se 2 dlaždicemi trvale 30px (ve sbaleném i rozbaleném stavu!) */
  .sheet-control-hero {
    margin: 2px 0 4px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .sheet-control-hero .sheet-hero-header {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    align-items: center !important;
    border: none !important;
    padding: 0 !important;
    height: 30px !important;
    max-height: 30px !important;
  }

  .sheet-control-hero .sheet-title-wrap {
    display: flex !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .sheet-control-hero .sheet-hero-title,
  .sheet-control-hero .sheet-hero-sub,
  .sheet-control-hero .sheet-hero-tournee,
  .sheet-control-hero .sheet-week-picker-wrap label {
    display: none !important;
  }

  /* Levá dlaždice: Rozbalit / Sbalit (trvale 30px na mobilu) */
  .sheet-control-hero .btn-toggle-sheet-overview {
    width: 100% !important;
    height: 30px !important;
    max-height: 30px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #0284c7 !important;
    font-weight: 750 !important;
    font-size: 0.80rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: all 0.15s ease;
    box-sizing: border-box !important;
  }

  .sheet-control-hero .sheet-week-picker-wrap {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  /* Pravá dlaždice: Výběr týdne se šipkami (trvale 30px na mobilu) */
  .sheet-control-hero .sheet-week-control {
    width: 100% !important;
    height: 30px !important;
    max-height: 30px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 2px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
  }

  .sheet-control-hero .btn-sheet-nav {
    background: transparent !important;
    border: none !important;
    color: #0284c7 !important;
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    height: 100% !important;
  }

  .sheet-control-hero .sheet-week-control input {
    font-size: 0.80rem !important;
    font-weight: 750 !important;
    color: #0f172a !important;
    letter-spacing: -0.01em !important;
    border: none !important;
    background: transparent !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    max-width: 110px !important;
  }

  /* Sbalený stav: tělo je skryto */
  .sheet-control-hero.is-collapsed .sheet-hero-collapsible-body {
    display: none !important;
  }

  /* Rozbalený stav: tělo se rozbalí přímo pod 30px dlaždicemi */
  .sheet-control-hero:not(.is-collapsed) .sheet-hero-collapsible-body {
    display: block !important;
    margin-top: 8px !important;
    width: 100% !important;
  }

  /* Na mobilu skrýt tiskové mřížky v těle tabulky */
  #printable-sheet .sheet-header-grid,
  .official-sheet-wrapper .sheet-header-grid {
    display: none !important;
  }

  .official-sheet-wrapper,
  #printable-sheet {
    margin-top: 0 !important;
  }

  /* Tmavý režim pro 30px lištu na mobilu */
  body.theme-ios-dark .sheet-control-hero .btn-toggle-sheet-overview {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #38bdf8 !important;
  }

  body.theme-ios-dark .sheet-control-hero .sheet-week-control {
    background: #1e293b !important;
    border-color: #334155 !important;
  }

  body.theme-ios-dark .sheet-control-hero .btn-sheet-nav {
    color: #38bdf8 !important;
  }

  body.theme-ios-dark .sheet-control-hero .sheet-week-control input {
    color: #f1f5f9 !important;
    color-scheme: dark !important;
  }
}

/* 4 hlavní dlaždice exportu v přehledu Tabulky jízd (Build 288) */
.sheet-export-grid-4 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

@media screen and (min-width: 768px) {
  .sheet-export-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

.btn-export-tile {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 12px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 3px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.15s ease !important;
  min-height: 72px !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
}

.btn-export-tile:active {
  transform: scale(0.97) !important;
}

.export-tile-icon {
  font-size: 1.35rem !important;
  line-height: 1 !important;
  margin-bottom: 2px !important;
}

.export-tile-title {
  font-size: 0.88rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
}

.export-tile-sub {
  font-size: 0.70rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.btn-export-tile.tile-sheet {
  border-color: #bfdbfe !important;
  background: #f8fafc !important;
}
.btn-export-tile.tile-sheet .export-tile-title {
  color: #0284c7 !important;
}

.btn-export-tile.tile-hours {
  border-color: #ddd6fe !important;
  background: #f8fafc !important;
}
.btn-export-tile.tile-hours .export-tile-title {
  color: #7c3aed !important;
}

.btn-export-tile.tile-email {
  border-color: #fed7aa !important;
  background: #f8fafc !important;
}
.btn-export-tile.tile-email .export-tile-title {
  color: #ea580c !important;
}

.btn-export-tile.tile-download-all {
  border-color: #bbf7d0 !important;
  background: #f0fdf4 !important;
}
.btn-export-tile.tile-download-all .export-tile-title {
  color: #166534 !important;
}

/* Modální okno pro výběr formátu exportu */
.export-choice-card {
  max-width: 360px !important;
  width: 90% !important;
  padding: 20px !important;
  text-align: center !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
  box-sizing: border-box !important;
  margin: auto !important;
}

.export-choice-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 4px !important;
}

.export-choice-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.export-choice-icon {
  font-size: 1.3rem !important;
}

.export-choice-title {
  margin: 0 !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}

.btn-close-export-choice {
  background: none !important;
  border: none !important;
  font-size: 1.25rem !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  padding: 4px 8px !important;
}

.export-choice-subtitle {
  font-size: 0.85rem !important;
  color: #64748b !important;
  margin: 0 0 16px 0 !important;
  text-align: left !important;
}

.export-choice-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-bottom: 14px !important;
}

.btn-choice-opt {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  font-weight: 750 !important;
  color: #0f172a !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  font-family: inherit !important;
}

.btn-choice-opt:hover, .btn-choice-opt:active {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
}

.btn-choice-opt-icon {
  font-size: 1.3rem !important;
}

.btn-export-choice-cancel {
  width: 100% !important;
  padding: 10px !important;
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  font-family: inherit !important;
}

/* Tmavý režim pro exportní dlaždice a modál */
body.theme-ios-dark .btn-export-tile {
  background: #1e293b !important;
  border-color: #334155 !important;
}
body.theme-ios-dark .btn-export-tile .export-tile-title {
  color: #f1f5f9 !important;
}
body.theme-ios-dark .btn-export-tile .export-tile-sub {
  color: #94a3b8 !important;
}
body.theme-ios-dark .btn-export-tile.tile-sheet .export-tile-title {
  color: #38bdf8 !important;
}
body.theme-ios-dark .btn-export-tile.tile-hours .export-tile-title {
  color: #a78bfa !important;
}
body.theme-ios-dark .btn-export-tile.tile-email .export-tile-title {
  color: #fb923c !important;
}
body.theme-ios-dark .btn-export-tile.tile-download-all {
  background: rgba(20, 83, 45, 0.2) !important;
  border-color: #166534 !important;
}
body.theme-ios-dark .btn-export-tile.tile-download-all .export-tile-title {
  color: #4ade80 !important;
}
body.theme-ios-dark .export-choice-card {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
}
body.theme-ios-dark .export-choice-title {
  color: #f1f5f9 !important;
}
body.theme-ios-dark .export-choice-subtitle {
  color: #94a3b8 !important;
}
body.theme-ios-dark .btn-choice-opt {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}
body.theme-ios-dark .btn-choice-opt:hover {
  background: rgba(30, 58, 138, 0.3) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}
body.theme-ios-dark .btn-export-choice-cancel {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

.sheet-hero-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--label-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.sheet-week-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--label-primary);
}

.sheet-week-picker input {
  padding: 7px 12px;
  border-radius: 10px;
  border: 0.5px solid var(--separator);
  background: var(--bg-primary);
  color: var(--label-primary);
  font-family: var(--font-ios);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Grille principale : 2 colonnes parfaitement symétriques (50% / 50%) */
.sheet-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}

/* Karta kilometrů (Vlevo) */
.sheet-km-card {
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 14px 18px;
  border: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-sizing: border-box;
}

.km-icon {
  font-size: 2rem;
  line-height: 1;
}

.km-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.km-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--label-secondary);
}

.km-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--label-primary);
  line-height: 1.1;
}

.km-sub {
  font-size: 0.78rem;
  color: var(--label-secondary);
  margin-top: 2px;
}

/* Karta tlačítek (Vpravo - 50%) */
.sheet-actions-card {
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 10px;
  border: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.sheet-btn-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.btn-sheet-print,
.btn-sheet-pdf,
.btn-sheet-excel {
  border-radius: 12px;
  padding: 10px 8px;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font-ios);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  height: 44px;
  white-space: nowrap;
}

.btn-sheet-print {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-sheet-print:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-sheet-print:active {
  transform: scale(0.985);
}

.btn-sheet-pdf {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.btn-sheet-pdf:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.btn-sheet-pdf:active {
  transform: scale(0.985);
}

.btn-sheet-excel {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.08);
}

.btn-sheet-excel:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  transform: translateY(-1px);
}

.btn-sheet-excel:active {
  transform: scale(0.985);
}

body.theme-ios-dark .btn-sheet-print {
  background: #1e293b;
  color: #f1f5f9;
  border-color: #334155;
}

body.theme-ios-dark .btn-sheet-pdf {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.4);
}

body.theme-ios-dark .btn-sheet-excel {
  background: rgba(5, 150, 105, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.official-sheet-wrapper {
  background: white;
  border: none;
  padding: 0;
  border-radius: 4px;
  font-family: 'Arial', sans-serif;
  color: #000;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.sheet-header-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: 100%;
  min-width: 820px;
  border: 1.5px solid #000;
  margin-bottom: 8px;
  background: #ffffff;
  padding: 0;
  gap: 0;
  border-radius: 0;
  box-shadow: none;
  box-sizing: border-box;
}

.header-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 6px;
  height: 48px;
  border: none;
  border-right: 1px solid #000;
  border-radius: 0;
  min-width: 0;
  box-sizing: border-box;
  box-shadow: none;
}

.header-box:last-child {
  border-right: none;
}

.box-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.box-value {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.box-value.brand {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

/* Varianta 1: Jemné pastelové tóny */
.box-logo {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.box-logo .box-label { color: #64748b; }
.box-logo .box-value { color: #0f172a; }

.box-driver {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}
.box-driver .box-label { color: #7c3aed; }
.box-driver .box-value { color: #5b21b6; }

.box-tournee {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}
.box-tournee .box-label { color: #64748b; }
.box-tournee .box-value { color: #1e293b; }

.box-semaine {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.box-semaine .box-label { color: #ea580c; }
.box-semaine .box-value { color: #9a3412; }

.box-immat {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.box-immat .box-label { color: #059669; }
.box-immat .box-value { color: #065f46; }

.box-signature {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.box-signature .box-label { color: #64748b; }
.box-signature .sig-container {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Brush Script MT', 'Caveat', 'Segoe Script', cursive;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

/* Tmavý režim pro hlavičkové karty */
body.theme-ios-dark .box-logo {
  background: #1e293b;
  border-color: #334155;
}
body.theme-ios-dark .box-logo .box-label { color: #94a3b8; }
body.theme-ios-dark .box-logo .box-value { color: #f8fafc; }

body.theme-ios-dark .box-driver {
  background: rgba(124, 58, 237, 0.2);
  border-color: rgba(167, 139, 250, 0.4);
}
body.theme-ios-dark .box-driver .box-label { color: #c4b5fd; }
body.theme-ios-dark .box-driver .box-value { color: #ede9fe; }

body.theme-ios-dark .box-tournee {
  background: #1e293b;
  border-color: #334155;
}
body.theme-ios-dark .box-tournee .box-label { color: #94a3b8; }
body.theme-ios-dark .box-tournee .box-value { color: #f8fafc; }

body.theme-ios-dark .box-semaine {
  background: rgba(234, 88, 12, 0.2);
  border-color: rgba(251, 146, 60, 0.4);
}
body.theme-ios-dark .box-semaine .box-label { color: #fdba74; }
body.theme-ios-dark .box-semaine .box-value { color: #ffedd5; }

body.theme-ios-dark .box-immat {
  background: rgba(5, 150, 105, 0.2);
  border-color: rgba(52, 211, 153, 0.4);
}
body.theme-ios-dark .box-immat .box-label { color: #6ee7b7; }
body.theme-ios-dark .box-immat .box-value { color: #d1fae5; }

body.theme-ios-dark .box-signature {
  background: #1e293b;
  border-color: #334155;
}
body.theme-ios-dark .sheet-header-grid {
  border-color: #475569;
}
body.theme-ios-dark .header-box {
  border-right-color: #475569;
}

.sheet-table-section {
  margin-bottom: 8px;
  min-width: 820px;
}

.sheet-table-section + .sheet-table-section {
  margin-top: 0;
}

.table-section-title {
  font-weight: 800;
  font-size: 0.85rem;
  background: #f1f5f9;
  padding: 3px 8px;
  border: 1.5px solid #000;
  text-transform: uppercase;
  margin: 0 0 8px 0;
  box-sizing: border-box;
}

.table-responsive {
  overflow-x: visible;
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
}

.mobi-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #000;
  font-size: 0.88rem;
  table-layout: fixed;
  margin: 0;
  box-sizing: border-box;
}

.mobi-table th, 
.mobi-table td {
  border: 1px solid #000;
  padding: 5px 6px;
  text-align: center;
}

.mobi-table thead th {
  background: white;
  font-weight: 800;
  padding: 0;
  vertical-align: top;
}

.th-day-col {
  min-width: 110px;
}

.day-full {
  display: block;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 4px;
}

.day-short {
  display: none;
}

.day-sub-labels {
  display: flex;
  border-top: 1px solid #000;
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 700;
}

.day-sub-labels .sub-h {
  flex: 1;
  border-right: 1px solid #000;
  padding: 2px 4px;
}

.day-sub-labels .sub-km {
  flex: 1;
  padding: 2px 4px;
}

.col-w-pts {
  width: 180px;
}

.col-w-day {
  width: auto;
}

.col-points-full {
  display: inline;
}

.col-points-short {
  display: none;
}

.mobi-table td.col-points-td,
.mobi-table th.col-points {
  text-align: left;
  font-weight: 700;
  width: 180px;
  background: #f8fafc;
  padding: 5px 6px;
  font-size: 0.88rem;
}

.col-day-cell {
  padding: 0 !important;
  height: 1px;
}

.cell-inner-wrap {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 26px;
  align-items: stretch;
}

.cell-time {
  flex: 1;
  border-right: 1px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.88rem;
}

.cell-km {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.cell-status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 24px;
  background: transparent !important;
  border: none !important;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: -0.2px;
  color: inherit !important;
}

.row-depart, .row-retour {
  font-weight: 800;
}

.row-depart .col-points-td, .row-retour .col-points-td {
  font-weight: 800;
}

/* Jména žáků / dětí tučně (Bold pupil names) */
.col-pupil-td,
.col-pupil-td strong,
.mobi-table td.col-pupil-td,
.mobi-table td.col-pupil-td strong {
  font-weight: 900 !important;
  color: #0f172a !important;
}

.cell-depart-active {
  background: #dbeafe !important;
  font-weight: 800;
}

.cell-gazole-active {
  background: var(--chip-gazole, #d9f2d0) !important;
  font-weight: 800;
}

body.theme-ios-dark .cell-depart-active {
  background: rgba(59, 130, 246, 0.3) !important;
}

body.theme-ios-dark .cell-gazole-active {
  background: rgba(34, 197, 94, 0.3) !important;
}

.sheet-legend-bar {
  border: 1.5px solid #000;
  display: grid;
  grid-template-columns: 1.1fr repeat(7, 1fr);
  width: 100%;
  margin-top: 8px;
  background: white;
  min-width: 820px;
  box-sizing: border-box;
}

.legend-title {
  background: #f1f5f9;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 6px 10px;
  border-right: 1.5px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  letter-spacing: 0.5px;
}

.legend-items {
  display: contents;
}

.legend-badge {
  padding: 6px 4px;
  font-size: 0.72rem;
  font-weight: 800;
  border-right: 1px solid #000;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  line-height: 1.15;
}

.legend-badge:last-child {
  border-right: none;
}

/* ==========================================================================
   RÉSUMÉ KILOMÉTRIQUE & CHAUFFEUR (4 DALLES APPLE IDENTIQUES)
   ========================================================================== */
.sheet-summary-quad-card {
  margin-top: 14px;
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #cbd5e1);
  border-radius: 14px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  box-shadow: var(--card-shadow, 0 4px 14px rgba(0, 0, 0, 0.04));
  min-width: 820px;
  box-sizing: border-box;
}

.quad-km-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-system, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--separator, #e2e8f0);
  min-width: 0;
  box-sizing: border-box;
  height: 52px;
}

.quad-km-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.quad-km-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.quad-km-text span {
  font-size: 0.72rem;
  color: var(--label-secondary, #64748b);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lbl-short {
  display: none;
}

.quad-km-text strong {
  font-size: 1.05rem;
  color: var(--label-primary, #0f172a);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quad-km-item.highlight {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.quad-km-item.highlight .quad-km-text span {
  color: #1d4ed8;
}

.quad-km-item.highlight .quad-km-text strong {
  color: var(--ios-blue, #0284c7);
  font-size: 1.15rem;
}

.quad-km-item.driver-card {
  background: #fdf4ff;
  border-color: #f0abfc;
}

.quad-km-item.driver-card .quad-km-text span {
  color: #a21caf;
}

.quad-km-item.driver-card .quad-km-text strong {
  color: #701a75;
  font-family: var(--font-ios);
  font-weight: 800;
}

/* Dark mode */
body.theme-ios-dark .sheet-summary-quad-card {
  background: #1c1c1e;
  border-color: #2c2c2e;
}

body.theme-ios-dark .quad-km-item {
  background: #2c2c2e;
  border-color: #3a3a3c;
}

body.theme-ios-dark .quad-km-text span {
  color: #98989d;
}

body.theme-ios-dark .quad-km-text strong {
  color: #ffffff;
}

body.theme-ios-dark .quad-km-item.highlight {
  background: rgba(0, 122, 255, 0.15);
  border-color: rgba(0, 122, 255, 0.35);
}

body.theme-ios-dark .quad-km-item.highlight .quad-km-text span {
  color: #60a5fa;
}

body.theme-ios-dark .quad-km-item.highlight .quad-km-text strong {
  color: #93c5fd;
}

body.theme-ios-dark .quad-km-item.driver-card {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
}

body.theme-ios-dark .quad-km-item.driver-card .quad-km-text span {
  color: #c084fc;
}

body.theme-ios-dark .quad-km-item.driver-card .quad-km-text strong {
  color: #e9d5ff;
}

/* ==========================================================================
   VUE 3 : RÉGLAGES & FLOTTE (CONCEPT 1: WORKSPACE SIDEBAR LAYOUT)
   ========================================================================== */
#view-settings.tab-view {
  max-width: 1400px;
  padding: 16px 20px 80px 20px;
}

.settings-workspace-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar Navigation */
.settings-sidebar {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #e2e8f0);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Tlačítko pro návrat na dispečink */
.settings-back-dispatch-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--font-ios);
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.settings-back-dispatch-btn:hover {
  background: #e2e8f0;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.settings-role-segmented-control {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.role-segment-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: var(--font-ios);
  font-size: 0.84rem;
  font-weight: 750;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.role-segment-btn:hover {
  color: #0f172a;
}

.role-segment-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Řízení zobrazení podle role: Řidič vs. Dispečer */
#view-settings[data-mode="driver"] [data-scope="dispatcher"] {
  display: none !important;
}

#view-settings[data-mode="driver"] .settings-back-dispatch-btn {
  display: none !important;
}

#view-settings[data-mode="dispatcher"] [data-scope="driver"] {
  display: none !important;
}

#view-settings[data-mode="dispatcher"] .settings-back-dispatch-btn {
  display: flex !important;
}

#view-settings[data-mode="dispatcher"] #settings-role-switcher {
  display: none !important;
}

.settings-row-2col {
  display: contents;
}

.settings-sidebar {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #e2e8f0);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--separator, #f1f5f9);
}

.settings-sidebar-icon {
  font-size: 1.8rem;
  background: #f1f5f9;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-sidebar-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--label-primary, #0f172a);
  margin: 0;
  letter-spacing: -0.02em;
}

.settings-sidebar-sub {
  font-size: 0.76rem;
  color: var(--label-secondary, #64748b);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.settings-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--label-secondary, #475569);
  font-family: var(--font-ios);
  font-size: 0.92rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.settings-nav-item:hover {
  background: #f8fafc;
  color: var(--label-primary, #0f172a);
}

.settings-nav-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.settings-nav-item .nav-item-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

.settings-nav-item .nav-item-text {
  flex: 1;
}

.txt-mobile {
  display: none;
}

.txt-desktop {
  display: inline;
}

.settings-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.settings-sidebar-footer {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--separator, #f1f5f9);
}

.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 999px;
  width: 100%;
  box-sizing: border-box;
}

.sync-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* Panes Content Area */
.settings-main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.settings-pane {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: fadeInPane 0.2s ease-out;
}

.settings-pane.active {
  display: flex;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 6px;
}

.settings-pane-title {
  font-size: 1.35rem;
  font-weight: 850;
  color: var(--label-primary, #0f172a);
  margin: 0;
  letter-spacing: -0.025em;
}

.settings-pane-sub {
  font-size: 0.86rem;
  color: var(--label-secondary, #64748b);
  margin: 4px 0 0 0;
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.settings-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #e2e8f0);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card.full-card {
  grid-column: 1 / -1;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.settings-card-header .card-icon {
  font-size: 1.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--label-primary, #0f172a);
  margin: 0;
  letter-spacing: -0.015em;
}

.card-sub {
  font-size: 0.78rem;
  color: var(--label-secondary, #64748b);
  margin-top: 2px;
  display: block;
}

/* Info Banner for Wage Parameters */
.settings-info-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #1e40af;
  font-size: 0.84rem;
  line-height: 1.45;
}

.settings-info-banner .info-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Form Fields */
.form-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-field.full-width {
  grid-column: 1 / -1;
}

.settings-field label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--label-primary, #0f172a);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-hint {
  font-weight: 500;
  color: var(--label-secondary, #64748b);
  font-size: 0.75rem;
}

.settings-field input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--separator, #cbd5e1);
  background: #f8fafc;
  color: var(--label-primary, #0f172a);
  font-size: 0.92rem;
  font-family: var(--font-ios);
  font-weight: 600;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.settings-field input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Fuel Selector */
.settings-fuel-selector {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
}

.settings-fuel-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 750;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.settings-fuel-btn.active {
  background: #ffffff;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Odometer Sync Card */
.odometer-sync-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.odo-icon-box {
  width: 42px;
  height: 42px;
  background: #e2e8f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #0284c7;
  flex-shrink: 0;
}

.odo-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.odo-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #64748b;
}

.odo-val {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.odo-note {
  font-size: 0.78rem;
  color: #64748b;
}

/* Actions Bar */
.settings-pane-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}

.btn-save-settings-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  padding: 13px 24px;
  border-radius: 12px;
  font-family: var(--font-ios);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-save-settings-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-primary-add {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: var(--font-ios);
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary-add:hover {
  background: #dbeafe;
}

/* Responsive adjustments pro MOBILNÍ TELEFONY */
@media (max-width: 860px) {
  #view-settings.tab-view {
    padding: 6px 10px 75px 10px !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .settings-workspace-layout {
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Na mobilu skryjeme zbytečný desktopový obal sidebaru */
  .settings-sidebar {
    position: relative;
    top: 0;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    gap: 8px;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Skryjeme desktopovou hlavičku sidebaru a přepínače na mobilu */
  .settings-sidebar-header,
  .settings-role-segmented-control,
  .settings-sidebar-footer,
  .settings-back-dispatch-btn {
    display: none !important;
  }

  /* Texty pro záložky na mobilu */
  .txt-mobile {
    display: inline !important;
  }
  .txt-desktop {
    display: none !important;
  }

  /* Čisté 3 záložky přesně stejně velké na celou šířku mobilu bez ikon */
  .settings-sidebar-nav {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 2px 0 10px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Mobilní dlaždice záložek */
  .settings-nav-item {
    white-space: nowrap !important;
    width: 100% !important;
    height: 44px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 6px !important;
    font-size: 0.88rem !important;
    font-weight: 750 !important;
    color: #475569;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }

  .settings-nav-item.active {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
  }

  /* Bez ikon na mobilu */
  .settings-nav-item .nav-item-icon {
    display: none !important;
  }

  .settings-nav-item .nav-item-text {
    width: 100% !important;
    text-align: center !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* Na mobilu zjednodušíme zdvojené nadpisy */
  .settings-pane-header {
    display: none !important;
  }

  .settings-main-content {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .settings-pane {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* Karty na celou šířku s velkými dotykovými prvky */
  .settings-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .settings-card {
    padding: 16px;
    border-radius: 18px;
    gap: 14px;
    box-sizing: border-box;
    max-width: 100% !important;
  }

  .form-fields-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .settings-field input {
    padding: 12px 14px;
    font-size: 1rem; /* Zabraňuje iOS auto-zoomu */
    border-radius: 12px;
    box-sizing: border-box;
  }

  .settings-info-banner {
    padding: 10px 12px;
    font-size: 0.8rem;
    box-sizing: border-box;
  }

  /* Spodní tlačítko Uložit na mobilu na celou šířku */
  .settings-pane-actions {
    padding: 10px 0 20px 0;
  }

  .btn-save-settings-primary {
    width: 100%;
    justify-content: center;
    padding: 14px 16px;
    font-size: 0.95rem;
    border-radius: 14px;
    box-sizing: border-box;
  }

  /* Specificky kompaktní rozvržení pro Vozidlo a Řidiče na mobilu bez scrollování */
  #pane-driver-vehicle .settings-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #pane-driver-vehicle .settings-card {
    padding: 8px 12px !important;
    border-radius: 14px !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
  }

  #pane-driver-vehicle .card-sub {
    display: none !important;
  }

  #pane-driver-vehicle .settings-card-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
    margin-bottom: 2px !important;
    border-bottom: 1px solid #f1f5f9 !important;
  }

  #pane-driver-vehicle .settings-card-header .card-icon {
    font-size: 1.15rem !important;
  }

  #pane-driver-vehicle .card-title {
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  #pane-driver-vehicle .settings-row-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #pane-driver-vehicle .settings-row-2col .settings-field.full-width {
    grid-column: auto !important;
  }

  #pane-driver-vehicle .form-fields-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  #pane-driver-vehicle .settings-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
  }

  #pane-driver-vehicle .settings-field label {
    font-size: 0.72rem !important;
    font-weight: 750 !important;
    color: #475569 !important;
    margin-bottom: 3px !important;
    line-height: 1.15 !important;
    min-height: 26px !important;
    display: flex !important;
    align-items: flex-end !important;
  }

  #pane-driver-vehicle .settings-field input {
    height: 35px !important;
    padding: 4px 10px !important;
    font-size: 0.88rem !important;
    font-weight: 650 !important;
    border-radius: 9px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  #pane-driver-vehicle .fuel-toggle-group {
    height: 35px !important;
    padding: 2px !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
  }

  #pane-driver-vehicle .fuel-toggle-btn {
    height: 29px !important;
    padding: 0 8px !important;
    font-size: 0.80rem !important;
    font-weight: 750 !important;
    border-radius: 7px !important;
    gap: 5px !important;
  }

  #pane-driver-vehicle .settings-pane-actions {
    padding: 6px 0 0 0 !important;
    margin: 0 !important;
  }

  #pane-driver-vehicle .btn-save-settings-primary {
    height: 40px !important;
    padding: 0 16px !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    border-radius: 11px !important;
    width: 100% !important;
  }
}

.settings-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.settings-hint {
  font-size: 0.85rem;
  color: var(--label-secondary);
  margin-bottom: 14px;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--label-primary);
  margin-bottom: 5px;
}

.form-row input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 0.5px solid var(--separator);
  background: var(--bg-secondary);
  color: var(--label-primary);
  font-size: 0.95rem;
  font-family: var(--font-ios);
}

.fuel-toggle-group {
  display: inline-flex;
  background: var(--bg-secondary, #f1f5f9);
  border: 1px solid var(--separator, #cbd5e1);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
  width: 100%;
}

.fuel-toggle-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: var(--font-ios);
  font-weight: 750;
  font-size: 0.92rem;
  color: var(--label-secondary, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.fuel-toggle-btn.active {
  background: #ffffff;
  color: #15803d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 850;
  border: 1px solid #86efac;
}

body.theme-ios-dark .fuel-toggle-btn.active {
  background: #2c2c2e;
  color: #86efac;
  border-color: #22c55e;
}

/* ==========================================================================
   ROZŠÍŘENÍ PRO ZASTÁVKY: PŘEPÍNAČ SMĚN (☀️/🌙) & BEZPEČNOSTNÍ ZÁMEK
   ========================================================================== */
.stops-header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.btn-stops-lock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-ios);
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  border: 1.5px solid #cbd5e1;
  background: #f1f5f9;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.btn-stops-lock-toggle:active {
  transform: scale(0.96);
}
.btn-stops-lock-toggle.unlocked {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.2);
}
body.theme-ios-dark .btn-stops-lock-toggle.locked {
  background: #1e293b;
  border-color: #475569;
  color: #cbd5e1;
}
body.theme-ios-dark .btn-stops-lock-toggle.unlocked {
  background: #78350f;
  border-color: #f59e0b;
  color: #fde68a;
}

/* PŘEPÍNAČ SMĚN (STEJNÝ LUXUSNÍ STYL JAKO DOCK NA VOLANTU) */
.stops-shift-switcher {
  display: flex;
  gap: 4px;
  background: #e2e8f0;
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
body.theme-ios-dark .stops-shift-switcher {
  background: #2c2c2e;
  border-color: #38383a;
}

.stops-shift-tab-btn {
  flex: 1 1 0;
  height: 42px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-family: var(--font-ios);
  font-size: 0.88rem;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
body.theme-ios-dark .stops-shift-tab-btn {
  color: #94a3b8;
}

.stops-shift-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}
body.theme-ios-dark .stops-shift-tab-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.5) !important;
}

.stops-shift-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.stops-shift-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  background: #cbd5e1;
  color: #334155;
  line-height: 1.2;
}
.stops-shift-tab-btn.active .stops-shift-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}


/* ZAMČENÝ REŽIM (POUZE PRO ČTENÍ) */
.stops-card-container.is-locked .stop-edit-item {
  padding: 6px 10px !important;
  border-radius: 12px !important;
}
.stops-card-container.is-locked .stops-edit-list {
  gap: 5px !important;
  margin-bottom: 4px !important;
}
.stops-card-container.is-locked .add-stop-row {
  display: none !important;
}
.stops-card-container.is-locked .item-reorder-group {
  display: none !important;
}
.stops-card-container.is-locked .btn-quick-gps-save,
.stops-card-container.is-locked .btn-edit-stop-settings,
.stops-card-container.is-locked .btn-remove-stop {
  display: none !important;
}
.stops-card-container.is-locked .stop-name-field {
  display: none !important;
}

.stop-order-pill {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body.theme-ios-dark .stop-order-pill {
  background: #334155;
  color: #cbd5e1;
}

.stop-name-display {
  font-family: var(--font-ios);
  font-size: 0.94rem;
  font-weight: 750;
  color: var(--label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stops-card-container:not(.is-locked) .stop-name-display {
  display: none !important;
}
.stops-card-container:not(.is-locked) .stop-order-pill {
  display: none !important;
}
.stop-lock-badge {
  font-size: 0.82rem;
  opacity: 0.45;
  padding-right: 4px;
}

.stops-edit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.stop-edit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  padding: 8px 10px;
  border-radius: 14px;
  gap: 8px;
}

.edit-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.stop-name-field {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: 10px;
  padding: 6px 10px;
  font-family: var(--font-ios);
  font-size: 0.90rem;
  font-weight: 700;
  color: var(--label-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.edit-item-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.btn-quick-gps-save {
  height: 32px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: 9px;
  padding: 0 8px;
  font-weight: 750;
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-quick-gps-save:active {
  transform: scale(0.96);
  background: #dcfce7;
}

.btn-edit-stop-settings {
  width: 32px;
  height: 32px;
  border: 1px solid var(--separator);
  background: var(--bg-card);
  color: var(--label-primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn-edit-stop-settings:active {
  transform: scale(0.96);
}

.stop-edit-meta {
  font-size: 0.70rem;
  color: var(--label-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.stop-gps-tag-ok {
  color: #16a34a;
  font-weight: 700;
}
.stop-gps-tag-none {
  color: #94a3b8;
}

.btn-remove-stop {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 59, 48, 0.15);
  color: var(--ios-red);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.95rem;
}

.add-stop-row {
  display: flex;
  gap: 8px;
}

.add-stop-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 0.5px solid var(--separator);
  background: var(--bg-secondary);
  color: var(--label-primary);
}

.btn-add-stop {
  padding: 10px 16px;
  background: var(--ios-blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.signature-pad-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.signature-pad-wrapper canvas {
  width: 100%;
  max-width: 100%;
  border: 1.5px dashed var(--separator);
  border-radius: 14px;
  background: #fafafa;
  margin-bottom: 8px;
  touch-action: none;
  box-sizing: border-box;
}

/* Návrh 1: Dvě karty vedle sebe */
.settings-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.settings-group-sig,
.settings-group-data {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.settings-group-sig .signature-pad-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.settings-group-sig .sig-btns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.settings-group-sig .sig-btns button {
  flex: 1;
  padding: 11px 10px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.data-btns-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
  margin-top: 10px;
}

.data-btns-col button,
.data-btns-col .btn-file-upload-subtle {
  width: 100%;
  padding: 13px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  box-sizing: border-box;
}

/* Personnalisation & Logo Entreprise (B2B White-Label) */
.company-logo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1.5px dashed var(--separator);
  border-radius: 14px;
  padding: 12px 16px;
  box-sizing: border-box;
}

.company-logo-preview-box {
  width: 64px;
  height: 48px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 1.6rem;
  flex-shrink: 0;
  padding: 4px;
}

.company-logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}

.company-logo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-file-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #ffffff;
  color: var(--brand-color, #2563eb);
  border: 1.5px solid var(--brand-border, rgba(37, 99, 235, 0.3));
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.btn-file-upload:hover {
  background: var(--brand-light, #eff6ff);
  border-color: var(--brand-color, #2563eb);
}

.btn-remove-logo {
  padding: 9px 12px !important;
  font-size: 0.82rem !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
  background: #fef2f2 !important;
  border-radius: 10px !important;
  cursor: pointer;
}

.btn-remove-logo:hover {
  background: #fee2e2 !important;
}

.brand-color-swatches {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.brand-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  outline: none;
}

.brand-swatch:hover {
  transform: scale(1.08);
}

.brand-swatch.active {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px #ffffff, 0 3px 8px rgba(0, 0, 0, 0.25);
  transform: scale(1.15);
}

.box-value.brand, #sheet-company-name {
  color: var(--brand-color, #2563eb) !important;
}

/* Tournées selector */
.tournee-selector-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tournee-tab-btn {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--separator);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--label-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tournee-tab-btn.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.tournee-add-row {
  display: flex;
  gap: 8px;
}

.tournee-add-row input {
  flex: 1;
}

.btn-file-upload-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  color: var(--label-primary);
}

.btn-file-upload-subtle:hover {
  background: var(--bg-system);
}

.btn-profile-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  font-weight: 700 !important;
  cursor: pointer;
}

.btn-action-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.icon-export {
  stroke: var(--brand-color, #2563eb);
}

.icon-import {
  stroke: #059669;
}

/* Logo dans l'en-tête de la feuille */
.header-box.box-logo.has-custom-logo {
  justify-content: center !important;
  align-items: center !important;
  padding: 3px 6px !important;
}

.header-box.box-logo.has-custom-logo .box-label {
  display: none !important;
}

.header-box.box-logo.has-custom-logo .brand-display-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-company-logo-img {
  max-height: 44px;
  max-width: 95%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (max-width: 580px) {
  .settings-bottom-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.sig-btns {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  width: 100% !important;
  margin-top: 14px !important;
  box-sizing: border-box !important;
}

.sig-btns button {
  width: 100% !important;
  height: 48px !important;
  padding: 0 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 0.92rem !important;
  font-weight: 750 !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.data-btns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Vycentrovaná nebezpečná zóna */
.danger-zone-card {
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  background: #fffafa !important;
  text-align: center !important;
  align-items: center !important;
}

body.theme-ios-dark .danger-zone-card {
  background: rgba(239, 68, 68, 0.05) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.danger-zone-header {
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  gap: 8px !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  width: 100% !important;
}

.danger-zone-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 14px !important;
  width: 100% !important;
}

.danger-hint {
  text-align: center !important;
  margin: 0 !important;
  max-width: 440px !important;
  line-height: 1.5 !important;
}

/* ==========================================================================
   MOJE DATA & SPOJENÍ (REŽIM ŘIDIČ NA MOBILU - BUILD 138)
   ========================================================================== */
.driver-data-cloud-card {
  background: #ffffff;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.06);
}

body.theme-ios-dark .driver-data-cloud-card {
  background: #1e293b;
  border-color: rgba(34, 197, 94, 0.3);
}

.driver-data-cloud-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.driver-data-cloud-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #86efac;
}

.driver-data-cloud-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #15803d;
}

body.theme-ios-dark .driver-data-cloud-title {
  color: #4ade80;
}

.driver-data-cloud-sub {
  font-size: 0.78rem;
  color: #475569;
}

.driver-data-cloud-info {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 10px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
}

body.theme-ios-dark .driver-data-cloud-info {
  background: #0f172a;
  color: #94a3b8;
}

.btn-driver-sync-now {
  width: 100%;
  height: 42px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-driver-sync-now:hover {
  background: #dcfce7;
}

.driver-data-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
}

body.theme-ios-dark .driver-data-card {
  background: #1e293b;
  border-color: #334155;
}

#card-driver-signature {
  margin-bottom: 8px;
}

.card-app-version-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 16px;
  margin-top: 0;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.app-version-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
}

body.theme-ios-dark .app-version-text {
  color: #f8fafc;
}

/* Karta verze v levém sloupci pod Données (pouze pro počítač / tablet) */
.sidebar-version-badge {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  box-sizing: border-box;
}

.sidebar-version-badge .app-version-text {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .sidebar-version-badge {
    display: none !important;
  }
}

.driver-data-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.driver-data-card-icon {
  font-size: 1.4rem;
}

.driver-data-card-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: #1e293b;
  margin: 0;
}

body.theme-ios-dark .driver-data-card-title {
  color: #f1f5f9;
}

.driver-data-card-sub {
  font-size: 0.78rem;
  color: #64748b;
}

.driver-data-actions-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.driver-data-actions-col .btn-list-action,
.driver-data-card .btn-list-action {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
  height: 44px;
}

.driver-backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.btn-driver-backup-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  padding: 0 10px;
}

.btn-driver-backup-tile:active {
  transform: scale(0.98);
  background: #f1f5f9;
}

.btn-driver-backup-tile.btn-backup-all {
  border: 1.5px solid #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 850;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

.btn-driver-backup-tile.btn-backup-all:active {
  background: #dbeafe;
}

.btn-driver-restore-tile {
  border: 1.5px dashed #059669 !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.12) !important;
  cursor: pointer !important;
  margin: 0 !important;
}

.btn-driver-restore-tile:active {
  background: #d1fae5 !important;
}

/* Dark mode pro zálohování */
body.theme-ios-dark .btn-driver-backup-tile {
  background: #273549;
  border-color: #3e4f66;
  color: #f1f5f9;
}
body.theme-ios-dark .btn-driver-backup-tile.btn-backup-all {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #93c5fd;
}
body.theme-ios-dark .btn-driver-restore-tile {
  background: #064e3b !important;
  border-color: #10b981 !important;
  color: #a7f3d0 !important;
}

.driver-data-phone-info {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
  margin-bottom: 10px;
}

/* ==========================================================================
   SPRÁVA DAT, ARCHIVACE & ZÁKONNÉ EXPORTY (DISPEČINK - BUILD 135)
   ========================================================================== */
.cloud-sync-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 18px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

body.theme-ios-dark .cloud-sync-card {
  background: #1e293b;
  border-color: #334155;
}

.cloud-sync-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cloud-sync-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #a7f3d0;
  flex-shrink: 0;
}

.cloud-sync-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cloud-sync-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: #0f172a;
}

body.theme-ios-dark .cloud-sync-title {
  color: #f8fafc;
}

.cloud-sync-badge {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cloud-sync-badge .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
}

.cloud-sync-sub {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

.ssl-shield-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.backup-card-header {
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

body.theme-ios-dark .backup-card-header {
  background: #0f172a;
  border-bottom-color: #334155;
}

.backup-card-title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #1e293b;
}

body.theme-ios-dark .backup-card-title {
  color: #f1f5f9;
}

.backup-card-sub {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 2px;
}

.backup-year-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.backup-list-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-bottom: 12px;
}

/* =============================================
   BACKUP GRID — 2×2 symetrické dlaždice
   ============================================= */
.backup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 4px;
}

.backup-tile {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s, transform 0.1s;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.backup-tile:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}
.backup-tile:active {
  transform: translateY(0);
}

/* barevný pruh nahoře každé dlaždice */
.backup-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 14px 14px 0 0;
}
.backup-tile-green::before  { background: #10b981; }
.backup-tile-purple::before { background: #8b5cf6; }
.backup-tile-slate::before  { background: #94a3b8; }
.backup-tile-red::before    { background: #ef4444; }

/* ikona — vždy stejná 48×48 px */
.backup-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.backup-tile-icon-green  { background: #f0fdf4; }
.backup-tile-icon-purple { background: #f5f3ff; }
.backup-tile-icon-slate  { background: #f1f5f9; }
.backup-tile-icon-red    { background: #fef2f2; }

/* název dlaždice */
.backup-tile-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}
.backup-tile-title-danger { color: #dc2626; }

/* podtitul dlaždice */
.backup-tile-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}
.backup-tile-sub-danger { color: #f87171; }

/* live badge na cloud dlaždici */
.backup-tile-live-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dcfce7;
  color: #16a34a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.backup-tile-live-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
}

/* Dark mode */
body.theme-ios-dark .backup-tile {
  background: #1e293b;
  border-color: #334155;
}
body.theme-ios-dark .backup-tile-title { color: #f1f5f9; }
body.theme-ios-dark .backup-tile-icon-green  { background: rgba(16,185,129,0.15); }
body.theme-ios-dark .backup-tile-icon-purple { background: rgba(139,92,246,0.15); }
body.theme-ios-dark .backup-tile-icon-slate  { background: rgba(148,163,184,0.12); }
body.theme-ios-dark .backup-tile-icon-red    { background: rgba(239,68,68,0.15); }

@media (max-width: 640px) {
  .backup-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .backup-tile {
    height: 140px;
  }
}


.backup-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid #f1f5f9;
  gap: 14px;
}

.backup-list-item:last-child {
  border-bottom: none;
}

.backup-list-item.danger-item {
  background: #fffafa;
}

.backup-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.backup-item-icon {
  font-size: 1.35rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.backup-item-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  margin-bottom: 2px;
}

.backup-item-sub {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.35;
}

.btn-list-action {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
  text-align: center;
  font-family: inherit;
  text-decoration: none;
}

.btn-list-blue {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-list-blue:hover {
  background: #1d4ed8;
}

.btn-list-gray {
  background: #f8fafc;
  color: #334155;
  border: 1.5px solid #cbd5e1;
}

.btn-list-gray:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-list-green {
  background: #f0fdf4;
  color: #15803d;
  border: 1.5px solid #86efac;
}

.btn-list-green:hover {
  background: #dcfce7;
}

.btn-list-red {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
}

.btn-list-red:hover {
  background: #fecaca;
}

.danger-reset-btn {
  width: 100% !important;
  max-width: 360px !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  border-radius: 14px !important;
  cursor: pointer !important;
}

.btn-primary {
  padding: 12px 18px;
  background: var(--ios-blue);
  color: white;
  border: none;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-subtle {
  padding: 12px 18px;
  background: var(--bg-secondary);
  color: var(--label-primary);
  border: none;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  padding: 12px 18px;
  background: rgba(255, 59, 48, 0.15);
  color: var(--ios-red);
  border: none;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Toast - Trvale odstraněno na přání uživatele */
.toast, #toast {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   RESPONSIVE MOBILE POUR FEUILLE OFFICIELLE (ÉCRAN < 600px)
   ========================================================================== */
@media screen and (max-width: 860px) {
  #view-sheet.active {
    display: block !important;
    padding: 2px 6px 85px 6px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .sheet-control-hero {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .sheet-hero-collapsible-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-hero-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding-bottom: 4px !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
  }

  .sheet-hero-title {
    font-size: 1.15rem !important;
    font-weight: 850 !important;
    margin: 0 !important;
    color: #0f172a !important;
  }

  .sheet-hero-sub,
  .sheet-hero-tournee {
    display: none !important;
  }

  .sheet-week-picker-wrap {
    width: auto !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
  }

  .sheet-week-picker-wrap label {
    font-size: 0.84rem !important;
    font-weight: 750 !important;
    text-transform: none !important;
    color: #334155 !important;
    margin: 0 !important;
    display: inline !important;
  }

  .sheet-week-control {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 2px 4px !important;
    display: flex !important;
    align-items: center !important;
    gap: 2px !important;
    width: auto !important;
    box-sizing: border-box !important;
  }

  .sheet-week-control input {
    font-size: 0.84rem !important;
    font-weight: 750 !important;
    border: none !important;
    padding: 2px 4px !important;
    max-width: 125px !important;
    background: transparent !important;
    text-align: center !important;
    color: #0f172a !important;
  }

  .btn-sheet-nav {
    padding: 2px 6px !important;
    font-size: 0.82rem !important;
    color: #2563eb !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
  }

  /* Svislý stack dlaždic na mobilu zredukujeme na 1 čistou kartu celkových km */
  .sheet-kpi-stack {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .sheet-kpi-card.kpi-blue {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .sheet-kpi-card.kpi-blue .sheet-kpi-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }

  .sheet-kpi-card.kpi-blue .sheet-kpi-label {
    font-size: 0.72rem !important;
    font-weight: 750 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
  }

  .sheet-kpi-card.kpi-blue .sheet-kpi-val {
    font-size: 1.55rem !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    line-height: 1.15 !important;
  }

  .sheet-kpi-card.kpi-blue .sheet-kpi-sub {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
  }

  .sheet-kpi-card.kpi-blue .sheet-kpi-icon {
    font-size: 2rem !important;
  }

  /* Ostatní 3 desktopové dlaždice na mobilu skryjeme */
  .sheet-kpi-card.kpi-slate,
  .sheet-kpi-card.kpi-green,
  .sheet-kpi-card.kpi-purple {
    display: none !important;
  }

  /* Sjednocená akční tlačítka tabulky (symetrická 2x2 mřížka s 8px rozestupem) */
  .sheet-side-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
    border-top: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  .sheet-side-actions .hours-actions-grid-2x2,
  .hours-actions-grid-2x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-side-actions button,
  .hours-actions-grid-2x2 button {
    width: 100% !important;
    height: 38px !important;
    padding: 6px 10px !important;
    font-size: 0.84rem !important;
    font-weight: 750 !important;
    justify-content: center !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
  }

  .sheet-day-shortcuts {
    display: none !important;
  }

  .official-sheet-wrapper {
    padding: 0 !important;
    border: none !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Skryjeme tiskový řádek pro dispečera na mobilu */
  .sheet-table-brand-header {
    display: none !important;
  }

  .table-responsive {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-table-section {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 8px !important;
    box-sizing: border-box !important;
  }

  .sheet-table-section + .sheet-table-section {
    margin-top: 0 !important;
  }

  .mobi-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    box-sizing: border-box !important;
    margin: 0 !important;
  }

  .col-w-pts {
    width: 72px !important;
  }

  .col-w-day {
    width: calc((100% - 72px) / 5) !important;
  }

  .col-points-full {
    display: none !important;
  }

  .col-points-short {
    display: inline !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
  }

  .mobi-table th, 
  .mobi-table td {
    padding: 2px 1px !important;
    box-sizing: border-box !important;
  }

  .mobi-table th.col-points {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    padding: 2px 1px !important;
    background: #f8fafc !important;
    text-align: center !important;
  }

  .mobi-table td.col-points-td {
    position: static !important;
    box-shadow: none !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 2px 2px !important;
    font-size: 0.65rem !important;
    line-height: 1.15 !important;
    background: #ffffff !important;
  }

  .th-day-col {
    width: calc((100% - 72px) / 5) !important;
    min-width: 0 !important;
    max-width: calc((100% - 72px) / 5) !important;
  }

  .day-full {
    display: none !important;
  }

  .day-short {
    display: block !important;
    font-weight: 800 !important;
    font-size: 0.75rem !important;
    padding: 2px 0 !important;
    text-align: center !important;
  }

  .day-sub-labels {
    display: none !important;
  }

  .col-day-cell {
    width: calc((100% - 72px) / 5) !important;
    min-width: 0 !important;
    max-width: calc((100% - 72px) / 5) !important;
    padding: 1px 0 !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  .cell-inner-wrap {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
  }

  .cell-time {
    border-right: none !important;
    border-bottom: 0.5px solid #cbd5e1 !important;
    font-size: 0.70rem !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    padding: 1px 0 !important;
    width: 100% !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  .cell-km {
    font-size: 0.60rem !important;
    font-family: var(--font-mono) !important;
    line-height: 1.1 !important;
    padding: 1px 0 !important;
    width: 100% !important;
    text-align: center !important;
    color: #334155 !important;
    white-space: nowrap !important;
  }

  .cell-status-badge {
    font-size: 0.60rem !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
    color: inherit !important;
  }

  .sheet-header-grid {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    padding: 8px !important;
    border-radius: 12px !important;
    border: 1px solid var(--separator, #cbd5e1) !important;
    background: var(--bg-card, #ffffff) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    box-sizing: border-box !important;
  }

  .header-box {
    height: 48px !important;
    min-height: 48px !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    border: 1px solid var(--separator, #e2e8f0) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
  }

  .header-box .box-label {
    font-size: 0.52rem !important;
    margin-bottom: 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .header-box .box-value {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #sheet-semaine-dates {
    font-size: 0.60rem !important;
    letter-spacing: -0.2px !important;
  }

  .sig-container {
    font-size: 0.82rem !important;
  }

  .mobi-france-logo .mobi-bold,
  .mobi-france-logo .mobi-light {
    font-size: 0.78rem !important;
  }

  .mobi-france-logo .mobi-sub {
    font-size: 0.44rem !important;
  }

  .sheet-legend-bar {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    font-size: 0.58rem !important;
    margin-top: 8px !important;
    border: 1.5px solid #000 !important;
  }

  .legend-title {
    font-size: 0.58rem !important;
    padding: 2px 4px !important;
  }

  .legend-badge {
    min-width: 0 !important;
    flex: 1 1 30% !important;
    padding: 2px 2px !important;
    font-size: 0.54rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .lbl-full {
    display: none !important;
  }

  .lbl-short {
    display: inline !important;
  }

  .sheet-summary-quad-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    position: static !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin-top: 8px !important;
    padding: 6px !important;
    border-radius: 10px !important;
  }

  .quad-km-item {
    height: 48px !important;
    padding: 4px 6px !important;
    gap: 6px !important;
    border-radius: 8px !important;
  }

  .quad-km-icon {
    font-size: 1.1rem !important;
  }

  .quad-km-text span {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
  }

  .quad-km-text strong {
    font-size: 0.80rem !important;
    letter-spacing: -0.3px !important;
    line-height: 1.15 !important;
  }

  .quad-km-item.highlight .quad-km-text strong {
    font-size: 0.88rem !important;
  }
}

/* ==========================================================================
   CENTRE DE RÉPARTITION EN DIRECT (LIVE DISPATCH / CHEF) - 100% LIGHT MODE
   ========================================================================== */
/* Dispečink je ve výchozím režimu pro řidiče 100% skrytý */
.nav-dispatch-badge,
.ios-tab-item[data-tab="dispatch"] {
  display: none !important;
}

/* Zobrazí se výhradně v režimu dispečinku pro vedoucího (.mode-dispatch) */
body.mode-dispatch .nav-dispatch-badge {
  display: inline-flex !important;
}

body.mode-dispatch .ios-tab-item[data-tab="dispatch"] {
  display: flex !important;
}

/* ROZTAŽENÍ NA 100% ŠÍŘKY A VÝŠKY PRO DISPEČINK (APP COCKPIT 100VH BEZ ROLOVÁNÍ OKNA) */
html.mode-dispatch,
body.mode-dispatch {
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.mode-dispatch .ios-tab-bar {
  display: none !important;
}

body.mode-dispatch .app-container {
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body.mode-dispatch .top-nav {
  flex: 0 0 auto !important;
  position: relative !important;
  top: 0 !important;
  z-index: 1000 !important;
  padding: 8px 18px !important;
  max-width: 100vw !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

body.mode-dispatch #view-dispatch.tab-view.active {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  max-width: 100vw !important;
  width: 100% !important;
  padding: 8px 16px 10px 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#view-dispatch.tab-view:not(.active) {
  display: none !important;
}

body.mode-dispatch .dispatch-header-bar {
  flex: 0 0 auto !important;
  margin-bottom: 8px !important;
  padding: 8px 14px !important;
}

/* Bannière de rappel sauvegarde hebdomadaire (Vendredi) */
.dispatch-friday-backup-banner {
  margin: 0 16px 12px 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1.5px solid #a7f3d0;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
  animation: fadeInDown 0.3s ease-out;
}
.friday-backup-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.friday-backup-icon {
  font-size: 1.3rem;
  background: #d1fae5;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.friday-backup-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #065f46;
  letter-spacing: -0.2px;
}
.friday-backup-desc {
  font-size: 0.78rem;
  color: #047857;
  margin-top: 1px;
}
.friday-backup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.btn-friday-backup-dl {
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(5, 150, 105, 0.25);
  transition: transform 0.15s, background-color 0.15s;
}
.btn-friday-backup-dl:hover {
  background: #047857;
  transform: translateY(-1px);
}
.btn-friday-backup-close {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  color: #059669;
  opacity: 0.6;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: opacity 0.15s;
}
.btn-friday-backup-close:hover {
  opacity: 1;
}

.nav-dispatch-badge {
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-dispatch-badge:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ==========================================================================
   SAMSARA COCKPIT DISPATCHER (STYLE SAMSARA TELEMATICS) - 100% LIGHT MODE
   ========================================================================== */

/* Barre supérieure de l'en-tête (Kompaktní na celou šířku) */
.dispatch-header-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.dispatch-header-main-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dispatch-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dispatch-brand-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 6px;
}

.dispatch-live-tag {
  display: none !important;
}

.dispatch-main-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.02em;
}

/* KPI Badges horizontaux */
.dispatch-kpi-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dispatch-kpi-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  transition: all 0.2s;
}

.dispatch-kpi-pill .pill-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1rem;
  color: #0f172a;
}

.dispatch-kpi-pill.kpi-pill-ontime {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.dispatch-kpi-pill.kpi-pill-ontime .pill-val {
  color: #16a34a;
}

.dispatch-kpi-pill.kpi-pill-delay {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}
.dispatch-kpi-pill.kpi-pill-delay .pill-val {
  color: #dc2626;
}

.dispatch-kpi-pill.kpi-pill-done {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.dispatch-kpi-pill.kpi-pill-done .pill-val {
  color: #2563eb;
}

.dispatch-header-actions {
  display: none !important;
}

.btn-dispatch-connect {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-dispatch-connect:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ==========================================================================
   GRILLE COCKPIT 3 COLONNES (SAMSARA LAYOUT)
   ========================================================================== */
.dispatch-samsara-cockpit {
  display: grid;
  grid-template-columns: 350px 1fr 370px;
  gap: 14px;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

@media (min-width: 861px) and (max-width: 1250px) {
  .dispatch-samsara-cockpit {
    grid-template-columns: 280px 1fr 335px;
    height: 100%;
    max-height: 100%;
    gap: 8px;
    min-height: 0;
  }
  .dispatch-col-drivers {
    min-width: 0;
    height: 100%;
    min-height: 0;
  }
  .drivers-header-title-row {
    flex-wrap: nowrap;
    gap: 4px;
  }
  .fleet-last-ping {
    white-space: nowrap;
    font-size: 0.7rem;
  }
  .driver-list-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .driver-item-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }
  .driver-item-name {
    font-size: 0.84rem;
  }
  .driver-city-badge {
    font-size: 0.65rem;
    padding: 1px 4px;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .driver-item-route {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .radio-select-circle {
    display: none;
  }
  .badge-tag-ontime, .badge-tag-delay, .badge-tag-done {
    font-size: 0.65rem;
    padding: 2px 5px;
    white-space: nowrap;
  }

  /* Mapa uprostřed */
  .dispatch-col-map {
    min-width: 0;
    height: 100%;
    min-height: 0;
  }
  .dispatch-map-container {
    height: 100%;
    min-height: 0;
  }
  .map-view-header {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .map-main-heading {
    font-size: 0.85rem;
  }
  .map-quick-controls {
    flex-wrap: wrap;
    gap: 4px;
  }
  .map-ctrl-btn {
    font-size: 0.68rem;
    padding: 3px 6px;
  }

  /* Sloupec detail vpravo */
  .dispatch-col-detail {
    grid-column: span 1;
    min-width: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    padding: 10px;
  }
  .widget-card-title {
    gap: 6px;
    flex-wrap: wrap;
  }
  .widget-card-title span:first-child {
    font-size: 0.82rem;
  }
  .widget-stat-val[style*="École cible"],
  .widget-stat-box:nth-child(4) .widget-stat-val {
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
  }
  .detail-stop-row {
    padding: 5px 6px;
  }
  .stop-row-name {
    font-size: 0.76rem;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    line-height: 1.25 !important;
  }
  .detail-stops-checklist {
    max-height: none !important;
    overflow-y: visible !important;
  }
  .stop-row-badge {
    font-size: 0.65rem;
    padding: 2px 4px;
  }
  .btn-edit-stop-addr {
    padding: 2px 4px;
  }

  .drivers-list-scroll {
    flex: 1 1 0;
    overflow-y: auto;
  }
  .dispatch-header-bar {
    padding: 6px 10px;
    gap: 6px;
  }
  .dispatch-main-title {
    font-size: 1.05rem;
  }
  .dispatch-kpi-row {
    gap: 4px;
  }
  .dispatch-kpi-pill {
    padding: 2px 6px;
  }
  .btn-dispatch-settings,
  .btn-dispatch-connect {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
}

@media (max-width: 860px) {
  .dispatch-samsara-cockpit {
    grid-template-columns: 1fr;
    height: auto;
  }
  .dispatch-col-detail {
    grid-column: span 1;
  }
}

/* COLONNE 1 : LISTE DES CHAUFFEURS */
.dispatch-col-drivers {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.drivers-col-header {
  padding: 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #ffffff;
}

.drivers-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drivers-header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.drivers-search-box {
  position: relative;
  width: 100%;
}

.drivers-search-box .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: #94a3b8;
  pointer-events: none;
}

.drivers-search-box input {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 10px 7px 30px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}

.drivers-search-box input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.drivers-filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
}

.filter-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
}

.filter-tab-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.filter-tab-btn.tab-btn-delay.active {
  color: #dc2626;
}

.drivers-scroll-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Carte item chauffeur dans la liste */
.driver-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.driver-list-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.driver-list-item.is-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.driver-item-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.driver-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #334155;
}

.driver-item-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}

.status-dot-active {
  background: #22c55e;
}
.status-dot-delay {
  background: #ef4444;
}
.status-dot-done {
  background: #3b82f6;
}

.driver-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.driver-item-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.driver-item-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.driver-city-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

.driver-item-route {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-item-right-badge {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.badge-tag-delay {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.badge-tag-ontime {
  background: #dcfce7;
  color: #16a34a;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.badge-tag-done {
  background: #e0e7ff;
  color: #4338ca;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}

.radio-select-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  transition: all 0.15s;
}

.driver-list-item.is-selected .radio-select-circle {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 2px #ffffff;
}

/* COLONNE 2 : CARTE FOCUS CHAUFFEUR */
.dispatch-col-map {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.map-view-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  gap: 10px;
}

.map-title-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-target-icon {
  font-size: 1.1rem;
}

.map-title-texts {
  display: flex;
  flex-direction: column;
}

.map-sub-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-main-heading {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.map-quick-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-ctrl-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.map-ctrl-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.dispatch-map-container {
  flex: 1 1 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #f1f5f9;
  position: relative;
  z-index: 1;
}

/* Custom Leaflet Markers */
.map-custom-vehicle {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.map-vehicle-icon-bubble {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #ffffff;
  position: relative;
  animation: pulse-vehicle 2s infinite;
}

@keyframes pulse-vehicle {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.map-vehicle-label-plate {
  margin-top: 3px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.map-custom-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #16a34a;
  border: 2.5px solid #ffffff;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.map-custom-stop:hover {
  transform: scale(1.15);
}

.map-custom-stop.stop-done {
  background: #16a34a;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.map-custom-stop.stop-delay {
  background: #ef4444;
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.45), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.map-custom-stop.stop-absent {
  background: #94a3b8;
  border-color: #cbd5e1;
  color: #ffffff;
  opacity: 0.75;
  text-decoration: line-through;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.map-custom-school {
  background: #0f172a;
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* COLONNE 3 : DÉTAIL & TÉLÉMÉTRIE CHAUFFEUR */
.dispatch-col-detail {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.detail-driver-header-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-driver-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.detail-driver-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.detail-driver-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
}

.detail-driver-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.detail-driver-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.detail-driver-city-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
}

/* Mini cartes dans le volet de droite */
.detail-widget-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-grid-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.widget-stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.widget-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}

.widget-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

/* Liste des élèves de la tournée en cours */
.detail-passenger-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.passenger-box-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1e40af;
  text-transform: uppercase;
}

.passenger-box-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1e3a8a;
}

.passenger-box-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: #3b82f6;
}

.detail-stops-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: none;
  overflow-y: visible;
  padding-right: 4px;
  padding-bottom: 12px;
}

.detail-stop-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f8fafc;
  font-size: 0.78rem;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.detail-stop-row:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-stop-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.stop-row-name {
  font-weight: 800;
  font-size: 0.84rem;
  color: #0f172a;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.detail-stop-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stop-row-address {
  font-size: 0.74rem;
  color: #475569;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1.35;
  word-break: break-word;
}

.stop-row-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
}

.btn-edit-stop-addr {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.72rem;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-edit-stop-addr:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Boutons d'action rapide dans le panneau de droite */
.detail-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn-detail-call {
  background: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-detail-call:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-detail-msg {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.btn-detail-msg:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn-detail-sheet {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}

.btn-detail-sheet:hover {
  background: #e2e8f0;
}

/* Modál připojení přes Wi-Fi */
.connect-modal-card {
  max-width: 420px;
  text-align: center;
}

.mobile-url-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 10px 0;
}

.mobile-url-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.btn-copy-url {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.mobile-url-hint {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 16px;
}

/* ==========================================================================
   DESKTOP NAVIGATION PILLS (Horní navigační lišta na desktopu)
   ========================================================================== */
.desktop-nav-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.nav-pill-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.nav-pill-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.nav-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Na PC dispečinku je tlačítko řidiče skryté - dispečer řídí flotilu */
body.role-dispatcher #desktop-nav-pills #nav-btn-driver {
  display: none !important;
}

/* Pro řidiče je dispečink trvale a přísně skrytý */
body.role-driver #desktop-nav-pills #nav-btn-dispatch,
body.role-driver #ios-bottom-tabs #tab-btn-dispatch {
  display: none !important;
}

@media (max-width: 860px) {
  .top-nav {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center !important;
    padding: calc(var(--safe-top) + 8px) 14px 8px !important;
  }

  .nav-brand {
    justify-self: start !important;
    flex: none !important;
  }

  .top-nav-center {
    justify-self: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 auto !important;
  }

  .lang-switcher-container {
    justify-self: end !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
  }

  /* 100% IDENTICKÁ GEOMETRIE A TVAR OBOU DLAŽDIC: CLOUD, JAZYK */
  #offline-badge,
  #btn-lang-switcher {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 10px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
  }

  #offline-badge {
    font-size: 0.95rem !important;
    line-height: 1 !important;
    border: 1.5px solid #22c55e !important;
    background: #f0fdf4 !important;
    color: #15803d !important;
  }

  #btn-lang-switcher {
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  #btn-lang-switcher .lang-code {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1 !important;
  }

  .vehicle-badge,
  #driver-vehicle-badge {
    display: none !important;
  }

  .desktop-nav-pills {
    display: none !important;
  }
  .sheet-doc-footer-note {
    display: none !important;
  }
  #view-driver .timeline-step-num {
    display: none !important;
  }
  #view-driver .row-status-tile.badge-standard {
    min-width: 26px !important;
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    border-radius: 7px !important;
    font-size: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 6px !important;
    box-sizing: border-box !important;
  }
  #view-driver .row-status-tile.badge-standard::after {
    content: "S";
    font-size: 0.82rem !important;
    font-weight: 850 !important;
    color: #334155;
    line-height: 1;
  }
  body.theme-ios-dark #view-driver .row-status-tile.badge-standard::after {
    color: #f2f2f7;
  }
}

/* ==========================================================================
   DISPATCHER LIVE MONITORING COCKPIT (VUE DRIVER DESKTOP)
   ========================================================================== */
.dispatcher-live-sidebar {
  display: none;
}

.driver-dual-cockpit-layout {
  display: block;
}

.disp-timeline-header-bar {
  display: none;
}

.disp-monitor-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #cbd5e1);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

/* 1. KARTA DETAILU AKTIVNÍ POZICE */
.disp-active-detail-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #cbd5e1);
}

.disp-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.disp-detail-step-badge {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.disp-detail-title-wrap {
  flex: 1;
  min-width: 0;
}

.disp-detail-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 3px 0;
  letter-spacing: -0.3px;
}

.disp-detail-address {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  display: block;
  line-height: 1.35;
}

.disp-detail-active-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  animation: dispPulse 2s infinite;
}

.disp-detail-action-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.disp-action-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.disp-action-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.disp-action-sub {
  font-size: 0.82rem;
  color: #475569;
}

.disp-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.disp-detail-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.disp-cell-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.disp-cell-val {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* 2. KARTA REÁLNÉHO SOUHRNU SMĚNY */
.disp-real-summary-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--separator, #cbd5e1);
}

.disp-summary-header {
  margin-bottom: 14px;
}

.disp-summary-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.disp-real-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.disp-real-kpi-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.disp-rkpi-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.disp-rkpi-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.disp-rkpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.disp-rkpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.disp-rkpi-sub {
  font-size: 0.72rem;
  color: #64748b;
}

.disp-real-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  font-size: 0.8rem;
  color: #475569;
}

.disp-rf-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.disp-rf-icon {
  font-size: 1rem;
}

.disp-rf-text {
  font-weight: 600;
}

/* KROKOVÝ PUNTÍK V TIMELINE */
.timeline-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 6px;
  transition: all 0.2s ease;
}

.timeline-item.active .timeline-step-num {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.timeline-item.completed .timeline-step-num {
  background: #64748b;
  color: #ffffff;
}

/* DARK MODE */
body.theme-ios-dark .disp-monitor-card,
body.theme-ios-dark .disp-active-detail-card,
body.theme-ios-dark .disp-real-summary-card {
  background: #1c1c1e !important;
  border-color: #38383a !important;
  color: #f1f5f9 !important;
}

body.theme-ios-dark .disp-detail-name,
body.theme-ios-dark .disp-summary-title,
body.theme-ios-dark .disp-rkpi-val,
body.theme-ios-dark .disp-action-title,
body.theme-ios-dark .disp-cell-val {
  color: #f1f5f9 !important;
}

body.theme-ios-dark .disp-detail-action-box,
body.theme-ios-dark .disp-detail-cell,
body.theme-ios-dark .disp-real-kpi-tile {
  background: #27272a !important;
  border-color: #3f3f46 !important;
}

body.theme-ios-dark .disp-real-footer {
  border-color: #27272a !important;
}

@media (min-width: 861px) {
  .top-nav-center .nav-dispatch-badge {
    display: none !important;
  }

  .ios-tab-bar {
    display: none !important;
  }

  /* Odstranění autíčka s SPZ i cloudu pro počítač */
  #driver-vehicle-badge,
  #offline-badge {
    display: none !important;
  }

  .app-header {
    justify-content: space-between !important;
    padding: 8px 16px !important;
  }

  .header-status {
    flex: 1 !important;
    justify-content: flex-end !important;
  }

  body {
    padding-bottom: 0 !important;
  }

  /* 2-sloupcový layout pro Dispečerský Cockpit / Řidič na desktopu */
  #view-driver.active {
    display: block !important;
    max-width: 1720px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 8px 16px 24px 16px !important;
    box-sizing: border-box !important;
  }

  .disp-timeline-header-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
  }

  .disp-timeline-heading {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin: 0 !important;
  }

  .disp-timeline-badge {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #2563eb !important;
    background: #eff6ff !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    border: 1px solid #bfdbfe !important;
  }

  /* ŘIDIČ NA POČÍTAČI VŮBEC NEEXISTUJE: Počítač slouží výhradně pro dispečera / vedení */
  #view-driver,
  #nav-btn-driver,
  .desktop-nav-pills [data-tab="driver"] {
    display: none !important;
  }

  #view-driver .timeline-item.active .item-name {
    color: #0284c7 !important;
    font-weight: 800 !important;
  }

  /* 2-sloupcový layout pro Tabulku jízd na desktopu (stejně jako Výkaz hodin) */
  #view-sheet.active {
    display: flex !important;
    gap: 10px !important;
    align-items: flex-start !important;
    padding: 6px 10px 10px 10px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sheet-control-hero {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    padding: 12px 14px !important;
    margin-bottom: 0 !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05) !important;
  }

  .sheet-hero-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 10px !important;
  }

  .sheet-hero-title {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    margin: 0 0 2px 0 !important;
    color: #0f172a !important;
  }

  .sheet-hero-sub {
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    color: #64748b !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .sheet-hero-tournee {
    font-size: 0.72rem !important;
    color: #64748b !important;
    margin-top: 2px !important;
  }

  .sheet-week-picker-wrap {
    width: 100% !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }

  .sheet-week-picker-wrap label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: #64748b !important;
    display: block !important;
  }

  .sheet-week-control {
    width: 100% !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    background: white !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 2px 4px !important;
  }

  .sheet-week-control input {
    flex: 1 !important;
    text-align: center !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    border: none !important;
    background: transparent !important;
    color: #0f172a !important;
    padding: 2px 4px !important;
  }

  .btn-sheet-nav {
    background: none !important;
    border: none !important;
    color: #2563eb !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-weight: 800 !important;
  }
  .btn-sheet-nav:hover {
    background: #eff6ff !important;
  }

  /* Svislý balík 4 dlaždic - stejný tvar jako Výkaz hodin, hezky barevný */
  .sheet-kpi-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sheet-kpi-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
  }

  .sheet-kpi-card.kpi-blue {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
  }

  .sheet-kpi-card.kpi-slate {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
  }

  .sheet-kpi-card.kpi-green {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
  }

  .sheet-kpi-card.kpi-purple {
    background: #faf5ff !important;
    border-color: #e9d5ff !important;
  }

  .sheet-kpi-info {
    display: flex !important;
    flex-direction: column !important;
  }

  .sheet-kpi-label {
    font-size: 0.70rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    color: #64748b !important;
    display: block !important;
  }

  .sheet-kpi-val {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    margin: 1px 0 !important;
  }

  .sheet-kpi-sub {
    font-size: 0.68rem !important;
    color: #64748b !important;
    font-weight: 500 !important;
    display: block !important;
  }

  .sheet-kpi-icon {
    font-size: 1.35rem !important;
  }

  /* Akční tlačítka v bočním panelu (Sjednoceno s výkazem hodin) */
  .sheet-side-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    border-top: 1px solid #e2e8f0 !important;
    padding-top: 10px !important;
    width: 100% !important;
  }

  .sheet-side-actions .hours-actions-grid-2x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .sheet-side-actions button {
    width: 100% !important;
    height: 34px !important;
    justify-content: center !important;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
  }

  .btn-sheet-email {
    background: #fefce8 !important;
    color: #a16207 !important;
    border: 1px solid #fef08a !important;
    cursor: pointer !important;
    font-weight: 600 !important;
  }
  .btn-sheet-email:hover {
    background: #fef9c3 !important;
  }

  /* Pravá část: official-sheet-wrapper bez spodních dlaždic */
  .official-sheet-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08) !important;
    background: white !important;
    border: 1px solid #cbd5e1 !important;
  }

  /* Brand Header pro Tabulku jízd (identický jako Výkaz hodin) */
  .sheet-table-brand-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }

  .sheet-brand-left .sheet-company-name {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    display: block !important;
  }

  .sheet-brand-left .sheet-company-sub {
    font-size: 0.72rem !important;
    color: #64748b !important;
    font-style: italic !important;
  }

  .sheet-brand-center {
    text-align: center !important;
  }

  .sheet-doc-title {
    font-size: 1.05rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    letter-spacing: 0.05em !important;
    display: block !important;
  }

  .sheet-doc-period {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #2563eb !important;
    margin-top: 2px !important;
    display: block !important;
  }

  .sheet-brand-right {
    font-size: 0.78rem !important;
    color: #334155 !important;
    line-height: 1.35 !important;
    text-align: right !important;
  }

  .sheet-header-grid {
    min-width: 0 !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    gap: 4px !important;
  }

  .header-box {
    padding: 4px 6px !important;
  }

  .sheet-table-section {
    min-width: 0 !important;
    width: 100% !important;
    margin-bottom: 8px !important;
  }

  .table-responsive {
    min-width: 0 !important;
    width: 100% !important;
  }

  .col-w-pts {
    width: 145px !important;
  }

  .col-points-td, .col-points {
    width: 145px !important;
    max-width: 145px !important;
    padding: 4px 4px !important;
  }

  .th-day-col {
    min-width: 90px !important;
  }

  .sheet-table-section .table-section-title {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 0.74rem !important;
    letter-spacing: 0.04em !important;
    padding: 3px 8px !important;
    border-radius: 4px 4px 0 0 !important;
  }

  .mobi-table {
    font-size: 0.78rem !important;
  }

  .mobi-table th,
  .mobi-table td {
    padding: 2px 4px !important;
    height: 24px !important;
  }

  .cell-inner-wrap {
    min-height: 24px !important;
  }

  .cell-time,
  .cell-km {
    font-size: 0.80rem !important;
    padding: 1px 3px !important;
  }

  .sheet-legend-bar {
    margin-top: 8px !important;
    padding: 4px 8px !important;
  }

  .sheet-doc-footer-note {
    display: flex !important;
    justify-content: space-between !important;
    font-size: 0.64rem !important;
    color: #64748b !important;
    margin-top: 8px !important;
    border-top: 1px solid #f1f5f9 !important;
  }
}

/* ==========================================================================
   OCHRANA ROLE ŘIDIČE PROTI PŘETOČENÍ NA ŠÍŘKU (LANDSCAPE GUARD - BUILD 148)
   ========================================================================== */
/* Dispečink je pro řidiče trvale a přísně skrytý kdekoli */
body[data-user-role="driver"] #view-dispatch,
body.role-driver #view-dispatch {
  display: none !important;
}

@media (max-width: 860px) {
  body[data-user-role="driver"] .desktop-nav-pills,
  body.role-driver .desktop-nav-pills,
  body[data-user-role="driver"] .dispatcher-live-sidebar,
  body.role-driver .dispatcher-live-sidebar {
    display: none !important;
  }

  body[data-user-role="driver"] .control-dock-bar,
  body.role-driver .control-dock-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body[data-user-role="driver"] .ios-tab-bar,
  body.role-driver .ios-tab-bar {
    display: flex !important;
  }

  body[data-user-role="driver"] .driver-dual-cockpit-layout,
  body.role-driver .driver-dual-cockpit-layout {
    display: block !important;
  }

  /* Kompaktní ergonomické řádky časové osy na mobilu (Build 256) */
  #view-driver .stops-timeline-list {
    gap: 4px !important;
  }
  #view-driver .timeline-item {
    padding: 6px 10px !important;
    border-radius: 12px !important;
    min-height: 44px !important;
    margin-bottom: 0 !important;
  }
  #view-driver .item-left {
    gap: 6px !important;
  }
  #view-driver .item-right {
    flex: 0 0 88px !important;
    width: 88px !important;
    gap: 4px !important;
  }
  #view-driver .row-status-tile {
    height: 24px !important;
    min-width: 58px !important;
    font-size: 0.70rem !important;
    padding: 0 4px !important;
    margin-right: 4px !important;
  }
  #view-driver .timeline-step-num {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.72rem !important;
  }
  #view-driver .item-name {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
  }
  #view-driver .metric-time {
    font-size: 0.82rem !important;
    font-weight: 750 !important;
  }
  #view-driver .metric-km,
  #view-driver .metric-km-input {
    font-size: 0.80rem !important;
    width: 80px !important;
    padding: 1px 2px !important;
    height: 20px !important;
  }
  #view-driver .shift-selector-card {
    padding: 8px 10px !important;
    margin: 0 0 6px 0 !important;
  }
  #view-driver .day-pills {
    margin-bottom: 5px !important;
  }
  #view-driver .driver-week-segment-bar {
    margin: 0 !important;
  }
  #view-driver .week-segment-btn {
    padding: 5px 3px !important;
    min-height: 38px !important;
  }
  #view-driver .active-stop-card {
    padding: 6px 12px !important;
    margin-bottom: 6px !important;
  }
  #view-driver .control-dock-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 6px !important;
    margin-bottom: 8px !important;
  }
  #view-driver .stops-timeline-section {
    padding: 8px 8px 16px 8px !important;
  }
  #view-driver .dock-3tile {
    height: 52px !important;
  }
}

body[data-user-role="driver"] #offline-badge,
body.role-driver #offline-badge {
  display: inline-flex !important;
}

#driver-vehicle-badge,
.vehicle-badge {
  display: none !important;
}

/* Optimalizace rozložení pro řidiče v držáku na palubní desce (Landscape) */
@media (orientation: landscape) and (max-height: 600px) {
  body[data-user-role="driver"] .top-nav,
  body.role-driver .top-nav {
    padding: calc(var(--safe-top, 0px) + 4px) 12px 4px !important;
  }
  body[data-user-role="driver"] .ios-tab-bar,
  body.role-driver .ios-tab-bar {
    height: 44px !important;
    padding-bottom: env(safe-area-inset-bottom, 2px) !important;
  }
  body[data-user-role="driver"] .ios-tab-item,
  body.role-driver .ios-tab-item {
    padding: 2px 0 !important;
  }
  body[data-user-role="driver"] .ios-tab-icon,
  body.role-driver .ios-tab-icon {
    font-size: 1.05rem !important;
  }
  body[data-user-role="driver"] .ios-tab-label,
  body.role-driver .ios-tab-label {
    font-size: 0.65rem !important;
  }
  body[data-user-role="driver"] .active-stop-card,
  body.role-driver .active-stop-card {
    padding: 8px 14px !important;
  }
  body[data-user-role="driver"] .active-stop-name,
  body.role-driver .active-stop-name {
    font-size: 1.25rem !important;
  }
  body[data-user-role="driver"] .shift-selector-card,
  body.role-driver .shift-selector-card {
    margin: 4px 10px !important;
  }
  body[data-user-role="driver"] .driver-week-segment-bar,
  body.role-driver .driver-week-segment-bar {
    margin: 4px 10px !important;
  }
}

/* Tlačítko Nastavení flotily v hlavičce dispečinku */
.btn-dispatch-settings {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 7px 14px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-dispatch-settings:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ==========================================================================
   MODÁL NASTAVENÍ A PERSONALIZACE FLOTILY (SAMSARA STYLE)
   ========================================================================== */
.fleet-settings-modal-card {
  max-width: 740px;
  width: 94vw;
  max-height: 88vh;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.fleet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.fleet-modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fleet-modal-icon {
  font-size: 1.8rem;
}

.fleet-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.fleet-modal-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin: 2px 0 0 0;
}

.btn-close-modal-x {
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-modal-x:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.fleet-modal-tabs {
  display: flex;
  background: #f8fafc;
  padding: 6px 20px;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.fleet-tab-btn {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.fleet-tab-btn:hover {
  color: #0f172a;
}

.fleet-tab-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.fleet-tab-content {
  display: none;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.fleet-tab-content.active {
  display: block;
}

.fleet-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.fleet-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fleet-form-field.full-span {
  grid-column: span 2;
}

.fleet-form-field label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fleet-form-field input {
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s ease;
}

.fleet-form-field input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.fleet-fuel-pills {
  display: flex;
  gap: 10px;
}

.fleet-fuel-btn {
  flex: 1;
  padding: 9px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 9px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fleet-fuel-btn.active {
  background: #dbeafe;
  border-color: #2563eb;
  color: #1e40af;
}

/* Tabulka řidičů flotily */
.fleet-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fleet-list-count {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

.btn-add-fleet-driver {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-add-fleet-driver:hover {
  background: #1d4ed8;
}

.fleet-drivers-table-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow-x: auto;
  width: 100%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.fleet-drivers-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.fleet-drivers-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.fleet-drivers-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.fleet-drivers-table th:nth-child(1), .fleet-drivers-table td:nth-child(1) { width: 23%; min-width: 170px; }
.fleet-drivers-table th:nth-child(2), .fleet-drivers-table td:nth-child(2) { width: 21%; min-width: 150px; }
.fleet-drivers-table th:nth-child(3), .fleet-drivers-table td:nth-child(3) { width: 14%; min-width: 110px; }
.fleet-drivers-table th:nth-child(4), .fleet-drivers-table td:nth-child(4) { width: 22%; min-width: 160px; }
.fleet-drivers-table th:nth-child(5), .fleet-drivers-table td:nth-child(5) { width: 14%; min-width: 120px; }
.fleet-drivers-table th:nth-child(6), .fleet-drivers-table td:nth-child(6) { width: 120px; min-width: 120px; text-align: center; }

.fleet-driver-cell-name {
  font-weight: 700;
}

.fleet-driver-input-inline {
  width: 100% !important;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  font-weight: 500;
  color: #0f172a;
  background: #ffffff;
  transition: all 0.15s ease;
}

.fleet-driver-input-inline:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.btn-fleet-driver-pair {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 5px 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-fleet-driver-pair:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-fleet-driver-del {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-fleet-driver-del:hover {
  background: #fecaca;
}

/* ========================================================================== */
/* FLOTILA: VERZE 5 - SYMETRICKÉ KARTY ŘIDIČŮ (2 SLOUPCE)                     */
/* ========================================================================== */
.fleet-drivers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 16px;
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .fleet-drivers-grid {
    grid-template-columns: 1fr;
  }
}

.fleet-driver-box-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.fleet-driver-box-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.fleet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 12px;
}

.fleet-card-driver-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fleet-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.fleet-card-avatar.standby {
  background: #fef3c7;
  color: #b45309;
}

.fleet-card-name {
  font-weight: 800;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.2;
}

.fleet-card-meta {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fleet-card-meta a {
  color: inherit;
  text-decoration: none;
}
.fleet-card-meta a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.fleet-card-badge-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge-tournee {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.badge-tournee.standby {
  background: #f1f5f9;
  color: #475569;
}

.badge-driver-status {
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-driver-status.active { color: #15803d; }
.badge-driver-status.standby { color: #b45309; }
.badge-driver-status.service { color: #475569; }

.fleet-card-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.fleet-mini-tile {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fleet-mini-lbl {
  font-size: 0.70rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fleet-mini-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fleet-plate-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  background: #e2e8f0;
  color: #1e293b;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.fleet-pmr-badge {
  background: #f3e8ff;
  color: #7e22ce;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.fleet-mini-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

.fleet-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  margin-top: auto;
}

.btn-fleet-action-pair {
  flex: 1;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-fleet-action-pair:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.btn-fleet-action-edit {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-fleet-action-edit:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-fleet-action-del {
  background: #ffffff;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
  transition: all 0.15s ease;
}
.btn-fleet-action-del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* KROK 4: Správa kvóty a uspaných vozidel */
.fleet-driver-box-card.paused {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  opacity: 0.85;
}
.fleet-driver-box-card.paused .fleet-card-avatar {
  background: #f1f5f9;
  color: #64748b;
}
.badge-driver-status.paused {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-fleet-action-toggle {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.btn-fleet-action-toggle.btn-pause:hover {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.btn-fleet-action-toggle.btn-resume {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.btn-fleet-action-toggle.btn-resume:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}
.fleet-quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.status-dot-paused {
  background: #94a3b8 !important;
}
.badge-tag-paused {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Modál editace řidiče */
.fleet-driver-modal-card {
  max-width: 620px !important;
  width: 95% !important;
  text-align: left !important;
}

.fleet-driver-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}
@media (max-width: 580px) {
  .fleet-driver-modal-grid {
    grid-template-columns: 1fr;
  }
}
.fleet-modal-col-span {
  grid-column: 1 / -1;
}

.fleet-driver-modal-grid label {
  display: block;
  font-size: 0.80rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

.fleet-driver-modal-grid input,
.fleet-driver-modal-grid select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.fleet-driver-modal-grid input:focus,
.fleet-driver-modal-grid select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fleet-modal-actions {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-cancel-modal {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-cancel-modal:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.btn-cancel-modal:active {
  transform: translateY(1px);
}

.btn-save-modal {
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-save-modal:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.38);
  transform: translateY(-1px);
}

.btn-save-modal:active {
  transform: translateY(0);
}

/* ==========================================================================
   PŘEPÍNAČ VRSTEV MAPY (PLÁN VS SATELIT)
   ========================================================================== */
.map-layer-switcher {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  gap: 2px;
}

.layer-pill-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.layer-pill-btn:hover {
  color: #0f172a;
}

.layer-pill-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   PLOVOUCÍ LIŠTA PRO VÝBĚR NA VELKÉ MAPĚ & NAŠEPTÁVAČ
   ========================================================================== */
.map-picker-banner {
  position: absolute;
  top: 64px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  border: 2px solid #2563eb;
  padding: 12px 18px;
  animation: slideDownPicker 0.22s ease-out;
}

@keyframes slideDownPicker {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.map-picker-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.map-picker-banner-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.picker-pulse-dot {
  font-size: 1.5rem;
  animation: pulsePicker 1.4s infinite;
}

@keyframes pulsePicker {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.map-picker-sub {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 2px;
}

.map-picker-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-picker-confirm {
  background: #16a34a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.4);
  transition: all 0.15s ease;
}

.btn-picker-confirm:hover {
  background: #15803d;
}

.btn-picker-cancel {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-picker-cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Autocomplete návrhy adres v modálu */
.address-suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  max-height: 220px;
  overflow-y: auto;
  z-index: 1100;
  margin-top: 4px;
}

.address-suggestion-item {
  padding: 10px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  transition: background 0.12s ease;
}

.address-suggestion-item:last-child {
  border-bottom: none;
}

.address-suggestion-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.map-picker-banner.hidden,
.address-suggestions-box.hidden,
.hidden {
  display: none !important;
}

/* ==========================================================================
   VUE 2B : RELEVÉ MENSUEL DES HEURES (1:1 MOBI FRANCE TIMESHEET)
   ========================================================================== */
#view-hours {
  padding: 12px 16px 80px 16px;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 861px) {
  body:has(#view-hours.active),
  body[data-active-tab="hours"] {
    padding-bottom: 0 !important;
  }

  #view-hours.active {
    display: flex !important;
    gap: 14px;
    align-items: flex-start;
    padding: 6px 14px 0 14px !important;
  }

  .hours-control-hero {
    width: 290px;
    min-width: 290px;
    max-width: 290px;
    padding: 14px 16px;
    margin-bottom: 0;
    gap: 12px;
    flex-shrink: 0;
    box-sizing: border-box;
  }

  .hours-hero-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 12px;
  }

  .hours-hero-title {
    font-size: 1.15rem;
    margin: 0 0 2px 0;
  }

  .hours-hero-sub {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .hours-month-picker-wrap {
    width: 100%;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .hours-month-picker-wrap label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
  }

  .hours-month-control {
    width: 100%;
    justify-content: space-between;
    box-sizing: border-box;
    background: white;
  }

  .hours-month-display-wrap {
    flex: 1;
    justify-content: center;
    align-items: center;
    cursor: pointer;
  }

  .hours-month-control #hours-month-select,
  .hours-month-control .hours-month-hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.001;
    cursor: pointer;
    z-index: 2;
    border: none;
    background: transparent;
  }

  .hours-kpi-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .hours-kpi-card {
    padding: 8px 12px;
    border-radius: 10px;
  }

  .hours-kpi-card .kpi-label {
    font-size: 0.72rem;
  }

  .hours-kpi-card .kpi-val {
    font-size: 1.15rem;
    margin: 1px 0;
  }

  .hours-kpi-card .kpi-sub {
    font-size: 0.70rem;
  }

  .hours-kpi-card .kpi-icon {
    font-size: 1.35rem;
  }

  .hours-actions-bar {
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
  }

  .hours-actions-bar button {
    width: 100%;
    height: 34px !important;
    justify-content: center;
    padding: 6px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
    box-sizing: border-box;
  }

  .hours-actions-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .official-hours-table-container {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    box-sizing: border-box;
  }

  .hours-table-brand-header {
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .hours-brand-left .hours-company-name {
    font-size: 1.10rem;
  }

  .hours-brand-left .hours-company-sub {
    font-size: 0.70rem;
  }

  .hours-doc-title {
    font-size: 0.92rem;
  }

  .hours-doc-month {
    font-size: 0.76rem;
  }

  .hours-brand-right {
    font-size: 0.70rem;
    line-height: 1.25;
  }

  .hours-table-scroll-wrapper {
    margin-bottom: 6px;
  }

  .mobi-hours-table {
    min-width: 1100px;
    font-size: 0.69rem;
  }

  .mobi-hours-table th,
  .mobi-hours-table td {
    padding: 2px 2px;
    line-height: 1.2;
  }

  .mobi-hours-table th.col-row-title,
  .mobi-hours-table td.col-row-title {
    width: 115px;
    min-width: 115px;
    padding-left: 6px;
  }

  .mobi-hours-table th.col-total,
  .mobi-hours-table td.col-total {
    width: 65px;
    min-width: 65px;
  }

  .mobi-hours-table .day-weekday {
    font-size: 0.66rem;
    margin-bottom: 1px;
    line-height: 1;
  }

  .mobi-hours-table .day-number {
    font-size: 0.76rem;
    line-height: 1.1;
  }

  .hours-summary-blocks-grid {
    margin-top: 6px;
    margin-bottom: 4px;
    gap: 8px;
  }

  .hours-summary-mini-table {
    font-size: 0.66rem;
  }

  .hours-summary-mini-table td {
    padding: 1.5px 5px;
    line-height: 1.2;
  }

  .hours-doc-footer-note {
    font-size: 0.64rem;
    margin-top: 4px;
    padding-top: 4px;
  }
}

.hours-control-hero {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  padding: 18px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hours-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hours-hero-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.hours-hero-sub {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
  display: block;
}

.hours-month-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hours-month-picker-wrap label {
  font-weight: 700;
  font-size: 0.88rem;
  color: #475569;
}

.hours-month-control {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
}

.btn-hours-nav {
  border: none;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.85rem;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.15s ease;
}

.btn-hours-nav:hover {
  background: #2563eb;
  color: #ffffff;
}

.hours-month-display-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 16px;
  min-width: 100px;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.hours-month-display-wrap:hover {
  background: #f8fafc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hours-month-display-wrap:active {
  transform: scale(0.98);
  background: #f1f5f9;
}

.hours-month-display-text {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.5px;
  pointer-events: none;
}

.hours-month-display-icon {
  font-size: 0.9rem;
  opacity: 0.85;
  pointer-events: none;
}

.hours-month-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.001;
  cursor: pointer;
  z-index: 2;
  border: none;
  background: transparent;
}

/* Grille de KPIs mensuels */
.hours-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.hours-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hours-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.hours-kpi-card .kpi-info {
  display: flex;
  flex-direction: column;
}

.hours-kpi-card .kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.hours-kpi-card .kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono, monospace);
  color: #0f172a;
  margin: 2px 0;
}

.hours-kpi-card .kpi-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.hours-kpi-card .kpi-icon {
  font-size: 1.6rem;
  opacity: 0.85;
}

.hours-actions-bar,
.sheet-side-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.btn-hours-settings-full {
  width: 100% !important;
  height: 40px !important;
  font-size: 0.90rem !important;
  font-weight: 700 !important;
  justify-content: center !important;
  border-radius: 9px !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.2);
}

.hours-actions-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.hours-actions-grid-2x2 button {
  width: 100% !important;
  height: 35px !important;
  padding: 6px 10px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-sizing: border-box;
  text-align: center;
}

/* Conteneur officiel du tableau */
.official-hours-table-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
  overflow: hidden;
}

.hours-table-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.hours-brand-left .hours-company-name {
  font-size: 1.3rem;
  font-weight: 900;
  color: #0f172a;
  display: block;
}

.hours-brand-left .hours-company-sub {
  font-size: 0.75rem;
  color: #64748b;
  font-style: italic;
}

.hours-brand-center {
  text-align: center;
}

.hours-doc-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.05em;
  display: block;
}

.hours-doc-month {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2563eb;
  margin-top: 2px;
  display: block;
}

.hours-brand-right {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.4;
  text-align: right;
}

/* Table scrollable */
.hours-table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.mobi-hours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  table-layout: auto;
  min-width: 1540px;
}

.mobi-hours-table th,
.mobi-hours-table td {
  border: 1px solid #94a3b8;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap !important;
  word-break: keep-all;
  font-weight: 500;
}

/* Première colonne fixe (titres des lignes) */
.mobi-hours-table th.col-row-title,
.mobi-hours-table td.col-row-title {
  width: 130px;
  min-width: 130px;
  text-align: left;
  padding-left: 8px;
  font-weight: 700;
  background: #f8fafc;
  color: #1e293b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0,0,0,0.06);
}

.mobi-hours-table th.col-day-header {
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 2px;
  line-height: 1.2;
}

.mobi-hours-table th.col-day-header.col-today {
  background: #dbeafe !important;
  color: #1e3a8a !important;
  border-bottom: 2px solid #2563eb !important;
}

.th-day-col.is-today-col {
  background: #eff6ff !important;
}

.mobi-hours-table .day-weekday {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2563eb;
  text-transform: capitalize;
  margin-bottom: 2px;
}

.mobi-hours-table .day-number {
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
}

.mobi-hours-table .val-empty {
  color: #cbd5e1;
  font-weight: 300;
}

.mobi-hours-table th.col-total,
.mobi-hours-table td.col-total {
  width: 75px;
  min-width: 75px;
  background: #e2e8f0;
  font-weight: 700;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-variant-numeric: tabular-nums;
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  border-left: 2px solid #334155 !important;
}

/* Week-ends hachurés */
.mobi-hours-table th.col-weekend,
.mobi-hours-table td.col-weekend {
  background: repeating-linear-gradient(
    45deg,
    #cbd5e1,
    #cbd5e1 5px,
    #94a3b8 5px,
    #94a3b8 10px
  ) !important;
  color: transparent !important;
  user-select: none;
}

/* Lignes spéciales */
.row-header-group {
  background: #e2e8f0;
  font-weight: 800;
  text-align: left;
  padding: 5px 8px;
}

.mobi-hours-table tr.row-total-work td {
  background: #f1f5f9;
  font-weight: 800;
}

.mobi-hours-table tr.row-forfait td {
  background: #ffffff;
  color: #64748b;
  font-weight: 700;
}

.mobi-hours-table tr.row-overtime td {
  background: #f0fdf4;
  color: #166534;
  font-weight: 800;
}

.mobi-hours-table tr.row-overtime td.has-overtime {
  background: #dcfce7;
  color: #15803d;
  font-weight: 900;
}

.mobi-hours-table tr.row-to-pay td {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 900;
}

.hours-cell-editable {
  cursor: pointer;
  transition: background 0.1s ease;
}

.hours-cell-editable:hover {
  background: #fef08a !important;
  color: #854d0e !important;
  outline: 1px solid #ca8a04;
}

/* Zone officielle de validation & signatures */
.hours-doc-signature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 14px;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .hours-doc-signature-block {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.hours-signature-card {
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 10px 14px;
  background: #fafafa;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hours-sig-title {
  font-size: 0.76rem;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hours-sig-sub {
  font-size: 0.68rem;
  color: #64748b;
  margin-top: 2px;
}

.hours-sig-line {
  border-bottom: 1px solid #cbd5e1;
  margin-top: 24px;
}

.hours-doc-footer-note {
  font-size: 0.68rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-sheet-email {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sheet-email:hover {
  background: #dcfce7;
  border-color: #86efac;
}

/* 3 Blocs de Synthèse officielle sous le tableau (MOBI France) */
.hours-summary-blocks-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.6fr;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .hours-summary-blocks-grid {
    grid-template-columns: 1fr;
  }
}

.hours-summary-block-card {
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  overflow: hidden;
}

.hours-summary-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.68rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-variant-numeric: tabular-nums;
}

.hours-summary-mini-table th,
.hours-summary-mini-table td {
  border: 1px solid #cbd5e1;
  padding: 3px 6px;
  vertical-align: middle;
}

.hours-summary-mini-table td.sum-lbl {
  background: #f8fafc;
  color: #1e293b;
  font-family: var(--font-sans, sans-serif);
  font-weight: 600;
  font-size: 0.68rem;
  white-space: nowrap;
}

.hours-summary-mini-table td.sum-val {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.hours-summary-mini-table tr.sum-highlight td {
  background: #eff6ff;
  font-weight: 900;
  color: #1d4ed8;
}

.btn-sheet-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sheet-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.btn-sheet-autofill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sheet-autofill:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

/* Modály dispečerské editace buněk a dnů */
.disp-cell-card,
.disp-hours-card {
  max-width: 440px !important;
  width: 92% !important;
}

.disp-modal-meta {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748b;
  margin-top: 4px;
}

.disp-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.disp-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.disp-input-group {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
}

.disp-input-group label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.disp-input-group input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  outline: none;
  transition: border-color 0.15s;
}

.disp-input-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.disp-status-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disp-status-section label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
}

.disp-status-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.disp-chip-btn {
  width: 100%;
  height: 42px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 750;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-sizing: border-box;
  white-space: nowrap;
}

/* První dlaždice Normal (Présent) se rozprostře přes 2 sloupce */
.disp-chip-btn[data-status="none"] {
  grid-column: 1 / -1;
  font-size: 0.86rem;
}

.disp-chip-btn:hover {
  background: #f1f5f9;
}

.disp-chip-btn.active {
  outline: 2.5px solid #2563eb;
  outline-offset: -1px;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 800;
  border-color: #2563eb;
}

.disp-chip-btn.chip-absent.active {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  outline-color: #dc2626;
  border-color: #dc2626;
}

.disp-chip-btn.chip-parents.active {
  background: #ffedd5 !important;
  color: #c2410c !important;
  outline-color: #ea580c;
  border-color: #ea580c;
}

.disp-chip-btn.chip-sans-ecole.active {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  outline-color: #9333ea;
  border-color: #9333ea;
}

.disp-chip-btn.chip-en-stage.active {
  background: #ccfbf1 !important;
  color: #0f766e !important;
  outline-color: #0d9488;
  border-color: #0d9488;
}

.disp-chip-btn.chip-gazole.active {
  background: #dcfce7 !important;
  color: #15803d !important;
  outline-color: #16a34a;
  border-color: #16a34a;
}

.disp-chip-btn.chip-lavage.active {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  outline-color: #0284c7;
  border-color: #0284c7;
}

.disp-modal-actions {
  padding: 14px 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.disp-modal-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.btn-disp-save {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  height: 44px;
  font-weight: 750;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  box-sizing: border-box;
}

.btn-disp-save:hover {
  background: #1d4ed8;
}

.btn-disp-delete {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  height: 44px;
  font-weight: 750;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  box-sizing: border-box;
}

.btn-disp-delete:hover {
  background: #fecaca;
  color: #991b1b;
}

#dispatcher-cell-modal .status-modal-cancel {
  border: none !important;
  background: transparent !important;
  padding: 6px 12px !important;
  font-size: 0.95rem !important;
  font-weight: 750 !important;
  color: #2563eb !important;
  cursor: pointer !important;
  text-align: center !important;
  width: 100% !important;
}

.disp-hours-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.disp-hours-section strong {
  font-size: 0.78rem;
  color: #334155;
  letter-spacing: 0.03em;
}

/* Interaktivní rychlá oprava a smazání záznamu v tabulce jízd */
.col-day-cell {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, filter 0.15s ease;
}

.col-day-cell:hover {
  filter: brightness(0.96);
}

/* ==========================================================================
   PWA UPDATE BANNER & PULL-TO-REFRESH (BUILD 145)
   ========================================================================== */
.pwa-update-banner {
  position: fixed;
  bottom: 84px;
  left: 16px;
  right: 16px;
  max-width: 440px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.25);
  z-index: 99999;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-update-banner.hidden {
  display: none !important;
}

@keyframes pwaSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pwa-update-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-update-icon {
  font-size: 1.6rem;
  line-height: 1;
  animation: pwaBounce 1.5s ease-in-out infinite;
}

@keyframes pwaBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.pwa-update-info {
  display: flex;
  flex-direction: column;
}

.pwa-update-info strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.pwa-update-sub {
  font-size: 0.78rem;
  color: #94a3b8;
}

.btn-pwa-update {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}

.btn-pwa-update:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.btn-pwa-update:active {
  transform: translateY(0);
}

/* Indikátor stažení shora (Pull-to-Refresh) */
.ptr-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 99998;
  pointer-events: none;
  opacity: 0;
  transition: height 0.15s ease-out, opacity 0.15s ease-out;
}

.ptr-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: ptrSpin 0.7s linear infinite;
}

@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}

.ptr-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

/* ==========================================================================
   BOUTON & MODAL PARAMÈTRES DU RELEVÉ D'HEURES (DISPATCHEUR WEB)
   ========================================================================== */
.btn-sheet-settings {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-sheet-settings:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.hours-cfg-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}

.hours-cfg-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hours-cfg-toggle-card {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hours-cfg-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hours-cfg-toggle-info strong {
  font-size: 0.88rem;
  color: #1e293b;
}

.hours-cfg-toggle-info span {
  font-size: 0.76rem;
  color: #64748b;
}

.hours-cfg-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.hours-cfg-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.hours-cfg-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Switch toggle */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s;
  border-radius: 26px;
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .slider {
  background-color: #16a34a;
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   TISK A4 PAYSAGE - IZOLOVANÝ A ČISTÝ PRO OBA DOKUMENTY (FEUILLE DE ROUTE & HEURES)
   ========================================================================== */
@media print {
  @page {
    size: A4 landscape;
    margin: 4mm 5mm !important;
  }

  html, body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 1. SKRYTÍ VŠECH OVLÁDACÍCH A SYSTÉMOVÝCH PRVKŮ ROZHRANÍ */
  .top-nav, 
  .sheet-control-hero,
  .sheet-preview-header,
  .sheet-toolbar, 
  .sheet-day-shortcuts,
  .sheet-side-actions,
  .hours-control-hero,
  .hours-actions-bar,
  .hours-kpis-grid,
  .ios-tab-bar,
  .pwa-update-banner,
  .toast,
  #toast,
  .row-status-modal-overlay,
  .safety-modal-overlay,
  .dispatcher-modal-overlay,
  .modal-overlay,
  #view-driver, 
  #view-settings,
  #view-dispatch {
    display: none !important;
  }

  /* 2. SKRYTÍ VŠECH ZÁLOŽEK VE VÝCHOZÍM STAVU */
  .tab-view {
    display: none !important;
  }

  /* 3. POUZE POŽADOVANÝ DOKUMENT BUDE ZOBRAZEN */
  /* A) TISK VÝKAZU HODIN */
  body.printing-hours #view-hours,
  body[data-active-tab="hours"]:not(.printing-sheet) #view-hours,
  body:has(#view-hours.active):not(.printing-sheet) #view-hours {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body.printing-hours #view-sheet,
  body[data-active-tab="hours"] #view-sheet,
  body:has(#view-hours.active) #view-sheet {
    display: none !important;
  }

  /* B) TISK TABULKY JÍZD (FEUILLE DE ROUTE) */
  body.printing-sheet #view-sheet,
  body[data-active-tab="sheet"]:not(.printing-hours) #view-sheet,
  body:has(#view-sheet.active):not(.printing-hours) #view-sheet {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body.printing-sheet #view-hours,
  body[data-active-tab="sheet"] #view-hours,
  body:has(#view-sheet.active) #view-hours {
    display: none !important;
  }

  /* Skrytí horního textového banneru v tisku (na přání uživatele) */
  .sheet-table-brand-header {
    display: none !important;
  }

  .official-sheet-wrapper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sheet-header-grid {
    min-width: 0 !important;
    width: 100% !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 6px !important;
    padding: 6px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .header-box {
    min-height: 38px !important;
    padding: 2px 6px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
  }

  .sheet-table-section {
    min-width: 0 !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .sheet-table-section + .sheet-table-section {
    margin-top: 0 !important;
  }

  .table-section-title {
    padding: 2px 6px !important;
    font-size: 0.78rem !important;
    border: 1.5px solid #000 !important;
    margin-bottom: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .table-responsive {
    min-width: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .mobi-table {
    min-width: 0 !important;
    width: 100% !important;
    border: 1.5px solid #000 !important;
    border-collapse: collapse !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .mobi-table th, 
  .mobi-table td {
    padding: 2px 4px !important;
    font-size: 0.76rem !important;
    line-height: 1.15 !important;
  }

  .mobi-table td.col-points-td,
  .mobi-table th.col-points {
    position: static !important;
    box-shadow: none !important;
    width: 180px !important;
    font-size: 0.76rem !important;
  }

  .day-full {
    display: block !important;
  }

  .day-short {
    display: none !important;
  }

  .day-sub-labels {
    display: flex !important;
  }

  .col-day-cell {
    height: 1px !important;
  }

  .cell-inner-wrap {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    align-items: stretch !important;
    min-height: 18px !important;
  }

  .cell-time {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-right: 1px solid #000 !important;
    padding: 2px 3px !important;
    font-size: 0.76rem !important;
  }

  .cell-km {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 2px 3px !important;
    font-size: 0.74rem !important;
  }

  .sheet-legend-bar {
    min-width: 0 !important;
    width: 100% !important;
    border: 1.5px solid #000 !important;
    margin-top: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .legend-title {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
  }

  .legend-badge {
    padding: 3px 4px !important;
    font-size: 0.65rem !important;
  }

  .sheet-summary-quad-card {
    min-width: 0 !important;
    width: 100% !important;
    margin-top: 4px !important;
    padding: 3px 6px !important;
    border: 1px solid #000 !important;
    border-radius: 4px !important;
    background: #fff !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    break-after: avoid !important;
    box-shadow: none !important;
  }

  .quad-km-item {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    height: 34px !important;
    padding: 2px 6px !important;
    border: 1px solid #cbd5e1 !important;
    background: #f8fafc !important;
    border-radius: 4px !important;
    gap: 6px !important;
  }

  .quad-km-icon {
    font-size: 0.95rem !important;
  }

  .quad-km-text span {
    font-size: 0.58rem !important;
  }

  .quad-km-text strong {
    font-size: 0.74rem !important;
    color: #000 !important;
  }

  .quad-km-item.highlight {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
  }

  .quad-km-item.highlight .quad-km-text strong {
    color: #0284c7 !important;
  }

  .quad-km-item.driver-card {
    background: #fdf4ff !important;
    border-color: #e9d5ff !important;
  }

  .quad-km-item.driver-card .quad-km-text strong {
    color: #701a75 !important;
  }

  /* ==========================================================================
     STYL TISKU PRO VÝKAZ HODIN (#view-hours) - DOKONALE ROVNÝ A SROVNANÝ NA A4
     ========================================================================== */
  .official-hours-table-container {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-table-brand-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 2px solid #0f172a !important;
    padding-bottom: 6px !important;
    margin-bottom: 6px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-brand-left .hours-company-name {
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
  }

  .hours-brand-left .hours-company-sub {
    font-size: 0.65rem !important;
    color: #475569 !important;
    font-style: italic !important;
  }

  .hours-brand-center {
    text-align: center !important;
  }

  .hours-doc-title {
    font-size: 0.98rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em !important;
    line-height: 1.15 !important;
    color: #0f172a !important;
  }

  .hours-doc-month {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #1d4ed8 !important;
    margin-top: 1px !important;
  }

  .hours-brand-right {
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
    text-align: right !important;
    color: #1e293b !important;
  }

  .hours-brand-right strong {
    color: #0f172a !important;
  }

  .hours-table-scroll-wrapper {
    overflow: visible !important;
    width: 100% !important;
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .mobi-hours-table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
    border: 1.5px solid #0f172a !important;
    font-size: 6.2pt !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    line-height: 1.15 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .mobi-hours-table th,
  .mobi-hours-table td {
    border: 1px solid #64748b !important;
    padding: 2.5px 0.5px !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-size: 6.2pt !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    box-sizing: border-box !important;
    height: 17px !important;
  }

  .mobi-hours-table th.col-row-title,
  .mobi-hours-table td.col-row-title {
    width: 13.5% !important;
    min-width: 0 !important;
    max-width: 13.5% !important;
    position: static !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    text-align: left !important;
    padding-left: 5px !important;
    padding-right: 2px !important;
    font-weight: 700 !important;
    font-size: 6.1pt !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    background: #f8fafc !important;
    color: #0f172a !important;
  }

  .mobi-hours-table th.col-day-header {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    padding: 2px 0 !important;
  }

  .mobi-hours-table .day-weekday {
    font-size: 5.2pt !important;
    font-weight: 700 !important;
    color: #1d4ed8 !important;
    text-transform: capitalize !important;
    margin-bottom: 0 !important;
    line-height: 1 !important;
  }

  .mobi-hours-table .day-number {
    font-size: 6.2pt !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    line-height: 1 !important;
  }

  .mobi-hours-table th.col-total,
  .mobi-hours-table td.col-total {
    width: 6.5% !important;
    min-width: 0 !important;
    max-width: 6.5% !important;
    position: static !important;
    right: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    background: #e2e8f0 !important;
    font-weight: 800 !important;
    font-size: 6.2pt !important;
    padding: 2.5px 0.5px !important;
    text-align: center !important;
    color: #0f172a !important;
  }

  .mobi-hours-table th.col-weekend,
  .mobi-hours-table td.col-weekend {
    background: #cbd5e1 !important;
    background-image: repeating-linear-gradient(
      45deg,
      #cbd5e1,
      #cbd5e1 3px,
      #94a3b8 3px,
      #94a3b8 6px
    ) !important;
    color: transparent !important;
  }

  .mobi-hours-table tr.row-header-group th {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 6.3pt !important;
    padding: 2px 6px !important;
    text-align: left !important;
    border-top: 1.5px solid #334155 !important;
  }

  .mobi-hours-table tr.row-total-work td {
    background: #f8fafc !important;
    font-weight: 800 !important;
  }

  .mobi-hours-table tr.row-forfait td {
    background: #f1f5f9 !important;
    font-weight: 800 !important;
  }

  .mobi-hours-table tr.row-overtime td.has-overtime {
    background: #dcfce7 !important;
    color: #15803d !important;
    font-weight: 800 !important;
  }

  .mobi-hours-table tr.row-to-pay td {
    background: #eff6ff !important;
    font-weight: 800 !important;
    color: #1e3a8a !important;
  }

  .hours-summary-blocks-grid {
    display: grid !important;
    grid-template-columns: 1fr 1.15fr 1.6fr !important;
    gap: 8px !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-summary-block-card {
    border: 1px solid #64748b !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-summary-mini-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 6.1pt !important;
    line-height: 1.15 !important;
  }

  .hours-summary-mini-table th,
  .hours-summary-mini-table td {
    padding: 2px 4px !important;
    border: 1px solid #94a3b8 !important;
    font-size: 6.1pt !important;
  }

  .hours-summary-mini-table td.sum-lbl {
    background: #f8fafc !important;
    font-weight: 600 !important;
    color: #334155 !important;
  }

  .hours-summary-mini-table td.sum-val {
    font-weight: 800 !important;
    color: #0f172a !important;
    text-align: right !important;
  }

  /* PODPISOVÁ ZÓNA V TISKU */
  .hours-doc-signature-block {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    margin-top: 6px !important;
    margin-bottom: 4px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-signature-card {
    border: 1px dashed #94a3b8 !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    background: #fafafa !important;
    min-height: 48px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .hours-sig-title {
    font-size: 6.6pt !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
  }

  .hours-sig-sub {
    font-size: 5.8pt !important;
    color: #64748b !important;
    margin-top: 1px !important;
  }

  .hours-sig-line {
    border-bottom: 1px solid #cbd5e1 !important;
    margin-top: 16px !important;
  }

  .hours-doc-footer-note {
    font-size: 5.4pt !important;
    padding-top: 4px !important;
    margin-top: 4px !important;
    border-top: 0.5px solid #cbd5e1 !important;
    display: flex !important;
    justify-content: space-between !important;
    color: #64748b !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}

/* ==========================================================================
   STYL PRO PŘÍMÝ PDF EXPORT VÝKAZU HODIN (#printable-hours-sheet klon)
   Zaručuje 1:1 identický kompaktní A4 vzhled jako při fyzickém tisku
   ========================================================================== */
.pdf-hours-export {
  box-sizing: border-box !important;
  width: 1120px !important;
  max-width: 1120px !important;
  min-width: 1120px !important;
  background: #ffffff !important;
  box-shadow: none !important;
  border: none !important;
  padding: 8px 12px !important;
  margin: 0 !important;
  color: #0f172a !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.pdf-hours-export .hours-table-brand-header {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-bottom: 2px solid #0f172a !important;
  padding-bottom: 6px !important;
  margin-bottom: 6px !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
}

.pdf-hours-export .hours-brand-left .hours-company-name {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  color: #0f172a !important;
  line-height: 1.15 !important;
  letter-spacing: -0.01em !important;
}

.pdf-hours-export .hours-brand-left .hours-company-sub {
  font-size: 0.65rem !important;
  color: #475569 !important;
  font-style: italic !important;
}

.pdf-hours-export .hours-brand-center {
  text-align: center !important;
}

.pdf-hours-export .hours-doc-title {
  font-size: 0.98rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.15 !important;
  color: #0f172a !important;
}

.pdf-hours-export .hours-doc-month {
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #1d4ed8 !important;
  margin-top: 1px !important;
}

.pdf-hours-export .hours-brand-right {
  font-size: 0.68rem !important;
  line-height: 1.35 !important;
  text-align: right !important;
  color: #1e293b !important;
}

.pdf-hours-export .hours-brand-right strong {
  color: #0f172a !important;
}

.pdf-hours-export .hours-table-scroll-wrapper {
  overflow: visible !important;
  width: 100% !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
}

.pdf-hours-export .mobi-hours-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-collapse: collapse !important;
  border: 1.5px solid #0f172a !important;
  font-size: 6.2pt !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  line-height: 1.15 !important;
}

.pdf-hours-export .mobi-hours-table th,
.pdf-hours-export .mobi-hours-table td {
  border: 1px solid #64748b !important;
  padding: 2.5px 0.5px !important;
  text-align: center !important;
  vertical-align: middle !important;
  font-size: 6.2pt !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  box-sizing: border-box !important;
  height: 17px !important;
}

.pdf-hours-export .mobi-hours-table th.col-row-title,
.pdf-hours-export .mobi-hours-table td.col-row-title {
  width: 13.5% !important;
  min-width: 0 !important;
  max-width: 13.5% !important;
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  text-align: left !important;
  padding-left: 5px !important;
  padding-right: 2px !important;
  font-weight: 700 !important;
  font-size: 6.1pt !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  background: #f8fafc !important;
  color: #0f172a !important;
}

.pdf-hours-export .mobi-hours-table th.col-day-header {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  padding: 2px 0 !important;
}

.pdf-hours-export .mobi-hours-table .day-weekday {
  font-size: 5.2pt !important;
  font-weight: 700 !important;
  color: #1d4ed8 !important;
  text-transform: capitalize !important;
  margin-bottom: 0 !important;
  line-height: 1 !important;
}

.pdf-hours-export .mobi-hours-table .day-number {
  font-size: 6.2pt !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1 !important;
}

.pdf-hours-export .mobi-hours-table th.col-total,
.pdf-hours-export .mobi-hours-table td.col-total {
  width: 6.5% !important;
  min-width: 0 !important;
  max-width: 6.5% !important;
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
  background: #e2e8f0 !important;
  font-weight: 800 !important;
  font-size: 6.2pt !important;
  padding: 2.5px 0.5px !important;
  text-align: center !important;
  color: #0f172a !important;
}

.pdf-hours-export .mobi-hours-table th.col-weekend,
.pdf-hours-export .mobi-hours-table td.col-weekend {
  background: #cbd5e1 !important;
  background-image: repeating-linear-gradient(
    45deg,
    #cbd5e1,
    #cbd5e1 3px,
    #94a3b8 3px,
    #94a3b8 6px
  ) !important;
  color: transparent !important;
}

.pdf-hours-export .mobi-hours-table tr.row-header-group th {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 6.3pt !important;
  padding: 2px 6px !important;
  text-align: left !important;
  border-top: 1.5px solid #334155 !important;
}

.pdf-hours-export .mobi-hours-table tr.row-total-work td {
  background: #f8fafc !important;
  font-weight: 800 !important;
}

.pdf-hours-export .mobi-hours-table tr.row-forfait td {
  background: #f1f5f9 !important;
  font-weight: 800 !important;
}

.pdf-hours-export .mobi-hours-table tr.row-overtime td.has-overtime {
  background: #dcfce7 !important;
  color: #15803d !important;
  font-weight: 800 !important;
}

.pdf-hours-export .mobi-hours-table tr.row-to-pay td {
  background: #eff6ff !important;
  font-weight: 800 !important;
  color: #1e3a8a !important;
}

.pdf-hours-export .hours-summary-blocks-grid {
  display: grid !important;
  grid-template-columns: 1fr 1.15fr 1.6fr !important;
  gap: 8px !important;
  margin-top: 6px !important;
  margin-bottom: 6px !important;
}

.pdf-hours-export .hours-summary-block-card {
  border: 1px solid #64748b !important;
  border-radius: 4px !important;
  overflow: hidden !important;
  background: #ffffff !important;
}

.pdf-hours-export .hours-summary-mini-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 6.1pt !important;
  line-height: 1.15 !important;
}

.pdf-hours-export .hours-summary-mini-table th,
.pdf-hours-export .hours-summary-mini-table td {
  padding: 2px 4px !important;
  border: 1px solid #94a3b8 !important;
  font-size: 6.1pt !important;
}

.pdf-hours-export .hours-summary-mini-table td.sum-lbl {
  background: #f8fafc !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

.pdf-hours-export .hours-summary-mini-table td.sum-val {
  font-weight: 800 !important;
  color: #0f172a !important;
  text-align: right !important;
}

.pdf-hours-export .hours-doc-signature-block {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  margin-top: 6px !important;
  margin-bottom: 4px !important;
}

.pdf-hours-export .hours-signature-card {
  border: 1px dashed #94a3b8 !important;
  border-radius: 4px !important;
  padding: 6px 10px !important;
  background: #fafafa !important;
  min-height: 48px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.pdf-hours-export .hours-sig-title {
  font-size: 6.6pt !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
}

.pdf-hours-export .hours-sig-sub {
  font-size: 5.8pt !important;
  color: #64748b !important;
  margin-top: 1px !important;
}

.pdf-hours-export .hours-sig-line {
  border-bottom: 1px solid #cbd5e1 !important;
  margin-top: 16px !important;
}

.pdf-hours-export .hours-doc-footer-note {
  font-size: 5.4pt !important;
  padding-top: 4px !important;
  margin-top: 4px !important;
  border-top: 0.5px solid #cbd5e1 !important;
  display: flex !important;
  justify-content: space-between !important;
  color: #64748b !important;
}

/* ==========================================================================
   BEZPEČNÝ ZÁMEK DIGITÁLNÍHO PODPISU (OCHRANA PROTI NECHTĚNÝM ČÁRÁM PŘI SCROLLOVÁNÍ)
   ========================================================================== */
.signature-locked-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.signature-status-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.sig-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

body.theme-ios-dark .sig-status-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.sig-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.signature-preview-display-wrap {
  width: 100%;
  min-height: 90px;
  max-height: 110px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
  touch-action: pan-y;
}

body.theme-ios-dark .signature-preview-display-wrap {
  background: #0f172a;
  border-color: #334155;
}

.signature-locked-preview-img {
  max-width: 90%;
  max-height: 75px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
}

body.theme-ios-dark .signature-locked-preview-img {
  filter: invert(1) brightness(1.2);
}

.btn-edit-signature {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  transition: all 0.15s ease;
}

body.theme-ios-dark .btn-edit-signature {
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

.btn-edit-signature:hover {
  background: #e2e8f0;
}

body.theme-ios-dark .btn-edit-signature:hover {
  background: #475569;
}

.sig-btns-stack {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  margin-top: 10px !important;
  box-sizing: border-box !important;
}

.btn-save-signature {
  width: 100% !important;
  height: 44px !important;
  font-size: 0.92rem !important;
  font-weight: 750 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
}

.sig-sub-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sig-sub-actions button {
  width: 100% !important;
  height: 40px !important;
  padding: 0 8px !important;
  font-size: 0.84rem !important;
  font-weight: 650 !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

