@charset "UTF-8";
:root {
  --bg: #f8f6f9;
  --surface: #fff;
  --border: #e8e1eb;
  --ink: #352b3a;
  --muted: #7b7081;
  --accent: #713583;
  --accent-ink: #fff;
  --danger: #c94b59;
  --success: #158e73;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-family: "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--accent);
}

h1 {
  margin: 0 0 22px;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px max(22px, (100vw - 1200px) / 2);
  background: #fffefa;
  border-bottom: 1px solid var(--border);
}
header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #34271d;
  font-size: 17px;
  font-weight: 600;
}
header.topbar .brand small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8em;
}
@media (max-width: 560px) {
  header.topbar {
    padding: 12px 16px;
  }
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #7b4c36;
  color: white;
  font-family: Georgia, serif;
  font-size: 24px;
}

.topbar-right {
  display: flex;
  gap: 16px;
  align-items: center;
}

.user-name {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 560px) {
  .user-name {
    display: none;
  }
}

nav.tabs {
  display: flex;
  gap: 18px;
  padding: 0 max(22px, (100vw - 1200px) / 2);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
nav.tabs a {
  padding: 14px 4px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  font-size: 14px;
  white-space: nowrap;
}
nav.tabs a.active {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 600;
}
@media (max-width: 560px) {
  nav.tabs {
    padding: 0 16px;
  }
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 22px 70px;
}
@media (max-width: 560px) {
  main {
    padding: 22px 14px 60px;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 6px 24px rgba(60, 39, 23, 0.035);
}
.card h3 {
  margin-top: 0;
  font-size: 17px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}
.page-heading h1 {
  margin: 0 0 7px;
}
.page-heading p {
  margin: 0;
}
@media (max-width: 560px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 8px !important;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 800px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .stat-grid {
    gap: 9px;
  }
}

.stat-card {
  display: flex;
  flex-direction: column;
  min-height: 150px;
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 24px rgba(60, 39, 23, 0.035);
}
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}
.stat-card strong {
  font-size: 30px;
  letter-spacing: -0.04em;
  margin: 12px 0 4px;
  line-height: 1;
}
.stat-card small {
  color: var(--accent);
  margin-top: auto;
}
@media (max-width: 560px) {
  .stat-card {
    min-height: 128px;
    padding: 14px;
  }
  .stat-card strong {
    font-size: 24px;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 800px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--border);
  padding: 13px 0;
  font-size: 14px;
}
.list-row:last-child {
  padding-bottom: 0;
}
.list-row small {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.danger-text {
  color: var(--danger);
}

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

.flash {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin: 0 0 12px;
}
.flash.success {
  background: #e8f3e6;
  color: var(--success);
}
.flash.error {
  background: #f6e4e1;
  color: var(--danger);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}
table th, table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
}

form.inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

label {
  display: block;
  font-size: 0.85em;
  color: var(--muted);
  margin-bottom: 4px;
}

input, select, textarea, button {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid #c6987a;
  outline-offset: 1px;
}

textarea {
  width: 100%;
  min-height: 90px;
  font-family: monospace;
}

button, .btn {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover {
  filter: brightness(0.94);
}
button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}
button.danger, .btn.danger {
  background: var(--danger);
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.8em;
}

.mono {
  font-family: monospace;
}

.right {
  text-align: right;
}

.muted {
  color: var(--muted);
}

@media print {
  header.topbar, nav.tabs, .no-print {
    display: none !important;
  }
}
.signBox {
  max-width: 340px;
  margin: 80px auto;
}
.signBox h1 {
  text-align: center;
  font-size: 1.3em;
}

.signForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signForm button {
  margin-top: 8px;
}

#frm-movementForm input[type=radio] {
  width: auto;
  padding: 0;
}

.card table {
  margin-top: 8px;
}
.card table td {
  border-bottom: 1px dashed var(--border);
}

.recipe-ingredient-field > label {
  display: block;
  margin-bottom: 8px;
}

.modal-field-label {
  display: block;
  margin-bottom: 6px;
  color: #7b7081;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.app-modal.recipe-modal {
  width: min(980px, 100vw - 36px);
}

.recipe-modal-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  gap: 28px;
  align-items: start;
}

.recipe-details-panel {
  padding-right: 28px;
  border-right: 1px solid #e9e1ec;
}

.recipe-materials-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e9e1ec;
  border-radius: 10px;
  background: #fcfafd;
}
.recipe-materials-panel .recipe-ingredient-field {
  margin: 0;
}

.recipe-ingredient-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px auto;
  align-items: end;
  gap: 10px;
}
.recipe-ingredient-composer .field {
  min-width: 0;
  margin: 0;
}
.recipe-ingredient-composer .field label {
  display: block;
  margin-bottom: 6px;
}
.recipe-ingredient-composer select {
  width: 100%;
}
@media (max-width: 600px) {
  .recipe-ingredient-composer {
    grid-template-columns: minmax(0, 1fr) 105px;
  }
}

.recipe-add-ingredient {
  min-height: 42px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .recipe-add-ingredient {
    grid-column: 1/-1;
    width: 100%;
  }
}

.recipe-ingredient-rows {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}

.recipe-ingredient-list-label {
  margin-top: 12px;
  color: #7b7081;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.recipe-ingredient-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 36px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e9e1ec;
  border-radius: 10px;
  background: #fcfafd;
}
.recipe-ingredient-editor input {
  width: 100%;
  min-width: 0;
}
@media (max-width: 600px) {
  .recipe-ingredient-editor {
    grid-template-columns: minmax(0, 1fr) 82px 34px;
    gap: 7px;
    padding: 8px;
  }
}

