/* Egy betűtípus az egész rendszerben: az Inter a rendszerrel együtt töltődik be, így minden
   gépen ugyanaz jelenik meg (nem a gép saját betűje). */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext.ad4eb06671be.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin.8e433c0592f7.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #2c251f;
  background: #f7f3eb;
  font-synthesis: none;
  --ink: #2c251f;
  --muted: #766d64;
  --paper: #fffdf8;
  --canvas: #f7f3eb;
  --line: #e5ddd1;
  --wheat: #c8843f;
  --wheat-dark: #8b4f23;
  --terracotta: #a64f32;
  --green: #356c4b;
  --green-soft: #e8f1e9;
  --danger: #a13d35;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
}

button,
input,
select { font: inherit; }

a { color: inherit; }

button,
.btn,
.button-row > a,
.actions > a {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.55rem;
  color: #fff;
  background: var(--wheat-dark);
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-row > a:hover,
.actions > a:hover { background: #713d1d; }

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(200 132 63 / 32%);
  outline-offset: 2px;
}
/* Beviteli mező: aláhúzás és színes fókuszkeret nélkül, fókuszban kicsit sötétebb háttér. */
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible { outline: none; box-shadow: none; background-color: rgb(0 0 0 / 7%); }
input[type=checkbox]:focus,
input[type=radio]:focus { background-color: transparent; }

.app-shell { min-height: 100vh; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  min-height: 3.2rem;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 0 3vw;
  border-bottom: 1px solid var(--line);
  background: rgb(255 253 248 / 94%);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-logo { display: block; width: 2.6rem; height: 2.6rem; }

.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  padding: 0.33rem;
  border-radius: 50%;
  background: #e8c37f;
  fill: none;
  stroke: var(--wheat-dark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

.main-navigation {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 1.8rem;
}

.main-navigation a {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
  color: #5f574f;
  font-size: 0.94rem;
  font-weight: 680;
  text-decoration: none;
}

.main-navigation a[aria-current="page"] { color: var(--wheat-dark); }
.main-navigation a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--wheat);
  content: "";
}

.user-menu { position: relative; }
.user-menu summary {
  color: #5f574f;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 650;
  list-style: none;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu[open] > div,
.row-actions[open] > div {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.8rem);
  right: 0;
  display: grid;
  width: max-content;
  min-width: 13rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--paper);
  box-shadow: 0 1rem 2.5rem rgb(70 48 26 / 16%);
}
.user-menu a,
.text-button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.35rem;
  color: var(--ink);
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}
.user-menu a:hover,
.text-button:hover { background: #f3ede3; }

.workspace {
  width: min(100%, 96rem);
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) 3vw 5rem;
}

.workspace-heading,
.order-context {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--terracotta);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 { text-wrap: balance; }
h1 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
h2 {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}
h3 { margin-top: 1.8rem; }
.lead {
  max-width: 52rem;
  margin: 0.8rem 0 2rem;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}
.muted,
.empty-copy { color: var(--muted); }
.quiet-link {
  padding-bottom: 0.2rem;
  color: var(--wheat-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-underline-offset: 0.25rem;
}

.partner-picker {
  position: relative;
  z-index: 10;
}
.partner-picker > label,
.date-switcher label,
.add-product label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}
input,
select,
button,
textarea { font: inherit; }
input,
select {
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: rgb(0 0 0 / 4%);
}
.partner-name-input { background: transparent; }
.partner-search-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
}
.partner-search-line input { min-width: 0; padding-left: 0; }
.partner-search-line.with-add { grid-template-columns: auto minmax(0, 1fr) auto; }
.add-button { font-size: 1.2rem; line-height: 1; }
.information-button,
.dialog-close {
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wheat-dark);
  background: transparent;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
}
.information-button:hover,
.dialog-close:hover { color: #fff; background: var(--wheat-dark); }
.partner-search-results {
  position: absolute;
  right: 0;
  left: 0;
  display: grid;
  max-height: 22rem;
  margin-top: 0.4rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--paper);
  box-shadow: 0 1rem 2.5rem rgb(70 48 26 / 16%);
}
.partner-search-results[hidden] { display: none; }
.partner-search-results a {
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
}
.partner-search-results a:first-child { border-top: 0; }
.partner-search-results a:hover {
  color: var(--wheat-dark);
  background: #f1e7d7;
}
.partner-search-results a span {
  color: var(--muted);
  font-size: 0.8rem;
}
.partner-search-results .empty-copy { margin: 0; padding: 1rem; }

