:root {
  --accent: #b71c1c;
  --accent-dark: #791212;
  --accent-soft: #ffebeb;
  --text: #202327;
  --muted: #656b73;
  --line: #e4e7eb;
  --panel: #ffffff;
  --bg: #f7f8fa;
  --danger: #c62828;
  --ok: #2e7d32;
  --warn: #f9a825;
  color-scheme: light;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* { box-sizing: border-box; letter-spacing: 0; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button, input, select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  padding: 10px 16px;
  line-height: 1.35;
  transition: background-color .15s, border-color .15s;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
  border-top: 4px solid #b71c1c;
}

.login-layout { width: min(420px, 100%); }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h1 { margin: 12px 0 8px; font-size: 27px; line-height: 1.25; font-weight: 650; }
.login-brand p { color: var(--muted); font-size: 15px; margin: 0; }
.login-heading h2 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.login-heading p { text-align: left; font-size: 14px; margin: 0; color: var(--muted); }
.login-card .field label { font-weight: 600; font-size: 14px; }
.login-card input { min-height: 52px; background: #fcfcfd; border-color: #d9dde2; }
.login-card input:focus { background: #fff; border-color: #b71c1c; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 13px; margin: 20px 0 0; }
.login-footer svg { width: 15px; height: 15px; flex: 0 0 15px; }
.password-control { position: relative; }
.password-control input { padding-right: 56px; }
.password-toggle { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; padding: 12px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: #f0f1f3; }
.password-toggle svg { width: 20px; height: 20px; display: block; }
.login-card .login-submit { background: #b71c1c; min-height: 50px; margin-top: 4px; }

.login-card {
  width: 100%;
  display: grid;
  gap: 22px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(25,28,31,.035);
  background: #fff;
}

.login-logo {
  width: 112px;
  height: 112px;
  justify-self: center;
  border-radius: 8px;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 650;
}

.login-card p {
  margin: 0 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.login-card .login-heading p { text-align: left; margin: 0; font-size: 14px; }

@media (max-width: 440px) {
  .login-brand h1 { font-size: 25px; }
  .login-screen { padding: 24px 18px; }
  .login-brand { margin-bottom: 22px; }
  .login-logo { width: 96px; height: 96px; }
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.secondary:hover, .ghost:hover, .icon-button:hover, .stock-switch:hover {
  background: #f1f3f5;
}

.primary:hover { filter: brightness(.94); }

.header-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 44px;
}

.stock-switch svg { width: 20px; height: 20px; }

input, select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline-color: var(--accent);
}

.primary {
  color: #fff;
  background: var(--accent-dark);
}

.secondary {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary svg,
.primary svg,
.danger svg {
  width: 20px;
  height: 20px;
}

.ghost {
  background: transparent;
  color: inherit;
}

.danger {
  background: var(--danger);
  color: #fff;
}

.icon-button {
  width: 50px;
  min-width: 50px;
  height: 50px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 10px;
}

.dark-icon {
  color: var(--text);
}

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

.topbar {
  background: #fff;
  color: var(--text);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
  padding: max(16px, env(safe-area-inset-top)) max(20px, calc((100vw - 1180px) / 2)) 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.brand-row {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.stock-switch {
  width: 42px;
  min-width: 42px;
  height: 42px;
  background: transparent;
  color: var(--accent-dark);
  padding: 10px;
  font-size: 22px;
}

.titles {
  min-width: 0;
}

.titles h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.3;
}

.titles p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-date {
  max-width: 260px;
  padding: 8px 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions svg {
  width: 22px;
  height: 22px;
}

.tabs {
  overflow-x: auto;
  display: flex;
  gap: 16px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab {
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 14px 8px;
  white-space: nowrap;
  font-size: 16px;
}

.tab.active {
  color: var(--accent-dark);
  background: transparent;
  border-bottom-color: var(--accent);
}

.content {
  min-width: 0;
  padding: 28px 20px;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.export-button,
.compact-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(14px, 2vw, 18px);
  box-shadow: none;
}

.panel + .panel,
.card + .card {
  margin-top: 0;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar > * {
  flex: 1 1 190px;
}

.panel.toolbar {
  padding: 0;
  margin: 0 0 20px;
  border: 0;
  background: transparent;
  border-radius: 0;
}

.search-field {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input { padding-left: 43px; }

.toolbar .compact-action { flex: 0 1 auto; }

.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

.actions-row button {
  flex: 1 1 160px;
}

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

.card-head {
  display: flex;
  align-items: start;
  gap: 10px;
}

.card-title {
  flex: 1;
  min-width: 0;
}

.stock-quantity {
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--muted);
  padding-left: 16px;
  border-left: 1px solid var(--line);
  min-width: 76px;
  max-width: 120px;
  overflow-wrap: anywhere;
}

.stock-quantity strong { font-size: 26px; font-weight: 650; color: var(--text); line-height: 1.3; }
.stock-quantity .stock-quantity-label { font-size: 13px; }
.stock-quantity.is-empty strong { font-size: 15px; color: var(--danger); }
.card .actions-row:empty { display: none; }
.stock-people { padding-top: 8px; border-top: 1px solid #f0f1f3; }
.card p { margin: 6px 0; }
.card .meta { margin-top: 6px; }
.list > .card { min-width: 0; }
.card-head .badge { flex: 0 0 auto; max-width: 40%; overflow-wrap: anywhere; }
.section-title p:empty { display: none; }

.content > .panel:has(> .list) {
  padding: 0;
  border: 0;
  background: transparent;
}

.content > .panel:has(> .list) > h3 {
  padding: 12px 0 8px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  font-weight: 600;
}

.card-title h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.stock-people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.stock-people span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #f4f5f7;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.stock-people strong {
  margin-right: 4px;
  color: var(--accent-dark);
}

.qty {
  font-weight: 650;
  font-size: 17px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

.badge.ok { background: #e8f5e9; color: var(--ok); }
.badge.warn { background: #fff8e1; color: #8a5a00; }
.badge.danger { background: #ffebee; color: var(--danger); }
.badge.empty { background: var(--accent-dark); color: #fff; }

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 30;
}

.modal {
  width: min(820px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: clamp(18px, 3vw, 26px);
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}

.modal h2 {
  margin: 0 0 6px;
}

.modal-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.settings-section,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 14px;
  margin-top: 12px;
}

.settings-grid { display: block; }
.settings-card { border: 0; border-bottom: 1px solid var(--line); padding: 20px 0; }
.settings-card:first-child { padding-top: 4px; }
.settings-card:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-card h3 { font-size: 17px; font-weight: 600; }
.settings-card .settings-actions { max-width: 500px; }
.settings-card .wide-button { width: auto; min-width: 180px; max-width: 100%; padding: 10px 16px; }
.settings-card .danger { background: #fff; color: var(--danger); border: 1px solid #f0d8d8; }
.settings-card .danger:hover { background: #fff6f6; }
.settings-card p { line-height: 1.5; }
.settings-card .settings-icon { background: #f4f5f7; color: var(--muted); }
.settings-card.danger-card .settings-icon { color: var(--danger); }
.settings-card.danger-card { border-color: var(--line); }
.settings-card .settings-actions button { min-height: 46px; }
.modal h2 { font-size: 22px; font-weight: 650; }
.modal .list > button { padding: 12px 16px; text-align: left; }
.production-preview { max-height: 320px; overflow: auto; }
.card-head { align-items: flex-start; }
input::placeholder { color: #757b84; }
.panel, .card, .empty { overflow-wrap: anywhere; }
.card:focus-within { border-color: #bcc2ca; }

.settings-card {
  margin-top: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  background: #fff;
  min-width: 0;
}

.settings-card > div {
  min-width: 0;
}

.account-card {
  grid-column: 1 / -1;
}

.spreadsheet-card {
  grid-column: 1 / -1;
}

.production-card {
  grid-column: 1 / -1;
}

.danger-card {
  border-color: rgba(198,40,40,.25);
}

.settings-section h3,
.settings-card h3 {
  margin: 0 0 8px;
}

.settings-section p,
.settings-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.settings-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.settings-icon svg {
  width: 24px;
  height: 24px;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  max-width: 100%;
}

.settings-actions button,
.wide-button {
  width: 100%;
}

.settings-actions button {
  min-width: 0;
  min-height: 56px;
  padding: 10px 14px;
  line-height: 1.18;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

.count-button {
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger);
  box-shadow: none;
}

.count-button:hover {
  background: #a91f1f;
  border-color: #a91f1f;
}

.date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  margin: 8px 0 12px;
}

.date-range label {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.date-range input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  background: #fff;
}

.production-actions {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  max-width: 420px;
}

.production-summary {
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.production-preview {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.production-preview table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 14px;
}

.production-preview th,
.production-preview td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.production-preview th {
  background: #fafafa;
  color: var(--text);
  font-weight: 600;
}

.production-preview tr:last-child td {
  border-bottom: 0;
}

#dashboardRoot { min-width: 0; max-width: 100%; }
.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
}
.dashboard-filters label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.dashboard-filters input, .dashboard-filters select { min-width: 0; font-size: 14px; font-weight: 400; }
.dashboard-filter-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.dashboard-exports { display: flex; gap: 8px; flex-wrap: wrap; }
.orders-shell { max-width:1280px; margin:auto; }
.orders-topbar { display:flex; align-items:center; gap:16px; padding:16px 0 24px; border-bottom:1px solid var(--line); margin-bottom:24px; flex-wrap:wrap; }
.orders-topbar img { width:48px;height:48px;object-fit:contain; }
.orders-topbar>div { flex:1;min-width:180px; }
.orders-topbar h1 { font-size:20px;margin:0 0 5px; }
.orders-topbar p { font-size:14px;margin:0;overflow-wrap:anywhere; }
.orders-search { display:flex;gap:12px;margin:24px 0; }
.store-category { margin:28px 0; }
.store-category h3 { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:14px 12px;background:#f3f4f6;border-left:3px solid var(--accent);font-size:17px; }
.store-category h3 span { font-size:13px;font-weight:400;color:var(--muted);white-space:nowrap; }
.dashboard-modes button[aria-current="page"] { color:var(--accent);border-bottom-color:var(--accent);font-weight:600; }
.orders-search input { min-width:0;flex:1; }
.orders-quantity { width:90px;min-width:70px; }
.orders-lot-dates { list-style:none;margin:10px 0 0;padding:0;font-size:13px;font-weight:400; }
.orders-lot-dates li { display:flex;flex-direction:column;gap:3px;padding:7px 0;border-top:1px solid var(--line,#e5e7eb); }
.orders-lot-dates li span:last-child { color:var(--muted); }
.orders-actions { display:flex;gap:12px;flex-wrap:wrap;margin:20px 0; }
.snapshot-table small { display:block;font-weight:400;font-size:13px;line-height:1.6;min-width:180px;margin-top:5px; }
.orders-review { border-top:2px solid var(--accent);padding:20px 0; }
.orders-review-product { margin:16px 0 24px; }
.orders-review label { display:block;font-size:14px; }
.orders-review textarea { display:block;width:100%;min-height:70px;margin:8px 0 16px; }
.orders-item { padding:18px;border:1px solid var(--line);border-radius:8px;background:white;margin:14px 0; }
.orders-item p { font-size:14px;line-height:1.5; }
.orders-item .section-title { margin:0; }
.orders-list-title { margin-top:32px;font-size:18px; }
.orders-pair-code { overflow-wrap:anywhere;user-select:all;font-family:monospace; }
.login-password-change { width:100%; margin-top:12px; font-size:14px; }
.password-modal { width:min(480px,100%); }
.password-modal label { display:block; margin:18px 0 8px; font-weight:600; font-size:14px; }
.password-modal input { width:100%; min-width:0; }
.password-modal .meta { font-size:13px; line-height:1.5; margin:8px 0; }
#passwordChangeStatus { font-size:14px; line-height:1.5; overflow-wrap:anywhere; }
.dashboard-modes { display:flex; gap:0; border-bottom:1px solid var(--line); margin:0 0 24px; }
.dashboard-modes button { background:transparent; border:0; border-bottom:3px solid transparent; border-radius:0; padding:14px 18px; font-size:15px; color:var(--muted); box-shadow:none; }
.dashboard-modes button[aria-selected="true"] { color:var(--accent); border-bottom-color:var(--accent); font-weight:600; }
.snapshot-caption { color:var(--muted); font-size:14px; margin:8px 0; }
.snapshot-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); border:1px solid var(--line); border-radius:8px; background:#fff; margin:24px 0; }
.snapshot-kpis>div { padding:20px; min-width:0; border-left:3px solid #b91c1c; }
.snapshot-kpis>div:nth-child(2) { border-left-color:#246c84; }
.snapshot-kpis>div:nth-child(3) { border-left-color:#46743b; }
.snapshot-kpis>div:nth-child(4) { border-left-color:#79539b; }
.snapshot-kpis span { display:block; color:var(--muted); font-size:14px; margin-bottom:8px; }
.snapshot-kpis strong { display:block; font-size:30px; overflow-wrap:anywhere; }
.snapshot-chart-grid,.snapshot-tables { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:32px; margin:32px 0; }
.snapshot-section { min-width:0; }
.snapshot-section h3 { font-size:17px; margin:0 0 20px; }
.snapshot-section h3 span { display:inline-block; font-weight:400; font-size:14px; color:var(--muted); margin-left:8px; }
.snapshot-bar { margin-bottom:16px; }
.snapshot-bar>div:first-child { display:flex; justify-content:space-between; align-items:baseline; gap:16px; font-size:14px; margin-bottom:7px; }
.snapshot-bar span { overflow-wrap:anywhere; }
.snapshot-bar strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.snapshot-track { height:8px; background:#e9ebee; border-radius:2px; overflow:hidden; }
.snapshot-track span { display:block; height:100%; }
.snapshot-table { overflow:auto; width:100%; border-top:1px solid var(--line); }
.snapshot-table table { width:100%; border-collapse:collapse; font-size:14px; background:white; }
.snapshot-table th,.snapshot-table td { padding:12px 10px; text-align:right; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums; }
.snapshot-table th:first-child { text-align:left; min-width:120px; }
.snapshot-table thead { color:var(--muted); background:#f3f4f6; }
@media(max-width:700px) {
  .store-category .snapshot-table { overflow:visible; }
  .store-category table,.store-category tbody { display:block; }
  .store-category thead { display:none; }
  .store-category tbody tr { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid var(--line);padding:4px 0 12px; }
  .store-category .snapshot-table th,.store-category .snapshot-table td { min-width:0;border:0;text-align:left;overflow-wrap:anywhere; }
  .store-category tbody th { grid-column:1/-1; }
  .store-category .snapshot-table small { min-width:0; }
  .store-category td:before { display:block;color:var(--muted);font-size:12px;margin-bottom:5px; }
  .store-category td:nth-child(2):before { content:'Em estoque'; }
  .store-category td:nth-child(3):before { content:'Reservado'; }
  .store-category td:nth-child(4):before { content:'Disponivel'; }
  .store-category td:last-child { grid-column:1/-1; }
  .store-category td:last-child:before { content:'Pedir'; }
  .store-category .orders-quantity { width:100%; }
}
.snapshot-expired { color:#a51e1e; background:#fff2f2; }
.snapshot-drill-trigger { display:block;width:100%;min-height:32px;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;font-weight:600;text-align:left;box-shadow:none; }
.snapshot-drill-trigger:not(:disabled):hover { text-decoration:underline;background:transparent; }
.snapshot-drill-trigger:focus-visible,.snapshot-item-link:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.snapshot-drill-trigger:disabled { opacity:.65;cursor:default; }
.snapshot-sort-trigger { display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;min-height:32px;padding:0;border:0;border-radius:0;background:transparent;color:inherit;font:inherit;font-weight:600;box-shadow:none;white-space:nowrap; }
.snapshot-sort-trigger:hover { color:var(--accent);background:transparent; }
.snapshot-sort-trigger:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }
.snapshot-sort-trigger span:last-child { font-size:16px; }
[data-snapshot-row] { cursor:pointer; }
[data-snapshot-row]:hover { outline:1px solid var(--line);outline-offset:-1px; }
.snapshot-details { margin-top:24px;padding:24px 0;border-top:1px solid var(--line);scroll-margin-top:20px; }
.snapshot-item-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px; }
.snapshot-item-link { display:flex;align-items:center;justify-content:space-between;gap:20px;min-width:0;width:100%;padding:18px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--text);text-align:left;font:inherit;box-shadow:none; }
.snapshot-item-link:hover { background:#f3f4f6; }
.snapshot-item-link>span:first-child { min-width:0;overflow-wrap:anywhere; }
.snapshot-item-link small { display:block;color:var(--muted);font-size:13px;line-height:1.6;margin-top:4px; }
.snapshot-item-quantity { flex-shrink:0;font-weight:600; }
.stock-toolbar { display:flex;gap:12px;align-items:center;margin:20px 0;min-width:0; }
.stock-toolbar .search-field { flex:1;min-width:0; }
.stock-filter-menu { position:relative;flex-shrink:0; }
.stock-filter-menu summary { display:flex;align-items:center;gap:8px;min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:white;cursor:pointer;list-style:none; }
.stock-filter-menu summary::-webkit-details-marker { display:none; }
.stock-filter-menu summary svg { width:18px;height:18px; }
.stock-filter-options { position:absolute;right:0;top:calc(100% + 8px);z-index:5;width:min(290px,calc(100vw - 40px));padding:16px;background:white;border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 18px #00000012; }
.stock-filter-options label { display:grid;gap:8px;font-size:14px;margin-bottom:14px; }
.stock-filter-options label:last-child { margin-bottom:0; }
.stock-filter-options select { width:100%;min-width:0; }
.stock-selection { display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--line);padding:0 0 16px;margin-bottom:16px;font-size:14px; }
@media(max-width:700px) { .snapshot-item-list { grid-template-columns:minmax(0,1fr); } .snapshot-item-link { gap:12px; } .snapshot-tables .snapshot-table th,.snapshot-tables .snapshot-table td { padding:10px 6px;font-size:13px; } .snapshot-tables .snapshot-table th:first-child { min-width:105px; } }
.snapshot-warning { color:#805500; background:#fff8df; }
.snapshot-quality { display:flex; gap:32px; align-items:center; border-top:1px solid var(--line); padding:24px 0; flex-wrap:wrap; }
.snapshot-quality h3 { font-size:17px; margin:0; }
.snapshot-quality span,.snapshot-quality strong { display:block; }
.snapshot-quality span { color:var(--muted); font-size:14px; margin-bottom:6px; }
.snapshot-quality strong { font-size:24px; }
@media(max-width:800px) { .snapshot-chart-grid,.snapshot-tables { grid-template-columns:minmax(0,1fr);gap:24px; } }
@media(max-width:480px) { .snapshot-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } .snapshot-kpis>div { padding:14px; } .snapshot-kpis strong { font-size:25px; } .dashboard-modes button { font-size:14px;padding:12px;flex:1; } }
.dashboard-sync { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.dashboard-sync button { padding: 4px 8px; text-decoration: underline; font-size: 14px; }
.dashboard-error { color: #9c1c1c; background: #fff1f1; border-left: 3px solid #c62828; padding: 12px; font-size: 14px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 24px 0; background: white; border: 1px solid var(--line); border-radius: 8px; }
.dashboard-metric { padding: 18px; min-width: 0; }
.dashboard-metric span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.dashboard-metric strong { display: block; font-size: 20px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.dashboard-charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin: 28px 0; }
.dashboard-charts section { min-width: 0; }
.dashboard-charts h3 { font-size: 17px; margin: 0 0 16px; font-weight: 600; }
.dashboard-charts h4 { font-size: 16px; color: var(--text); margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dashboard-bars { min-width: 0; }
.dashboard-unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.dashboard-unit { min-width: 0; }
.dashboard-timeline .dashboard-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 24px; }
.dashboard-view-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
.dashboard-checkbox { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.dashboard-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.dashboard-filters .dashboard-checkbox { display:flex;align-items:center;font-weight:400; }
.dashboard-filter-actions { flex-wrap:wrap;align-items:center; }
.dashboard-group { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.dashboard-group select { width: auto; min-width: 150px; font-size: 14px; }
.dashboard-bar { margin: 0 0 14px; }
.dashboard-bar > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 5px; }
.dashboard-track { height: 7px; background: #e9ebee; border-radius: 2px; overflow: hidden; }
.dashboard-track span { display: block; height: 100%; background: var(--accent); }
.dashboard-unit:nth-child(2) .dashboard-track span { background: #246c84; }
.dashboard-unit:nth-child(3) .dashboard-track span { background: #46743b; }
@media (max-width: 850px) { .dashboard-unit-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .dashboard-timeline .dashboard-bars { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 480px) { .dashboard-unit-grid { grid-template-columns: minmax(0,1fr); } .dashboard-group { width:100%; justify-content:space-between; } }
.dashboard-table { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); background: white; border-radius: 8px; }
.dashboard-table table { width: 100%; min-width: 1500px; border-collapse: collapse; font-size: 14px; }
.dashboard-table th, .dashboard-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dashboard-table th { background: #f1f3f5; font-weight: 600; white-space: nowrap; }
.dashboard-table tr:last-child td { border-bottom: 0; }
.dashboard-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 16px 0; font-size: 14px; }
@media (max-width: 850px) { .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-charts { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-filters { grid-template-columns: 1fr; } .dashboard-exports { width: 100%; } .dashboard-exports button { flex: 1; } .dashboard-pagination { justify-content: center; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 50;
  max-width: min(520px, calc(100vw - 28px));
  text-align: center;
  font-weight: 700;
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .top-actions {
    justify-content: flex-end;
  }

  .grid,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 22px;
  }

  .titles p {
    display: block;
    font-size: 13px;
  }

  .top-actions {
    gap: 2px;
  }

  .sync-date {
    max-width: none;
    padding: 0;
    font-size: 13px;
  }

  .icon-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }

  .section-title {
    align-items: stretch;
  }

  .section-title > div,
  .section-title .export-button {
    width: 100%;
  }

  .toolbar {
    gap: 8px;
  }

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

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

  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .brand-row { gap: 4px; }
  .header-logo { width: 36px; height: 36px; flex-basis: 36px; }
  .stock-switch { width: 32px; min-width: 32px; padding: 6px; }
  .titles h1 { font-size: 19px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 100px; }
  .top-actions .sync-date { order: 3; flex-basis: 100%; text-align: right; font-size: 12px; white-space: normal; }
  .tabs { padding: 0 16px; gap: 12px; }
  .tab { font-size: 14px; }
  .content { padding: 22px 16px; }
  .stock-quantity { min-width: 68px; max-width: 92px; padding-left: 10px; }
}

@media (max-width: 560px) {
  .count-only-actions {
    grid-template-columns: 1fr;
  }

  .date-range,
  .production-actions {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

@media (min-width: 900px) {
  .list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .panel .list,
  .modal .list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1180px) {
  body {
    font-size: 16px;
  }

  .content {
    padding-top: 34px;
  }
}
.production-actions{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin:16px 0}
.production-actions label{display:grid;gap:6px;max-width:100%;min-width:160px}
.production-nav{padding-bottom:16px;border-bottom:1px solid var(--line,#ddd)}
.production-nav.production-actions{width:100%;max-width:none;justify-content:flex-start;align-items:center}
.production-history-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:24px 0 16px}
.production-history-title h3{font-size:18px;margin:0}
.production-history-title span,.production-history-heading p{font-size:14px;color:var(--muted,#667085)}
.production-history-toolbar{display:flex;flex-wrap:wrap;align-items:end;gap:12px;padding:0 0 18px;border-bottom:1px solid var(--line,#ddd)}
.production-history-toolbar label{display:grid;gap:6px;font-size:14px;font-weight:600;min-width:180px;flex:1;max-width:240px}
.production-history-toolbar input{width:100%;min-width:0}
.production-history-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.production-history-heading h3{font-size:18px;margin:0 0 6px}
.production-history-heading p{margin:0}
.production-history-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.production-history-actions button{min-height:40px;padding:9px 14px;font-size:14px;white-space:normal}
.production-status{font-size:12px;font-weight:400;background:#eee;padding:4px 8px;border-radius:4px}
.production-editor{display:grid;gap:0}
.production-editor-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:22px 0;border-bottom:1px solid var(--line,#ddd)}
.production-editor-row label{display:grid;gap:6px;min-width:0;font-size:14px;font-weight:600}
.production-fixed-person{display:grid;align-content:start;gap:6px;min-width:0;font-size:14px;font-weight:600}
.production-fixed-person strong{display:flex;align-items:center;min-height:48px;padding:8px 0;font-size:16px;overflow-wrap:anywhere}
.production-person-field{display:grid;align-content:start;gap:8px;min-width:0}
.production-person-field>label{display:grid;gap:6px}
.production-add-product{width:100%;white-space:normal;font-size:14px;padding:9px 12px}
.production-additional-row{border-left:3px solid var(--accent,#b71c1c);padding-left:14px}
.production-editor-row input,.production-editor-row select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.production-editor-row .icon-button{justify-self:end;align-self:end}
.production-observation{display:grid;gap:8px;margin:24px 0;font-size:17px;font-weight:700}
.production-observation textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box;resize:vertical;min-height:90px;padding:12px;font:inherit;border:1px solid var(--line,#ddd);border-radius:6px;background:#fff;color:#111}
.production-schedule-note{white-space:pre-wrap;overflow-wrap:anywhere;font-size:17px;font-weight:700;margin:18px 0}
.production-history{padding:24px 0;border-bottom:1px solid var(--line,#ddd)}
.production-history .table-wrap{overflow-x:auto}
.production-table{border-collapse:collapse;width:100%;font-size:14px}
.production-table th,.production-table td{padding:12px;text-align:left;border:1px solid var(--line,#ddd)}
.production-table th{background:#f3f4f5;white-space:nowrap}
.production-history .production-table{background:white;line-height:1.5}
.production-history .production-table td:first-child{font-weight:600}
.production-history .production-table tbody tr:hover{background:#fafafa}
@media(max-width:700px){.production-history-toolbar label{min-width:0;max-width:none;flex-basis:calc(50% - 12px)}.production-history-toolbar button{flex:1;white-space:normal}.production-history-heading{align-items:stretch}.production-history-actions{width:100%}.production-history-actions button{flex:1;min-width:120px}}
.production-actual{display:grid;gap:6px;min-width:150px}
.production-actual input{min-width:0;width:100%;max-width:180px}
.production-actual button{white-space:normal}
.production-deleted-toggle{display:flex;align-items:center;gap:8px;margin:16px 0;font-size:14px}
.production-deleted-toggle input{width:18px;height:18px;margin:0}
.production-people{list-style:none;padding:0}
.production-people li{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line,#ddd)}
.production-people li span{flex:1;min-width:0;overflow-wrap:anywhere}
.production-account{padding:24px 0}
.production-error{padding:12px;border-left:3px solid #b71c1c;color:#a11313;background:#fff1f1}
@media(max-width:700px){.production-editor-row{grid-template-columns:repeat(2,minmax(0,1fr))}.production-people li{flex-wrap:wrap}.production-actions button{max-width:100%;white-space:normal}.production-table th,.production-table td{padding:8px}}
@media(max-width:380px){.production-editor-row{grid-template-columns:minmax(0,1fr)}}
.access-loading{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;min-height:100vh;min-height:100dvh;background:#fff;margin:0;padding:0}
.access-loading-logo{display:block;width:min(420px,88vw,78vh);height:auto;aspect-ratio:1;object-fit:contain}
.list-filters{display:flex;align-items:end;gap:12px;margin:16px 0}
.list-filters label{display:grid;gap:6px;font-size:14px;font-weight:600;min-width:200px;max-width:100%}
.list-filters select{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--text)}
.list-category{padding:14px 0;border-bottom:1px solid var(--line)}
.list-category>summary{display:flex;align-items:center;gap:10px;min-height:48px;cursor:pointer;list-style:none;font-size:18px;font-weight:600;overflow-wrap:anywhere}
.list-category>summary::-webkit-details-marker{display:none}
.list-category>summary>svg{width:20px;height:20px;flex:none;transform:rotate(-90deg)}
.list-category[open]>summary>svg{transform:rotate(0)}
.list-category>summary>small{margin-left:auto;font-size:13px;font-weight:400;color:var(--muted);white-space:nowrap}
.list-category>summary:focus-visible,.list-previous-dates>summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.list-category>.list{margin-top:12px}
.card.list-item-depleted{background:#fff8da;border-color:#e8d894}
.list-item-depleted .badge{background:#f8eab4;color:#604b0d}
.list-expirations{display:grid;gap:6px;margin-top:12px}
.list-expiration{display:flex;justify-content:space-between;gap:12px;font-size:14px;color:var(--muted);flex-wrap:wrap}
.list-expiration strong{font-weight:600;color:var(--text)}
.list-previous-dates{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.list-previous-dates>summary{cursor:pointer;font-size:14px;color:var(--muted);min-height:30px}
.list-previous-dates>summary>span{margin-left:6px;font-size:12px}
@media(max-width:600px){.list-filters label{width:100%}.list-category>summary{font-size:16px}.list-category .card-head{gap:10px;flex-wrap:wrap}.list-expiration{font-size:13px}}
