:root {
  --bg: #f3f5f1;
  --surface: #fffefa;
  --surface-strong: #ffffff;
  --ink: #202123;
  --muted: #66706b;
  --line: #d8ded4;
  --green: #2f6f4e;
  --green-dark: #1f4d36;
  --blue: #265b8c;
  --red: #a43f3f;
  --amber: #b7791f;
  --shadow: 0 8px 22px rgba(31, 45, 37, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #edf5ef 0%, #ffffff 52%, #f5f1e8 100%);
}

.login-screen.hidden {
  display: none;
}

.public-screen {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 24px;
  background: linear-gradient(135deg, #edf5ef 0%, #ffffff 52%, #f5f1e8 100%);
}

.public-screen.hidden {
  display: none;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(36, 48, 43, 0.16);
}

.login-card img {
  width: 118px;
  max-height: 76px;
  object-fit: contain;
}

.public-card {
  display: grid;
  gap: 14px;
  width: min(860px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(36, 48, 43, 0.16);
}

.public-card-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.public-card-head img {
  width: 88px;
  max-height: 62px;
  object-fit: contain;
}

.login-card h1,
.login-card p,
.public-card h1,
.public-card p {
  margin: 0;
}

.login-card h1,
.public-card h1 {
  font-size: 30px;
}

.login-card p,
.public-card p,
#loginMessage,
.public-message {
  color: var(--muted);
}

.login-version {
  display: inline-block;
  width: max-content;
  padding: 6px 9px;
  border-radius: 999px;
  color: #23422d;
  background: #e7f4e7;
  font-size: 12px;
}

#loginMessage {
  min-height: 22px;
  padding: 8px 10px;
  border: 1px solid #dbe7df;
  border-radius: 7px;
  background: #f7faf6;
  font-size: 14px;
  line-height: 1.35;
}

.login-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.login-card input,
.public-card input,
.public-card select,
.public-card textarea {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
}

.public-card textarea {
  min-height: 86px;
  padding: 10px 12px;
}

.public-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.public-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.public-availability {
  display: grid;
  gap: 8px;
}

#loginMessage.error {
  color: #b42318;
  border-color: #f3c6c2;
  background: #fff5f4;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-shell.app-locked {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: #26352d;
  color: #f9faf7;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #ffffff;
  color: #1d2a22;
  font-weight: 800;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-logos img {
  width: 100%;
  max-height: 66px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.shop-link {
  display: grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  color: #f9faf7;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 700;
}

.shop-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.entry-form h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p {
  margin-top: 3px;
  color: #c7d2cc;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.ghost-button,
.danger-button,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.nav-item {
  padding: 0 12px;
  text-align: left;
  color: #e8eee9;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.ghost-button {
  padding: 0 14px;
  color: var(--green-dark);
  background: #edf5ef;
  border: 1px solid #cadbce;
}

.danger-button {
  padding: 0 14px;
  color: #ffffff;
  background: #8e3d37;
}

.primary-button {
  padding: 0 16px;
  color: #ffffff;
  background: var(--green);
}

.workspace {
  min-width: 0;
  padding: 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -20px -20px 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 241, 0.94);
  backdrop-filter: blur(8px);
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 28px;
}

.auth-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 220px;
}

.auth-box span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

#appStatusLabel {
  color: #52705d;
  font-size: 12px;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.search input {
  width: min(360px, 38vw);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.entry-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric-button {
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}

.metric-button:hover {
  border-color: var(--green);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.documents-grid {
  margin-top: 18px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.25fr);
  align-items: start;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-actions label,
.document-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.panel-actions input,
.panel-actions select,
.document-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: #ffffff;
}

.filter-actions {
  display: grid;
  grid-template-columns: auto 150px 132px 108px 96px 132px auto;
  align-items: end;
  width: min(100%, 860px);
}

.filter-actions input,
.filter-actions select {
  min-height: 34px;
  padding: 5px 8px;
  font-size: 13px;
}

.panel-header h3,
.entry-form h3 {
  font-size: 18px;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(650px, 820px) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

#orders .split-layout {
  grid-template-columns: 1fr;
}

.span-2 {
  grid-column: 1 / -1;
}

.entry-form {
  display: grid;
  gap: 10px;
  padding: 18px;
}

#orderForm:not(.order-form-modal) {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.order-form-modal {
  position: fixed;
  inset: 18px;
  z-index: 80;
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  margin: auto;
  border: 1px solid rgba(39, 67, 48, 0.18);
  border-radius: 10px;
  overflow: auto;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(20, 31, 24, 0.28);
}

.modal-form-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -18px -18px 6px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.entry-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.entry-form input,
.entry-form select,
.entry-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

.order-top-grid {
  display: grid;
  grid-template-columns: 96px 220px minmax(220px, 360px);
  gap: 10px;
  align-items: end;
}

#orderForm input[name="number"] {
  text-align: center;
}

#orderForm input[name="receivedDate"],
#orderForm input[name="processDate"] {
  max-width: 220px;
}