.recipe-ingredient-editor-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.recipe-ingredient-editor-meta strong {
  overflow: hidden;
  color: #51405a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-ingredient-editor-meta small {
  color: var(--muted);
  font-size: 11px;
}

.recipe-remove-ingredient {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: #b74c58;
  background: #fff0f1;
  font-size: 19px;
  cursor: pointer;
}
.recipe-remove-ingredient:hover {
  color: #a13241;
  background: #ffe5e8;
}

@media (max-width: 760px) {
  .app-modal.recipe-modal {
    width: min(620px, 100vw - 28px);
  }
  .recipe-modal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .recipe-details-panel {
    padding: 0;
    border: 0;
  }
}
.production-entry-card,
.finished-stock-card,
.production-history-card {
  margin-bottom: 20px;
  padding: 22px;
}
.production-entry-card .card-title,
.finished-stock-card .card-title,
.production-history-card .card-title {
  margin-bottom: 17px;
}
.production-entry-card .card-title h2,
.finished-stock-card .card-title h2,
.production-history-card .card-title h2 {
  margin: 0;
  color: #3b2a43;
  font-size: 18px;
}
.production-entry-card .card-title p,
.finished-stock-card .card-title p,
.production-history-card .card-title p {
  margin: 4px 0 0;
  font-size: 12px;
}

.product-overview {
  margin-top: 18px;
}

.production-entry-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  align-items: end;
  gap: 14px;
}
.production-entry-form .field {
  margin: 0;
}
.production-entry-form .field select,
.production-entry-form .field input {
  width: 100%;
}
@media (max-width: 720px) {
  .production-entry-form {
    grid-template-columns: 1fr 100px;
  }
  .production-entry-form > input[type=submit] {
    grid-column: 1/-1;
    width: 100%;
  }
}

.finished-product-list {
  display: grid;
}

.finished-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #eee7f0;
}
.finished-product-row:last-child {
  border-bottom: 0;
}
@media (max-width: 720px) {
  .finished-product-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

.finished-product-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.finished-product-info strong,
.finished-product-info small {
  display: block;
}
.finished-product-info strong {
  color: #51405a;
  font-size: 14px;
}
.finished-product-info small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.finished-product-info small b {
  color: #6d367e;
}

.product-stock-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  color: #78438f;
  background: #f4edf7;
}

.stock-adjuster {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}
@media (max-width: 720px) {
  .stock-adjuster {
    align-self: flex-end;
  }
}

.stock-current {
  min-width: 54px;
  color: #3d2b45;
  font-size: 17px;
  text-align: center;
}

.stock-unit {
  margin-left: -4px;
  color: var(--muted);
  font-size: 12px;
}

.stock-adjust-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid #e1d6e6;
  border-radius: 8px;
  color: #69317d;
  background: #fff;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
}
.stock-adjust-button:hover {
  border-color: #e1d6e6;
  background: #faf5fc;
}
.stock-adjust-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.empty-stock {
  margin: 10px 0;
}

.production-history-card table {
  width: 100%;
}

.cashier-heading {
  margin-bottom: 21px;
}

.cashier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}
.cashier-layout .card {
  padding: 21px;
}
@media (max-width: 720px) {
  .cashier-layout {
    grid-template-columns: 1fr;
  }
}

.cashier-main-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.cashier-add-card .card-title,
.cashier-cart-card .card-title,
.cashier-sales-card .card-title {
  margin-bottom: 16px;
}
.cashier-add-card .card-title h2,
.cashier-cart-card .card-title h2,
.cashier-sales-card .card-title h2 {
  margin: 0;
  color: #3b2a43;
  font-size: 18px;
}
.cashier-add-card .card-title p,
.cashier-cart-card .card-title p,
.cashier-sales-card .card-title p {
  margin: 3px 0 0;
  font-size: 12px;
}

.cashier-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px auto;
  align-items: end;
  gap: 12px;
}
.cashier-add-form .field {
  margin: 0;
}
.cashier-add-form .field label {
  display: block;
  margin-bottom: 6px;
}
.cashier-add-form select,
.cashier-add-form input:not([type=submit]) {
  width: 100%;
}
.cashier-add-form > input[type=submit] {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .cashier-add-form {
    grid-template-columns: minmax(0, 1fr) 150px;
  }
  .cashier-add-form > input[type=submit] {
    grid-column: 1/-1;
    width: 100%;
  }
}
@media (max-width: 560px) {
  .cashier-add-form {
    grid-template-columns: 1fr;
  }
  .cashier-add-form > input[type=submit] {
    grid-column: 1;
  }
}

