/* ===== RBES – Pracovní zápisník – iOS-inspired design system ===== */
:root {
  /* Light mode */
  --bg-primary: #F2F2F7;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #E5E5EA;
  --bg-grouped: #F2F2F7;
  --text-primary: #000000;
  --text-secondary: #3C3C43;
  --text-tertiary: #8E8E93;
  --text-quaternary: #C7C7CC;
  --separator: rgba(60, 60, 67, 0.12);
  --blue: #007AFF;
  --blue-light: #E5F1FF;
  --green: #34C759;
  --orange: #FF9500;
  --red: #FF3B30;
  --purple: #AF52DE;
  --gray: #8E8E93;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 49px;
  --header-height: 56px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 17px;
  --font-size-sm: 15px;
  --font-size-xs: 13px;
  --font-size-lg: 20px;
  --font-size-xl: 22px;
  --font-size-title: 28px;
  --font-size-large-title: 34px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1C1C1E;
    --bg-tertiary: #2C2C2E;
    --bg-grouped: #000000;
    --text-primary: #FFFFFF;
    --text-secondary: #EBEBF5;
    --text-tertiary: #8E8E93;
    --text-quaternary: #636366;
    --separator: rgba(84, 84, 88, 0.65);
    --blue-light: #0A2540;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

/* Dark mode class override (manual toggle) */
html.dark {
  --bg-primary: #000000;
  --bg-secondary: #1C1C1E;
  --bg-tertiary: #2C2C2E;
  --bg-grouped: #000000;
  --text-primary: #FFFFFF;
  --text-secondary: #EBEBF5;
  --text-tertiary: #8E8E93;
  --text-quaternary: #636366;
  --separator: rgba(84, 84, 88, 0.65);
  --blue-light: #0A2540;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.4;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

/* Dynamic Type support */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: var(--blue); text-decoration: none; }

/* ===== Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 100vw;
  overflow: hidden;
}

.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.header h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  letter-spacing: -0.4px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--blue);
  font-size: var(--font-size-base);
  font-weight: 400;
  padding: 8px 4px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn.primary { font-weight: 600; }

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  background: transparent; /* vodoznak RBES (#app::before) prosvítá zespodu */
}

/* ===== Vodoznak RBES na pozadí všech stránek =====
 * z-index:-1 → leží pod obsahem, nad barvou pozadí. Funguje, dokud #app ani body
 * nevytvářejí vlastní stacking context (transform, isolation, z-index…). */
#app::before {
  content: '';
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  background: url('../assets/brand/rbes-logo.png') center 42% / min(84vw, 400px) auto no-repeat;
  opacity: 0.10;
  pointer-events: none;
  z-index: -1;
}
@media (prefers-color-scheme: dark) {
  #app::before {
    background-image: url('../assets/brand/rbes-logo-white.png');
    opacity: 0.10;
  }
}