#orderForm input[name="customer"] {
  max-width: 360px;
}

.short-field {
  max-width: 180px;
}

.process-date-field {
  max-width: 240px;
}

.compact-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid #dfe7da;
  border-radius: 8px;
  padding: 10px;
  background: #f8faf6;
}

.entry-form input[readonly] {
  color: var(--green-dark);
  background: #edf5ef;
  font-weight: 700;
}

.package-picker {
  display: grid;
  gap: 8px;
}

.package-picker > span {
  color: var(--muted);
  font-size: 13px;
}

.package-grid {
  display: grid;
  gap: 8px;
}

.package-option {
  display: grid;
  grid-template-columns: 20px minmax(100px, 1fr) 82px 82px 76px minmax(130px, 1fr) 72px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

.package-option-head {
  border: 0;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.package-option input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
}

.package-option input[type="number"] {
  min-height: 36px;
  padding: 5px 8px;
}

.package-option input[readonly] {
  background: #edf5ef;
}

.public-package-option,
.public-package-head {
  grid-template-columns: 20px minmax(120px, 1fr) 92px 82px 76px;
}

.remainder-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 12px;
}

.remainder-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.remainder-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 62px;
  border: 1px solid #cddacb;
  border-radius: 7px;
  color: var(--muted);
  background: #f8faf6;
  font-weight: 800;
}

.remainder-choice input:focus-visible + span {
  outline: 2px solid #3f7c4a;
  outline-offset: 2px;
}

.remainder-choice input:checked + span {
  color: #ffffff;
  border-color: #3f7c4a;
  background: #3f7c4a;
}

.package-liters {
  color: var(--green-dark);
  font-size: 12px;
}

.package-prep {
  color: var(--blue);
  font-size: 12px;
  line-height: 1.25;
}

.mix-additives {
  display: grid;
  gap: 8px;
}

.mix-head,
.mix-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 88px 102px;
  align-items: center;
  gap: 8px;
}

.mix-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mix-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

.mix-row span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  border: 1px solid #c6d8c9;
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--green-dark) !important;
  background: #eff8f0;
  font-weight: 700;
}

.checkbox-line input {
  width: 18px !important;
  min-height: 18px !important;
}

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

.form-actions button,
.panel-actions button,
.document-form button {
  min-width: 120px;
}

.settings-form {
  display: grid;
  gap: 12px;
}

#employeeForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#employeeForm .form-actions {
  grid-column: 1 / -1;
}

#employeeForm .wide-form-field {
  grid-column: 1 / -1;
}

.wide-form-field {
  grid-column: 1 / -1;
}

#sipProfitForm,
#coldStorageForm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#sipProfitForm button,
#sipProfitResult,
#coldStorageForm .form-actions {
  grid-column: 1 / -1;
}

.calculation-form {
  grid-template-columns: 1fr;
}

.calculation-form fieldset {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcf7;
}

.calculation-form legend {
  padding: 0 6px;
  font-weight: 800;
  color: #263629;
}

.calculation-form .calculation-box,
.calculation-form .form-actions {
  grid-column: 1 / -1;
}

.calculation-comparison-table td,
.calculation-comparison-table th {
  font-size: 12px;
}

#workLogForm {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

#workLogForm .work-employee-field,
#workLogForm .work-calc-field,
#workLogForm .work-note-field {
  grid-column: 1 / -1;
}

#workLogForm .work-save-field,
#workLogForm .work-clear-field {
  grid-column: span 2;
}

#workLogForm .work-date-field,
#workLogForm .work-time-field {
  grid-column: span 2;
}

