:root {
  /* M3-inspired palette – akcent #5DF8D8 */
  --brand: #5df8d8;
  --brand-dim: #2dd4bf;
  --brand-container: #ccfbf1;
  --brand-container-soft: #f0fdfa;
  --on-brand: #134e4a;

  --bg: #f4f7f6;
  --card: #ffffff;
  --text: #171717;
  --muted: #5c6563;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #14b8a6;
  --accent: #e07a5f;
  --border: #dce8e5;
  --header-bg: #e6fffa;
  --category-bg: #f0fdfa;
  --row-hover: #f3fbf8;
  --row-ordered: #fffbeb;
  --danger: #dc2626;
  --warning: #d97706;

  --header-surface: #f8fffe;
  --header-text: #171717;
  --header-muted: #64748b;
  --header-input-bg: #ffffff;
  --header-input-border: #cbd5e1;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 4px 12px rgba(15, 118, 110, 0.1);
  --shadow-section: 0 2px 8px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 118, 110, 0.07);
  --focus-ring: 0 0 0 3px rgba(93, 248, 216, 0.45);
  --cta-bg: linear-gradient(135deg, var(--brand) 0%, var(--brand-dim) 100%);
  --cta-border: rgba(20, 184, 166, 0.45);
  --cta-text: #042f2e;

  /* --- Scales & shared semantic tokens (values chosen to match existing usage,
     so nothing shifts visually when ad-hoc literals are swapped for tokens) --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Neutral surfaces / table chrome (repeated literals across admin + order). */
  --surface-subtle: #f8fafc;
  --table-head-bg: #f8fafc;
  --hover-soft: #ecfdf5;

  /* Admin shell. */
  --admin-topbar-bg: linear-gradient(180deg, #0a3f3b 0%, #115e59 48%, #0f766e 100%);

  /* Status badge tokens (mirror the badge hex used in the admin orders table). */
  --badge-submitted-bg: #dbeafe;       --badge-submitted-fg: #1e40af;
  --badge-pending-bg: #ffedd5;         --badge-pending-fg: #9a3412;
  --badge-processing-bg: #fef3c7;      --badge-processing-fg: #92400e;
  --badge-completed-bg: #dcfce7;       --badge-completed-fg: #166534;
  --badge-cancelled-bg: #fee2e2;       --badge-cancelled-fg: #991b1b;
  --badge-voice-bg: #ede9fe;           --badge-voice-fg: #5b21b6;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--primary); }
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-1);
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn:hover { filter: none; background: var(--brand-container-soft); }
.btn.primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-color: var(--cta-border);
  box-shadow: var(--shadow-2);
}
.btn.primary:hover { filter: brightness(1.03); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.brand {
  background: var(--brand);
  color: var(--cta-text);
  border-color: var(--brand);
  font-weight: 700;
}
.btn.brand:hover { background: var(--brand-dim); }
.btn.large { padding: 0.9rem 1.2rem; font-size: 1rem; }
.btn.sm { padding: 0.35rem 0.65rem; font-size: 0.82rem; }
.btn.ghost { background: transparent; }
.btn.danger-outline {
  color: var(--danger);
  border-color: var(--danger);
  background: #fff;
}
.btn.danger-outline:hover { background: #fef2f2; }
.btn.full { width: 100%; margin-top: 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Landing */
.landing {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(45, 212, 191, 0.28) 0%, rgba(45, 212, 191, 0) 55%),
    radial-gradient(120% 100% at 100% 100%, rgba(15, 118, 110, 0.25) 0%, rgba(15, 118, 110, 0) 55%),
    linear-gradient(160deg, #eef2f1 0%, #e2e8f0 100%);
}
.landing-card {
  position: relative;
  text-align: center;
  max-width: 30rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.85rem 2.5rem 2.5rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 30px 60px -22px rgba(15, 118, 110, 0.38),
    0 10px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.landing-badge {
  display: grid;
  place-items: center;
  width: 6rem;
  height: 6rem;
  margin-bottom: 1.4rem;
  border-radius: 26px;
  background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%);
  box-shadow: 0 16px 32px -10px rgba(15, 118, 110, 0.6);
}
.landing-title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary-dark);
}
.landing-tagline {
  margin: 0.4rem 0 2rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.landing-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  width: 100%;
}
.landing-btn {
  flex: 1 1 0;
  min-width: 9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
}
.landing-btn-ico { flex-shrink: 0; }
.btn.btn-outline {
  background: rgba(255, 255, 255, 0.7);
  color: var(--primary-dark);
  border: 1.5px solid var(--brand-dim);
  box-shadow: none;
}
.btn.btn-outline:hover {
  background: var(--brand-container-soft);
  border-color: var(--brand);
}

/* Branded error pages (reuse the landing gradient + card). */
.error-card { padding-top: 2.5rem; }
.error-code {
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  background: var(--cta-bg);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-title { font-size: clamp(1.5rem, 4vw, 2rem); margin-top: 0.5rem; }
.error-message { max-width: 26rem; }

/* Admin */
/* Admin styling lives in admin.css (scoped to body.admin-page). Only the
   generic primitives shared with the order page stay here. */
.hidden { display: none; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  padding: 1rem;
}
.full-width { grid-column: 1 / -1; }
.drop-zone {
  border: 2px dashed var(--brand-dim);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  position: relative;
  background: var(--brand-container-soft);
}
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-grid { display: grid; gap: 0.6rem; }
.form-grid input, .form-grid textarea, label input {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.status { margin-top: 0.75rem; }
.list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

/* Order page */
.order-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}
.update-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  font-size: 0.88rem;
}
.update-banner-text {
  flex: 1 1 240px;
  max-width: 44rem;
  line-height: 1.45;
  color: #78350f;
}
.update-banner-text strong { font-weight: 700; }
.update-banner-text > strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}
.update-banner.hidden { display: none; }
.compact-header.order-top {
  background: linear-gradient(180deg, #ffffff 0%, var(--header-surface) 45%, var(--brand-container-soft) 100%);
  color: var(--header-text);
  padding: 0.52rem 1rem;
  flex-shrink: 0;
  border-bottom: 2px solid var(--brand);
  box-shadow: var(--shadow-2);
  position: sticky;
  top: 0;
  z-index: 230;
}
.header-layout {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}
.order-top-inner {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}
.header-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  min-height: 2.15rem;
}
.header-row-title {
  align-items: center;
  justify-content: space-between;
  min-height: 1.55rem;
  margin-bottom: 0.05rem;
}
.header-row-title strong { font-size: 1.02rem; line-height: 1.2; color: var(--header-text); }
.header-row-top-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.header-fields-grid {
  display: grid;
  /* Telefon má pevnou „telefonní“ šířku, e-mail hned za ním, Platba se roztáhne
     až k poli Datum (které má pevnou šířku). */
  grid-template-columns: 9.5rem minmax(11rem, 14rem) minmax(7rem, 1fr) minmax(7rem, 1fr) 7.25rem auto;
  gap: 0.35rem 0.4rem;
  align-items: end;
}
.hf-address { grid-column: 1 / 4; grid-row: 1; min-width: 0; }
.hf-ico { grid-column: 4; grid-row: 1; width: 100%; max-width: 7.25rem; }
.hf-past-btn { grid-column: 6; grid-row: 1; justify-self: end; align-self: end; }
.hf-phone { grid-column: 1; grid-row: 2; min-width: 0; }
.hf-email { grid-column: 2; grid-row: 2; min-width: 0; }
.hf-payment { grid-column: 3 / 5; grid-row: 2; min-width: 0; }
.hf-date { grid-column: 5; grid-row: 2; width: 100%; max-width: 7.25rem; }
.hf-voice-btn { grid-column: 6; grid-row: 2; justify-self: end; align-self: end; }
.supplier-label {
  font-size: 0.68rem;
  color: var(--header-muted);
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hf-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: var(--header-muted);
  min-width: 0;
  font-weight: 600;
}
.hf-field.hf-ico,
.hf-field.hf-date {
  justify-self: start;
}
.hf-field.hf-ico input {
  width: 100%;
  max-width: none;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}