/* ===== Bottom Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  background: var(--bg-secondary);
  border-top: 0.5px solid var(--separator);
  display: flex;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
}

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

.tab-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 0 16px 12px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}

.card-group {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 0 16px 12px;
  overflow: hidden;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--separator);
  min-height: 44px;
}

.card-row:last-child { border-bottom: none; }

.card-row-label {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

.card-row-value {
  font-weight: 500;
  text-align: right;
}

/* ===== Section headers ===== */
.section-header {
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 20px 16px 8px;
  margin: 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  min-height: 50px;
  padding: 0 20px;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { opacity: 0.7; transform: scale(0.98); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  width: 100%;
}

.btn-secondary {
  background: var(--blue-light);
  color: var(--blue);
  width: 100%;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  width: 100%;
}

.btn-ghost {
  background: transparent;
  color: var(--blue);
}

.btn-large {
  min-height: 56px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

.btn-start {
  background: var(--green);
  color: #fff;
  width: 100%;
  min-height: 56px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

.btn-stop {
  background: var(--red);
  color: #fff;
  width: 100%;
  min-height: 56px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}

/* ===== Status badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-active { background: #E8F8ED; color: #1B7A3D; }
.badge-progress { background: #E5F1FF; color: #0056B3; }
.badge-done { background: #F0E6FF; color: #6B2FA0; }
.badge-invoiced { background: #FFF4E5; color: #B36B00; }
.badge-paid { background: #E8F8ED; color: #1B7A3D; }
.badge-draft { background: #F2F2F7; color: #636366; }
.badge-sent { background: #E5F1FF; color: #0056B3; }
.badge-waiting { background: #FFF4E5; color: #B36B00; }
.badge-overdue { background: #FFEBEA; color: #C41E16; }
.badge-cancelled { background: #F2F2F7; color: #8E8E93; }

@media (prefers-color-scheme: dark) {
  .badge-active { background: #0A2F1A; color: #34C759; }
  .badge-progress { background: #0A2540; color: #0A84FF; }
  .badge-done { background: #2A1A3A; color: #BF5AF2; }
  .badge-invoiced { background: #3A2A0A; color: #FF9F0A; }
  .badge-paid { background: #0A2F1A; color: #34C759; }
  .badge-draft { background: #2C2C2E; color: #8E8E93; }
  .badge-sent { background: #0A2540; color: #0A84FF; }
  .badge-waiting { background: #3A2A0A; color: #FF9F0A; }
  .badge-overdue { background: #3A0A0A; color: #FF453A; }
  .badge-cancelled { background: #2C2C2E; color: #8E8E93; }
}

html.dark .badge-active { background: #0A2F1A; color: #34C759; }
html.dark .badge-progress { background: #0A2540; color: #0A84FF; }
html.dark .badge-done { background: #2A1A3A; color: #BF5AF2; }
html.dark .badge-invoiced { background: #3A2A0A; color: #FF9F0A; }
html.dark .badge-paid { background: #0A2F1A; color: #34C759; }
html.dark .badge-draft { background: #2C2C2E; color: #8E8E93; }
html.dark .badge-sent { background: #0A2540; color: #0A84FF; }
html.dark .badge-waiting { background: #3A2A0A; color: #FF9F0A; }
html.dark .badge-overdue { background: #3A0A0A; color: #FF453A; }
html.dark .badge-cancelled { background: #2C2C2E; color: #8E8E93; }

/* ===== Forms ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 6px;
  padding-left: 4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  min-height: 44px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row > * { flex: 1; }

.form-error {
  color: var(--red);
  font-size: var(--font-size-xs);
  margin-top: 4px;
  padding-left: 4px;
}

/* ===== List items ===== */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  gap: 12px;
  min-height: 60px;
  transition: background 0.1s;
}

.list-item:active { background: var(--bg-tertiary); }
.list-item:last-child { border-bottom: none; }

.list-item-content { flex: 1; min-width: 0; }

.list-item-title {
  font-weight: 600;
  font-size: var(--font-size-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-meta {
  text-align: right;
  flex-shrink: 0;
}

.list-item-price {
  font-weight: 600;
  font-size: var(--font-size-base);
}

.list-item-chevron {
  color: var(--text-quaternary);
  flex-shrink: 0;
}

/* ===== Search bar ===== */
.search-bar {
  padding: 8px 16px 12px;
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 10px;
  padding: 10px 14px 10px 36px;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}

/* ===== Stats grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 12px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--card-shadow);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ===== Segmented control ===== */
.segmented {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: 8px;
  padding: 2px;
  margin: 0 16px 12px;
}

.segment {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.segment.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 600;
}

/* ===== Empty state ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: var(--font-size-sm);
  margin-bottom: 24px;
}

/* ===== Modal / Sheet ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: var(--safe-bottom);
}

.modal-overlay.open .modal-sheet {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}

.modal-header h2 {
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== Timer display ===== */
.timer-display {
  font-size: 48px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  text-align: center;
  padding: 16px 0;
}

.timer-running {
  color: var(--green);
}

/* ===== Active job card ===== */
.active-job-card {
  background: linear-gradient(135deg, #007AFF 0%, #0056B3 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  margin: 0 16px 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.active-job-card .label { opacity: 0.8; font-size: var(--font-size-xs); }
.active-job-card .title { font-size: var(--font-size-lg); font-weight: 700; margin: 4px 0 12px; }
.active-job-card .meta { display: flex; gap: 20px; font-size: var(--font-size-sm); }

/* ===== Summary numbers ===== */
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: var(--font-size-sm);
}

.summary-row.total {
  font-weight: 700;
  font-size: var(--font-size-base);
  border-top: 1px solid var(--separator);
  margin-top: 8px;
  padding-top: 12px;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(0,122,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  transition: transform 0.15s;
}

.fab:active { transform: scale(0.92); }
.fab svg { width: 28px; height: 28px; }

/* ===== Utilities ===== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-orange { color: var(--orange); }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* Scrollbar hide on mobile */
.content::-webkit-scrollbar { display: none; }
.content { -ms-overflow-style: none; scrollbar-width: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--separator);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Chart container */
.chart-container {
  padding: 0 16px 16px;
  height: 180px;
}

/* Detail header */
.detail-header {
  background: var(--bg-secondary);
  padding: 20px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.detail-header .job-number {
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
}

.detail-header .job-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin: 4px 0;
}

.detail-header .job-customer {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* Price breakdown */
.price-breakdown {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 0 16px 12px;
  padding: 16px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--font-size-sm);
}

.price-line.total {
  font-weight: 700;
  font-size: var(--font-size-base);
  border-top: 1px solid var(--separator);
  margin-top: 8px;
  padding-top: 12px;
}

/* Confirm dialog */
.confirm-dialog {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 320px;
  margin: auto;
  text-align: center;
}

.confirm-dialog h3 {
  font-size: var(--font-size-lg);
  margin-bottom: 8px;
}

.confirm-dialog p {
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
}

.confirm-actions .btn {
  flex: 1;
  min-height: 44px;
}


/* ===== Autocomplete dropdown ===== */
.autocomplete-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  margin-top: 4px;
}
.autocomplete-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:active,
.autocomplete-item:hover { background: var(--bg-tertiary); }

.form-group { position: relative; }

/* Job multi-select chips */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}
.chip-remove {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

/* Invoice preview */
.invoice-preview {
  background: #fff;
  color: #000;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 0 16px 16px;
  font-size: 13px;
  box-shadow: var(--card-shadow);
}
.invoice-preview h2 { font-size: 18px; color: #007AFF; margin-bottom: 4px; }
.invoice-preview .preview-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.invoice-preview .preview-table th,
.invoice-preview .preview-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #eee; font-size: 12px; }
.invoice-preview .preview-table th { color: #888; font-weight: 600; }
.invoice-preview .preview-total { font-weight: 700; font-size: 15px; text-align: right; margin-top: 8px; }

/* File upload */
.file-upload {
  border: 1.5px dashed var(--separator);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-secondary);
}
.file-upload img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  margin-bottom: 8px;
}
.file-upload input[type=file] { display: none; }

/* ===== Záloha dat ===== */
.backup-banner {
  margin: 12px 16px 0;
  padding: 12px 14px;
  background: var(--blue-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}
.backup-banner-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: var(--font-size-sm); }
.backup-banner-text span { color: var(--text-tertiary); font-size: var(--font-size-xs); }
.backup-banner-actions { display: flex; gap: 4px; flex-shrink: 0; }
.backup-banner .btn { min-height: 36px; padding: 0 12px; font-size: var(--font-size-sm); }
.backup-note { padding: 8px 32px 0; font-size: var(--font-size-xs); color: var(--text-tertiary); line-height: 1.4; }

/* ===== Čísla, řady, dny v týdnu ===== */
.form-hint { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-top: 6px; line-height: 1.4; }
.weekday-hint { color: var(--blue); font-weight: 600; margin-left: 6px; text-transform: capitalize; }
.token-btn { cursor: pointer; font-family: ui-monospace, Menlo, Consolas, monospace; border: none; }

/* ===== Upozornění na novou verzi ===== */
.update-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px);
  z-index: 150;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px;
  background: var(--text-primary); color: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
  font-size: var(--font-size-sm);
}
.update-banner .btn { min-height: 36px; padding: 0 16px; width: auto; }

/* ===== Záznam práce: celkový čas, ignorovaná pole, odkaz-tlačítko ===== */
.input-suffix { position: relative; flex: 1; }
.input-suffix .form-input { padding-right: 44px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; font-size: var(--font-size-sm); }
.is-ignored { opacity: .4; }
.is-ignored input { pointer-events: none; }
.link-btn { background: none; border: none; padding: 0; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.rate-picker select + input { margin-top: 8px; }

/* Tlačítko „Přidat záznam ručně“ – stejný vzhled jako Začít práci, modré */
.btn-manual {
  background: var(--blue);
  color: #fff;
  width: 100%;
  min-height: 56px;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
}
.entry-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--blue-light); color: var(--blue); vertical-align: 2px; }

/* ===== Hromadné úpravy ===== */
.bulk-toolbar { display:flex; align-items:center; justify-content:space-between; padding:4px 16px 8px; min-height:36px; }
.bulk-count { color: var(--text-tertiary); font-size: var(--font-size-sm); }
.bulk-check { width:24px; height:24px; border-radius:50%; border:2px solid var(--text-quaternary); flex-shrink:0; box-sizing:border-box; position:relative; }
.bulk-check.on { background: var(--blue); border-color: var(--blue); }
.bulk-check.on::after { content:''; position:absolute; left:6px; top:2px; width:6px; height:11px; border:solid #fff; border-width:0 2.5px 2.5px 0; transform:rotate(45deg); }
.bulk-bar { position:fixed; left:0; right:0; bottom:calc(var(--nav-height) + var(--safe-bottom)); z-index:99; display:flex; gap:8px; padding:10px 12px; background:var(--bg-secondary); border-top:0.5px solid var(--separator); overflow-x:auto; }
.bulk-act { flex:1 0 auto; min-height:44px; padding:0 14px; border-radius:var(--radius-md); border:none; background:var(--blue-light); color:var(--blue); font-weight:600; font-size:var(--font-size-sm); font-family:inherit; white-space:nowrap; }
.bulk-act.danger { background:rgba(255,59,48,0.12); color:var(--red); }
.bulk-act:disabled { opacity:0.4; }

/* ===== Výběr data (styl iOS/macOS) ===== */
.dp-native { position:absolute !important; opacity:0; pointer-events:none; width:1px; height:1px; }
.dp-button { text-align:left; font-weight:500; cursor:pointer; display:block; width:100%; font-family:inherit; color:var(--text-primary); background:var(--bg-secondary); }
.dp-overlay { position:fixed; inset:0; z-index:400; background:rgba(0,0,0,0); display:flex; align-items:flex-end; justify-content:center; transition:background .2s; }
.dp-overlay.open { background:rgba(0,0,0,0.4); }
.dp-sheet { width:100%; max-width:480px; background:var(--bg-secondary); border-radius:22px 22px 0 0; padding:18px 14px calc(14px + var(--safe-bottom)); transform:translateY(100%); transition:transform .25s ease; box-shadow:0 -8px 30px rgba(0,0,0,.25); }
.dp-overlay.open .dp-sheet { transform:none; }
@media (min-width:600px) { .dp-overlay { align-items:center; } .dp-sheet { border-radius:22px; } }
.dp-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; padding:0 4px; }
.dp-title { background:none; border:none; font:700 21px/1.2 var(--font); color:var(--text-primary); text-transform:capitalize; padding:6px 4px; }
.dp-chev { color:var(--blue); margin-left:4px; }
.dp-nav { display:flex; gap:6px; }
.dp-arrow { width:44px; height:44px; border:none; border-radius:50%; background:none; color:var(--blue); font-size:30px; line-height:1; }
.dp-arrow:active { background:var(--bg-tertiary); }
.dp-dow, .dp-grid { display:grid; grid-template-columns:repeat(7,1fr); text-align:center; }
.dp-dow span { font-size:13px; font-weight:600; color:var(--text-tertiary); padding:6px 0; }
.dp-dow .we { color:var(--text-quaternary); }
.dp-grid { row-gap:4px; }
.dp-cell { height:48px; display:flex; align-items:center; justify-content:center; }
.dp-day { margin:0 auto; width:48px; border:none; border-radius:50%; background:none; font:400 20px var(--font); color:var(--text-primary); }
.dp-day.today { color:var(--blue); font-weight:700; }
.dp-day.sel { background:var(--blue); color:#fff; font-weight:600; }
.dp-day:disabled { color:var(--text-quaternary); }
.dp-months { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; padding:6px 0; }
.dp-month { height:56px; border:none; border-radius:14px; background:var(--bg-primary); font:500 17px var(--font); color:var(--text-primary); text-transform:capitalize; }
.dp-month.sel { background:var(--blue); color:#fff; }
.dp-foot { display:flex; justify-content:space-between; margin-top:10px; padding-top:8px; border-top:0.5px solid var(--separator); }
.dp-link { background:none; border:none; color:var(--blue); font:600 17px var(--font); padding:10px 8px; }
.dp-link:disabled { opacity:.4; }