#workLogForm .work-stamp-field,
#workLogForm .work-payment-field,
#workLogForm .work-place-field {
  grid-column: span 1;
}

#workLogForm .work-stamp-field {
  align-self: center;
  min-height: 38px;
}

.work-time-field {
  display: grid;
  grid-template-columns: minmax(110px, 140px) minmax(110px, 140px);
  gap: 10px;
}

.work-time-field label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.date-with-day {
  display: grid;
  grid-template-columns: minmax(140px, 170px) minmax(105px, 120px);
  gap: 10px;
}

.date-with-day label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #ffffff;
}

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

.sms-help {
  padding: 8px 10px;
  border: 1px solid #dce8d8;
  border-radius: 7px;
  color: var(--muted);
  background: #f7fbf5;
  font-size: 12px;
  line-height: 1.4;
}

.table-input {
  width: 82px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
}

.active-input {
  width: 18px;
  min-height: 18px;
}

.small-input {
  width: 64px;
}

.wide-input {
  width: 150px;
}

.table-note {
  width: 150px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  resize: vertical;
}

.production-table {
  min-width: 2200px;
}

.document-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, auto) minmax(150px, auto) auto;
  gap: 12px;
  align-items: end;
}

.hidden {
  display: none !important;
}

.save-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #b8d6bd;
  border-radius: 8px;
  color: #17351f;
  background: #edf8ee;
  box-shadow: 0 12px 32px rgba(28, 40, 31, 0.18);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.save-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.save-toast.error {
  color: #8f1f16;
  border-color: #f0bbb5;
  background: #fff2f0;
}

.calculation-box {
  display: grid;
  gap: 5px;
  border: 1px solid #c9d9cc;
  border-radius: 7px;
  padding: 10px;
  color: #284333;
  background: #f1f8f2;
  font-size: 13px;
}

.calculation-box span {
  display: block;
}

.table-panel {
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #ece7dd;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #35443b;
  background: #f1eadf;
}

tbody tr:nth-child(even) {
  background: #fbf8f0;
}

tbody tr:hover {
  background: #fbfcf8;
}

td.numeric,
th.numeric {
  text-align: right;
}

.stock-balance {
  font-weight: 800;
  color: #24342a;
}