.hf-field.hf-date {
  width: 100%;
  max-width: 7.25rem;
}
.order-date-value {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--header-input-border);
  background: var(--header-input-bg);
  color: var(--header-text);
  border-radius: 10px;
  padding: 0.22rem 0.45rem;
  font-size: 0.78rem;
  min-height: 1.55rem;
  line-height: 1.35;
  white-space: nowrap;
}
.hf-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--header-input-border);
  background: var(--header-input-bg);
  color: var(--header-text);
  border-radius: 10px;
  padding: 0.22rem 0.45rem;
  font-size: 0.78rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hf-field.hf-phone input {
  width: 100%;
}
.hf-field.hf-email input,
.hf-field.hf-payment input,
.hf-field.hf-address input {
  min-width: 0;
}
.hf-field input::placeholder { color: #94a3b8; }
.hf-field input:focus {
  outline: none;
  border-color: var(--brand-dim);
  box-shadow: var(--focus-ring);
}
/* Pro odběratele (ne admin) jsou údaje jen ke čtení – zašedlé, bez kurzoru i focus rámečku.
   Admin v režimu nové objednávky (.admin-order-page) je má plně editovatelné. */
.order-page:not(.admin-order-page) .hf-field input[readonly] {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
  cursor: default;
}
.order-page:not(.admin-order-page) .hf-field input[readonly]:focus {
  border-color: #e2e8f0;
  box-shadow: none;
}
.btn-header {
  padding: 0.32rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 999px;
  color: var(--on-brand);
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn-header-supplier {
  background: var(--brand-container);
  border: 1px solid rgba(45, 212, 191, 0.55);
  cursor: pointer;
}
.btn-header-supplier:hover {
  background: #99f6e4;
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.btn-header-past {
  background: var(--brand-container);
  border: 1px solid rgba(45, 212, 191, 0.55);
}
.btn-header-past:hover {
  background: #99f6e4;
  box-shadow: var(--shadow-1);
}
.btn-header-voice {
  background: var(--brand-container);
  border: 1px solid rgba(45, 212, 191, 0.55);
}
.btn-header-voice:hover {
  background: #99f6e4;
  box-shadow: var(--shadow-1);
}

.order-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "main aside"
    "footer aside";
  gap: 1.35rem;
  align-items: start;
  flex: 1;
  min-height: 0;
  width: 100%;
}
.order-main {
  grid-area: main;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  /* Žádný vnitřní scroll – seznam produktů se natáhne a roluje se hlavní
     scrollbar stránky (viz .excel-table-wrap). */
  overflow: visible;
  border-radius: 14px;
  box-shadow: var(--shadow-section);
  border: 1px solid rgba(220, 232, 229, 0.95);
}
.order-footer {
  grid-area: footer;
  box-shadow: var(--shadow-section);
  border: 1px solid rgba(220, 232, 229, 0.95);
  padding: 1.1rem 1.1rem 1.15rem;
}
.side-stack {
  grid-area: aside;
}
.order-main.card { margin-bottom: 0; }

.order-zone-controls {
  padding: 1.15rem 1.2rem 1.05rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--brand-container-soft) 100%);
  border-bottom: 1px solid var(--border);
  /* .order-main už neklipuje obsah (overflow:visible), proto rohy zaoblíme tady. */
  border-radius: 14px 14px 0 0;
}
.order-zone-catalog {
  padding: 1.2rem 1.15rem 1.15rem;
  background: #fff;
  border-radius: 0 0 14px 14px;
}
.order-zone-catalog .excel-table-wrap {
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  border-color: rgba(220, 232, 229, 0.95);
}
.order-zone-catalog .order-total-row {
  margin-top: 1rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.search-summary-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.search-box {
  flex: 0 1 50%;
  min-width: 220px;
  max-width: 560px;
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 3px solid var(--brand);
  border-radius: 14px;
  padding: 0;
  background: #fff;
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}
.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  padding: 0.45rem 0.55rem;
  background: var(--cta-bg);
  border-right: 2px solid var(--brand);
  flex-shrink: 0;
}
.search-box input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
  background: #fff;
  padding: 0.45rem 0.55rem;
}