.order-workspace { min-width: 0; }
.partner-heading { margin-top: 2rem; }
.partner-heading > label.eyebrow { margin-bottom: 0.2rem; }
.partner-heading .partner-search-line input.partner-name-input {
  min-height: 3.2rem;
  padding: 0.2rem 0;
  border-bottom-color: transparent;
  font-family: inherit;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.partner-name-display {
  cursor: text;
  overflow-wrap: anywhere;
  border-bottom: 1px solid transparent;
}
.partner-name-display:hover,
.partner-name-display:focus-visible { border-bottom-color: #bdb2a5; outline: none; }
.partner-name-display[hidden],
.partner-name-input[hidden] { display: none; }
.partner-heading .partner-search-line input.partner-name-input:hover,
.partner-heading .partner-search-line input.partner-name-input:focus { border-bottom-color: #bdb2a5; }
.date-switcher {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}
.date-switcher > a {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  place-items: center;
  border-radius: 50%;
  color: var(--wheat-dark);
  background: #efe5d6;
  font-size: 1.25rem;
  text-decoration: none;
}
.date-switcher input { min-width: 10rem; }
.order-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.25rem;
  margin-top: 1.4rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-weight: 750;
}
.status-pill::before {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
  content: "";
}
.status-open::before { background: var(--green); }
.status-closed::before { background: var(--terracotta); }

.order-lines { margin-top: 1.4rem; }
.order-line {
  position: relative;
  display: grid;
  grid-template-columns: minmax(12rem, 2fr) minmax(6rem, 0.7fr) minmax(10rem, 1fr) 2rem;
  align-items: center;
  gap: 1.1rem;
  min-height: 4.4rem;
  border-bottom: 1px solid var(--line);
}
.order-line-heading {
  min-height: 2rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.product-name { display: grid; gap: 0.16rem; }
.product-name span,
.standing-value {
  color: var(--muted);
  font-size: 0.8rem;
}
.quantity-cell form {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.quantity-cell input {
  width: 6rem;
  min-height: 2.4rem;
  padding: 0.25rem 0.4rem;
  border-bottom: 0;
  font-size: inherit;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}
.quantity-cell span { color: var(--muted); font-size: 0.82rem; }
.save-status {
  display: block;
  color: var(--danger);
  font-size: 0.76rem;
  font-weight: 700;
}
.save-status.is-error { color: var(--danger); }
.row-actions { position: relative; }
.row-actions summary {
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.08em;
  list-style: none;
}
.row-actions summary::-webkit-details-marker { display: none; }
.row-actions[open] > div { top: 1.7rem; }
.danger-text { color: var(--danger); }
.add-product {
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.add-product > summary {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  place-items: center;
  border: 1px solid var(--wheat);
  border-radius: 50%;
  color: var(--wheat-dark);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 750;
  list-style: none;
}
.add-product > summary::-webkit-details-marker { display: none; }
.add-product > summary:hover { color: #fff; background: var(--wheat-dark); }
.add-product > form {
  display: grid;
  grid-template-columns: minmax(13rem, 2fr) minmax(8rem, 0.7fr) auto;
  align-items: end;
  gap: 1rem;
  margin-top: 1rem;
}
.standing-order-update {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: right;
}

.partner-information-dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100vh - 4rem);
  padding: 1.7rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2rem 5rem rgb(44 37 31 / 24%);
}
.partner-information-dialog::backdrop { background: rgb(44 37 31 / 42%); }
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.partner-information-dialog dl { margin-top: 1.5rem; }
.partner-information-dialog h3 { margin-bottom: 0.6rem; }
.partner-information-dialog p { margin: 0.45rem 0; }

/* Diszpécseri munkafelület: tömör elrendezés, hogy a rendelés egyben átlátható legyen. */
.workspace:has(.order-workspace) { padding-top: 0; }
.order-workspace .compact-heading {
  align-items: center;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}
.compact-heading h1 { font-size: clamp(1.3rem, 2.4vw, 2.1rem); }
.compact-heading .eyebrow { margin-bottom: 0.15rem; font-size: 0.66rem; }
.compact-heading .date-switcher label { margin-bottom: 0.1rem; font-size: 0.7rem; }
.compact-heading .date-switcher > a { width: 2.1rem; height: 2.1rem; font-size: 1rem; }
.compact-heading .date-switcher input { min-height: 2.1rem; padding: 0.2rem 0.4rem; min-width: 9rem; }
.order-workspace .partner-heading { margin-top: 1rem; }
.order-workspace .partner-heading > label.eyebrow { margin-bottom: 0; font-size: 0.66rem; }
.order-workspace .partner-search-line {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}
.order-workspace .partner-name-display,
.order-workspace .partner-heading .partner-search-line input.partner-name-input {
  font-size: clamp(1.05rem, 1.8vw, 1.45rem);
  line-height: 1.2;
}
.order-workspace .partner-heading .partner-search-line input.partner-name-input {
  flex: 1;
  min-height: 2rem;
}
.order-workspace .information-button {
  flex: none;
  width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  margin-top: -0.15rem;
  font-size: 0.7rem;
  line-height: 1;
}
.order-workspace .order-status-line {
  margin-top: 0.3rem;
  padding: 0 0 0.5rem;
  border-top: 0;
  font-size: 0.8rem;
}
.order-workspace .order-lines { margin-top: 0; }
.order-workspace .order-line {
  grid-template-columns: minmax(12rem, 3fr) minmax(4rem, 0.6fr) minmax(7rem, 0.9fr) 1.5rem;
  gap: 0.6rem;
  min-height: 2.35rem;
  padding: 0.15rem 0;
}
.order-workspace .order-line-heading { min-height: 1.5rem; font-size: 0.66rem; }
.order-workspace .product-name { display: flex; align-items: flex-start; gap: 0.3rem; }
.order-workspace .product-name > span { align-self: baseline; margin-left: 0.25rem; }
.order-workspace .product-name strong { font-size: 0.86rem; font-weight: 650; }
.order-workspace .product-name span,
.order-workspace .standing-value { font-size: 0.75rem; }
.order-workspace .quantity-cell input {
  width: 4.2rem;
  min-height: 1.8rem;
  padding: 0.05rem 0;
  font-size: 0.95rem;
}
.order-workspace .add-product { margin-top: 0.6rem; padding-top: 0; }
.order-workspace .add-product > summary { width: 1.7rem; height: 1.7rem; font-size: 1.05rem; }
.order-workspace .standing-order-update { margin-top: 1rem; padding-top: 0.8rem; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Dátumléptető és pipa egyetlen, középre igazított sorban. */
.day-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 1.4rem; }
.compact-heading .date-switcher { display: flex; align-items: center; gap: 0.45rem; }
.compact-heading .date-switcher form { display: block; }
.compact-heading .date-switcher input { min-height: 2.1rem; width: 9.5rem; min-width: 0; }
.compact-heading .weekday-name { align-self: center; padding-bottom: 0; min-width: 3.6rem; }
/* Vevőszűrő a fejléc jobb oldalán: lenyíló menü (Összes, Keretes, Napi, Azonnali),
   egérrel ráállva nyílik. */
/* A később jövő vevőkereső (z-index 10) fölé kell nyílnia. */
.list-filter { position: relative; z-index: 15; }
.list-filter-current {
  min-height: 0;
  padding: 0.25rem 0.1rem;
  border: 0;
  color: var(--ink);
  background: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.list-filter-current:hover,
.list-filter-current:focus { color: var(--wheat-dark); background: none; }
.list-filter-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  display: none;
  min-width: 8rem;
  padding: 0.25rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.08);
}
.list-filter:hover .list-filter-menu,
.list-filter:focus-within .list-filter-menu { display: block; }
.list-filter-menu a {
  display: block;
  padding: 0.35rem 0.8rem;
  color: var(--ink);
  font-size: 0.88rem;
  text-decoration: none;
}
.list-filter-menu a:hover { background: #f1e7d7; }
.list-filter-menu a.is-active { color: var(--wheat-dark); font-weight: 700; }
.list-filter-separator { margin: 0.3rem 0; border: 0; border-top: 1px solid var(--line); }
.order-list-row.product-order-row { grid-template-columns: 6rem minmax(0, 1fr) 5rem 8rem; }
.order-list-row.product-partner-row { grid-template-columns: 4rem minmax(0, 1fr) 8rem; }
.product-detail-title { margin: 1.2rem 0 0.4rem; font-size: 1.05rem; }
/* Vevőmező súgója: egérrel ráállva azonnal megjelenik, gépelés közben nem. */
.partner-search-line[data-hint] { position: relative; }
.partner-search-line[data-hint]::after {
  content: attr(data-hint);
  position: absolute;
  bottom: 100%;
  left: 0;
  z-index: 5;
  margin-bottom: 0.2rem;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
}
.partner-search-line:has(> [data-search-trigger]:hover, > input:not(:focus):hover)::after { visibility: visible; }
.back-to-list { margin-right: 1rem; color: var(--wheat-dark); font-weight: 700; text-decoration: none; }
.order-list { margin-top: 0.8rem; }
.order-list-row {
  display: grid;
  grid-template-columns: 4rem minmax(12rem, 3fr) minmax(6rem, 1fr) 3.5rem 6rem 7.5rem;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.2rem;
  padding: 0.1rem 0.3rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
}
a.order-list-row:hover,
a.order-list-row.is-active { background: #f1e7d7; }
.partner-search-results a.is-active { background: #f1e7d7; }
.order-close { margin-top: 1rem; }
.order-list-row[hidden] { display: none; }
.order-list-row strong { font-weight: 650; }
.order-list-row .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.order-list-heading button {
  display: block;
  justify-self: stretch;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}
.order-list-heading button.numeric { text-align: right; }
.order-list-heading button.is-sorted { color: var(--wheat-dark); }
.order-list-heading button[aria-sort="ascending"]::after { content: " ▲"; }
.order-list-heading button[aria-sort="descending"]::after { content: " ▼"; }
/* A fejlécsor fölé állva minden rendezhető oszlop mellett megjelenik a nyíl. */
.order-list-heading:hover button[data-sort]:not([aria-sort])::after { content: " ▼"; opacity: 0.55; }
.order-list-summary { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.78rem; }
.mobile-only { display: none; }
@media (max-width: 40rem) {
  /* Telefonon egy vevő két sor: fent a név, alatta túra, mennyiség és nettó érték. */
  .order-list-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "name name name" "route qty value";
    gap: 0.1rem 0.8rem;
    padding: 0.45rem 0.2rem;
  }
  .order-list-row .c-name { grid-area: name; }
  .order-list-row .c-route { grid-area: route; color: var(--muted); font-size: 0.78rem; }
  .order-list-row .c-qty { grid-area: qty; }
  .order-list-row .c-value { grid-area: value; }
  .order-list-row .c-code,
  .order-list-row .c-items { display: none; }
  .order-list-heading { grid-template-areas: "name route value"; grid-template-columns: minmax(0, 1fr) auto auto; }
  .order-list-heading .c-qty { display: none; }
  .mobile-only { display: inline; }
}
.dialog-actions { display: flex; gap: 0.5rem; }
.dialog-edit {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wheat-dark);
  text-decoration: none;
}
.dialog-edit:hover { color: #fff; background: var(--wheat-dark); }

/* Diszpécseri munkafelület – egységes betűkép és oszloprend. */
.order-workspace,
.order-workspace h1,
.order-workspace h2,
.order-workspace .partner-name-display,
.order-workspace .partner-heading .partner-search-line input.partner-name-input {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
.order-workspace h1 { font-size: 1.35rem; font-weight: 700; }
.order-workspace .partner-name-display,
.order-workspace .partner-heading .partner-search-line input.partner-name-input {
  font-size: 1.15rem;
  font-weight: 700;
}
.order-workspace .partner-search-line { align-items: center; }
.order-workspace .information-button {
  align-self: flex-start;
  margin-top: 0;
  border-color: #cdbfae;
  font-family: inherit;
}
.partner-route {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.weekday-name {
  align-self: flex-end;
  padding-bottom: 0.45rem;
  min-width: 4.8rem;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
}
.compact-heading .date-switcher { align-items: center; }
.back-to-list { display: inline-block; font-size: 0.8rem; }
.order-workspace .order-line {
  grid-template-columns: minmax(12rem, 1fr) 5rem 5.5rem 8.5rem 2rem;
  gap: 0.8rem;
  min-height: 2.3rem;
}
.order-workspace .order-line > .numeric,
.order-workspace .order-line-heading .numeric { text-align: right; }
.order-workspace .product-name { align-items: center; }
.order-workspace .product-name strong {
  font-size: 0.85rem;
  font-weight: 600;
}
.order-workspace .product-sku,
.order-workspace .standing-value { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.order-workspace .standing-value small { font-size: 0.72rem; }
.order-workspace .quantity-cell form { justify-content: flex-end; }
.order-workspace .quantity-cell input { width: 4.5rem; text-align: right; }
.order-workspace .quantity-cell span { width: 1.8rem; font-size: 0.72rem; }
.order-workspace .quantity-cell .quantity-readonly { display: flex; justify-content: flex-end; align-items: baseline; gap: 0.3rem; width: auto; color: var(--ink); font-size: inherit; font-variant-numeric: tabular-nums; }
.order-workspace .quantity-cell .quantity-readonly small { width: 1.8rem; color: var(--muted); font-size: 0.72rem; }
.row-delete { margin: 0; justify-self: end; }
.icon-button {
  display: grid;
  width: 1.9rem;
  min-height: 1.9rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0.4rem;
  color: var(--muted);
  background: transparent;
}
.icon-button:hover { color: var(--danger); background: #f6e4df; }
@media (max-width: 40rem) {
  .order-workspace .order-line {
    grid-template-columns: minmax(0, 1fr) auto 2rem;
    grid-template-areas: "name name name" "meta qty del";
    gap: 0.2rem 0.6rem;
  }
  .order-workspace .order-line .product-name { grid-area: name; }
  .order-workspace .order-line .product-sku { display: none; }
  .order-workspace .order-line .standing-value { grid-area: meta; text-align: left; }
  .order-workspace .order-line .standing-value::before { content: "keret: "; }
  .order-workspace .order-line .quantity-cell { grid-area: qty; }
  .order-workspace .order-line .row-delete { grid-area: del; }
  .partner-route { flex-basis: 100%; margin-left: 0; }
  .order-workspace .compact-heading { align-items: stretch; }
  .order-workspace .compact-heading h1 { text-align: left; }
  .order-workspace .day-controls { justify-content: space-between; }
  .order-workspace .partner-search-line { flex-wrap: wrap; }
}

/* Dátumléptető: ← dátum nap → naptár */
.compact-heading .date-switcher { gap: 0.5rem; }
.date-display {
  min-width: 9.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.date-picker { position: relative; display: flex; }
.calendar-button {
  display: grid;
  width: 2.1rem;
  min-height: 2.1rem;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--wheat-dark);
  background: transparent;
}
.calendar-button:hover { color: #fff; background: var(--wheat-dark); }
.date-picker-input {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2.1rem;
  min-height: 0;
  height: 2.1rem;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
/* Cím egységként: ← dátum nap → Rendelések, a dátum a címmel azonos betűvel. */
.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.title-line .date-picker { position: relative; display: flex; }
.order-workspace .title-line .date-display {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: none;
  font-size: 1.35rem;
  font-weight: 700;
  cursor: pointer;
}
.order-workspace .title-line .date-display:hover { color: var(--wheat-dark); }
.title-line .day-arrow {
  display: grid;
  width: 1.4rem;
  height: 1.9rem;
  place-items: center;
  color: var(--muted);
  font-size: 1.1rem;
  text-decoration: none;
}
.title-line .day-arrow:hover { color: var(--wheat-dark); }
/* Egérrel a nyilak csak a dátum fölé állva látszanak; érintőképernyőn mindig. */
@media (hover: hover) {
  .title-line .day-arrow { opacity: 0; transition: opacity 0.12s; }
  .title-line:hover .day-arrow,
  .title-line:focus-within .day-arrow { opacity: 1; }
}
.title-line h1 { margin-left: 0.25rem; }
/* Fejléc jobb oldala: egy betűméret és -vastagság. */
.order-workspace .day-controls,
.order-workspace .day-controls input,
.order-workspace .date-display,
.order-workspace .weekday-name,
/* Vevőmező: keret, aláhúzás és fókuszkeret nélkül; csak a halvány „Vevő” felirat. */
.order-workspace .partner-heading .partner-search-line input.partner-name-input,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:hover,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:focus,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:focus-visible,
.order-workspace .partner-name-display,
.order-workspace .partner-name-display:hover,
.order-workspace .partner-name-display:focus-visible {
  border: 0;
  outline: none;
  box-shadow: none;
}
.order-workspace .partner-name-input::placeholder { color: #a99b8b; font-weight: 600; }
.order-workspace .partner-name-input::-webkit-search-cancel-button { display: none; }

/* Új tétel sora */
.new-line { border-bottom: 0; }
.new-line-picker { position: relative; z-index: 5; }
.new-line-picker input { min-height: 2rem; padding: 0.2rem 0.4rem; font-size: 0.85rem; }
.new-line-picker input::placeholder { color: var(--wheat-dark); }
.new-line-quantity { display: flex; justify-content: flex-end; align-items: baseline; gap: 0.45rem; }
.new-line .new-line-quantity input { width: 4.5rem; text-align: right; }

/* Termelési munkafelület: a rendelési munkatérrel azonos napi fejléc és tömör sorlista. */
.workspace:has(.production-workspace) { padding-top: 0; }
.heading-tools { display: flex; align-items: center; gap: 1.2rem; }
.list-filter-current svg { display: block; }
.production-warning { margin: 1rem 0 0; }
.production-line {
  display: grid;
  grid-template-columns: 5rem minmax(14rem, 1fr) 7.5rem 8rem;
  align-items: center;
  gap: 0.8rem;
  min-height: 2.3rem;
  padding: 0.15rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.production-line-heading {
  min-height: 1.5rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.production-line .product-name { display: flex; align-items: center; gap: 0.3rem; }
.production-line .product-name strong { font-size: 0.85rem; font-weight: 600; }
.production-line .product-sku { color: var(--muted); font-variant-numeric: tabular-nums; }
.production-line .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.production-line .production-total small { color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.production-line .information-button {
  flex: none;
  align-self: center;
  width: 1.15rem;
  min-height: 1.15rem;
  height: 1.15rem;
  border-color: #cdbfae;
  font-family: inherit;
  font-size: 0.7rem;
  line-height: 1;
}
.production-workspace .partner-heading { margin-top: 0.8rem; }
.production-line[hidden] { display: none; }
.urgent-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem; color: var(--muted); font-size: 0.9rem; }
.urgent-dates strong { color: var(--ink); }
.urgent-dates .date-picker { display: flex; align-items: center; gap: 0.4rem; }
.urgent-order-row { grid-template-columns: 4rem minmax(0, 1fr) 4rem 10rem 6rem 8rem 6rem; }
.activity-workspace { max-width: 82rem; }
.report-workspace { max-width: 72rem; }
.report-title { margin: 1.4rem 0 0.5rem; font-size: 0.95rem; }
.report-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.8rem; }
.report-tile { display: grid; gap: 0.2rem; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 0.55rem; background: var(--paper); }
.report-label { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.report-value { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.report-base { color: var(--muted); font-size: 0.78rem; }
.report-change { font-weight: 700; font-variant-numeric: tabular-nums; }
.report-change.is-up { color: #2f7d32; }
.report-change.is-down { color: #b3261e; }
.report-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.4rem; align-items: end; height: 11rem; }
.report-bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; text-align: center; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.report-bar-track { display: flex; align-items: flex-end; }
.report-bar-fill { width: 100%; min-height: 2px; border-radius: 0.25rem 0.25rem 0 0; background: #d9c3a3; }
.report-bar.is-current .report-bar-fill { background: var(--wheat-dark); }
.report-bar-day { color: var(--muted); }
.report-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
.report-row { grid-template-columns: 4.5rem minmax(0, 1fr) 8rem; }
.report-standing-row { grid-template-columns: 4.5rem minmax(0, 1fr) 9rem 9rem; }
.activity-filters { display: flex; gap: 0.6rem; align-items: center; }
.activity-filters select, .activity-filters input { min-height: 2rem; }
.activity-title { margin: 1.2rem 0 0.4rem; font-size: 0.95rem; }
.presence-row { grid-template-columns: minmax(9rem, 1fr) minmax(14rem, 3fr) 9rem; }
.presence-row .activity-state { color: var(--muted); text-align: right; }
.presence-row.is-active .activity-state { color: #2f7d32; font-weight: 600; }
.log-row { grid-template-columns: 6.5rem minmax(9rem, 1fr) minmax(16rem, 4fr); }
.activity-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.production-list-title { margin: 1.2rem 0 0.3rem; font-size: 0.95rem; }
.production-line[data-href] { cursor: pointer; }
.production-line[data-href]:hover { background: #f1e7d7; }
/* Termék napi oldala: a gyártandó mennyiség a fejléc jobb szélén, jól láthatóan. */
.production-amount { margin-left: auto; color: var(--ink); font-size: 1.05rem; font-weight: 600; white-space: nowrap; }
.production-amount strong { font-size: 1.6rem; font-weight: 750; }
.production-amount small { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.production-lines > .empty-copy { margin: 0; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }

.empty-state {
  max-width: 38rem;
  margin: 5rem auto;
  text-align: center;
}
.empty-state p:last-child {
  color: var(--muted);
  line-height: 1.65;
}
.welcome-state { margin-top: 3rem; }
.spacious { padding: 2rem 0; }

.messages { margin-bottom: 1rem; }
.message {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--green);
  color: #244c35;
  background: var(--green-soft);
}
.message.error {
  border-color: var(--danger);
  color: #772e29;
  background: #f8e8e4;
}

.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.4rem;
}
.button-row > a.secondary,
.actions > a.secondary,
button.secondary {
  border: 1px solid #b7926e;
  color: var(--wheat-dark);
  background: transparent;
}
.compact { min-height: 2.1rem !important; padding: 0.35rem 0.6rem !important; font-size: 0.86rem; }
button.danger { background: var(--danger); }
.inline-form { display: inline; margin: 0; }
form p { display: grid; gap: 0.35rem; }
.errorlist { color: var(--danger); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.access-create { margin: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.access-create > summary { padding: 1rem 0; color: var(--wheat-dark); font-weight: 750; cursor: pointer; }
.access-create > form { display: grid; grid-template-columns: minmax(16rem, 1.4fr) minmax(18rem, 2fr) auto auto; align-items: end; gap: 1.5rem; padding: 0 0 1.4rem; }
.access-settings fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.access-settings legend,
.access-settings label:not(.access-active) { color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.access-settings fieldset > div { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; padding-top: 0.5rem; }
.access-settings fieldset label { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink); font-size: 0.86rem; font-weight: 600; }
.access-settings input[type="checkbox"] { width: auto; min-height: auto; }
.access-list { margin-top: 2rem; }
.access-row { display: grid; grid-template-columns: minmax(16rem, 1.4fr) minmax(18rem, 2fr) 7rem 13rem; align-items: center; gap: 1.5rem; min-height: 4.6rem; border-bottom: 1px solid var(--line); }
.access-row-heading { min-height: 2.4rem; color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.access-row small { display: block; margin-top: 0.2rem; color: var(--muted); }
.access-active { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 650; }
.access-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.8rem; }
.access-customer { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.86rem; font-weight: 600; }
.access-actions a { color: var(--wheat-dark); font-size: 0.82rem; font-weight: 700; }
.auth-page .shell {
  padding: 2rem;
  background:
    radial-gradient(circle at 15% 10%, rgb(232 195 127 / 24%), transparent 34rem),
    radial-gradient(circle at 90% 85%, rgb(166 79 50 / 10%), transparent 30rem),
    #f8f5ef;
}
.auth-card {
  width: min(100%, 25rem);
  padding: 2rem;
  border-radius: 1.25rem;
  background: rgb(255 253 248 / 96%);
  box-shadow: 0 1.5rem 4rem rgb(73 54 38 / 12%);
}
.auth-card .brand { margin-bottom: 2rem; }
.auth-card .brand-mark { width: 2.15rem; height: 2.15rem; }
.auth-heading { margin-bottom: 1.6rem; }
.auth-card h1 {
  font-family: inherit;
  font-size: 1.65rem;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.auth-heading p { margin: 0.45rem 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.auth-form { display: grid; gap: 1rem; }
.auth-field label { display: block; margin: 0 0 0.4rem; color: #5f574f; font-size: 0.78rem; font-weight: 720; }
.auth-field input:not([type="hidden"]) {
  min-height: 2.8rem;
  padding: 0.65rem 0.8rem;
  border: 0;
  border-radius: 0.7rem;
  background: #f2eee7;
}
.auth-field input:not([type="hidden"]):hover { background: #eee8df; }
.auth-field input:not([type="hidden"]):focus { background: #fff; box-shadow: 0 0 0 2px rgb(139 79 35 / 24%); outline: 0; }
.auth-field .errorlist,
.auth-form > .errorlist { margin: 0.4rem 0 0; padding: 0; color: var(--danger); font-size: 0.78rem; list-style: none; }
.auth-actions { display: flex; gap: 0.65rem; margin-top: 0.35rem; }
.auth-actions .auth-submit { flex: 1; }
.auth-actions .auth-back {
  color: var(--muted);
  background: transparent;
  font-weight: 680;
}
.auth-actions .auth-back:hover { color: var(--ink); background: #f2eee7; }
.auth-alternatives { display: grid; gap: 0.55rem; color: var(--muted); font-size: 0.8rem; }
.login-separator { display: flex; align-items: center; gap: 0.8rem; margin: 1.25rem 0; color: #9a9086; font-size: 0.75rem; }
.login-separator::before,
.login-separator::after { flex: 1; height: 1px; background: #e9e2d9; content: ""; }
.google-login {
  width: 100%;
  gap: 0.65rem;
  color: var(--ink);
  background: #f2eee7;
  font-weight: 680;
}
.google-login svg { width: 1.1rem; height: 1.1rem; }
.google-login:hover { color: var(--ink); background: #eae4db; }
.backup-login { margin-top: 1rem; text-align: center; }
.backup-login button { min-height: auto; padding: 0.35rem; color: var(--wheat-dark); background: transparent; font-size: 0.8rem; }
.backup-login button:hover { color: #713d1d; background: transparent; text-decoration: underline; }

.table-scroll { width: 100%; margin: 1.4rem 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th,
td {
  padding: 0.8rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
table a:not(.btn) { color: var(--wheat-dark); font-weight: 700; }
.partner-list { display: grid; gap: 0; padding: 0; list-style: none; }
.partner-list a {
  display: block;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--wheat-dark);
  font-weight: 700;
  text-decoration: none;
}
dl { display: grid; gap: 0; margin: 1.5rem 0; }
dl div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
dt { color: var(--muted); }
dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }

.shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  background: radial-gradient(circle at 20% 15%, #fffdf8 0, transparent 45%), var(--canvas);
}
.status-card {
  width: min(100%, 44rem);
  padding: clamp(2rem, 6vw, 4rem);
  border-top: 4px solid var(--wheat);
  background: var(--paper);
}
.mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--wheat-dark);
  font-weight: 800;
}

/* Mai kiszállítások túratérképe és a szállító helyzetkövetésének indítása. */
.route-map-workspace,
.route-tracking-workspace { max-width: 96rem; margin: 0 auto; }
.route-map-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.route-map-routes {
  max-height: 68vh;
  padding-right: 0.5rem;
  overflow-y: auto;
}
.route-map-route { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.route-map-route:first-child { padding-top: 0; }
.route-map-route-heading {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.35rem;
  border-radius: 0.55rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 760;
  letter-spacing: 0;
}
.route-map-route-heading:hover,
.route-map-route.is-visible .route-map-route-heading { background: rgb(166 79 50 / 9%); }
.route-map-visibility { display: flex; flex: 1; align-items: center; gap: 0.55rem; cursor: pointer; }
.route-map-visibility input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--terracotta); }
.route-map-visibility strong { flex: 1; font: inherit; }
.route-map-route-heading button {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.route-map-route-heading i {
  color: var(--muted);
  font-style: normal;
  transition: transform 140ms ease;
}
.route-map-route.is-open .route-map-route-heading i { transform: rotate(180deg); }
.route-map-visibility span {
  display: inline-grid;
  min-width: 2.4rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--terracotta);
  font-size: 0.72rem;
}
.route-map-route:nth-child(7n + 2) .route-map-visibility span { background: #356c4b; }
.route-map-route:nth-child(7n + 3) .route-map-visibility span { background: #285c86; }
.route-map-route:nth-child(7n + 4) .route-map-visibility span { background: #8b4f23; }
.route-map-route:nth-child(7n + 5) .route-map-visibility span { background: #6d4b8e; }
.route-map-route:nth-child(7n + 6) .route-map-visibility span { background: #247c78; }
.route-map-route:nth-child(7n) .route-map-visibility span { background: #b06d17; }
.route-map-route ol { display: grid; gap: 0.55rem; margin: 0.75rem 0 0; padding: 0; list-style: none; }
.route-map-route ol[hidden] { display: none; }
.route-map-route li { display: grid; grid-template-columns: 3.3rem minmax(0, 1fr); gap: 0.55rem; align-items: start; }
.route-map-route li strong,
.route-map-route li small { display: block; }
.route-map-route li strong { font-size: 0.86rem; }
.route-map-route li small { margin-top: 0.12rem; color: var(--muted); font-size: 0.73rem; line-height: 1.35; }
.route-stop-number { padding-top: 0.1rem; color: var(--wheat-dark); font-size: 0.75rem; font-weight: 780; }
.route-map-panel { position: relative; min-width: 0; }
.route-map-canvas { width: 100%; min-height: 68vh; border-radius: 1rem; background: #ece7df; box-shadow: inset 0 0 0 1px var(--line); }
.route-map-status {
  position: absolute;
  z-index: 1000;
  right: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 0.55rem;
  color: var(--muted);
  background: rgb(255 253 248 / 92%);
  box-shadow: 0 0.25rem 1rem rgb(44 37 31 / 12%);
  font-size: 0.72rem;
}
.route-stop-map-icon,
.route-truck-map-icon { border: 0; background: transparent; }
.route-stop-map-marker {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0.2rem 0.65rem rgb(44 37 31 / 28%);
  font-size: 8px;
  font-weight: 800;
}
.route-truck-map-marker {
  display: grid;
  width: 48px;
  min-height: 58px;
  place-items: center;
  color: #2c251f;
  filter: drop-shadow(0 0.2rem 0.4rem rgb(44 37 31 / 25%));
}
.route-truck-symbol {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 2px solid var(--route-color);
  border-radius: 50%;
  color: var(--route-color);
  background: #fff;
}
.route-truck-symbol svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.route-truck-map-marker strong {
  margin-top: -0.25rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
}
.route-tracking-workspace { max-width: 42rem; }
.route-tracking-workspace .lead { max-width: 36rem; font-size: 1rem; }
.route-tracking-start { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; max-width: 34rem; }
.route-tracking-start label { grid-column: 1 / -1; margin-bottom: -0.3rem; color: var(--muted); font-size: 0.78rem; font-weight: 750; }
.route-tracking-active { display: flex; align-items: center; gap: 0.9rem; margin: 1.5rem 0 0.8rem; }
.route-tracking-active strong { font-size: 1.08rem; }
.route-tracking-active p { margin: 0.2rem 0 0; color: var(--green); font-size: 0.86rem; }
.route-tracking-pulse {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.4rem rgb(53 108 75 / 14%);
}

@media (max-width: 58rem) {
  .app-header {
    grid-template-columns: auto 1fr;
    padding: 0.8rem 1rem;
  }
  .main-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 2.6rem;
    overflow-x: auto;
  }
  .user-menu { justify-self: end; }
  .order-line { grid-template-columns: minmax(11rem, 2fr) 6rem minmax(9rem, 1fr) 2rem; gap: 0.7rem; }
}

@media (max-width: 40rem) {
  .workspace { padding: 1.6rem 1rem 3rem; }
  .workspace-heading,
  .order-context { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 2.7rem; }
  .date-switcher { width: 100%; align-items: flex-end; }
  .date-switcher form { flex: 1; }
  .order-line-heading { display: none; }
  .order-line {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem 1rem;
    padding: 1rem 0;
  }
  .product-name { grid-column: 1; }
  .standing-value { grid-column: 1; }
  .quantity-cell { grid-column: 2; grid-row: 1 / span 2; }
  .row-actions { grid-column: 2; grid-row: 3; justify-self: end; }
  .add-product > form { grid-template-columns: 1fr; }
  dl div { grid-template-columns: 1fr; gap: 0.25rem; }
  .table-scroll { overflow: visible; }
  table.responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .responsive-table tbody tr {
    margin-bottom: 1rem;
    padding: 0.65rem 0;
    border-bottom: 2px solid var(--line);
  }
  .responsive-table tbody td {
    display: grid;
    grid-template-columns: minmax(7rem, 42%) minmax(0, 1fr);
    gap: 0.6rem;
    border-bottom: 1px solid #eee7dc;
    overflow-wrap: anywhere;
  }
  .responsive-table tbody td::before { content: attr(data-label); color: var(--muted); font-weight: 700; }
}

/* Vissza gomb sávja a felső menü alatt, bal oldalon; üresen is megtartja a helyét. */
.back-bar { display: flex; align-items: center; min-height: 1.7rem; }

/* Dátummenü: ráállásra lenyíló panel, fent a Keret gomb, alatta a havi naptár. */
.date-menu { position: relative; z-index: 15; display: flex; }
.date-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  display: none;
  width: 15.5rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.08);
}
.date-menu:hover .date-menu-panel,
.date-menu:focus-within .date-menu-panel { display: block; }
.date-menu-standing {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid #cdbfae;
  border-radius: 6px;
  color: var(--wheat-dark);
  font-size: 0.85rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}
.date-menu-standing:hover { color: #fff; background: var(--wheat-dark); border-color: var(--wheat-dark); }
.mini-calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; font-size: 0.85rem; }
.mini-calendar-head button {
  min-height: 0;
  padding: 0 0.4rem;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 1rem;
  cursor: pointer;
}
.mini-calendar-head button:hover { color: var(--wheat-dark); background: none; }
.mini-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.1rem; text-align: center; }
.mini-calendar-weekday { color: var(--muted); font-size: 0.66rem; font-weight: 700; }
.mini-calendar-grid a {
  padding: 0.2rem 0;
  border-radius: 5px;
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
}
.mini-calendar-grid a:hover { background: #f1e7d7; }
.mini-calendar-grid a.is-today { outline: 1px solid #cdbfae; }
.mini-calendar-grid a.is-selected { color: #fff; background: var(--wheat-dark); font-weight: 700; }

/* Keret: vevőlista hétnapi pipákkal, és a vevő kerete soronként a hét napjaival. */
.standing-list-row {
  grid-template-columns: 4rem minmax(12rem, 3fr) minmax(6rem, 1fr) repeat(7, 4.2rem);
}
.standing-list-row .day-flag { color: var(--wheat-dark); font-weight: 700; text-align: center; }
.order-list-heading button.day-flag { text-align: center; }
.order-workspace .standing-line {
  grid-template-columns: minmax(12rem, 1fr) 5rem repeat(7, 4.6rem) 1.5rem;
}
.standing-row { display: contents; }
/* A napi mennyiségmezők a napi rendelés mennyiségmezőjével azonosak. */
.order-workspace .standing-line .day-quantity {
  justify-self: end;
  width: 4.2rem;
  min-height: 1.8rem;
  padding: 0.05rem 0.4rem;
  border-bottom: 0;
  font-size: inherit;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.standing-line .save-status.is-error { color: #a33; font-size: 0.72rem; }

/* Törzsadatok: fogaskerék ikon a fejléc jobb szélén. */
.settings-link { display: grid; place-items: center; color: var(--muted); }
.settings-link:hover { color: var(--wheat-dark); }

/* Rendelési műveletek menü a cím mellett (balra nyílik). */
.order-actions-menu .list-filter-menu { right: auto; left: 0; min-width: 11rem; }
.order-actions-menu .list-filter-current svg { display: block; }

/* Rendelések zárása: kijelölhető sorok, fölötte a kijelölő és a Zárás gomb. */
.closing-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; margin-top: 0.6rem; }
.closing-toolbar p { margin: 0 auto 0 0; color: var(--muted); font-size: 0.85rem; }
.closing-toolbar button { min-height: 2rem; padding: 0.2rem 0.9rem; font-size: 0.85rem; }
.closing-toolbar button[hidden] { display: none; }
.closing-row {
  grid-template-columns: 4rem minmax(12rem, 3fr) 5.5rem minmax(6rem, 1fr) 3.5rem 6rem 7.5rem 2rem;
  cursor: pointer;
}
label.closing-row { font-weight: 400; }
label.closing-row:hover { background: #f1e7d7; }
.closing-row input[type=checkbox] { justify-self: center; width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--wheat-dark); }

/* Termelés: lezáratlan rendelés esetén piszkozat jelzés a cím mellett. */
.draft-badge {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  color: #8a5a0f;
  background: #fbefd4;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Napi és azonnali rendelés sorai: termék, cikkszám, (keret), mennyiség, törlés. */
.order-workspace .with-urgent .order-line,
.order-workspace .order-line.with-urgent {
  grid-template-columns: minmax(12rem, 1fr) 5rem 5.5rem 8.5rem 2rem;
}
.order-workspace .without-standing .order-line,
.order-workspace .order-line.without-standing {
  grid-template-columns: minmax(12rem, 1fr) 5rem 8.5rem 2rem;
}
.order-list-row.is-urgent .c-name { color: var(--wheat-dark); }
.urgent-mark { margin-left: 0.4rem; color: var(--wheat-dark); font-size: 0.75rem; font-weight: 700; }

/* Zárás: a fejléc kijelölő négyzete, ráállva azonnal megjelenő súgóval. */
.select-all { position: relative; display: grid; place-items: center; cursor: pointer; }
.select-all[hidden] { display: none; }
.select-all input[type=checkbox] { width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--wheat-dark); }
.select-all::after {
  content: attr(data-hint);
  position: absolute;
  right: 0;
  bottom: 120%;
  z-index: 5;
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  visibility: hidden;
}
.select-all:hover::after { visibility: visible; }

/* Készre jelentés: a súly helyén beviteli mező, fejlécben „Teljes mennyiség” pipa. */
.completion-heading { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; }
.completion-cell { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.3rem; }
.completion-cell input {
  width: 5rem;
  min-height: 1.8rem;
  padding: 0.05rem 0.4rem;
  border-bottom: 0;
  font-size: inherit;
  font-weight: 780;
  text-align: right;
}
.completion-cell small { color: var(--muted); font-size: 0.72rem; }
.production-line.is-done { color: var(--muted); }
.done-mark { color: var(--green); font-weight: 800; }

.completion-lines .production-line { grid-template-columns: 5rem minmax(14rem, 1fr) 7.5rem 11rem; }

/* Szállítás: vevőlista, vevő tartalma és túrára kiadás. */
.date-static { font-size: 1.35rem; font-weight: 700; }
.delivery-row { grid-template-columns: 7rem 4rem minmax(12rem, 3fr) minmax(6rem, 1fr) 6rem 6rem 7rem 2rem; }
.delivery-row.with-date { grid-template-columns: 6.5rem 7rem 4rem minmax(12rem, 3fr) minmax(6rem, 1fr) 6rem 6rem 7rem 2rem; }
/* Minden dátum: a szűrő fölötti pipa; bekapcsolva a kiválasztott nap elhalványul. */
.all-dates-toggle { display: inline-flex; white-space: nowrap; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; cursor: pointer; }
.all-dates-toggle[hidden] { display: none; }
.all-dates-toggle input[type=checkbox] { width: 1rem; height: 1rem; min-height: 0; margin: 0; accent-color: var(--wheat-dark); }
.title-line.is-all-dates .date-picker { opacity: 0.35; }
.delivery-content-row { grid-template-columns: 5rem minmax(12rem, 1fr) 8rem; }
.issue-row { grid-template-columns: minmax(10rem, 1.3fr) 4.5rem minmax(10rem, 1.5fr) 5rem 5rem 5rem 9.5rem; }
.issue-row.is-done { color: var(--muted); }
.issue-extras { display: grid; grid-template-columns: 1fr auto; gap: 0.8rem; align-items: end; margin-top: 0.8rem; }
.issue-extras textarea { min-height: 2.4rem; padding: 0.3rem 0.4rem; border: 0; border-radius: 4px; background: rgb(0 0 0 / 4%); font: inherit; font-size: 0.85rem; resize: vertical; }
.issue-extras input[type=file] { min-height: 0; border: 0; font-size: 0.8rem; }

/* Vevői átadás: telefonra optimalizált, egy oszlopos, nagy érintési felületek. */
.handover { max-width: 34rem; }
.handover-heading { margin: 0.4rem 0 0.8rem; }
.handover-heading h1 { margin: 0; font-size: 1.35rem; }
.handover-heading .eyebrow { margin-bottom: 0.2rem; }
.handover-list, .handover-lines { margin: 0; padding: 0; list-style: none; }
.handover-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.2rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  text-decoration: none;
}
.handover-list a:hover, .handover-list a:active { background: #f1e7d7; }
.handover-list a.is-done { color: var(--muted); }
.handover-check, .handover-done { color: var(--green); font-weight: 800; }
.handover-lines li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.handover-product { display: grid; gap: 0.15rem; min-width: 0; }
.handover-product strong { font-size: 1rem; }
.handover-product span { color: var(--muted); font-size: 0.85rem; }
.handover-qty { display: flex; align-items: baseline; gap: 0.3rem; }
.handover-qty input {
  width: 5.5rem;
  min-height: 2.6rem;
  padding: 0.2rem 0.4rem;
  border-bottom: 0;
  font-size: inherit;
  font-weight: 780;
  text-align: right;
}
.handover-qty span { color: var(--muted); font-size: 0.85rem; }
.handover-accept {
  width: 100%;
  min-height: 3.2rem;
  margin-top: 1.2rem;
  border-radius: 8px;
  color: #fff;
  background: var(--wheat-dark);
  font-size: 1.1rem;
  font-weight: 750;
}

/* Vevői átadás – visszáru (mínuszos tételek, cikk-kereső, fajta). */
.handover-returns { margin-top: 1.6rem; padding-top: 0.8rem; border-top: 2px solid var(--line); }
.handover-returns h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.handover-minus { color: var(--danger); font-size: 1.05rem; font-weight: 750; white-space: nowrap; }
.handover-return-form { display: grid; gap: 0.7rem; margin-top: 0.6rem; }
.handover-return-form .new-line-picker input { min-height: 2.8rem; font-size: 1.05rem; }
.handover-return-form .partner-search-results a { min-height: 2.8rem; }
.handover-kind { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 1rem; }
.handover-kind label { display: flex; align-items: center; gap: 0.4rem; }
.handover-kind input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--wheat-dark); }

/* Vevői átadás – tömörebb telefonos megjelenés, vonalak nélkül. */
.handover-heading h1 { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.handover-heading h1 span { color: var(--muted); font-weight: 600; }
.handover-list a { min-height: 2.6rem; padding: 0.45rem 0.2rem; border-bottom: 0; font-size: 0.95rem; }
.handover-lines li { gap: 0.6rem; padding: 0.4rem 0; border-bottom: 0; }
.handover-product { display: block; min-width: 0; font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.handover-product small { color: var(--muted); font-weight: 500; }
.handover-sku { color: var(--muted); font-weight: 500; }
.handover-qty { flex: none; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
.handover-qty > span { color: var(--muted); white-space: nowrap; }
.handover-qty input { width: 4.2rem; min-height: 2.2rem; font-size: 1rem; }
.handover-accept { min-height: 2.8rem; font-size: 1rem; }
.handover-returns { border-top: 0; }
.handover-returns h2 { font-size: 0.95rem; }
.handover-minus { font-size: 0.9rem; }
.user-icon { display: grid; place-items: center; list-style: none; }
.user-icon svg { display: block; }


/* Vevői rendelés: Termék, Cikkszám, Keret, Mennyiség, Egységár, Érték, törlés; alul összesen. */

/* Vevői rendelés: tömör sorok, aláhúzás nélküli mezők, kisebb kereső-találatok, cégnév középen. */
.customer-orders .title-line { flex-wrap: nowrap; gap: 0.35rem; }
.customer-orders .title-line h1 { margin: 0 0.3rem 0 0; }
.customer-orders .date-display { font-size: 1.05rem !important; white-space: nowrap; }
.customer-orders .product-name strong { font-size: 0.85rem; font-weight: 600; }
.customer-orders .quantity-cell input,
.customer-orders .new-line-quantity input,
.customer-orders .new-line-picker input {
  border-bottom: 0 !important;
  background: rgb(0 0 0 / 3%);
  border-radius: 4px;
}
.customer-orders .quantity-cell input { width: 3.6rem; min-height: 1.7rem; font-size: 0.9rem; }
.customer-orders .partner-search-results a { padding: 0.35rem 0.5rem; }
.customer-orders .partner-search-results strong { font-size: 0.85rem; font-weight: 600; }
.customer-orders .partner-search-results span { display: none; }
.customer-orders .customer-total { border-top: 1px solid var(--line); }
.customer-title { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.main-navigation .customer-title { justify-content: center; }


/* Vevői rendelés sorai: saját rács, minden képernyőn egy sor – név | mennyiség | törlés,
   jobbra görgetve egységár | érték. */
.customer-scroll { overflow-x: auto; }
.customer-orders .customer-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) 6.5rem 1.8rem 5.5rem 6.5rem;
  min-width: 34rem;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.05rem 0;
  font-size: 0.85rem;
}
.customer-orders .customer-row > * { grid-column: auto; grid-row: auto; grid-area: auto; }
.customer-orders .customer-row-heading { min-height: 1.4rem; color: var(--muted); font-size: 0.66rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.customer-orders .customer-row .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.customer-orders .customer-row .quantity-cell form { display: flex; align-items: center; justify-content: flex-end; gap: 0.3rem; }
.customer-orders .customer-row .quantity-cell span { color: var(--muted); font-size: 0.72rem; }
.customer-orders .customer-row .row-delete { display: grid; place-items: center; }
.customer-orders .customer-total { border-top: 1px solid var(--line); font-size: 0.9rem; }

/* Vevői átadás és visszáru: egy betűtípus, egy méret, aláhúzás nélküli mezők. */
.handover, .handover * { font-size: 0.95rem; font-weight: 400; }
.handover-heading h1 { font-weight: 700; }
.handover-list a, .handover-lines li { min-height: 2.4rem; padding: 0.3rem 0.1rem; border: 0; }
.handover-qty { gap: 0.3rem; }
.handover-qty > span { color: inherit; }
.handover input[type=number],
.handover input[type=text] {
  border: 0 !important;
  border-radius: 4px;
  background: rgb(0 0 0 / 4%);
  font-weight: 400;
}
.handover-qty input { width: 4rem; min-height: 2rem; padding: 0 0.3rem; text-align: right; }
.handover-minus { color: inherit; }
.handover-accept { font-weight: 600; }

.handover .handover-heading h1,
.handover .handover-qty input,
.handover input,
.handover button { font-family: inherit; font-size: 0.95rem; }

/* Visszáru sorai: cikk és mennyiség egy sorban, tördelés nélkül. */
.return-rows { display: grid; gap: 0.35rem; }
.return-row { display: grid; grid-template-columns: minmax(0, 1fr) 4rem; gap: 0.4rem; align-items: center; }
.return-pick { position: relative; min-width: 0; }
.return-pick input { width: 100%; min-height: 2rem; padding: 0 0.4rem; }
.return-row input[type=number] { min-height: 2rem; padding: 0 0.3rem; text-align: right; }
.return-pick .partner-search-results { position: absolute; z-index: 10; left: 0; right: 0; }
.return-pick .partner-search-results a { display: block; padding: 0.35rem 0.5rem; color: var(--ink); text-decoration: none; }
.return-pick .partner-search-results a.is-active { color: var(--wheat-dark); background: #f1e7d7; }
.returns-desk-pick { margin: 0.6rem 0 1rem; }
.returns-desk-recorded { margin-bottom: 0.8rem; }
.returns-desk-row { grid-template-columns: 6rem minmax(0, 1fr) 8rem 2rem; align-items: center; }
.returns-desk-row .quantity-cell { display: flex; justify-content: flex-end; align-items: baseline; gap: 0.3rem; }
.returns-desk-row .quantity-cell input { width: 4.5rem; min-height: 1.9rem; padding: 0 0.4rem; text-align: right; }
.returns-desk-row .quantity-cell span { width: 1.8rem; color: var(--muted); font-size: 0.72rem; }
.returns-desk-day-row { grid-template-columns: 6rem 4rem minmax(0, 1fr) 6rem 7rem 2rem; }
.returns-desk-lines [data-lines] { display: grid; gap: 0.35rem; }
.returns-desk-close { margin-top: 0.8rem; }
.returns-desk-line { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: 0.4rem; }
.returns-desk-line [data-quantity] { min-height: 2rem; padding: 0 0.4rem; text-align: right; }
.handover-kind { gap: 1rem; }
.handover-lines li.is-return { justify-content: space-between; flex-wrap: nowrap; }


/* Számlázás: számlalista, szállítólevelek számlázása (lenyíló vevő → bizonylat → tétel sorok). */
.billing-workspace .workspace-heading { align-items: center; }
.billing-actions { display: flex; gap: 0.5rem; }
.billing-button {
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  color: #fff;
  background: var(--wheat-dark);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.billing-button:hover { filter: brightness(1.08); }
.invoice-row { grid-template-columns: 1.2rem 10rem 4rem minmax(12rem, 3fr) 7.5rem 6.5rem 7rem 7rem 7.5rem 2rem; }
.invoice-group[hidden] { display: none; }
.invoice-source { min-height: 1.8rem; color: var(--muted); font-size: 0.8rem; background: rgb(0 0 0 / 1.5%); }
.invoice-source[hidden] { display: none; }
.invoice-source > span:nth-child(4) { grid-column: 4 / -1; }
[data-sources-toggle] { cursor: pointer; }
.preview-row { grid-template-columns: 9rem 4rem minmax(12rem, 3fr) minmax(8rem, 1.2fr) 7rem 2rem; cursor: pointer; }
label.preview-row { font-weight: 400; }
.preview-row a { color: var(--wheat-dark); font-weight: 650; text-decoration: none; }
.preview-row input[type=checkbox] { justify-self: center; width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--wheat-dark); }
.billing-filters { display: flex; align-items: flex-end; gap: 1.5rem; }
.billing-filters .partner-search-line { flex: 1; }
.billing-period { display: flex; gap: 0.8rem; }
.billing-period label { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.billing-period input,
.billing-export input,
.payment-fields input,
.payment-fields select,
.allocation-row input {
  min-height: 1.9rem;
  padding: 0.1rem 0.4rem;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: rgb(0 0 0 / 4%);
  font: inherit;
  font-size: 0.9rem;
}
.billing-export { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1.2rem; }
.billing-export label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.billing-selected { margin-right: auto; color: var(--muted); font-size: 0.85rem; }
.billing-selected[hidden] { display: none; }
.billing-row { grid-template-columns: 1.2rem 4rem minmax(12rem, 3fr) 8rem 6.5rem 7rem 7.5rem 2rem; }
.billing-day > span:nth-child(3) { padding-left: 0.8rem; }
.billing-row.billing-document > span:nth-child(3) { padding-left: 1.6rem; }
.billing-invoice { color: var(--wheat-dark); font-weight: 650; text-decoration: none; }
.billing-invoice:hover { text-decoration: underline; }
.billing-state {
  min-height: 1.6rem;
  padding: 0 0.2rem;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: rgb(0 0 0 / 4%);
  font: inherit;
  font-size: 0.75rem;
}
.billing-row[hidden] { display: none; }
.billing-customer,
.billing-day,
.billing-document { cursor: pointer; }
.billing-customer:hover,
.billing-day:hover,
.billing-document:hover { background: #f1e7d7; }
.billing-document { color: var(--ink); background: rgb(0 0 0 / 1.5%); }
.billing-document.is-return .numeric { color: #9a3b2a; }
.billing-item { min-height: 1.8rem; color: var(--muted); font-size: 0.8rem; }
.billing-item > span:nth-child(3) { padding-left: 2.4rem; }
.toggle-mark { color: var(--muted); font-size: 0.75rem; transition: transform 0.12s; }
.is-open > .toggle-mark { transform: rotate(90deg); }
.billing-check { display: grid; place-items: center; }
.billing-check input[type=checkbox],
.billing-row .select-all input[type=checkbox] { width: 1.05rem; height: 1.05rem; min-height: 0; accent-color: var(--wheat-dark); }
.missing-price { color: #b3261e; font-weight: 700; }
.order-list-summary { border-top: 2px solid var(--line); }
.billing-settings-dialog { width: min(64rem, calc(100% - 2rem)); height: calc(100vh - 4rem); display: none; flex-direction: column; }
.billing-settings-dialog[open] { display: flex; }
.billing-settings-dialog iframe { flex: 1; width: 100%; margin-top: 0.8rem; border: 0; }
.billing-row.order-list-heading > span,
.preview-row.order-list-heading > span,
.payment-row.order-list-heading > span,
.allocation-row.order-list-heading > span,
.urgent-order-row.order-list-heading > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Szállítólevelek nyomtatása: túra → vevő lenyíló lista, előkép felugró ablakban. */
.note-row { grid-template-columns: 1.2rem minmax(14rem, 1fr) 6rem 2rem; }
.note-row[hidden] { display: none; }
.note-row.order-list-heading > span { color: var(--muted); font-size: 0.66rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }

/* Pénzügy: fizetések listája, fizetés rögzítése és párosítása számlákkal. */
.open-item-row { grid-template-columns: 8rem 4.5rem minmax(12rem, 3fr) 6.5rem 6.5rem 7rem 7rem; }
.open-item-row.is-overdue span:nth-child(5) { color: var(--wheat-dark); font-weight: 600; }
.bank-transfers { max-width: 62rem; }
.bank-transfer-line { display: grid; grid-template-columns: 9.5rem minmax(0, 1.4fr) minmax(0, 1fr) 8rem; gap: 0.5rem; margin: 0.6rem 0 0.4rem; }
.bank-transfer-line input { min-height: 2.1rem; padding: 0 0.5rem; }
.bank-transfer-line [data-amount] { text-align: right; }
.bank-transfer-error { color: #a33; margin: 0.2rem 0 0.6rem; }
.bank-transfer-list { margin-top: 0.8rem; }
.bank-transfer-row { grid-template-columns: 6.5rem 4.5rem minmax(12rem, 3fr) 8rem 7rem; }
.bank-transfer-line.with-route { grid-template-columns: 9.5rem 9rem minmax(0, 1.4fr) minmax(0, 1fr) 8rem; }
.with-route .bank-transfer-row { grid-template-columns: 6.5rem 8rem 4.5rem minmax(12rem, 3fr) 8rem 7rem; }
.payment-row { grid-template-columns: 7rem 4rem minmax(12rem, 3fr) 6rem minmax(8rem, 1.5fr) 7rem 7rem; }
.payment-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin: 1rem 0; }
.payment-fields label { display: flex; flex-direction: column; gap: 0.3rem; color: var(--muted); font-size: 0.8rem; }
.payment-fields .payment-reference { flex: 1; min-width: 12rem; }
.allocation-row { grid-template-columns: 9rem 7rem 7rem 8rem 9rem 8rem; }
.allocation-row input { min-height: 2rem; padding: 0 0.4rem; text-align: right; }
.allocation-fill { padding: 0; border: 0; color: var(--ink); background: none; font: inherit; cursor: pointer; }
.allocation-fill:hover { color: var(--wheat-dark); }
.payment-form .closing-toolbar { justify-content: flex-end; gap: 1rem; margin-top: 1rem; }

/* Vevő- és termékadatlap („i”): a lap betűméretén, két hasábban, görgethető. */
.info-dialog { width: min(52rem, calc(100% - 2rem)); max-height: calc(100vh - 4rem); padding: 1.1rem 1.4rem 1.3rem; font-size: 0.85rem; }
.info-dialog .dialog-heading { align-items: center; }
.info-dialog .eyebrow { margin: 0 0 0.1rem; font-size: 0.66rem; }
.info-dialog h2,
.info-dialog h3 { margin: 0; font-family: inherit; letter-spacing: 0; }
.info-dialog h2 { font-size: 1.05rem; font-weight: 700; }
.info-dialog .dialog-close,
.info-dialog .dialog-edit { width: 1.9rem; height: 1.9rem; min-height: 1.9rem; font-size: 0.85rem; }
.info-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; margin-top: 0.9rem; }
.info-section h3 {
  margin: 0 0 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.info-section dl { display: grid; grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr); gap: 0.2rem 0.9rem; margin: 0; }
.info-section dt { color: var(--muted); }
.info-section dd { font-weight: 600; }
.info-dialog button.dialog-edit { min-height: 0; padding: 0; color: var(--wheat-dark); background: transparent; font-weight: 400; }
.info-dialog button.dialog-edit:hover { color: #fff; background: var(--wheat-dark); }
.info-dialog .dialog-actions > button:not(.dialog-close):not(.dialog-edit) { min-height: 1.9rem; padding: 0.2rem 0.9rem; font-size: 0.85rem; }
.info-dialog .info-wide { grid-column: 1 / -1; }
.info-dialog dd input:not([type=checkbox]),
.info-dialog dd select,
.info-table input:not([type=checkbox]),
.info-table select { min-height: 1.8rem; padding: 0.1rem 0.4rem; font-size: 0.85rem; }
.info-dialog dt label { color: var(--muted); font-weight: 400; }
.info-dialog input[type=checkbox] { width: 1rem; height: 1rem; min-height: 0; accent-color: var(--wheat-dark); }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th { padding: 0 0.3rem 0.2rem; color: var(--muted); font-size: 0.75rem; font-weight: 400; text-align: left; }
.info-table td { padding: 0.15rem 0.3rem; vertical-align: top; }
.info-error { display: block; color: var(--danger); font-size: 0.75rem; }

.route-issued { margin-left: 0.4rem; font-style: normal; font-size: 0.78rem; color: var(--muted); }

/* Felső menü: az aktuális nézet műveletei a menüpont alatt, egérrel ráállva lenyílnak. */
.main-navigation .nav-item { position: relative; display: flex; height: 100%; align-items: center; }
.main-navigation .nav-menu {
  position: absolute; top: 100%; left: -0.9rem; z-index: 50; display: none; min-width: 14rem;
  padding: 0.35rem 0; border: 1px solid rgb(0 0 0 / 10%); border-radius: 0.5rem;
  background: #fffdf8; box-shadow: 0 10px 24px rgb(0 0 0 / 10%);
}
/* Csak az aktuális oldal menüpontjánál nyílik le. */
.main-navigation .nav-item:has(> a[aria-current="page"]):hover .nav-menu,
.main-navigation .nav-item:has(> a[aria-current="page"]):focus-within .nav-menu { display: block; }
.main-navigation .nav-menu a { display: block; height: auto; padding: 0.45rem 0.9rem; font-weight: 560; white-space: nowrap; }
.main-navigation .nav-menu a::after { display: none; }
.main-navigation .nav-menu .adm-mark { margin-left: 0.2rem; color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.main-navigation .nav-menu form { margin: 0; }
.main-navigation .nav-menu-action { display: block; width: 100%; min-height: 0; padding: 0.45rem 0.9rem; border: 0; border-radius: 0; background: none; color: #5f574f; font: inherit; font-size: 0.94rem; font-weight: 560; text-align: left; white-space: nowrap; cursor: pointer; }
.main-navigation .nav-menu a:hover,
.main-navigation .nav-menu-action:hover { color: var(--wheat-dark, #8a4b22); background: rgb(166 79 50 / 8%); }

/* A menü alatti napi folyamatáttekintő: az egyeztetett folyamatsáv kompakt változata. */
.process-overview {
  margin: 0 2.5vw;
  padding-top: 1.85rem;
  font-size: 0.7rem;
  overflow: visible;
}
.process-overview > summary {
  position: fixed;
  z-index: 19;
  top: var(--app-header-bottom, var(--app-header-height, 3.2rem));
  left: 50%;
  display: flex;
  width: max-content;
  min-width: 10.75rem;
  min-height: 1.85rem;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0 0.9rem 0.08rem;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 0.85rem 0.85rem;
  color: var(--ink);
  background: rgb(255 253 248 / 97%);
  box-shadow: 0 0.28rem 0.6rem rgb(74 42 20 / 13%);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  list-style: none;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}
.process-overview > summary:hover {
  background: #faf4e8;
  box-shadow: 0 0.32rem 0.68rem rgb(74 42 20 / 17%);
}
.process-overview > summary::-webkit-details-marker { display: none; }
.process-overview-dot {
  width: 0.42rem;
  height: 0.42rem;
  flex: none;
  border: 1px solid rgb(139 79 35 / 18%);
  border-radius: 50%;
  background: #e8c37f;
}
.process-overview > summary > strong { font-weight: 720; }
.process-overview-rows {
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: rgb(255 253 248 / 92%);
  overflow: hidden;
}
.process-overview-head,
.process-overview-row {
  display: grid;
  grid-template-columns: 10.4rem repeat(3, minmax(9rem, 1fr));
  align-items: center;
}
.process-overview-head {
  min-height: 1.35rem;
  color: #273a5d;
  font-size: 0.62rem;
  font-weight: 680;
  text-align: center;
}
.process-overview-head span + span { border-left: 1px solid var(--line); }
.process-overview-row {
  min-height: 2rem;
  padding: 0.18rem 0.45rem;
  border-top: 1px solid rgb(229 221 209 / 70%);
}
.process-overview-row time {
  padding-left: 0.35rem;
  color: #273a5d;
  font-size: 0.68rem;
  font-weight: 680;
  white-space: nowrap;
}
.process-step {
  position: relative;
  display: flex;
  min-height: 1.55rem;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0 0.45rem;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 0.8rem;
  color: #273a5d;
  background: linear-gradient(180deg, #f1f2f4, #e4e6e9);
  white-space: nowrap;
}
.process-step::before {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  border-radius: 0.8rem 0 0 0.8rem;
  content: "";
}
.process-step strong {
  z-index: 1;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 630;
  text-overflow: ellipsis;
}
.process-step.is-complete {
  color: #1f3d2b;
}
.process-step.is-complete::before {
  border-radius: 0.8rem;
  background: linear-gradient(180deg, #8fd3a8, #6cc290);
}
.process-step.is-active {
  color: #2c251f;
}
.process-step.is-active::before { background: linear-gradient(180deg, #ffcf5c, #ffb936); }
.process-step:hover::after,
.process-step:focus-visible::after {
  position: absolute;
  z-index: 60;
  right: 0.25rem;
  bottom: calc(100% + 0.35rem);
  width: max-content;
  max-width: 18rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.35rem;
  color: #fff;
  background: #27344a;
  box-shadow: 0 0.5rem 1.2rem rgb(0 0 0 / 20%);
  content: attr(data-tooltip);
  font-size: 0.66rem;
  font-weight: 500;
  white-space: normal;
}
@media (max-width: 58rem) {
  .process-overview-rows { overflow-x: auto; }
}

/* Cikktörzs */
.product-row { grid-template-columns: 5.5rem minmax(14rem, 3fr) minmax(8rem, 1.2fr) 5.5rem 4.5rem 9rem 6rem 4.5rem; cursor: pointer; }
.product-row.order-list-heading { cursor: default; }
.product-row:not(.order-list-heading):hover { background: #f1e7d7; }
.product-row.is-inactive { color: var(--muted); }
.product-workspace .heading-tools { flex-wrap: wrap; justify-content: flex-end; gap: 0.9rem; }

/* Árlisták */
.price-list-row { grid-template-columns: 7rem minmax(14rem, 3fr) 7rem 7rem 4.5rem; cursor: pointer; }
.price-item-row { grid-template-columns: 5.5rem minmax(14rem, 3fr) 5.5rem 8rem; }
.price-partner-row { grid-template-columns: 6rem minmax(14rem, 3fr) 4.5rem; }
.price-list-row.order-list-heading { cursor: default; }
.price-list-row:not(.order-list-heading):hover { background: #f1e7d7; }
.price-list-row.is-inactive, .price-partner-row.is-inactive { color: var(--muted); }

/* Vevőtörzs */
.partner-master-row { grid-template-columns: 4.5rem minmax(13rem, 3fr) minmax(7rem, 1fr) 8rem minmax(7rem, 1fr) 7rem 6.5rem 7.5rem 9rem 4.5rem; cursor: pointer; }
.partner-master-row.order-list-heading { cursor: default; }
.partner-master-row:not(.order-list-heading):hover { background: #f1e7d7; }
.partner-master-row.is-inactive { color: var(--muted); }
.master-list-workspace .heading-tools { flex-wrap: wrap; justify-content: flex-end; gap: 0.9rem; }

/* Listaoszlop fejléce (cikk- és vevőtörzs): a névre állva lenyílik az oszlop szűrője,
   a nyíl rendez. */
.column-head { position: relative; display: flex; min-width: 0; align-items: center; gap: 0.15rem; }
.column-head.numeric { justify-content: flex-end; }
.column-filter { position: relative; min-width: 0; }
.column-name {
  display: block; overflow: hidden; color: var(--muted); font-size: 0.66rem; font-weight: 750;
  letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap;
}
.column-filter .column-name { cursor: default; border-bottom: 1px dotted transparent; }
.column-filter:hover .column-name { border-bottom-color: var(--muted); }
.column-name.is-filtered { color: var(--wheat-dark); }
.column-filter-menu { left: 0; right: auto; min-width: 12rem; max-height: 60vh; overflow-y: auto; text-transform: none; }
.column-filter:hover .column-filter-menu,
.column-filter:focus-within .column-filter-menu { display: block; }
.order-list-heading .sort-arrow { width: auto; flex: none; padding: 0 0.15rem; }
.order-list-heading .column-head .sort-arrow:not([aria-sort])::after { content: "↕"; opacity: 0.45; }
.order-list-heading .sort-arrow[aria-sort="ascending"]::after { content: "▲"; }
.order-list-heading .sort-arrow[aria-sort="descending"]::after { content: "▼"; }

/* Vissza gomb: mindenhol egyetlen, felirat nélküli nyíl. */
.back-to-list {
  display: inline-flex; width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center;
  margin-right: 0.5rem; border-radius: 50%; font-size: 1.5rem; font-weight: 700; line-height: 1;
  text-decoration: none;
}
.back-to-list:hover { background: rgb(166 79 50 / 9%); }

/* A vissza nyíl a menüsor elején (a szkript teszi oda); az üres sáv eltűnik. */
.back-bar:not(:has(.back-to-list)) { display: none; }
.main-navigation > .back-to-list {
  flex: none; width: 2.2rem; height: 2.2rem; justify-content: center; margin-right: -0.6rem; padding: 0;
  border-radius: 50%; color: var(--wheat-dark, #8a4b22); font-size: 1.5rem; font-weight: 700; line-height: 1;
}
.main-navigation > .back-to-list::after { display: none; }

/* Hiir számlák */
.legacy-filter { display: flex; gap: 0.8rem; align-items: center; }
.legacy-filter input, .legacy-filter select { min-width: 12rem; }
.legacy-pages { display: flex; gap: 1.2rem; justify-content: center; margin: 1rem 0; font-size: 0.9rem; }
.legacy-tag { margin-left: 0.3rem; padding: 0 0.3rem; border-radius: 3px; color: #fff; background: var(--muted); font-size: 0.66rem; }

/* Bizonylat-PDF a listákból: az utolsó oszlopban melléklet-jel, megnyitás felugró ablakban. */
.attachment-cell { text-align: center; }
.attachment { font-size: 0.95rem; }
/* A PDF-ablak akkora, mint egy A4-es lap (fejléc + 210:297 arányú lap), nem szélesebb. */
.pdf-dialog { --tools: 2.6rem; width: min(94vw, calc((92vh - var(--tools)) * 0.7071)); height: 92vh; padding: 0; border: 0; border-radius: 0.5rem; overflow: hidden; }
.pdf-dialog[open] { display: flex; flex-direction: column; }
.pdf-dialog-tools { display: flex; flex: none; align-items: center; justify-content: flex-end; gap: 0.3rem; height: var(--tools); padding: 0 0.5rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.pdf-dialog-close { font-size: 1.3rem; line-height: 1; }
.pdf-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.pdf-dialog iframe { display: block; flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }

/* Szállítás: Azonnali és Napi rendelések listája; nyomtató ikon és kijelölés a sor végén. */
.note-list-toolbar { justify-content: flex-start; margin: 0.8rem 0 0.2rem; }
.note-list-title { margin: 0 auto 0 0; font-size: 0.95rem; }
.note-list-title.is-urgent { color: var(--wheat-dark); }
.delivery-row { grid-template-columns: 7rem 4rem minmax(12rem, 3fr) minmax(6rem, 1fr) 6rem 6rem 7rem 2rem 2rem; }
.delivery-row.is-urgent-list { grid-template-columns: 7rem 4rem minmax(12rem, 3fr) 6rem 6rem 7rem 2rem 2rem; }
.delivery-row a { color: inherit; text-decoration: none; }
.delivery-row a:hover { color: var(--wheat-dark); }
.print-job { max-width: 28rem; margin: 18vh auto 0; padding: 0 1rem; text-align: center; }
.print-job h1 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.print-job-count { font-size: 1.6rem; font-variant-numeric: tabular-nums; margin: 0 0 0.8rem; }
.print-job progress { width: 100%; height: 0.6rem; accent-color: var(--wheat-dark); }
.print-button:hover { color: var(--wheat-dark); background: rgb(166 79 50 / 8%); }

/* Rendelések zárása: a ma lezártak visszanyitása. */
.reopen-title { margin: 1.4rem 0 0.3rem; }
.reopen-row { grid-template-columns: 4rem minmax(12rem, 3fr) 5.5rem 4rem minmax(6rem, 1fr) 4rem 8rem; }
.reopen-row form { margin: 0; justify-self: end; }

/* Készletek (superuser): cikk × leltáregység mátrix, rögzített fejléc és cikkoszlopok. */
.stock-workspace { max-width: none; }
.stock-matrix-scroll { overflow: auto; max-height: calc(100vh - 9rem); }
.stock-matrix { border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.stock-matrix th, .stock-matrix td { padding: 0.3rem 0.6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stock-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--canvas); text-align: left; font-weight: 600; }
.stock-matrix .stock-qty { text-align: right; min-width: 5.5rem; }
.stock-matrix .stock-qty.is-negative { color: var(--danger); }
.stock-matrix .stock-uom { color: var(--muted); }
.stock-matrix tbody tr:hover td { background: rgb(166 79 50 / 6%); }

/* Aktivitás: a jobb szélen felhasználónként a nap rögzített tételei és aktív ideje. */
.activity-layout { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1.6rem; align-items: start; }
.workload { position: sticky; top: 1rem; }
.workload-row { display: grid; gap: 0.25rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.workload-head { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.88rem; }
.workload-head span { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.workload-track { display: block; height: 0.4rem; border-radius: 0.2rem; background: var(--line); }
.workload-fill { display: block; height: 100%; min-width: 2px; border-radius: 0.2rem; background: var(--wheat-dark); }

/* Táblázatsor tipográfiája (UX koncepció 5.4): egy sorban minden cella – név, kód, szám,
   mértékegység, gomb, mező, ikon – ugyanazzal a betűvel (méret, vastagság, szín, számforma).
   A sor maga adja a betűt, a cellák öröklik; a fejlécsor a saját, egységes betűjét. */
:is(.order-list-row, .order-line, .production-line, .access-row, .process-overview-row,
  .process-overview-head, .workload-head, .responsive-table tr, .stock-matrix tr, .info-table tr) {
  font-variant-numeric: tabular-nums;
}
:is(.order-list-row, .order-line, .production-line, .access-row, .process-overview-row,
  .process-overview-head, .workload-head, .responsive-table tr, .stock-matrix tr, .info-table tr)
  :not(svg, svg *) {
  font-family: inherit !important;
  font-size: inherit !important;
  font-style: inherit !important;
  font-weight: inherit !important;
  font-variant-numeric: inherit !important;
  letter-spacing: inherit !important;
  text-transform: inherit !important;
}
/* Szín: a cella a sor színét viszi; a gombok és a jelölők (azonnali, Hiir) megtartják a magukét. */
:is(.order-list-row, .order-line, .production-line, .access-row, .process-overview-row,
  .workload-head, .responsive-table tr, .stock-matrix tr, .info-table tr)
  :not(svg, svg *, button, .button, .compact, .secondary, .danger, .urgent-mark, .legacy-tag, .information-button) {
  color: inherit !important;
}
.order-list-heading,
.order-line-heading,
.production-line-heading,
.access-row-heading {
  color: var(--muted);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.order-list-heading { font-size: 0.66rem; }
.order-list-heading button { color: inherit !important; }
.order-line:not(.order-line-heading),
.access-row:not(.access-row-heading) { color: var(--ink); font-size: 0.85rem; font-weight: 400; }
.order-list-row.order-list-summary { color: var(--ink); font-size: 0.85rem; }
.process-overview-row { font-size: 0.7rem; font-weight: 400; }
:is(.responsive-table, .stock-matrix, .info-table) thead tr { font-weight: 600; }
/* Kivétel: a lejárt határidő és a hiányzó ár piros. */
.open-item-row.is-overdue span:nth-child(5),
.order-list-row .missing-price,
.order-list-row .report-change.is-down { color: var(--danger) !important; }


/* Arculat: a felső sáv a logó színe (sötét kenyérhéj), benne a logó és a menü gombként.
   Az oldal eleje mindenhol: 1. sor a cím és mellette a dátum; 2. sor balra a kereső, jobbra az
   oldal szűrői és gombjai; alatta a táblázat, a fejléce halvány sávban. A sorrendet a CSS adja
   (a fejléc „display: contents”), a sablonok szerkezete és működése változatlan. */
:root { --app-header-height: 3.6rem; --bar-ink: #f3e6d3; --head-band: #f1e6d6; }
.app-header {
  min-height: var(--app-header-height);
  border-bottom: 0;
  background: #35271c; /* a fejléclogó háttérszíne, így a logó beleolvad a sávba */
  backdrop-filter: none;
}
.app-header .brand-logo { width: auto; height: var(--app-header-height); }
.main-navigation { gap: 0.35rem; }
.main-navigation > a,
.main-navigation .nav-item > a {
  height: auto;
  padding: 0.45rem 0.85rem;
  border-radius: 0.45rem;
  color: var(--bar-ink);
}
.main-navigation > a:hover,
.main-navigation .nav-item > a:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.main-navigation > a[aria-current="page"],
.main-navigation .nav-item > a[aria-current="page"] { color: #fff; background: var(--wheat); }
.main-navigation a[aria-current="page"]::after { display: none; }
.main-navigation .nav-menu { top: calc(100% - 0.2rem); }
.app-header .back-to-list,
.app-header .settings-link,
.app-header .user-menu summary,
.app-header .customer-title { color: var(--bar-ink); }
.app-header .back-to-list:hover,
.app-header .settings-link:hover,
.app-header .user-menu summary:hover { color: #fff; }

.order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  align-items: center;
}
.order-workspace > *,
.order-workspace > .workspace-heading > .title-line { grid-column: 1 / -1; }
.order-workspace > .workspace-heading { display: contents; }
.order-workspace > .workspace-heading > :not(.title-line) { grid-row: 2; grid-column: auto; margin: 1rem 0 0.9rem 0.8rem; }
.order-workspace > :is(.partner-heading, .returns-desk-pick) { grid-row: 2; grid-column: 1; margin: 1rem 0 0.9rem; }
.order-workspace > .workspace-heading > .title-line { grid-row: 1; }

.title-line { gap: 0.6rem; }
.title-line h1 { order: -1; margin: 0 0.6rem 0 0; font-size: 2rem; font-weight: 750; letter-spacing: -0.01em; }
.title-line h1::first-letter { text-transform: uppercase; }
.order-workspace .title-line .date-display { font-size: 1.05rem; font-weight: 600; }

.order-workspace .partner-heading .partner-search-line input.partner-name-input,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:hover,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:focus,
.order-workspace .partner-heading .partner-search-line input.partner-name-input:focus-visible,
.order-workspace .returns-desk-pick .return-pick input.partner-name-input,
.order-workspace .returns-desk-pick .return-pick input.partner-name-input:hover,
.order-workspace .returns-desk-pick .return-pick input.partner-name-input:focus {
  width: 26rem;
  max-width: 100%;
  flex: 0 1 26rem;
  min-height: 2.4rem;
  padding: 0 0.8rem 0 2.3rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fff 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='%23766d64' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  font-size: 0.9rem;
  font-weight: 400;
}
.order-workspace .partner-heading .partner-search-line input.partner-name-input:focus,
.order-workspace .returns-desk-pick .return-pick input.partner-name-input:focus { border-color: var(--wheat); }
.order-workspace > .workspace-heading .list-filter-current:not(:has(svg)) {
  min-width: 11rem;
  min-height: 2.4rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: var(--ink);
  background: #fff;
  font-size: 0.9rem;
  text-align: left;
}
.order-workspace > .workspace-heading .list-filter-current:not(:has(svg)):hover,
.order-workspace > .workspace-heading .list-filter-current:not(:has(svg)):focus { border-color: var(--wheat); }
/* A túra és a megálló a vevő neve mellett, vele egy vonalban. */
.order-workspace .partner-search-line .partner-route { margin-left: 1rem; }

.order-list-heading,
.order-line-heading,
.production-line-heading {
  border-bottom: 0;
  border-radius: 0.45rem;
  background: var(--head-band);
}
.order-list-heading { min-height: 2.4rem; }
.stock-matrix thead th { background: var(--head-band); }
.stock-matrix thead th:first-child { border-radius: 0.45rem 0 0 0.45rem; }
.stock-matrix thead th:last-child { border-radius: 0 0.45rem 0.45rem 0; }
.order-workspace > .workspace-heading > .activity-filters { grid-column: 1; justify-self: start; margin-left: 0; }
/* A többi oldal (beállítások, jelszó, vevői oldalak) címe ugyanakkora, mint a munkafelületeké. */
h1 { font-size: 2rem; font-weight: 750; letter-spacing: -0.01em; line-height: 1.15; }

/* Törzsadatok menü: a fogaskerékre állva lenyílik (Cikktörzs, Vevőtörzs, Árlisták). */
.settings-menu { position: relative; display: flex; align-self: stretch; align-items: center; }
.settings-menu-panel {
  position: absolute; top: calc(100% - 0.2rem); right: -0.6rem; z-index: 50; display: none; min-width: 12rem;
  padding: 0.35rem 0; border: 1px solid rgb(0 0 0 / 10%); border-radius: 0.5rem;
  background: #fffdf8; box-shadow: 0 10px 24px rgb(0 0 0 / 10%);
}
.settings-menu:hover .settings-menu-panel,
.settings-menu:focus-within .settings-menu-panel { display: block; }
.settings-menu-panel a { display: block; padding: 0.45rem 0.9rem; color: #5f574f; font-size: 0.94rem; font-weight: 560; text-decoration: none; white-space: nowrap; }
.settings-menu-panel a:hover { color: var(--wheat-dark); background: #f1e7d7; }
.settings-menu-panel .adm-mark { margin-left: 0.2rem; color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.app-header .settings-link[aria-current="page"] { color: #fff; }

/* Megnyitott szállítólevél: a vevő neve mellett a nyomtatás. */
.partner-search-line .heading-icon { display: inline-flex; align-self: center; margin: 0 0 0 0.6rem; }
.order-workspace > .returns-desk-delete { grid-row: 2; grid-column: auto; margin: 1rem 0 0.9rem 0.6rem; }
/* Termelés: főcsoportonkénti statisztika a lista elején. */
.production-stats { max-width: 30rem; margin: 0.2rem 0 0.8rem; }
.production-stats-row { grid-template-columns: 7rem 5rem minmax(8rem, 1fr); }

.list-filter-menu a { white-space: nowrap; }
/* Szállítás, megnyitott vevő: a napi és az azonnali szállítólevelek egymás alatt. */
.order-workspace > .delivery-section { margin-top: 1.2rem; }
.delivery-section-title h3 { margin: 0; font-size: 1rem; font-weight: 650; }
.delivery-section-title .urgent-mark { margin-left: 0; }
.print-route-title { margin: 1rem 0 0.2rem; }
/* Számlamegjegyzés ikon: halvány, ha nincs megjegyzés; erős színű, ha van. */
.note-button { color: var(--muted); opacity: 0.4; }
.note-button.has-note { color: var(--wheat-dark); opacity: 1; }
.note-cell { display: inline-flex; }
.supply-cell { display: inline-flex; }
.dates-dialog .dates-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.4rem 0; }
.dates-dialog .date-display { min-height: 0; padding: 0.3rem 0.4rem; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.dates-dialog .date-display:hover { color: var(--wheat-dark); }

.billing-customer-name { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.note-dialog { width: min(32rem, 92vw); padding: 1rem 1.2rem; border: 0; border-radius: 0.5rem; }
.note-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.note-dialog h2 { margin: 0 0 0.6rem; font-size: 1rem; }
.note-dialog textarea { width: 100%; font: inherit; }
.note-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.8rem; }


/* Lista nyomtatása: a jobb felső nyomtatás ikon; nyomtatásban csak a cím, a szűrők sora és a
   lista, fehér alapon, a sorok nem törnek két lapra. A lap tájolását és a méretezést az app.js
   állítja be a lista szélessége szerint. */
.list-print { align-self: center; margin-left: auto; }
.workspace-heading .list-print { order: 99; }
.print-meta,
.print-only { display: none; }
@media print {
  .print-only { display: inline; }
  .process-overview,
  .billing-state { display: none !important; }
  html,
  body,
  .app-shell { background: #fff !important; }
  .app-header,
  .back-bar,
  .messages,
  .list-print,
  .partner-heading,
  .billing-actions,
  .closing-toolbar,
  .billing-filters,
  dialog,
  .pdf-dialog,
  .note-cell,
  .supply-cell { display: none !important; }
  /* A sor cellái helyükön maradnak (a rács oszlopai nem csúsznak el), csak nem látszanak. */
  .billing-check,
  .select-all,
  .attachment-cell,
  .toggle-mark,
  .order-list-row input[type=checkbox],
  .order-list-row .icon-button { visibility: hidden !important; }
  .workspace { width: 100%; max-width: none; margin: 0; padding: 0; }
  .workspace-heading { margin: 0 0 2mm; }
  .workspace-heading > :not(.title-line):not(div:has(h1)):not(h1) { display: none !important; }
  h1 { font-size: 16pt; letter-spacing: 0; }
  .print-meta { display: block; margin: 1mm 0 4mm; color: #444; font-size: 8.5pt; }
  .order-list,
  table { width: 100% !important; box-shadow: none !important; }
  /* A fejsor minden lapon megismétlődik: az app.js a sorokat nyomtatásra táblázatba teszi. */
  .print-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
  .print-table > * > tr > td { padding: 0; border: 0; }
  .print-table tr[hidden] { display: none; }
  .print-table > tbody > tr { break-inside: auto; }
  thead { display: table-header-group; }
  .order-list-row,
  tr { break-inside: avoid; }
  .order-list-row { min-height: 0; padding-block: 1px; background: none !important; }
  .order-list-heading { position: static !important; background: none !important; border-bottom: 1.5px solid #000; }
  .order-list-heading button,
  .order-list-heading select { appearance: none; border: 0; padding: 0; background: none; color: #000; }
  a { color: inherit !important; text-decoration: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Vezetői elemzések: időszakválasztó, oszlop- és sávdiagramok, korosított kintlévőség. */
.analytics-periods { display: flex; gap: 0.3rem; margin-top: 0.8rem; }
.analytics-periods a { padding: 0.3rem 0.7rem; border-radius: 999px; color: var(--ink); background: rgb(0 0 0 / 4%); font-size: 0.85rem; font-weight: 650; text-decoration: none; }
.analytics-periods a[aria-current] { color: #fff; background: var(--wheat-dark); }
.analytics-span { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.82rem; }
.analytics-subtitle { margin: 1rem 0 0.4rem; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.analytics-chart { grid-template-columns: repeat(var(--bars, 12), minmax(0, 1fr)); }
.analytics-hbars { display: grid; gap: 0.25rem; }
.analytics-hbar { display: grid; grid-template-columns: minmax(8rem, 3fr) minmax(3rem, 1.2fr) 6.5rem 4.5rem; align-items: center; gap: 0.6rem; min-height: 1.6rem; font-size: 0.82rem; }
.analytics-hbar-label { overflow-wrap: anywhere; line-height: 1.2; }
.analytics-hbar-track { height: 0.8rem; border-radius: 0.2rem; background: rgb(0 0 0 / 4%); }
.analytics-hbar-fill { display: block; height: 100%; min-width: 2px; border-radius: 0.2rem; background: var(--wheat-dark); }
.analytics-hbar.is-down .analytics-hbar-fill { background: #c4705f; }
.analytics-hbar-value,
.analytics-hbar-extra { text-align: right; font-variant-numeric: tabular-nums; }
.analytics-hbar-extra { color: var(--muted); }
.analytics-stack { display: flex; height: 1.6rem; margin-top: 0.8rem; overflow: hidden; border-radius: 0.3rem; background: rgb(0 0 0 / 4%); }
.analytics-stack-part { display: inline-block; flex-basis: 0; min-width: 3px; }
.analytics-legend .analytics-stack-part { width: 0.8rem; height: 0.8rem; margin-right: 0.35rem; border-radius: 0.15rem; vertical-align: -0.1rem; }
.analytics-stack-part.is-current { background: #9cbf8a; }
.analytics-stack-part.is-d15 { background: #e7c86e; }
.analytics-stack-part.is-d30 { background: #e09a55; }
.analytics-stack-part.is-d60 { background: #cf6a4c; }
.analytics-stack-part.is-over { background: #9e2f24; }
.analytics-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 0.5rem; font-size: 0.82rem; }
@media print {
  .analytics-periods { display: none !important; }
  .analytics-workspace .report-columns,
  .analytics-hbar,
  .report-chart { break-inside: avoid; }
}

/* Vezetői riport telefonon: csempék két oszlopban, listák és sávdiagramok egy oszlopban, a vevő
   neve a teljes sorban; a sok oszlopos diagram vízszintesen görgethető. */
.report-chart { grid-template-columns: repeat(var(--bars, 12), minmax(1.6rem, 1fr)); overflow-x: auto; }
@media (max-width: 40rem) {
  .report-workspace .title-line { flex-wrap: wrap; row-gap: 0.4rem; }
  .report-workspace .title-line h1 { order: -1; width: 100%; font-size: 2rem; }
  .report-workspace .list-print { display: none; }
  .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .report-tile { padding: 0.6rem 0.7rem; }
  .report-value { font-size: 1.05rem; overflow-wrap: anywhere; }
  .report-columns { grid-template-columns: 1fr; gap: 0; }
  .report-chart { height: 9rem; gap: 0.25rem; padding-right: 0.7rem; }
  .report-bar { font-size: 0.6rem; }
  /* Keskeny oszlopoknál minden második dátum, hogy ne folyjanak egymásba. */
  .report-chart .report-bar:nth-last-child(even) .report-bar-day { visibility: hidden; }
  .report-workspace .order-list-row.report-row,
  .report-workspace .order-list-row.report-standing-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: none;
    gap: 0.1rem 0.6rem;
  }
  .report-workspace .report-row > :first-child,
  .report-workspace .report-standing-row > :first-child { display: none; }
  .report-workspace .report-standing-row > strong { grid-column: 1 / -1; }
  .analytics-hbar { grid-template-columns: minmax(0, 1fr) 6.5rem 4rem; row-gap: 0.15rem; padding: 0.2rem 0; }
  .analytics-hbar-label { grid-column: 1 / -1; }
  .analytics-periods a { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
}
/* Érintőképernyőn nincs egérráállás: az aktuális menüpont koppintásra nyitja a lenyílóját. */
@media (hover: none) {
  .main-navigation .nav-item.is-open .nav-menu { display: block; position: fixed; left: 1rem; right: 1rem; min-width: 0; }
}

/* Fejléc telefonon/keskeny ablakban: első sor a logó, jobbra a fogaskerék és a felhasználó;
   második sor a menü egy sorban, vízszintesen görgethető, az aktuális pont látható helyen. */
@media (max-width: 58rem) {
  :root { --app-header-height: 2.9rem; }
  .app-header {
    grid-template-columns: auto 1fr auto auto;
    column-gap: 0.4rem;
    row-gap: 0;
    padding: 0 0.6rem 0.35rem;
  }
  .app-header .brand { grid-column: 1; grid-row: 1; }
  .app-header .settings-menu { grid-column: 3; grid-row: 1; }
  .app-header .user-menu { grid-column: 4; grid-row: 1; justify-self: end; }
  .main-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 0;
    gap: 0.15rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .main-navigation::-webkit-scrollbar { display: none; }
  .main-navigation .nav-item { height: auto; flex: none; }
  .main-navigation > a,
  .main-navigation .nav-item > a { padding: 0.35rem 0.6rem; font-size: 0.88rem; white-space: nowrap; }
}

/* Listák telefonon (megtekintésre): a sok oszlopos lista a saját dobozában vízszintesen
   görgethető; minden sora a lista legkisebb szélességét kapja (--list-min, az app.js méri), így
   az oszlopok egymás alatt maradnak, és az oldal nem lóg ki. A telefonra külön tördelt (vevőnév, túra, mennyiség) listák kivételek. */
@media (max-width: 40rem) {
  .order-list:not(:has(.c-name)) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .order-list:not(:has(.c-name)) > * { min-width: var(--list-min, 100%); }
  .order-list:not(:has(.c-name)) .order-list-row { grid-template-areas: none; }
  .order-list:not(:has(.c-name)) .order-list-heading { position: static; }
  main.workspace table { display: block; max-width: 100%; overflow-x: auto; }
}
@media (max-width: 40rem) {
  /* Cím a teljes sorban, alatta a napválasztó; a fejléc eszközei és gombjai tördelődnek. */
  .workspace-heading .title-line { flex-wrap: wrap; row-gap: 0.4rem; }
  .workspace-heading .title-line h1 { order: -1; width: 100%; font-size: 2rem; }
  .heading-tools { flex-wrap: wrap; gap: 0.6rem; width: 100%; }
  .billing-actions { flex-wrap: wrap; width: 100%; }
  .billing-button { display: inline-block; white-space: normal; }
  /* Termelés: cikkszám nélkül, név – mennyiség – össztömeg. */
  .production-line { grid-template-columns: minmax(0, 1fr) 5rem 5.5rem; gap: 0.5rem; }
  .production-line > :first-child { display: none; }
  /* Aktivitás: a jelenlét és a napló egymás alatt. */
  .activity-layout { grid-template-columns: minmax(0, 1fr); }
  .activity-layout > * { min-width: 0; }
  .activity-filters { flex-wrap: wrap; }
}
@media (max-width: 40rem) {
  /* A fejléc hosszú gombja (pl. Szállítólevelek nyomtatása) saját sorban, a kereső alatt. */
  .order-workspace > .workspace-heading > .billing-actions { grid-row: 3; grid-column: 1 / -1; margin: 0 0 0.6rem; }
}
@media (max-width: 40rem) {
  .billing-filters,
  .billing-period { flex-wrap: wrap; gap: 0.6rem; }
  .billing-filters .partner-search-line { flex-basis: 100%; min-width: 0; }
}
@media (max-width: 40rem) {
  .partner-search-line .partner-name-input { min-width: 0; width: 100%; }
  /* Banki utalás / KP rögzítősor: a mezők tördelődnek. */
  .bank-transfer-line { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .bank-transfer-line > * { flex: 1 1 9rem; min-width: 0; }
}