.row-action {
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  color: #ffffff;
  background: var(--red);
  cursor: pointer;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  align-items: center;
  gap: 12px;
  min-height: 28px;
  font-size: 14px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #e4dfd3;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.compact-list,
.recipe-list,
.order-grid,
.reservation-list {
  display: grid;
  gap: 10px;
}

.compact-item,
.recipe-item,
.order-card,
.reservation-card {
  border: 1px solid #e5dfd3;
  border-radius: 7px;
  padding: 12px;
  background: #ffffff;
}

.compact-list > .compact-item:nth-child(even),
.recipe-list > .recipe-item:nth-child(even),
.order-grid > .order-card:nth-child(even),
.reservation-list > .reservation-card:nth-child(even),
.production-list > .production-card:nth-child(even):not(.finished-row-head) {
  background: #fbf8f0;
}

.compact-item strong,
.order-card strong {
  display: block;
}

.compact-item span,
.order-card span,
.recipe-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.order-duration-field {
  display: grid;
  grid-template-columns: auto 92px;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-duration-field input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
}

.settings-action button {
  margin-top: 10px;
}

.danger-zone {
  border-color: #e2b6ad;
  background: #fff8f6;
}

.order-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.order-grid {
  grid-template-columns: 1fr;
}

.orders-today-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.orders-calendar-panel,
.orders-today-panel,
.orders-older-panel {
  min-width: 0;
}

.orders-today-panel {
  display: grid;
  align-content: start;
  gap: 10px;
}

.today-order-list {
  display: grid;
  gap: 10px;
}

.orders-older-panel {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.reservation-list {
  grid-template-columns: 1fr;
}

.reservation-schedule {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe6d8;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf5;
}

.reservation-calendar-wrap,
.public-calendar,
.operations-calendar {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe6d8;
  border-radius: 8px;
  padding: 12px;
  background: #f8fbf5;
}

.reservation-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.reservation-schedule-head strong,
.reservation-schedule-head span {
  display: block;
}

.reservation-schedule-head strong {
  color: var(--ink);
  font-size: 15px;
}

.reservation-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.reservation-calendar {
  display: grid;
  gap: 10px;
}

.reservation-calendar.is-week {
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  overflow-x: auto;
}

.reservation-day-column {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.reservation-day-title {
  display: grid;
  gap: 2px;
  min-height: 42px;
  border-radius: 7px;
  padding: 7px 8px;
  color: #1d2d22;
  background: #e8f1e3;
  font-weight: 800;
}

.reservation-day-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.reservation-day-grid {
  position: relative;
  min-height: 720px;
  border: 1px solid #d9e4d5;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.calendar-slot {
  min-height: 40px;
  border-bottom: 1px solid #edf1ea;
  padding: 4px 6px;
  color: #7a857f;
  font-size: 11px;
}

.calendar-slot.drag-over {
  background: #e4f4df;
  outline: 2px solid rgba(47, 111, 78, 0.25);
}

.reservation-day-grid.drag-over {
  outline: 3px solid rgba(47, 111, 78, 0.22);
}

.calendar-break-block {
  position: absolute;
  left: 54px;
  right: 7px;
  z-index: 4;
  display: grid;
  align-content: center;
  gap: 1px;
  border: 1px solid #75a7d4;
  border-radius: 7px;
  padding: 5px 8px;
  color: #17324a;
  background: #cfe5f8;
  box-shadow: 0 6px 14px rgba(31, 45, 37, 0.08);
  pointer-events: none;
}

.calendar-break-block strong,
.calendar-break-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-break-block span {
  font-size: 12px;
}

.calendar-reservation-block {
  position: absolute;
  left: 54px;
  right: 7px;
  z-index: 2;
  display: grid;
  align-content: start;
  gap: 2px;
  border: 1px solid #a7c49f;
  border-radius: 7px;
  padding: 7px 8px;
  color: #163422;
  background: #dff0d9;
  box-shadow: 0 8px 18px rgba(31, 45, 37, 0.12);
  cursor: grab;
  overflow: hidden;
}

.calendar-reservation-block.is-public {
  cursor: default;
  color: #3e493f;
  background: #e4e9df;
  border-color: #cbd6c6;
}

.calendar-reservation-block.is-background {
  left: 54px;
  right: 44px;
  z-index: 1;
  opacity: 0.48;
  cursor: default;
  background: #dfe8d9;
  border-color: #c8d5c1;
}

.calendar-order-block {
  position: absolute;
  left: 84px;
  right: 7px;
  z-index: 3;
  display: grid;
  align-content: start;
  gap: 2px;
  border: 1px solid #7aa1c5;
  border-radius: 7px;
  padding: 7px 8px;
  color: #17324a;
  background: #dcecf9;
  box-shadow: 0 10px 20px rgba(31, 45, 37, 0.16);
  overflow: hidden;
}

#orders .calendar-order-block {
  left: 62px;
}

#orders .operations-calendar {
  width: 100%;
}

#orders .reservation-day-grid {
  min-height: 980px;
}

#orders .calendar-reservation-block.is-background {
  right: 28px;
}

.calendar-order-block.is-grouped {
  border-color: #4f8d5a;
  background: #dff2e3;
  color: #1e4429;
}

.calendar-order-block strong,
.calendar-order-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-order-block span {
  color: #335572;
  font-size: 12px;
}

.calendar-order-block.is-grouped span {
  color: #335b3d;
  font-weight: 700;
  white-space: normal;
  line-height: 1.25;
}

.calendar-reservation-block strong,
.calendar-reservation-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-reservation-block span {
  color: #395244;
  font-size: 12px;
}

.reservation-slot {
  display: grid;
  gap: 8px;
  min-height: 94px;
  border: 1px solid #cfdec9;
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
}

.reservation-slot.drag-over {
  outline: 3px solid rgba(47, 111, 78, 0.28);
  background: #edf7ec;
}

.reservation-slot.is-overloaded {
  border-color: #d9907f;
  background: #fff5f2;
}

.reservation-slot-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.reservation-slot-time span {
  color: var(--muted);
  font-size: 12px;
}

.reservation-slot-items {
  display: grid;
  gap: 6px;
}

.slot-empty {
  color: var(--muted);
  font-size: 12px;
}

.schedule-reservation {
  display: grid;
  gap: 3px;
  border-radius: 7px;
  padding: 8px;
  color: #163422;
  background: #e4f2df;
  cursor: grab;
}