.cashier-stepper {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 136px;
  border: 1px solid #cfd9ea;
  border-radius: 10px;
  background: white;
  overflow: hidden;
}
.cashier-stepper:focus-within {
  border-color: #713583;
  box-shadow: 0 0 0 3px rgba(113, 53, 131, 0.13);
}
.cashier-stepper button {
  flex: 0 0 38px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #faf5fc;
  color: #69317d;
  font-size: 21px;
  font-weight: 500;
  cursor: pointer;
}
.cashier-stepper button:hover {
  background: #f2e9f5;
}
.cashier-stepper input {
  width: 100%;
  min-width: 46px;
  min-height: 42px;
  padding: 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.cashier-stepper input:focus {
  outline: none;
  border: 0;
}
.cashier-stepper input::-webkit-inner-spin-button, .cashier-stepper input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.cashier-stepper input {
  appearance: textfield;
}

.cashier-row-qty {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.cashier-row-qty .cashier-stepper {
  width: 136px;
}
.cashier-row-qty .cashier-stepper button {
  flex-basis: 34px;
  min-height: 36px;
}
.cashier-row-qty .cashier-stepper input {
  min-height: 36px;
}
.cashier-row-qty .cashier-save-qty {
  min-height: 36px;
  padding: 5px 8px;
  font-size: 11px;
}
.cashier-row-qty--auto .cashier-save-qty {
  display: none;
}

.cashier-cart-table {
  width: 100%;
  min-width: 650px;
}
.cashier-cart-table td:first-child {
  min-width: 170px;
}
.cashier-cart-table td {
  vertical-align: middle;
}

.remove-cart-item {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: #b74c58;
  text-decoration: none;
  font-size: 19px;
}
.remove-cart-item:hover {
  color: #a13241;
  background: #fff0f1;
}

.clear-cart-link {
  font-size: 12px;
  text-decoration: none;
}

.cashier-checkout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.85fr);
  gap: 18px;
  align-items: end;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid #eee7f0;
}
.cashier-checkout > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.cashier-checkout > div strong {
  color: #69317d;
  font-size: 25px;
}
@media (max-width: 1000px) {
  .cashier-checkout {
    grid-template-columns: 1fr;
  }
}

.cashier-checkout-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.cashier-checkout-form .field {
  margin: 0;
}
.cashier-checkout-form .field label {
  display: block;
  margin-bottom: 6px;
}
.cashier-checkout-form input:not([type=submit]) {
  width: 100%;
}
@media (max-width: 720px) {
  .cashier-checkout-form {
    grid-template-columns: 1fr;
  }
}

.cashier-empty {
  display: grid;
  justify-items: center;
  padding: 25px 12px 31px;
  text-align: center;
}
.cashier-empty strong {
  color: #51405a;
}
.cashier-empty p {
  margin: 4px 0 0;
  font-size: 12px;
}

.empty-cart-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 11px;
  border-radius: 13px;
  background: #f4edf7;
  color: #78438f;
  font-size: 23px;
}

.cashier-sales-card {
  margin-top: 20px;
  padding: 21px;
}

.cashier-export-panel {
  margin: 0 0 20px;
  padding: 20px;
  border: 1px solid #cad9f7;
  border-radius: 12px;
  background: linear-gradient(135deg, #f6f0f8 0%, #fcfafd 75%);
  box-shadow: inset 3px 0 #713583;
}
.cashier-export-panel[hidden] {
  display: none;
}

.cashier-export-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.cashier-export-heading strong {
  color: #3b2a43;
  font-size: 15px;
}
.cashier-export-heading p {
  margin: 3px 0 0;
  color: #7b7081;
  font-size: 12px;
}

.cashier-export-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f4edf7;
  color: #78438f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cashier-export-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 15px;
}
.cashier-export-presets button {
  min-height: 34px;
  padding: 5px 13px;
  border: 1px solid #d6e0f1;
  border-radius: 8px;
  background: white;
  color: #415579;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.cashier-export-presets button:hover, .cashier-export-presets button.active {
  border-color: #78438f;
  background: #f4edf7;
  color: #69317d;
}

.cashier-export-form {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 200px) auto;
  align-items: end;
  gap: 12px;
}
.cashier-export-form .field {
  margin: 0;
}
.cashier-export-form .field label {
  display: block;
  margin-bottom: 6px;
}
.cashier-export-form .field input {
  width: 100%;
  background: #fff;
}
@media (max-width: 720px) {
  .cashier-export-form {
    grid-template-columns: 1fr 1fr;
  }
  .cashier-export-form button[type=submit] {
    grid-column: 1/-1;
  }
}
@media (max-width: 560px) {
  .cashier-export-form {
    grid-template-columns: 1fr;
  }
  .cashier-export-form button[type=submit] {
    grid-column: 1;
  }
}

.cashier-no-sales {
  margin: 5px 0;
}

.cashier-sales-table {
  width: 100%;
}

.select2-container {
  min-width: 0;
}
.select2-container .select2-selection--single {
  width: 100%;
}

.analytics-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.analytics-filter .analytics-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.analytics-filter .analytics-range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #7b7081;
}
.analytics-filter .analytics-range input {
  width: 220px;
  cursor: pointer;
}
@media (max-width: 720px) {
  .analytics-filter .analytics-range input {
    width: 100%;
  }
}

.admin-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.admin-users {
  padding: 0;
  overflow: visible;
}

.admin-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e8edf5;
}
.admin-filters select,
.admin-filters .search-field {
  min-width: 200px;
}
@media (max-width: 720px) {
  .admin-filters select,
  .admin-filters .search-field {
    flex: 1 1 100%;
  }
}

.admin-filters__label {
  color: #76849a;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-grid .user-row[hidden] {
  display: none;
}