.cart-summary {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: baseline;
  justify-content: flex-end;
  padding: 0.45rem 0.65rem;
  background: var(--brand-container-soft);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 14px;
  font-size: 0.9rem;
  align-self: center;
}
.cart-summary span { text-align: right; }
.cart-summary em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  margin-right: 0.25rem;
}
.cart-summary strong { font-size: 1rem; }
.cart-summary .highlight strong { color: var(--primary-dark); }

.search-full {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.category-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.65rem 0 0.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0;
  max-height: 4.5rem;
  overflow-y: auto;
}
.order-filter-tabs {
  max-height: none;
  overflow: visible;
  margin-bottom: 0.85rem;
}
.cat-chip,
.tab {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}
.cat-chip:hover,
.tab:hover { background: var(--brand-container-soft); }
.cat-chip.active,
.tab.active {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-color: var(--cta-border);
  font-weight: 600;
}

/* Mobile-only UI (hidden on desktop/tablet) */
.mobile-top-bar { display: none; }
.mobile-name-btn,
.mobile-inline-price,
.mobile-product-detail { display: none; }
.qty-stepper { display: block; }
.qty-step {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 2px solid rgba(45, 212, 191, 0.65);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dim);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.qty-step:active { background: var(--brand-container-soft); }
.mobile-accordion > summary {
  list-style: none;
  cursor: default;
}
.mobile-accordion > summary::-webkit-details-marker { display: none; }

@media (min-width: 701px) {
  .side-stack {
    position: sticky;
    /* Posadit panel pod pinned hlavičku, ať ho nepřekrývá (výšku hlásí JS). */
    top: calc(var(--order-top-h, 5rem) + 0.75rem);
    align-self: start;
  }
  .order-checkout-panel {
    display: flex;
  }
  .mobile-accordion {
    display: block;
    border: none;
    margin: 0;
    background: transparent;
  }
  .mobile-accordion > summary { display: none; }
  .mobile-accordion-body { padding: 0; }
  .mobile-accordion .tabs.scroll-tabs { margin-bottom: 0.85rem; }
  .desktop-category-label { display: block; margin-top: 0; }
  .desktop-promo-title { display: flex; }
  .mobile-promo-accordion .promo-panel.card {
    padding: 1.15rem 1.1rem 1.05rem;
    border: 1px solid rgba(220, 232, 229, 0.95);
    box-shadow: var(--shadow-section);
  }
  .mobile-top-bar { display: none !important; }
  .mobile-header-drawer {
    position: static;
    display: block;
    pointer-events: auto;
  }
  .mobile-header-drawer .mobile-drawer-backdrop,
  .mobile-header-drawer .mobile-drawer-head { display: none !important; }
  .mobile-header-drawer .mobile-drawer-panel {
    position: static;
    transform: none !important;
    width: 100%;
    max-width: none;
    height: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    overflow: visible;
  }
  .mobile-name-btn,
  .mobile-inline-price,
  .mobile-product-detail { display: none !important; }
  .product-name-btn { display: inline; }
  .info-btn.desktop-only { display: inline-flex; }

  /* Vyhledávání a filtry zůstávají vždy viditelné – přilepené pod horní lištou. */
  .order-zone-controls {
    position: sticky;
    top: var(--order-top-h, 4.5rem);
    z-index: 50;
  }
  /* Jednotný scroll stránky: tabulka produktů nemá vlastní vnitřní scrollbar,
     takže hlavní scrollbar neschová hlavičku tabulky. Hlavička (thead) se lepí
     pod přilepené filtry – offset (výška hlavičky + filtrů) měří JS do
     --order-thead-top. Scoped na objednávku, admin tabulky zůstávají beze změny. */
  .order-zone-catalog .excel-table-wrap {
    overflow: visible;
    max-height: none;
  }
  .order-zone-catalog .excel-table thead th {
    top: var(--order-thead-top, 9rem);
    z-index: 40;
  }
}