.schedule-reservation:active {
  cursor: grabbing;
}

.schedule-reservation span {
  color: #395244;
  font-size: 12px;
}

.reservation-card {
  display: grid;
  gap: 10px;
  border-left: 5px solid var(--amber);
}

.reservation-card.status-potvrdeno {
  border-left-color: var(--green);
}

.reservation-card.status-odbijeno {
  border-left-color: var(--red);
}

.reservation-card.status-odradeno {
  border-left-color: var(--blue);
}

.reservation-main {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(100px, 0.7fr) minmax(130px, 0.8fr) minmax(110px, 0.7fr);
  gap: 10px;
  align-items: start;
}

.reservation-main span,
.reservation-note {
  color: var(--muted);
  font-size: 13px;
}

.reservation-main strong {
  display: block;
  margin-top: 3px;
}

.reservation-summary {
  display: grid;
  grid-template-columns: 150px minmax(220px, 1fr) 180px;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f7faf6;
  color: var(--muted);
  font-size: 13px;
}

.reservation-summary strong {
  color: var(--ink);
}

.reservation-link {
  display: grid;
  gap: 5px;
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.reservation-link input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
}

.reservation-time {
  display: grid;
  gap: 5px;
  max-width: 180px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.reservation-time input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
}

.reservation-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f7faf6;
}

.reservation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reservation-actions button {
  min-height: 36px;
}

.reservation-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reservation-filters input,
.reservation-filters select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
}

.production-list {
  display: grid;
  gap: 14px;
  overflow-x: auto;
}

.production-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.production-card.is-finished {
  background: #f7faf5;
}

.production-list > .production-card.is-finished:nth-child(even):not(.finished-row-head) {
  background: #f0f6ed;
}

.finished-row {
  display: grid;
  grid-template-columns: 96px minmax(160px, 1fr) 132px 132px 110px 64px 86px minmax(260px, 1.5fr) 86px 178px;
  align-items: center;
  gap: 0;
  min-width: 1300px;
  padding: 10px 12px;
  text-align: center;
}

.finished-row-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #35443b;
  background: #f1eadf;
  font-size: 12px;
}

.finished-row-head label {
  display: grid;
  gap: 4px;
  font-weight: 800;
}

.finished-row-head input,
.finished-row-head select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 7px;
  font-size: 12px;
}

.finished-row > span {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.finished-row .order-select,
.finished-row .row-actions {
  justify-content: center;
}

.finished-row .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.finished-row .row-actions .ghost-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.order-section-title {
  margin: 6px 0 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-note {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--muted);
  background: #faf8f2;
}

.order-archive-list {
  display: grid;
  gap: 6px;
}

.order-archive-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.55fr) minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) minmax(72px, 0.45fr) minmax(92px, 0.6fr) minmax(90px, 0.55fr) minmax(150px, auto);
  align-items: center;
  gap: 10px;
  border: 1px solid #e5dfd3;
  border-radius: 7px;
  padding: 9px 10px;
  text-align: center;
  background: #ffffff;
}

.order-archive-list > .order-archive-row:nth-child(even):not(.order-archive-head) {
  background: #fbf8f0;
}

.order-archive-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #35443b;
  background: #f1eadf;
  font-size: 12px;
}

.order-archive-row > span {
  color: var(--muted);
  font-size: 13px;
}

.order-archive-row .order-select,
.order-archive-row .row-actions {
  justify-content: center;
}

.production-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.production-card-head strong,
.production-card-head span {
  display: block;
}

.production-card-head span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.production-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 200px));
  justify-content: start;
  gap: 10px;
  margin-bottom: 12px;
}

.production-form-grid label,
.production-field,
.production-card > label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.production-field {
  align-content: center;
  min-height: 42px;
  border: 1px solid #edf0ea;
  border-radius: 7px;
  padding: 7px 9px;
  background: #ffffff;
}

.production-field strong {
  color: var(--ink);
}

.waste-input {
  width: 68px;
}

.small-check {
  min-height: 42px;
  align-content: center;
}

.small-check span {
  display: grid;
  gap: 2px;
}

.small-check small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.production-subsection {
  border: 1px solid #e3e9df;
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
  background: #fbfcf8;
}