.admin-person {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-person small {
  display: block;
  color: #95a2b2;
  font-size: 11px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4edf7;
  color: #78438f;
  font-weight: 500;
}

.admin-role {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f2f5fa;
  color: #5b6a82;
  font-size: 11px;
  font-weight: 500;
}
.admin-role--admin {
  background: #f4edf7;
  color: #78438f;
}

.admin-empty {
  padding: 32px 13px;
  text-align: center;
  color: #95a2b2;
}

.admin-actions-cell {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

.admin-menu-wrap {
  position: relative;
  display: inline-block;
}

.admin-menu {
  display: none;
  position: fixed;
  z-index: 200;
  min-width: 210px;
  padding: 6px;
  border: 1px solid #dfe6f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(43, 20, 53, 0.16);
  text-align: left;
}
.is-open > .admin-menu {
  display: block;
}

.admin-menu__item {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3b2a43;
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.admin-menu__item:hover {
  background: #f2f5fa;
}
.admin-menu__item.is-danger {
  color: #b9515d;
}

.admin-menu__divider {
  height: 1px;
  margin: 5px 0;
  background: #e8edf5;
}

@media (max-width: 720px) {
  .admin-grid thead {
    display: none;
  }
  .admin-grid,
  .admin-grid tbody,
  .admin-grid tr,
  .admin-grid td {
    display: block;
  }
  .admin-grid tr {
    padding: 10px 0;
    border-bottom: 1px solid #e8edf5;
  }
  .admin-grid td {
    border: 0;
    padding: 5px 16px;
  }
  .admin-grid td[data-label]:not([data-label=Jméno]):not([data-label=Akce])::before {
    content: attr(data-label) ": ";
    color: #95a2b2;
  }
  .admin-actions-cell {
    width: auto;
  }
}
.qrLabel {
  text-align: center;
  padding: 20px;
}
.qrLabel canvas {
  margin: 0 auto;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: #713583;
}

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

button, .btn {
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
button:hover, .btn:hover {
  filter: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(113, 53, 131, 0.3);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
}
@media (max-width: 1000px) {
  .app-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 25px 14px 18px;
  color: #fff;
  background: linear-gradient(175deg, #57246a 0%, #3d194e 58%, #281137 100%);
  box-shadow: 7px 0 28px rgba(49, 24, 61, 0.12);
  z-index: 20;
}
@media (max-width: 720px) {
  .app-sidebar {
    position: relative;
    height: auto;
    padding: 12px;
  }
}

.sidebar-brand .brand-mark {
  width: 46px;
  height: 46px;
  display: block;
  flex: none;
  border-radius: 50%;
  object-fit: contain;
  background: transparent;
}
.sidebar-brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.sidebar-brand small {
  display: block;
  color: #d5bfde;
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px 32px;
  color: white;
  text-decoration: none;
}
.sidebar-brand:hover {
  color: white;
}
@media (max-width: 720px) {
  .sidebar-brand {
    padding: 2px 4px 12px;
  }
}

.sidebar-caption {
  padding: 4px 17px 10px;
  color: #c0a0ce;
  font-size: 10px;
  letter-spacing: 0.13em;
  font-weight: 800;
}
@media (max-width: 720px) {
  .sidebar-caption {
    display: none;
  }
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 9px;
  color: #eee4f2;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.sidebar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.sidebar-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 3px 0 #e2b2ef;
}
@media (max-width: 720px) {
  .sidebar-nav a {
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 12px;
  }
}
@media (max-width: 720px) {
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    gap: 5px;
  }
}

.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  font-size: 17px;
  line-height: 1;
}
@media (max-width: 720px) {
  .nav-icon {
    font-size: 15px;
    width: 20px;
  }
}

.nav-icon svg,
.recipe-mark svg,
.material-icon svg,
.product-stock-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.recipe-mark svg,
.material-icon svg,
.product-stock-icon svg {
  width: 19px;
  height: 19px;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 17px 11px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.sidebar-bottom strong, .sidebar-bottom small {
  display: block;
  line-height: 1.3;
}
.sidebar-bottom strong {
  font-size: 12px;
}
.sidebar-bottom small {
  color: #d1b7dc;
  font-size: 11px;
}
@media (max-width: 720px) {
  .sidebar-bottom {
    display: none;
  }
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #80529a;
  color: white;
  font-weight: 500;
}

.app-main {
  min-width: 0;
}

header.topbar {
  height: 68px;
  padding: 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: #fff;
  box-shadow: none;
}
@media (max-width: 1000px) {
  header.topbar {
    padding: 0 22px;
  }
}
@media (max-width: 720px) {
  header.topbar {
    height: 54px;
    padding: 0 15px;
  }
}

.topbar-label {
  color: #713583;
  font-weight: 500;
  font-size: 14px;
}
.topbar-label span {
  color: #b4becf;
  padding: 0 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.topbar-user {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 720px) {
  .topbar-user {
    display: none;
  }
}

.logout-link {
  border: 1px solid #e1d6e6;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: #713583;
  font-size: 13px;
  font-weight: 500;
}
.logout-link:hover {
  background: #faf5fc;
}

main.app-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 36px 80px;
}
@media (max-width: 1000px) {
  main.app-content {
    padding: 28px 22px 65px;
  }
}
@media (max-width: 720px) {
  main.app-content {
    padding: 24px 15px 55px;
  }
}

.page-heading {
  margin-bottom: 25px;
}
.page-heading h1 {
  color: #3b2a43;
  font-size: 32px;
  font-weight: 750;
  letter-spacing: -0.035em;
}
.page-heading .muted {
  font-size: 14px;
}
@media (max-width: 720px) {
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.eyebrow {
  color: #713583;
  font-size: 11px;
  letter-spacing: 0.11em;
}

.page-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .page-actions {
    width: 100%;
  }
  .page-actions .btn {
    flex: 1;
  }
}

.card {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(58, 35, 67, 0.045);
}
.card h3 {
  color: #3d2b45;
  font-size: 17px;
  font-weight: 500;
}

.card-title h2 {
  color: #3b2a43;
  font-size: 18px;
}
.card-title a {
  color: #713583;
  font-size: 13px;
}

.stat-card {
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 8px 28px rgba(58, 35, 67, 0.045);
}
.stat-card:hover {
  border-color: #e1d6e6;
  transform: translateY(-2px);
}
.stat-card strong {
  color: #69317d;
}
.stat-card small {
  color: #713583;
}

.btn, button[type=submit], input[type=submit] {
  min-height: 39px;
  border-radius: 8px;
  border: 1px solid #713583;
  padding: 9px 16px;
  background: #713583;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}
.btn:hover, button[type=submit]:hover, input[type=submit]:hover {
  background: #59266c;
  color: white;
  transform: translateY(-1px);
}

.btn.secondary, button.secondary {
  border-color: #e1d6e6;
  background: #fff;
  color: #69317d;
}
.btn.secondary:hover, button.secondary:hover {
  background: #faf5fc;
  border-color: #e1d6e6;
  color: #69317d;
}

.btn.danger {
  background: #c94b59;
  border-color: #c94b59;
}

input, select, textarea {
  color: var(--ink);
  background: #fff;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 9px 11px;
  min-height: 40px;
}
input:focus, select:focus, textarea:focus {
  border-color: #713583;
  outline: 3px solid rgba(113, 53, 131, 0.13);
  box-shadow: none;
}

input::placeholder, textarea::placeholder {
  color: #a3adbc;
}

label {
  color: #53627b;
  font-size: 13px;
  font-weight: 650;
}

table {
  font-size: 13px;
}
table th {
  background: #f8faff;
  color: #76849a;
  letter-spacing: 0.04em;
}
table th, table td {
  padding: 12px 13px;
  border-color: #e8edf5;
}
table tr:last-child td {
  border-bottom: none;
}
table tbody tr:hover {
  background: #fbfcff;
}

.pill {
  background: #f2e9f5;
  color: #69317d;
  font-weight: 650;
}

.flash {
  border: 1px solid transparent;
  border-radius: 9px;
}
.flash.success {
  border-color: #c9eadf;
  background: #eaf8f3;
  color: #187b65;
}
.flash.error {
  border-color: #f1cbd0;
  background: #fff0f2;
  color: #b64051;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.warehouse-heading {
  align-items: end;
}

.warehouse-toolbar {
  padding: 15px;
  margin-bottom: 24px;
}

.category-nav {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.category-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex: none;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: #5b6881;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.category-pill:hover, .category-pill.active {
  background: #f2e9f5;
  color: #69317d;
}
.category-pill span {
  padding: 1px 6px;
  border-radius: 10px;
  color: #78438f;
  background: #f2f5fd;
  font-size: 11px;
}

.warehouse-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}
@media (max-width: 720px) {
  .warehouse-tools {
    flex-wrap: wrap;
  }
  .warehouse-tools .btn {
    width: 100%;
  }
}

.search-field {
  flex: 1;
  max-width: 390px;
  margin: 0;
}
.search-field input {
  width: 100%;
  padding-left: 35px;
  background: #f9fbfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238091aa' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E") no-repeat 11px center;
}
@media (max-width: 720px) {
  .search-field {
    max-width: none;
    width: 100%;
  }
}

.warehouse-categories {
  display: grid;
  gap: 23px;
  margin-bottom: 25px;
}

.category-section {
  scroll-margin-top: 20px;
}
.category-section[hidden] {
  display: none;
}

.delete-button {
  color: #b74c58;
}
.delete-button:hover {
  color: #fff;
  background: #c94b59;
  border-color: #c94b59;
}

.category-admin-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 720px) {
  .category-admin-grid {
    grid-template-columns: 1fr;
  }
}

.category-create-card, .category-list-card {
  padding: 22px;
}
.category-create-card .card-title, .category-list-card .card-title {
  margin: 0 0 18px;
}
.category-create-card .card-title h2, .category-list-card .card-title h2 {
  margin: 0;
  font-size: 17px;
}
.category-create-card .card-title p, .category-list-card .card-title p {
  margin: 4px 0 0;
  font-size: 12px;
}

.category-create-form .field {
  margin-bottom: 13px;
}
.category-create-form .field input {
  width: 100%;
}

.category-admin-list {
  display: grid;
}

.category-admin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eee7f0;
}
.category-admin-row:last-child {
  border-bottom: 0;
}

.category-admin-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f4edf7;
  color: #78438f;
}

.category-admin-name {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}
.category-admin-name strong {
  color: #51405a;
  font-size: 13px;
}
.category-admin-name small {
  color: var(--muted);
  font-size: 11px;
}

.confirm-copy {
  margin: 22px 28px 4px;
  color: #52617b;
  font-size: 14px;
}

.danger {
  background: #c94b59 !important;
  border-color: #c94b59 !important;
  color: #fff !important;
}

.stand-toast-container {
  position: fixed;
  right: 24px;
  top: 20px;
  bottom: auto;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.app-authenticated .stand-toast-container {
  top: 84px;
}

@media (max-width: 720px) {
  .app-authenticated .stand-toast-container {
    top: 180px;
    right: 14px;
  }
}
.stand-toast {
  min-width: 240px;
  max-width: 380px;
  padding: 12px 18px;
  border-radius: 9px;
  color: #fff;
  background: #1f2933;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  font-size: 13px;
  animation: standToastIn 0.25s ease;
  pointer-events: auto;
}
.stand-toast--success {
  background: #146c43;
}
.stand-toast--error {
  background: #c13b38;
}
.stand-toast--warning {
  background: #a75b0b;
}
.stand-toast--info {
  background: #713583;
}
.stand-toast--leaving {
  animation: standToastOut 0.25s ease forwards;
}

@keyframes standToastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes standToastOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}
.analytics-section {
  margin: 28px 0;
}
.analytics-section > .section-heading {
  padding: 0 2px 12px;
}
.analytics-section .eyebrow {
  margin: 0 0 3px;
}
.analytics-section h2 {
  margin: 0;
  color: #3b2a43;
  font-size: 21px;
}
.analytics-section .section-heading p:last-child {
  margin: 4px 0 0;
  font-size: 12px;
}

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

.analytics-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.analytics-dashboard-grid .analytics-wide {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  .analytics-dashboard-grid .analytics-wide {
    grid-column: auto;
  }
}
.analytics-dashboard-grid .analytics-card .card-title h2 {
  margin: 0;
  font-size: 16px;
}
.analytics-dashboard-grid .analytics-card .card-title p {
  margin: 3px 0 0;
  font-size: 11px;
}
@media (max-width: 760px) {
  .analytics-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-page-heading .btn {
  flex: none;
}

.analytics-summary {
  margin-bottom: 18px;
}
.analytics-summary .stat-card {
  min-height: 125px;
}

.analytics-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  width: 100%;
  height: 120px;
}
.analytics-bar-group .analytics-bar {
  display: block;
  width: min(30%, 8px);
  min-height: 2px;
}

.analytics-tip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #1f2933;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25);
}
.analytics-tip span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.analytics-tip i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.series-candles {
  background: #78438f !important;
}