@media (max-width: 700px) {
  .order-checkout-panel {
    display: none;
  }
  body.order-page {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-accordion {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 0.5rem;
    overflow: hidden;
  }
  .mobile-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    background: linear-gradient(180deg, #fff 0%, var(--brand-container-soft) 100%);
  }
  .mobile-accordion > summary::after {
    content: "▾";
    color: var(--muted);
    transition: transform 0.2s ease;
  }
  .mobile-accordion[open] > summary::after { transform: rotate(180deg); }
  .mobile-accordion-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-dim);
    background: var(--brand-container-soft);
    border: 1px solid rgba(45, 212, 191, 0.45);
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    white-space: nowrap;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-accordion-body { padding: 0 0.65rem 0.65rem; }
  .mobile-accordion .tabs.scroll-tabs {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0;
  }
  .desktop-category-label,
  .desktop-promo-title { display: none; }
  .mobile-promo-accordion .promo-panel.card {
    padding: 0.35rem 0 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .mobile-promo-accordion .promo-panel .section-title { display: none; }
}

.compact-notes { margin-bottom: 0.65rem; }
.compact-notes span { font-size: 0.78rem; color: var(--muted); }
.compact-notes textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  /* Omezené zvětšování – jen svisle a do limitu, ať uživatel nerozbije layout. */
  resize: vertical;
  min-height: 2.6rem;
  max-height: 8rem;
}

.wide-dialog { max-width: 640px; width: calc(100% - 1rem); }

.section-title {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}
.badge.locked {
  font-size: 0.72rem;
  background: #e9ecef;
  color: #495057;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 600;
}

.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}
.customer-grid label span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.customer-grid input {
  width: 100%;
  border: 1px solid var(--border);
  background: #f8faf8;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  color: var(--text);
}

.toolbar { display: none; }
.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding-bottom: 0;
}
.tab.tab-today {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}
.tab.tab-today.active {
  background: var(--cta-bg);
  color: var(--cta-text);
  border-color: var(--cta-border);
}
.tab.tab-action {
  margin-left: 0.15rem;
}

.show-today-catalog-row {
  display: flex;
  justify-content: flex-end;
  margin: 0.75rem 0 0.35rem;
}
.btn-show-today-catalog {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary-dark);
  border-radius: 10px;
  padding: 0.48rem 0.9rem;
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-show-today-catalog:hover {
  background: var(--brand-container-soft);
  border-color: rgba(45, 212, 191, 0.45);
}
.btn-show-today-catalog.active {
  background: var(--brand-container);
  border-color: var(--brand-dim);
  color: var(--on-brand);
}

.order-total-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}
.order-total-label {
  margin-right: auto;
  font-weight: 700;
  color: var(--primary-dark);
}
.order-total-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  margin-right: 0.25rem;
}
.order-total-row .highlight strong { color: var(--primary-dark); }

.order-checkout-panel {
  /* display nastavuje až @media: flex na desktopu (≥701px), none na mobilu
     (≤700px – jinak by se „Odeslat" zdvojilo s fixní spodní lištou). Bez tohoto
     by base `display:flex` (později ve zdroji) přebil mobilní `display:none`. */
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(220, 232, 229, 0.95);
}
.order-checkout-meta {
  display: flex;
  justify-content: center;
  text-align: center;
}
.order-free-shipping {
  display: block;
  width: 100%;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.order-free-shipping.hidden { display: none; }
.order-free-shipping.is-pending { color: var(--warning); }
.order-free-shipping.is-unlocked { color: var(--brand); }

.mobile-checkout-bar {
  /* Tři sloupce: vlevo odpočet „Doprava zdarma“, uprostřed tlačítko Odeslat,
     vpravo počet položek + cena. */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.65rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 240;
  /* Center the bar content within the same max-width as the order shell,
     while the bar background still spans the full viewport width. */
  padding: 0.55rem max(0.75rem, calc((100% - 1400px) / 2)) calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 2px solid var(--brand);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
}
.mobile-checkout-shipping {
  grid-column: 1;
  justify-self: start;
  min-width: 0;
}
/* Plovoucí tlačítko „skok dolů / nahoru“ – díky jednotnému scrollu se k Poznámce,
   součtům a tlačítku „Vyfiltruj dnešní“ dostanete na jeden klik. Jen desktop. */
.scroll-jump-btn { display: none; }
@media (min-width: 701px) {
  .scroll-jump-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    position: fixed;
    right: max(1rem, calc((100% - 1400px) / 2));
    bottom: 4.85rem;
    z-index: 200;
    height: 2.6rem;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(45, 212, 191, 0.55);
    background: var(--brand-container);
    color: var(--primary-dark);
    box-shadow: var(--shadow-2);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .scroll-jump-btn:hover { background: #99f6e4; transform: translateY(-1px); }
  .scroll-jump-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    display: block;
    transition: transform 0.2s ease;
  }
  .scroll-jump-btn.is-up .scroll-jump-icon { transform: rotate(180deg); }
  .scroll-jump-label { white-space: nowrap; }
}
.mobile-checkout-meta {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  text-align: right;
}
.mobile-checkout-items {
  font-size: 0.78rem;
  color: var(--muted);
}
.mobile-checkout-gross {
  font-size: 0.92rem;
  white-space: nowrap;
}
.mobile-checkout-gross em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.72rem;
  margin-right: 0.2rem;
}
.mobile-free-shipping {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-free-shipping.hidden { display: none; }
.mobile-free-shipping.is-pending { color: var(--warning); }
.mobile-free-shipping.is-unlocked { color: var(--brand); }
.mobile-checkout-bar .btn.primary {
  grid-column: 2;
  justify-self: center;
  flex-shrink: 0;
  min-width: 7.5rem;
  padding: 0.65rem 1rem;
}

/* Desktop: the pinned bottom bar is the single Send action, so hide the
   in-panel large submit button (toast + free-shipping meta stay visible). */
@media (min-width: 701px) {
  .order-checkout-panel .submit-actions #submitBtn {
    display: none;
  }
  .mobile-checkout-bar .btn.primary {
    min-width: 12rem;
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
  }
}