.production-subsection h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.production-card .package-actual-list {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.production-card .package-actual {
  grid-template-columns: minmax(110px, 1fr) 82px;
  border: 1px solid #edf0ea;
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

.production-card .package-actual span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.production-total {
  display: grid;
  grid-template-columns: repeat(3, auto 1fr);
  gap: 6px 10px;
  align-items: baseline;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.production-total strong {
  color: var(--ink);
}

.billing-lines {
  display: grid;
  gap: 8px;
}

.billing-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 8px;
  border-bottom: 1px solid #edf0ea;
  padding-bottom: 8px;
  font-size: 13px;
}

.billing-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.billing-line span {
  color: var(--muted);
}

.auto-note {
  border: 1px solid #e7ddc2;
  border-radius: 7px;
  margin-bottom: 10px;
  padding: 8px 10px;
  color: #58411a;
  background: #fff8e7;
  font-size: 13px;
}

.estimate-warning {
  border: 1px solid #d7b87b;
  border-radius: 7px;
  margin-bottom: 10px;
  padding: 8px 10px;
  color: #573b00;
  background: #fff4d7;
  font-size: 13px;
  font-weight: 800;
}

.production-note {
  width: 100%;
  min-height: 70px;
  margin-top: 8px;
}

.production-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, auto)) minmax(120px, auto) minmax(120px, 1fr) minmax(160px, auto);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.customer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.tank-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 110px auto;
  gap: 10px;
  align-items: end;
}

.tank-item label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

[data-sms-production] {
  color: #174a2b;
  background: #e8f5ea;
  border: 1px solid #b9d8bf;
}

.sms-status {
  color: #52705d;
  font-size: 12px;
  font-weight: 800;
}

.production-actions .sms-status {
  min-height: 16px;
}

.package-actual-list {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.package-actual {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 64px;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.document-preview {
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.document-editor {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  text-align: center;
}

.eco-record-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #dfe7db;
  border-radius: 7px;
  background: #fbfdf8;
}

.eco-record-form .compact-fields {
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 0.7fr) minmax(118px, 0.75fr) minmax(105px, 0.65fr);
  gap: 8px;
}

.eco-record-form label {
  gap: 4px;
}

.eco-record-form input,
.eco-record-form select {
  min-height: 32px;
  padding: 5px 8px;
}

.eco-record-form .package-actual-list {
  grid-template-columns: 1fr;
  gap: 3px;
  min-width: 0;
}

.eco-package-head,
.eco-package-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 72px 72px;
  align-items: center;
  gap: 6px;
}

.eco-package-head {
  padding: 0 7px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.eco-package-row {
  padding: 5px 7px;
  border: 1px solid #e3eadf;
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
}

.eco-package-row:nth-child(odd) {
  background: #f6f9f2;
}

.eco-package-row strong {
  text-align: right;
  font-size: 12px;
}

.eco-record-form h4 {
  margin: 0 0 6px;
  font-size: 13px;
}

.eco-record-form .calculation-box {
  margin-top: 8px;
  padding: 8px 9px;
}

.order-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-select input {
  width: 18px;
  height: 18px;
}

.order-card-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.status {
  align-self: start;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 900;
  border: 1px solid transparent;
}

.status.status-received {
  color: #5a3a00;
  background: #ffe2a8;
  border-color: #d59b2f;
}

.status.status-process {
  color: #17324a;
  background: #dcecf9;
  border-color: #8fb9dd;
}

.status.status-finished {
  color: #143a25;
  background: #cfe9d4;
  border-color: #75b583;
}

.eco-label {
  display: inline-block;
  border-radius: 5px;
  padding: 2px 6px;
  color: #ffffff;
  background: var(--green);
  font-size: 11px;
}

.recipe-item {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 12px;
}

.recipe-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef4f8;
  color: #24445e;
  font-size: 12px;
}