.series-floating {
  background: #e2a34a !important;
}

.series-workshops {
  background: #46a58e !important;
}

.analytics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: #77849a;
  font-size: 10px;
}
.analytics-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.analytics-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

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

.top-product-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.75fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 14px;
}
@media (max-width: 760px) {
  .top-product-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.top-product-label {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  min-width: 0;
}
.top-product-label strong {
  overflow: hidden;
  color: #34445f;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-product-label span {
  flex: none;
  color: #7c899d;
  font-size: 11px;
}

.top-product-track {
  height: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: #eef2f8;
}
.top-product-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #78438f;
}

.analytics-card {
  min-width: 0;
  padding: 17px;
}
.analytics-card .card-title {
  margin: 0 0 14px;
}
.analytics-card .card-title h3 {
  margin: 0;
  font-size: 14px;
}
.analytics-card .card-title span {
  color: var(--muted);
  font-size: 11px;
}

.analytics-chart {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.analytics-scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 142px;
  color: #8490a3;
  font-size: 10px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.analytics-bars {
  display: grid;
  grid-template-columns: repeat(var(--days, 14), minmax(0, 1fr));
  grid-auto-rows: 100%;
  align-items: end;
  gap: 2px;
  height: 142px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e6ebf3;
  background: linear-gradient(#eef1f6 1px, transparent 1px) 0 0/100% 50% repeat-y;
}

.analytics-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.analytics-column:hover {
  background: rgba(120, 67, 143, 0.07);
}
.analytics-column:hover .analytics-tip {
  display: flex;
}
.analytics-column small {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 4px;
  transform: translateX(-50%);
  color: #8490a3;
  font-size: 8px;
  white-space: nowrap;
}

.analytics-bar {
  width: min(100%, 15px);
  height: max(3px, var(--bar-height));
  border-radius: 4px 4px 0 0;
  background: #78438f;
}

.candle-bars .analytics-bar {
  background: #e2a34a;
}

.floating-bars .analytics-bar {
  background: #46a58e;
}

.analytics-combo-chart {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.analytics-scale-right {
  padding-left: 8px;
  text-align: left;
}

.analytics-combo {
  position: relative;
  gap: 0;
}
.analytics-combo .analytics-bar {
  width: min(60%, 26px);
}

.analytics-line {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.analytics-line polyline {
  fill: none;
  stroke: #e2a34a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.analytics-line-dot {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  margin: 0 0 -4px -4px;
  border: 2px solid #e2a34a;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

.series-line {
  background: #e2a34a !important;
}

.analytics-legend .series-line {
  height: 3px;
  border-radius: 2px;
}

.recipe-heading {
  align-items: end;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.recipe-card {
  min-width: 0;
  padding: 20px;
}
.recipe-card h2 {
  margin: 14px 0;
  color: #3d2b45;
  font-size: 19px;
}

.recipe-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 7px;
  border-radius: 9px;
  color: #78438f;
  background: #f4edf7;
}

.recipe-price {
  color: #69317d;
  font-size: 15px;
  font-weight: 750;
}
.recipe-price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.recipe-ingredients {
  border-top: 1px solid #edf0f5;
}

.recipe-ingredient {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f7;
  color: #58667d;
  font-size: 12px;
}
.recipe-ingredient strong {
  color: #51405a;
  white-space: nowrap;
}

.recipe-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}
.recipe-actions .btn {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 12px;
}
.recipe-actions .delete-button {
  margin-left: auto;
}

.recipe-form textarea {
  width: 100%;
  min-height: 135px;
  resize: vertical;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: #8a96a8;
  font-size: 11px;
}

.empty-state {
  padding: 45px;
  text-align: center;
}
.empty-state h2 {
  margin-top: 0;
  color: #3d2b45;
  font-size: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 12px;
}
.section-heading h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  color: #3b2a43;
}
.section-heading p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.material-list {
  display: grid;
  gap: 7px;
  min-height: 20px;
}
.material-list:empty {
  min-height: 62px;
  border: 1px dashed #cad5eb;
  border-radius: 11px;
  background: #fafcff;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 3px 13px rgba(31, 54, 106, 0.035);
}
.material-item[hidden] {
  display: none;
}
.material-item:hover {
  border-color: #c8d6ef;
}
@media (max-width: 520px) {
  .material-item {
    gap: 8px;
    padding: 9px;
  }
}

.drag-handle {
  border: 0;
  background: transparent;
  color: #9aa8bf;
  padding: 3px 5px;
  cursor: grab;
  line-height: 1;
  font-size: 17px;
  letter-spacing: -4px;
}
.drag-handle:active {
  cursor: grabbing;
}
@media (max-width: 520px) {
  .drag-handle {
    padding: 2px;
  }
}

.material-ghost {
  opacity: 0.5;
  background: #faf5fc;
}

.material-icon {
  width: 37px;
  height: 37px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #f4edf7;
  color: #78438f;
  font-size: 18px;
}
@media (max-width: 520px) {
  .material-icon {
    display: none;
  }
}

.material-info {
  min-width: 0;
  flex: 1;
}
.material-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #263754;
  font-size: 13px;
  font-weight: 500;
}
.material-info span {
  color: #8190a5;
  font-size: 11px;
}

.material-stock {
  min-width: 115px;
  text-align: right;
}
.material-stock strong {
  display: block;
  color: #6d367e;
  font-size: 15px;
  line-height: 1.2;
}
.material-stock strong.danger-text {
  color: var(--danger);
}
@media (max-width: 520px) {
  .material-stock strong {
    font-size: 13px;
  }
}
.material-stock small {
  color: #8a96a8;
  font-size: 11px;
}
@media (max-width: 520px) {
  .material-stock {
    min-width: 72px;
  }
}

.material-actions {
  display: flex;
  gap: 5px;
  margin-left: 4px;
}
@media (max-width: 520px) {
  .material-actions {
    gap: 3px;
    margin-left: 0;
  }
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #e0e7f2;
  border-radius: 8px;
  background: #f9fbff;
  color: #713583;
  font-size: 18px;
  cursor: pointer;
}
.icon-button:hover {
  background: #f2e9f5;
  border-color: #e1d6e6;
}
@media (max-width: 520px) {
  .icon-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
  }
}

.movements-preview .card-title {
  margin-bottom: 18px;
}
.movements-preview .card-title p {
  margin: 3px 0 0;
  font-size: 12px;
}

.status-pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.status-pill.positive {
  color: #0b8464;
  background: #e5f7ef;
}
.status-pill.negative {
  color: #b9515d;
  background: #fff0f1;
}

.table-sub {
  display: block;
  color: #95a2b2;
  font-size: 11px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.app-modal {
  width: min(520px, 100vw - 28px);
  max-height: min(90vh, 850px);
  overflow: visible;
  padding: 0;
  border: 1px solid #dfe6f1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(43, 20, 53, 0.2);
  color: var(--ink);
}
.app-modal::backdrop {
  background: rgba(37, 16, 46, 0.55);
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 17px;
  border-bottom: 1px solid #eee7f0;
}
.modal-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
  color: #3b2a43;
}
.modal-head .eyebrow {
  margin: 0;
}
@media (max-width: 520px) {
  .modal-head {
    padding: 19px 20px 14px;
  }
}

.modal-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: #f2f5fa;
  color: #71809a;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  background: #e8eef8;
}