.submit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.submit-actions .btn { width: 100%; }
.submit-actions .btn.primary.is-submitting,
.submit-actions .btn.is-submitting {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
  color: #fff !important;
  border-color: #475569 !important;
  box-shadow: none !important;
  cursor: wait !important;
  opacity: 1;
  filter: none !important;
}
.order-toast {
  margin-top: 0.15rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-1);
  display: block;
}
.order-toast.hidden { display: none !important; }
.order-toast.loading {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e40af;
  font-weight: 600;
}
.order-toast.success {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
  font-weight: 600;
}
.order-toast.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  font-weight: 600;
}
.submit-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.submit-overlay.hidden { display: none !important; }
.submit-overlay-box {
  background: #fff;
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  border: 2px solid #5df8d8;
}
.submit-overlay-box p {
  margin: 0.65rem 0 0;
  font-weight: 700;
  color: #115e59;
}
.submit-overlay-hint {
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: #64748b !important;
}
.submit-overlay-spinner {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto;
  border: 3px solid #ccfbf1;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: submit-spin 0.85s linear infinite;
}
@keyframes submit-spin {
  to { transform: rotate(360deg); }
}

.excel-table-wrap {
  /* Vnitřní scrollbar seznamu produktů + sticky hlavička tabulky. Stránka má
     navíc vlastní vnější scrollbar pro zbytek obsahu (Poznámka, Součty, Odeslat).
     Mobil (≤700px) má vlastní kartové zobrazení s vlastním scrollem. */
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1;
  min-height: 200px;
  max-height: min(62vh, 640px);
}
.excel-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.excel-table thead th {
  position: sticky;
  /* Lepí se na vrch vlastního scroll-kontejneru tabulky (jednotně pro objednávku
     i admin tabulky typu „Akce a slevy"). */
  top: 0;
  z-index: 2;
  background: var(--header-bg);
  border-bottom: 2px solid var(--brand-dim);
  padding: 0.65rem 0.55rem;
  text-align: left;
  white-space: nowrap;
  color: var(--primary-dark);
}
.excel-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0.55rem;
  vertical-align: middle;
}
.excel-table tbody tr:not(.category-row):hover { background: var(--row-hover); }
.excel-table .num { text-align: right; white-space: nowrap; }
.excel-table .mono { font-family: Consolas, monospace; }
.excel-table .col-code { width: 72px; }
.excel-table .col-photo { width: 52px; text-align: center; }
.excel-table .col-qty { width: 110px; }
.excel-table .col-price { width: 120px; }