@media (max-width: 980px) {
  .public-form-grid,
  .reservation-main,
  .reservation-summary {
    grid-template-columns: 1fr;
  }

  .reservation-calendar.is-week {
    grid-template-columns: repeat(7, minmax(180px, 1fr));
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    gap: 12px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 0 13px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-grid,
  .panel-grid,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .production-form-grid,
  .production-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-line {
    grid-template-columns: 1fr;
  }

  #orderForm {
    position: static;
    max-height: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    margin: 0 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .search input {
    width: 100%;
  }

  .filter-actions,
  .document-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    background: #eef2ed;
  }

  .public-screen {
    padding: 12px;
  }

  .public-card {
    padding: 14px;
  }

  .public-card-head {
    align-items: flex-start;
  }

  .public-card-head img {
    width: 68px;
    max-height: 54px;
  }

  .public-card h1 {
    font-size: 23px;
  }

  .reservation-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reservation-actions button {
    width: 100%;
    padding: 0 8px;
  }

  .workspace,
  .sidebar {
    padding: 12px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .sidebar-footer {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric,
  .panel,
  .entry-form {
    border-radius: 7px;
    box-shadow: none;
  }

  .metric {
    padding: 12px;
  }

  .metric strong {
    font-size: 21px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .panel,
  .entry-form {
    padding: 12px;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions,
  .filter-actions,
  .document-form,
  #employeeForm,
  #workLogForm,
  #sipProfitForm,
  #coldStorageForm,
  .calculation-form fieldset,
  .date-with-day,
  .work-time-field,
  .order-top-grid,
  .compact-fields {
    grid-template-columns: 1fr;
    width: 100%;
  }

  #workLogForm .work-date-field,
  #workLogForm .work-time-field,
  #workLogForm .work-place-field,
  #workLogForm .work-stamp-field,
  #workLogForm .work-payment-field {
    grid-column: 1;
  }

  #orderForm input[name="receivedDate"],
  #orderForm input[name="processDate"],
  #orderForm input[name="customer"],
  .short-field,
  .process-date-field {
    max-width: none;
  }

  .panel-actions {
    display: grid;
  }

  .package-option,
  .mix-row {
    grid-template-columns: 24px 1fr;
    align-items: start;
  }

  .mix-row {
    grid-template-columns: 1fr;
  }

  .mix-row span,
  .mix-row input,
  .mix-row select {
    grid-column: 1;
  }

  .package-option-head,
  .mix-head {
    display: none;
  }

  .package-option > span:nth-child(2) {
    font-weight: 700;
  }

  .package-option input[type="number"],
  .package-liters,
  .package-prep,
  .remainder-choice,
  .mix-row input,
  .mix-row select {
    grid-column: 2;
    width: 100%;
  }

  .remainder-choice {
    min-height: 34px;
  }

  .recipe-item,
  .order-card {
    grid-template-columns: 1fr;
  }

  .order-card-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: stretch;
  }

  .order-card-actions .status {
    grid-column: 1 / -1;
    width: max-content;
  }

  .order-card-actions button {
    padding: 0 8px;
  }

  .customer-item,
  .tank-item {
    grid-template-columns: 1fr;
  }

  .brand-logos {
    display: none;
  }

  .production-card-head,
  .production-form-grid,
  .production-actions,
  .finished-row,
  .order-archive-row,
  .production-card .package-actual-list,
  .production-total {
    grid-template-columns: 1fr;
  }

  .production-card-head {
    display: grid;
  }

  .production-total {
    gap: 4px;
  }

  .production-card .package-actual {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  .production-table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 8px;
    background: #ffffff;
  }

  td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #edf0ea;
    padding: 8px 4px;
    font-size: 13px;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  td.numeric {
    text-align: left;
  }

  .table-input,
  .small-input,
  .wide-input,
  .table-note {
    width: 100%;
  }

  .package-actual-list {
    min-width: 0;
  }

  .document-preview {
    max-height: 55vh;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .app-shell {
    display: block;
  }

  .workspace,
  .sidebar {
    padding: 10px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p,
  .brand-logos {
    display: none;
  }

  .shop-link {
    min-height: 34px;
    font-size: 13px;
  }

  .nav {
    gap: 6px;
    margin: 0 -10px;
    padding: 0 10px 4px;
    scrollbar-width: thin;
  }

  .nav-item {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }

  .topbar {
    position: static;
    gap: 10px;
    padding: 12px;
    margin-bottom: 12px;
  }

  .topbar h2 {
    font-size: 20px;
  }

  .auth-box {
    align-items: stretch;
    flex-direction: column;
    justify-content: stretch;
    min-width: 0;
    width: 100%;
  }

  .auth-box span {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #orders .split-layout {
    gap: 12px;
  }

  #orderForm {
    gap: 9px;
    padding-bottom: 82px;
  }

  #orderForm h3 {
    font-size: 18px;
  }

  #orderForm .compact-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  #orderForm .compact-fields .checkbox-line,
  #orderForm .compact-fields label:has(select[name="tank"]) {
    grid-column: 1 / -1;
  }

  .entry-form input,
  .entry-form select,
  .entry-form textarea {
    min-height: 46px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 6px -12px -12px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }

  .form-actions button,
  .panel-actions button,
  .document-form button {
    width: 100%;
    min-height: 46px;
  }

  .package-option {
    gap: 7px 9px;
    padding: 10px;
  }

  .order-card,
  .production-card,
  .compact-item {
    box-shadow: none;
  }

  .production-card {
    padding: 12px;
  }

  .production-actions {
    position: static;
    margin: 10px 0 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .production-save-button {
    position: sticky;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 9;
    box-shadow: 0 10px 22px rgba(41, 86, 48, 0.22);
  }

  .finished-row-head {
    position: static;
    display: none;
  }

  .save-toast {
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .view {
    scroll-margin-top: 128px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric small {
    line-height: 1.25;
  }

  .panel-grid,
  .documents-grid,
  .calculations-grid,
  .split-layout {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .orders-today-layout {
    grid-template-columns: 1fr;
  }

  .panel-header {
    gap: 10px;
  }

  .panel-actions,
  .filter-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .panel-actions label,
  .filter-actions label,
  .document-form label {
    display: grid;
    gap: 5px;
  }

  #production .filter-actions,
  #orders .panel-actions {
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .production-list,
  .order-grid,
  .compact-list {
    gap: 10px;
  }

  .production-card,
  .order-card,
  .compact-item,
  .recipe-item {
    border-radius: 8px;
    padding: 12px;
  }

  .production-field {
    min-height: auto;
  }

  .production-subsection {
    padding: 10px;
  }

  .billing-line,
  .production-total {
    grid-template-columns: 1fr;
  }

  .production-total {
    gap: 3px;
  }

  .row-actions,
  .order-card-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .finished-row {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: stretch;
  }

  .order-archive-row {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    align-items: stretch;
  }

  .order-archive-head {
    display: none;
  }

  .finished-row > span {
    display: block;
  }

  .order-archive-row > span {
    display: block;
  }

  .finished-row > span::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .order-archive-row > span::before {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .finished-row > span:nth-of-type(1)::before { content: "Stranka"; }
  .finished-row > span:nth-of-type(2)::before { content: "Datum dovoza"; }
  .finished-row > span:nth-of-type(3)::before { content: "Datum prerade"; }
  .finished-row > span:nth-of-type(4)::before { content: "Voce"; }
  .finished-row > span:nth-of-type(5)::before { content: "EKO"; }
  .finished-row > span:nth-of-type(6)::before { content: "Kilograma"; }
  .finished-row > span:nth-of-type(7)::before { content: "Napunjeno"; }
  .finished-row > span:nth-of-type(8)::before { content: "SMS"; }

  .order-archive-row > span:nth-of-type(1)::before { content: "Stranka"; }
  .order-archive-row > span:nth-of-type(2)::before { content: "Datum prerade"; }
  .order-archive-row > span:nth-of-type(3)::before { content: "Voce"; }
  .order-archive-row > span:nth-of-type(4)::before { content: "Kilograma"; }
  .order-archive-row > span:nth-of-type(5)::before { content: "Posuda"; }
  .order-archive-row > span:nth-of-type(6)::before { content: "Status"; }

  #stockForm,
  #workLogForm,
  #employeeForm,
  #settingsForm,
  #customerForm,
  #sipProductForm,
  #sipStockForm,
  #sipProfitForm,
  #coldStorageForm,
  .calculation-form {
    grid-template-columns: 1fr !important;
  }

  .settings-form fieldset,
  .calculation-form fieldset {
    min-width: 0;
    padding: 10px;
  }

  .document-form {
    grid-template-columns: 1fr !important;
  }

  .document-preview,
  .document-editor textarea {
    max-height: none;
    min-height: 260px;
  }

  .calculation-comparison-table,
  .table-wrap {
    width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .table-wrap table {
    min-width: 0;
  }

  #priceRows input,
  #stockForm input,
  #stockForm select {
    min-width: 0;
  }

  .save-toast {
    font-size: 14px;
  }
}