.modal-form {
  max-height: calc(90vh - 100px);
  overflow-y: auto;
  overflow-x: visible;
  padding: 23px 28px 27px;
}
@media (max-width: 520px) {
  .modal-form {
    padding: 19px 20px 24px;
  }
}

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  margin-bottom: 7px;
}
.field input:not([type=radio]), .field select, .field textarea {
  width: 100%;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  padding-top: 5px;
}

.form-errors {
  padding: 10px 13px;
  margin-bottom: 16px;
  border: 1px solid #f0c5cc;
  border-radius: 8px;
  color: #b84454;
  background: #fff1f3;
  font-size: 13px;
}
.form-errors p {
  margin: 0 0 3px;
}
.form-errors p:last-child {
  margin-bottom: 0;
}

.radio-pills {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.radio-pills label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  border: 1px solid #dce4f1;
  border-radius: 8px;
  cursor: pointer;
  color: #536682;
}
.radio-pills label:has(input:checked) {
  color: #69317d;
  border-color: #78438f;
  background: #f4edf7;
}
.radio-pills input {
  width: auto;
  min-height: 0;
  accent-color: #713583;
}

.select2-container .select2-selection--single {
  height: 41px !important;
  border: 1px solid #d6deea !important;
  border-radius: 8px !important;
}
.select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 39px !important;
  padding-left: 12px !important;
  color: #263754 !important;
}
.select2-container .select2-selection--single .select2-selection__arrow {
  height: 39px !important;
  right: 8px !important;
}