.photo-btn {
  border: 1px solid var(--border);
  background: #f8fafc;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.photo-btn.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-btn:hover { border-color: var(--primary); }

.voice-intro {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.category-row td {
  background: var(--category-bg);
  font-weight: 700;
  color: var(--primary-dark);
  border-top: 2px solid var(--brand-container);
  padding: 0.55rem 0.75rem;
}
.row-ordered { background: var(--row-ordered) !important; }
.product-name { line-height: 1.35; }
.cat-pill {
  display: inline-block;
  background: #edf2ff;
  color: #364fc7;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.empty { text-align: center; color: var(--muted); padding: 2rem !important; }

.qty-input {
  width: 72px;
  padding: 0.4rem 0.35rem;
  border: 2px solid rgba(45, 212, 191, 0.65);
  border-radius: 10px;
  text-align: right;
  font-weight: 700;
  background: #fff;
  margin-left: auto;
  display: block;
}
.qty-input:focus {
  outline: none;
  border-color: var(--brand-dim);
  box-shadow: var(--focus-ring);
}
.qty-input.invalid { border-color: var(--danger); background: #fef2f2; }

.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--brand-container);
  color: var(--primary-dark);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: pointer;
  margin-left: 0.35rem;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.info-btn:hover { background: #99f6e4; }
.info-btn svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: currentColor;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--border);
}
.summary-row.total {
  border-bottom: none;
  padding-top: 0.65rem;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.promo-panel ul { padding-left: 0; margin: 0; list-style: none; }
.promo-links { list-style: none; padding: 0; margin: 0; }
.promo-link {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.promo-link strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--text);
  line-height: 1.35;
}
.promo-link:hover {
  background: var(--brand-container-soft);
  border-color: var(--brand-dim);
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.1);
  transform: translateY(-1px);
}
.promo-desc {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  line-height: 1.35;
}
.promo-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; background: #fef3c7; color: #92400e;
  padding: 0.12rem 0.4rem; border-radius: 999px; margin-right: 0.25rem;
}
.promo-badge.new { background: #dbeafe; color: #1e40af; }
.promo-meta {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.side-stack { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.promo-panel.card,
.summary-panel.card {
  box-shadow: var(--shadow-section);
  border: 1px solid rgba(220, 232, 229, 0.95);
}
.promo-panel.card { padding: 1.15rem 1.1rem 1.05rem; }
.summary-panel.card { padding: 1.1rem 1.1rem 1.15rem; }
.scroll-tabs { overflow-x: auto; }
.flash-highlight { animation: flash 2s ease; }
@keyframes flash {
  0%, 100% { background: inherit; }
  30% { background: #fef08a; }
}
.row-ordered.in-promo { box-shadow: inset 3px 0 0 #f59e0b; }
.promo-tip { font-weight: 600; }

.validation-box {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.validation-box.hidden { display: none; }
.validation-box .error { color: var(--danger); }
.validation-box .warning { color: var(--warning); }

dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 2rem);
}
dialog:not([open]) {
  display: none !important;
}
.modal-content { padding: 1rem; position: relative; }
.modal-close {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  cursor: pointer;
}
#modalImage { max-width: 100%; border-radius: 8px; display: none; }

#productModal[open] {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 1rem;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
#productModal::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
#productModal .modal-content {
  max-width: 520px;
  width: 100%;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.app-message-dialog[open] {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.app-message-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.app-message-content {
  position: relative;
  width: min(100%, 420px);
  padding: 1.15rem 1.1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
}
.app-message-close {
  position: absolute;
  right: 0.55rem;
  top: 0.45rem;
  border: none;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}
.app-message-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  margin: 0.15rem auto 0.65rem;
  border-radius: 999px;
  background: var(--brand-container);
  color: #0f766e;
  font-size: 1.15rem;
  font-weight: 700;
}
.app-message-dialog[data-type="success"] .app-message-icon {
  background: #ecfdf5;
  color: #047857;
}
.app-message-dialog[data-type="error"] .app-message-icon {
  background: #fef2f2;
  color: #b91c1c;
}
.app-message-dialog[data-type="warning"] .app-message-icon {
  background: #fffbeb;
  color: #b45309;
}
.app-message-title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  color: var(--text);
}
.app-message-title[hidden] { display: none; }
.app-message-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}
.app-message-text[hidden] { display: none; }
/* Rich-HTML body (admin-authored): left-aligned, normal wrapping, room for lists/links. */
.app-message-text.is-html {
  white-space: normal;
  text-align: left;
  max-height: min(60vh, 420px);
  overflow-y: auto;
}
.app-message-text.is-html a { color: var(--brand-dark, #0f766e); }
.app-message-text.is-html :first-child { margin-top: 0; }
.app-message-text.is-html :last-child { margin-bottom: 0; }
.app-message-input {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.app-message-optout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
}
.app-message-optout input { margin: 0; }
.app-message-actions { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.app-message-actions .btn { min-width: 7rem; }
/* Secondary (non-primary) button in confirm/prompt dialogs. */
.app-message-actions .btn:not(.primary) {
  background: #fff;
  color: #334155;
  border: 1px solid var(--border, #cbd5e1);
}
.app-message-actions .btn:not(.primary):hover { background: #f1f5f9; }

/* Úvodní zpráva (admin popup) – vlastní dialog s rich HTML tělem. */
.opening-message-dialog[open] {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 1rem;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.opening-message-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.opening-message-content {
  width: min(100%, 460px);
  padding: 1.5rem 1.25rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--brand-dim, rgba(45, 212, 191, 0.35));
  background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.opening-message-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #334155;
  max-height: min(60vh, 440px);
  overflow-y: auto;
}
.opening-message-body :first-child { margin-top: 0; }
.opening-message-body :last-child { margin-bottom: 0; }
.opening-message-body a { color: var(--brand-dark, #0f766e); }
.opening-message-optout {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0 0.75rem;
  font-size: 0.82rem;
  color: #64748b;
  cursor: pointer;
}
.opening-message-optout input { margin: 0; }
.opening-message-actions { display: flex; justify-content: flex-end; }
.opening-message-actions .btn { min-width: 8rem; }

.product-name-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.product-name-btn:hover { color: var(--primary-dark); text-decoration: underline; }

.supplier-contact-dialog[open] {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
  border: none;
  padding: 1rem;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.supplier-contact-dialog::backdrop {
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}
.supplier-contact-content {
  max-width: 420px;
  width: 100%;
  padding: 1.15rem 1.1rem 1.25rem;
  background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 100%);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.supplier-contact-head {
  text-align: center;
  margin-bottom: 1rem;
  padding-right: 1.5rem;
}
.supplier-contact-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-container);
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.supplier-contact-head h3 {
  margin: 0.55rem 0 0.35rem;
  font-size: 1.35rem;
  color: #0f172a;
}
.supplier-contact-lead {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}
.supplier-contact-cards {
  display: grid;
  gap: 0.65rem;
}
.supplier-contact-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.supplier-contact-card:hover {
  border-color: rgba(45, 212, 191, 0.75);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.supplier-contact-card.hidden { display: none; }
.supplier-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.supplier-contact-card--phone .supplier-contact-icon {
  background: #ecfdf5;
}
.supplier-contact-card--email .supplier-contact-icon {
  background: #eff6ff;
}
.supplier-contact-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.supplier-contact-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.supplier-contact-card-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}
.supplier-contact-empty {
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  color: #64748b;
  font-size: 0.86rem;
  text-align: center;
}
.supplier-contact-empty.hidden { display: none; }

.past-order { margin-bottom: 0.65rem; border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.65rem; }
.past-order summary { cursor: pointer; font-weight: 600; }
.excel-table.compact td, .excel-table.compact th { padding: 0.35rem 0.45rem; font-size: 0.85rem; }
.repeat-order-btn { margin-top: 0.5rem; }
.voice-recorder-panel {
  margin: 0.5rem 0 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.voice-meter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}
#voiceMeter {
  width: 100%;
  max-width: 320px;
  height: 52px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.voice-timer-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-dark);
}
.voice-rec-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}
.voice-rec-dot.hidden { display: none; }
.voice-rec-dot.pulse { animation: voice-rec-pulse 1.1s ease-in-out infinite; }
@keyframes voice-rec-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.88); }
}
.voice-meter-wrap.is-recording #voiceMeter { border-color: rgba(239, 68, 68, 0.45); }
.voice-meter-wrap.is-finished #voiceMeter { border-color: rgba(34, 197, 94, 0.45); }
#voiceStatus {
  margin: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.voice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.voice-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.voice-actions .btn-icon { font-size: 0.95rem; line-height: 1; }

.feed-report { margin-top: 0.75rem; font-size: 0.9rem; }
.feed-report table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.feed-report th, .feed-report td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.45rem;
  text-align: left;
  font-size: 0.82rem;
}
.feed-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 0.5rem; }

.product-picker { display: grid; gap: 0.5rem; }
.picker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.picker-toolbar input[type="search"] {
  flex: 1 1 240px;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.picker-count { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.selected-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
}
.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--brand-container-soft);
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
}
.code-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.product-picker-table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.product-picker-table-wrap .col-check { width: 36px; text-align: center; }
.item-actions { display: flex; gap: 0.4rem; margin-top: 0.45rem; flex-wrap: wrap; }
.form-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.inline-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }

@media (max-width: 1100px) {
  .order-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "aside"
      "footer";
    padding: 1rem 0.85rem 1.25rem;
  }
  .search-summary-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }
  .cart-summary {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 900px) {
  .order-zone-controls,
  .order-zone-catalog,
  .order-footer {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* Desktop dvousloupcový layout (produkty + postranní panel). */
@media (min-width: 1101px) {
  /* Pinned spodní lišta: obsah přesně lícuje s tabulkou produktů – levý/pravý
     okraj měří JS (--catalog-pad-*). Tlačítko Odeslat je vycentrované pod
     tabulkou. Vlevo odpočet dopravy zdarma, vpravo (u pravého okraje tabulky)
     počet položek + cena. Fallback (před změřením) drží šířku sloupce produktů.
     +1rem padding .order-shell, +1.15rem padding .order-zone-catalog,
     +280px aside, +1.35rem mezera gridu. */
  .mobile-checkout-bar {
    padding-left: var(--catalog-pad-left, calc(max(0.75rem, (100% - 1400px) / 2) + 1rem + 1.15rem));
    padding-right: var(--catalog-pad-right, calc(max(0.75rem, (100% - 1400px) / 2) + 1rem + 1.15rem + 280px + 1.35rem));
  }
  .mobile-checkout-bar .mobile-checkout-meta {
    flex-direction: row;
    align-items: baseline;
    gap: 0.9rem;
  }
}

@media (max-width: 700px) {
  body.mobile-drawer-open { overflow: hidden; }

  .compact-header.order-top {
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 220;
  }
  .header-layout { gap: 0; }
  .mobile-top-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.65rem;
  }
  .desktop-header-title { display: none; }
  .admin-order-page .desktop-header-title {
    display: block;
    padding: 0.45rem 0.65rem 0;
  }
  .admin-order-page .desktop-header-title .header-row-top-actions,
  .admin-order-page .desktop-header-title .admin-customer-title { display: none !important; }
  .admin-order-page .admin-customer-picker { width: 100%; min-width: 0; }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--brand);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .mobile-menu-icon,
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    display: block;
    width: 1rem;
    height: 2px;
    background: var(--brand-dim);
    border-radius: 999px;
    position: relative;
  }
  .mobile-menu-icon::before,
  .mobile-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }
  .mobile-menu-icon::before { top: -5px; }
  .mobile-menu-icon::after { top: 5px; }
  .mobile-top-title { min-width: 0; }
  .mobile-top-title strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-top-meta {
    display: block;
    font-size: 0.72rem;
    color: var(--header-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-top-supplier {
    font-size: 0.72rem;
    padding: 0.35rem 0.55rem;
    white-space: nowrap;
  }

  .mobile-header-drawer {
    position: fixed;
    inset: 0;
    z-index: 260;
    pointer-events: none;
  }
  .mobile-header-drawer.is-open { pointer-events: auto; }
  .mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.22s ease;
  }
  .mobile-header-drawer.is-open .mobile-drawer-backdrop { opacity: 1; }
  .mobile-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20rem, 88vw);
    background: #fff;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    overflow-y: auto;
    padding: 0.75rem 0.85rem 1.25rem;
  }
  .mobile-header-drawer.is-open .mobile-drawer-panel { transform: translateX(0); }
  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
  }
  .mobile-drawer-close {
    border: none;
    background: var(--brand-container-soft);
    color: var(--brand-dim);
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
  }
  .mobile-drawer-fields.header-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  .mobile-drawer-fields .hf-address { grid-column: 1 / -1; grid-row: auto; }
  .mobile-drawer-fields .hf-ico { grid-column: 1; grid-row: auto; max-width: none; }
  .mobile-drawer-fields .hf-phone { grid-column: 2; grid-row: auto; }
  .mobile-drawer-fields .hf-email { grid-column: 1 / -1; grid-row: auto; }
  .mobile-drawer-fields .hf-payment { grid-column: 1; grid-row: auto; }
  .mobile-drawer-fields .hf-date { grid-column: 2; grid-row: auto; max-width: none; }
  .mobile-drawer-fields .hf-past-btn,
  .mobile-drawer-fields .hf-voice-btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }
  .mobile-drawer-fields .hf-field input,
  .mobile-drawer-fields .order-date-value { font-size: 0.78rem; }
  .mobile-drawer-fields .hf-phone { width: 100%; max-width: none; }

  .order-shell {
    padding: 0.55rem 0.55rem 1rem;
    gap: 0.75rem;
  }
  .order-zone-controls { padding: 0.75rem 0.65rem 0.55rem; }
  .search-summary-row { margin-bottom: 0.55rem; }
  .search-box { max-width: none; flex: 1 1 auto; width: 100%; }
  .search-box input { font-size: 16px; }
  #cartSummary,
  .search-summary-row .cart-summary { display: none !important; }

  .category-filters {
    max-height: 9.5rem;
    overflow-y: auto;
    margin-bottom: 0;
  }

  .order-zone-catalog { padding: 0.65rem 0.55rem 0.85rem; }
  .excel-table-wrap {
    max-height: min(52vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    border: none;
    box-shadow: none;
    background: transparent;
    padding-right: 0.15rem;
  }
  .excel-table {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 0.86rem;
    border-collapse: separate;
    border-spacing: 0 0.45rem;
  }
  .excel-table thead { display: none; }
  .excel-table tbody { display: block; }
  .excel-table tbody tr.product-row {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr) auto;
    grid-template-areas:
      "photo name qty"
      "detail detail detail";
    gap: 0.45rem 0.55rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
  }
  .excel-table tbody tr.product-row.row-ordered {
    background: var(--row-ordered);
    border-color: rgba(245, 158, 11, 0.35);
  }
  .excel-table tbody tr.product-row.mobile-detail-open {
    border-color: var(--brand);
    box-shadow: var(--shadow-2);
  }
  .excel-table tbody tr.product-row td {
    display: block;
    border: none;
    padding: 0;
    background: transparent;
  }
  .excel-table .col-code,
  .excel-table .col-price-net,
  .excel-table .col-price-vat,
  .excel-table .product-name-btn,
  .excel-table .info-btn.desktop-only { display: none !important; }
  .excel-table .col-photo { grid-area: photo; text-align: center; }
  .excel-table .col-name { grid-area: name; min-width: 0; }
  .excel-table .col-qty { grid-area: qty; align-self: center; }

  .mobile-name-btn {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    text-align: left;
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
    color: inherit;
    cursor: pointer;
  }
  .mobile-inline-price {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
  }
  .mobile-product-detail {
    display: block;
    grid-area: detail;
    padding: 0.55rem 0 0;
    border-top: 1px dashed var(--border);
  }
  .mobile-product-detail[hidden] { display: none !important; }
  .mobile-detail-image {
    width: 100%;
    max-height: 10rem;
    object-fit: contain;
    border-radius: 10px;
    background: #f8fafc;
    margin-bottom: 0.45rem;
  }
  .mobile-detail-placeholder {
    padding: 1rem;
    text-align: center;
    color: var(--muted);
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
  }
  .mobile-product-detail p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #334155;
  }

  .photo-btn {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
  }
  .photo-btn.has-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
  }

  .qty-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .qty-step { display: inline-flex; }
  .qty-input {
    width: 2.65rem;
    min-width: 2.65rem;
    max-width: 2.65rem;
    margin-left: 0;
    padding: 0.35rem 0.2rem;
    font-size: 16px;
    text-align: center;
  }

  .show-today-catalog-row { justify-content: stretch; }
  .btn-show-today-catalog { width: 100%; text-align: center; font-size: 0.82rem; }
  .order-total-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
  .order-total-label { margin-right: 0; }
  .order-total-row span:not(.order-total-label) {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .side-stack .summary-panel { padding: 0.85rem; }

  dialog {
    width: calc(100vw - 0.75rem);
    max-width: none;
    margin: auto;
  }
  .wide-dialog { width: calc(100vw - 0.75rem); max-width: none; }
  .voice-actions { flex-direction: column; }
  .voice-actions .btn { width: 100%; min-width: 0; }
  .admin-order-bar { flex-direction: column; align-items: flex-start; }
  .admin-customer-picker { width: 100%; min-width: 0; }
  .landing-actions { flex-direction: column; align-items: stretch; }
  .landing-actions .btn { width: 100%; text-align: center; min-width: 0; }
}

.admin-order-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: #fff7ed;
  border-bottom: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.88rem;
}

.admin-customer-picker {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
}

.admin-customer-picker label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.admin-customer-picker input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 2px solid #0f766e;
  border-radius: 8px;
  font-size: 0.92rem;
}

.admin-customer-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 120;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  background: #fff;
  border: 1px solid #dce8e5;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow: auto;
}

.admin-customer-results li button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.admin-customer-results li button:hover {
  background: #f0fdfa;
}

.admin-customer-picker.has-customer input {
  border-color: #059669;
  background: #ecfdf5;
  font-weight: 700;
}

.order-main--disabled {
  opacity: 0.55;
  pointer-events: none;
}

.order-main--disabled::after {
  content: "Nejdříve vyhledejte a vyberte odběratele.";
  display: block;
  padding: 1rem;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}