.select2-dropdown {
  border: 1px solid #cdd9ea !important;
  border-radius: 8px !important;
  box-shadow: 0 9px 22px rgba(20, 42, 91, 0.12);
}

.select2-container--open {
  z-index: 2147483647 !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: #713583 !important;
}

.label-preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 24px 28px 10px;
  padding: 25px;
  border: 1px dashed #bcc9e0;
  border-radius: 11px;
  background: #fcfdff;
  text-align: center;
}
.label-preview img {
  display: block;
}
.label-preview strong {
  font-size: 17px;
}
.label-preview span {
  color: var(--muted);
}

.label-modal .modal-footer {
  padding: 12px 28px 27px;
}

.auth-main {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}
.auth-main > .flash {
  position: fixed;
  top: 16px;
  right: 16px;
  left: auto;
  z-index: 10;
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: white;
}
@media (max-width: 720px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
}

.login-form-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px 36px;
}
@media (max-width: 720px) {
  .login-form-panel {
    padding: 30px 24px 55px;
    min-height: 100vh;
  }
}

.login-box {
  width: min(100%, 440px);
}
.login-box .eyebrow {
  margin-bottom: 12px !important;
}
.login-box h1 {
  font-size: 34px;
  margin: 0 0 10px;
  color: #3b2a43;
  letter-spacing: -0.035em;
}

.login-intro {
  margin: 0 0 33px;
  color: #8290a4;
  font-size: 14px;
}

.login-form .field {
  margin-bottom: 23px;
}
.login-form .field label {
  color: #4e5d75;
  font-size: 13px;
}
.login-form .field input {
  width: 100%;
  height: 46px;
}

.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 89px;
}
.password-wrap button {
  position: absolute;
  top: 5px;
  right: 5px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #713583;
  font-size: 12px;
  cursor: pointer;
}
.password-wrap button:hover {
  color: #713583;
  background: #f1f5fd;
}

.login-submit {
  width: 100%;
  height: 47px;
  justify-content: space-between;
  padding: 0 17px;
  background: #713583;
}
.login-submit span {
  font-size: 20px;
  font-weight: 400;
}

.login-foot {
  color: #a1adbc;
  margin: 25px 0 0;
  font-size: 12px;
}

.login-brand-panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: white;
  background: linear-gradient(140deg, #69317d 0%, #47205c 48%, #291238 100%);
}
.login-brand-panel::before, .login-brand-panel::after {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}
.login-brand-panel::before {
  left: -310px;
  top: -330px;
}
.login-brand-panel::after {
  right: -340px;
  bottom: -380px;
}
@media (max-width: 720px) {
  .login-brand-panel {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    min-height: 0;
    width: auto;
    overflow: visible;
    background: transparent;
    pointer-events: none;
  }
  .login-brand-panel::before, .login-brand-panel::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .login-brand-panel .login-brand-content {
    padding: 0;
  }
  .login-brand-panel .login-brand-content > p,
  .login-brand-panel .login-brand-content h2 {
    display: none;
  }
  .login-brand-panel .login-brand-logo {
    width: clamp(72px, 20vw, 94px);
    margin: 0;
  }
}
.login-brand-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 520px;
  padding: 40px;
}
.login-brand-content h2 {
  margin: 8px 0 14px;
  font-size: clamp(28px, 3vw, 43px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.login-brand-content > p:last-child {
  margin: 0;
  color: #eadbef;
  font-size: 14px;
}

.login-brand-logo {
  display: block;
  width: clamp(150px, 15vw, 210px);
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 12px 24px rgba(20, 8, 28, 0.2));
}

.login-brand-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.17em;
  color: #e6c5ef;
}

@media print {
  .app-sidebar, header.topbar, .no-print {
    display: none !important;
  }
  .app-shell {
    display: block;
  }
  main.app-content {
    max-width: none;
    padding: 0;
  }
  .app-modal:not(#labelModal):not(#recipeLabelModal) {
    display: none !important;
  }
  body:has(#labelModal[open]) .app-shell {
    display: block;
  }
  body:has(#labelModal[open]) .app-content > :not(#labelModal) {
    display: none !important;
  }
  body:has(#labelModal[open]) #labelModal {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
  }
  body:has(#labelModal[open]) #labelModal .modal-head,
  body:has(#labelModal[open]) #labelModal .modal-footer {
    display: none;
  }
  body:has(#recipeLabelModal[open]) .app-shell {
    display: block;
  }
  body:has(#recipeLabelModal[open]) .app-content > :not(#recipeLabelModal) {
    display: none !important;
  }
  body:has(#recipeLabelModal[open]) #recipeLabelModal {
    position: static;
    display: block;
    width: 100%;
    max-height: none;
    border: 0;
    box-shadow: none;
  }
  body:has(#recipeLabelModal[open]) #recipeLabelModal .modal-head,
  body:has(#recipeLabelModal[open]) #recipeLabelModal .modal-footer {
    display: none;
  }
}

.quick-stock { display: flex; align-items: center; gap: 4px; }
.quick-stock input { width: 64px; height: 34px; padding: 0 6px; text-align: center; border: 1px solid #e0e7f2; border-radius: 8px; }
@media (max-width: 520px) { .quick-stock input { width: 48px; height: 30px; } }
