:root {
  --bg: #eef5ff;
  --surface: #ffffff;
  --surface2: #f4f8ff;
  --field: #ffffff;
  --line: #c9d9ef;
  --ink: #102033;
  --muted: #5e7088;
  --primary: #2563eb;
  --primary2: #60a5fa;
  --primary-dark: #1746a2;
  --danger: #dc2626;
  --ok: #15803d;
  --warn: #d97706;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef5ff 0, #f8fbff 44%, #eef5ff 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
body > header {
  background: #0f2a4d;
  border-bottom: 4px solid var(--primary2);
}
.topbar {
  max-width: 1220px;
  margin: 0 auto;
  padding: 15px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-mark {
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 8px;
  background: linear-gradient(135deg, #1746a2, #60a5fa);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
  background-size: cover;
  background-position: center;
}
.logo-mark.has-image { color: transparent; }
.brand h1 {
  margin: 0;
  font-family: Georgia, serif;
  text-transform: uppercase;
  font-size: 31px;
  color: #ffffff;
}
.brand p { margin: 5px 0 0; color: #dbeafe; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
main { max-width: 1220px; margin: 0 auto; padding: 18px; }
.hidden { display: none !important; }
/* Nunca muestres el formulario de acceso mientras se abre una demostración. */
html[data-demo-loading="true"] #authView { visibility: hidden; }
.toast {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #e9f8ee;
  color: #14532d;
  box-shadow: 0 18px 42px rgba(22, 51, 91, .18);
  padding: 12px 14px;
  font-weight: 800;
}
.toast.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: var(--danger);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.accounting-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.metric, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(22, 51, 91, .10);
}
.metric { padding: 14px; min-height: 96px; }
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-size: 24px; color: #0f2a4d; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { background: var(--surface); color: var(--ink); border-color: var(--line); }
.tab.active { background: var(--primary); color: #fff; }
.view { display: none; }
.view.active { display: grid; gap: 14px; }
.panel { overflow: hidden; }
.panel-head {
  padding: 13px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-body { padding: 14px; }
.auth-screen {
  min-height: calc(100vh - 136px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr);
  gap: 22px;
  align-items: stretch;
  padding: 18px 0 26px;
}
.auth-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid #b7cbe7;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 42, 77, .94), rgba(37, 99, 235, .86)),
    linear-gradient(180deg, #1746a2, #60a5fa);
  color: #ffffff;
  padding: 34px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  box-shadow: 0 18px 42px rgba(22, 51, 91, .18);
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -140px auto;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}
.auth-kicker {
  width: max-content;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255,255,255,.10);
  font-size: 13px;
  font-weight: 900;
}
.auth-hero h2 {
  max-width: 660px;
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: 0;
}
.auth-hero p {
  max-width: 620px;
  margin: -12px 0 0;
  color: #dbeafe;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 700;
}
.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-highlights span {
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255,255,255,.10);
  color: #eff6ff;
  font-size: 13px;
  font-weight: 900;
}
.auth-preview {
  position: relative;
  z-index: 1;
  max-width: 560px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  padding: 15px;
  backdrop-filter: blur(8px);
}
.preview-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}
.preview-row span,
.preview-grid span {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}
.preview-row strong {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 5px 10px;
  font-size: 12px;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.preview-grid div {
  min-height: 74px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 8px;
  background: rgba(15, 42, 77, .34);
  padding: 11px;
}
.preview-grid strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 22px;
}
.preview-lines {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.preview-lines i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.preview-lines i:nth-child(2) { width: 82%; }
.preview-lines i:nth-child(3) { width: 64%; }
.auth-card {
  align-self: center;
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr;
}
.auth-panel-head {
  padding: 24px;
}
.auth-panel-head span {
  display: block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}
.auth-panel-head h2 {
  font-size: 28px;
}
.auth-panel-body {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 24px;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form input {
  min-height: 48px;
  font-size: 15px;
}
.auth-form button {
  min-height: 48px;
  margin-top: 4px;
  font-size: 15px;
}
.auth-notice {
  min-height: 22px;
  margin: 0;
}
.auth-foot {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.auth-foot span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}
.auth-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
.product-grid { grid-template-columns: 1.25fr .72fr .62fr .72fr .78fr .55fr .55fr .8fr auto; }
.sales-grid { grid-template-columns: 1.05fr 1.1fr .45fr .7fr 1fr .75fr .7fr auto; }
.accounting-grid { grid-template-columns: .75fr 1.2fr .8fr .75fr 1fr auto; }
.settings-grid { grid-template-columns: 1fr 1.4fr .9fr .9fr auto auto; }
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 18px;
  align-items: stretch;
}
.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  align-content: start;
}
.settings-fields label:nth-child(2) { grid-column: 1 / -1; }
.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-preview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid #b7cbe7;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #eaf3ff);
  padding: 18px;
  min-height: 190px;
}
.settings-preview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.settings-preview strong {
  display: block;
  margin-top: 8px;
  color: #0f2a4d;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.settings-preview p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}
.toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 9px;
  margin-bottom: 12px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, button { font: inherit; }
input, select {
  width: 100%;
  min-height: 39px;
  border: 1px solid #b7cbe7;
  border-radius: 7px;
  background-color: var(--field);
  color: var(--ink);
  padding: 8px 10px;
  color-scheme: light;
}
input[type="date"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231746a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 38px;
}
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
.date-enhanced-label {
  gap: 8px;
}
.date-control-panel {
  display: grid;
  gap: 7px;
  margin-top: -2px;
}
.date-readable {
  display: block;
  color: #6b7c94;
  font-size: 12px;
  font-weight: 800;
}
.date-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.date-quick,
.date-calendar-button {
  min-height: 32px;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}
.date-quick {
  border-color: #bfd4f2;
  background: #eaf3ff;
  color: #1746a2;
}
.date-quick.today,
.date-calendar-button {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}
.date-calendar-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button {
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--primary2), var(--primary));
  color: #fff;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
}
button.small, .file-button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}
button.secondary { background: #eef5ff; color: var(--primary-dark); border-color: #b7cbe7; }
button.danger { background: linear-gradient(180deg, #ff7967, var(--danger)); color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b7cbe7;
  border-radius: 7px;
  background: #eef5ff;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 800;
}
.notice { color: var(--muted); margin: 12px 0 0; line-height: 1.45; }
.product-photo-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.product-photo-preview-image,
.product-thumb,
.pos-card-image {
  background: linear-gradient(135deg, #1746a2, #60a5fa);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.product-photo-preview-image {
  width: 108px;
  height: 108px;
  border: 1px solid #b7cbe7;
  border-radius: 8px;
  font-size: 28px;
}
.product-photo-preview-image.has-image,
.product-thumb.has-image,
.pos-card-image.has-image { color: transparent; }
.product-cell {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 230px;
}
.product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 13px;
}
.pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .34fr);
  gap: 14px;
  align-items: start;
}
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.pos-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  min-height: 132px;
}
.pos-card.disabled { opacity: .58; }
.pos-card-image {
  width: 88px;
  height: 100%;
  min-height: 108px;
  border-radius: 8px;
  font-size: 22px;
}
.pos-card-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.pos-card-body strong {
  display: block;
  margin-bottom: 6px;
  color: #0f2a4d;
  overflow-wrap: anywhere;
}
.pos-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.pos-card-meta b {
  color: var(--primary-dark);
  font-size: 15px;
  white-space: nowrap;
}
.pos-card-actions {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 8px;
}
.pos-card-actions input { text-align: center; }
.pos-cart {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}
.pos-cart-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 68px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px;
}
.pos-cart-info {
  min-width: 0;
}
.pos-cart-info strong {
  display: block;
  color: #0f2a4d;
  overflow-wrap: anywhere;
}
.pos-cart-info span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}
.pos-cart-item input {
  min-height: 34px;
  text-align: center;
  padding-inline: 6px;
}
.pos-summary {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.pos-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pos-summary-line span {
  color: var(--muted);
  font-weight: 800;
}
.pos-summary-line strong {
  color: #0f2a4d;
  font-size: 20px;
}
.pos-summary-line.total strong {
  color: var(--primary);
  font-size: 24px;
}
.pos-checkout {
  width: 100%;
  margin-top: 12px;
  min-height: 48px;
  font-size: 16px;
}
.backup-box {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.backup-box h3 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #0f2a4d;
}
.backup-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.logo-preview {
  width: 150px;
  height: 150px;
  border: 1px solid #b7cbe7;
  border-radius: 8px;
  background: linear-gradient(135deg, #1746a2, #60a5fa);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 0;
  flex: 0 0 auto;
}
.logo-preview.has-image { color: transparent; }
.stock-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #effaf3;
  padding: 12px;
}
.stock-alerts.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}
.stock-alerts strong {
  color: #0f2a4d;
}
.stock-alerts span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.stock-alerts ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stock-alerts li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(37, 99, 235, .04);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; min-width: 820px; border-collapse: collapse; background: var(--surface); font-size: 14px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #edf4ff; color: var(--muted); text-transform: uppercase; font-size: 12px; }
tbody tr:hover { background: #f4f8ff; }
tr.low-stock { background: #fff7ed; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.select-cell { width: 42px; text-align: center; }
.select-cell input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--primary); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-input {
  min-width: 150px;
}
.user-actions {
  min-width: 330px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef5ff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.pill.warn { border-color: var(--warn); color: #92400e; }
.pill.bad { border-color: var(--danger); color: #b91c1c; }
.empty { color: var(--muted); margin-bottom: 0; }
.report-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.report-line span { color: var(--muted); }
.report-line strong { color: #0f2a4d; }
.period-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}
.period-card {
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 122px;
}
.period-card span,
.period-card small,
.period-card em {
  display: block;
}
.period-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.period-card strong {
  display: block;
  margin-top: 8px;
  color: #0f2a4d;
  font-size: 22px;
  overflow-wrap: anywhere;
}
.period-card small {
  margin-top: 7px;
  color: var(--primary);
  font-weight: 700;
}
.period-card em {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.user-table { margin-top: 14px; }
@media (max-width: 980px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-card { min-height: auto; }
  .auth-hero { min-height: 420px; }
  .auth-hero h2 { font-size: 36px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-form, .auth-grid, .product-grid, .sales-grid, .accounting-grid, .settings-grid, .toolbar, .period-grid, .settings-layout, .settings-fields, .pos-shell { grid-template-columns: 1fr; }
  .settings-fields label:nth-child(2), .settings-actions { grid-column: auto; }
  .settings-preview { grid-template-columns: 120px minmax(0, 1fr); }
  .logo-preview { width: 120px; height: 120px; font-size: 34px; }
  .stock-alerts ul { grid-template-columns: 1fr; }
  .backup-box { align-items: flex-start; flex-direction: column; }
  .backup-actions { justify-content: flex-start; }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .tab { white-space: nowrap; }
}
/* POS Stitch-style checkout */
body.pos-focus main {
  max-width: none;
  padding: 0;
}

body.pos-focus .command-center,
body.pos-focus .metrics,
body.pos-focus .insight-grid {
  display: none;
}

#pos.pos-dashboard.active {
  display: block;
  min-height: calc(100vh - 86px);
  background: #f4f7fb;
}

#pos .pos-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 448px;
  gap: 0;
  min-height: calc(100vh - 86px);
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f7fc;
}

#pos .pos-catalog {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid #dbe3ef;
}

#pos .pos-catalog-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid #dbe3ef;
  background: #ffffff;
}

#pos .pos-search-wrap {
  flex: 1;
  position: relative;
  min-width: 260px;
}

#pos .pos-search-wrap span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#pos #posSearch {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #ffffff;
  padding: 0 14px;
  font-size: 16px;
}

#pos .pos-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

#pos .pos-filter-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #dde8f8;
  color: #4b5563;
  padding: 0 18px;
  box-shadow: none;
  font-weight: 850;
}

#pos .pos-filter-tabs button.active {
  background: #004da8;
  color: #ffffff;
}

#pos #posStockFilter {
  width: 1px;
  min-width: 1px;
  max-width: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#pos .pos-catalog-status {
  padding: 14px 16px 0;
}

#pos .pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  align-content: start;
  gap: 16px;
  padding: 16px;
  overflow: auto;
}

#pos .pos-card {
  display: flex;
  min-height: 376px;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #d3dce9;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
  cursor: pointer;
  box-shadow: none;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

#pos .pos-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 77, 168, .3);
  box-shadow: 0 18px 34px rgba(15, 23, 42, .09);
}

#pos .pos-card.disabled {
  opacity: .56;
}

#pos .pos-card-image {
  width: 100%;
  height: 160px;
  min-height: 160px;
  border-radius: 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #f8fafc;
}

#pos .pos-card-image.has-image {
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #ffffff;
}

#pos .pos-card-body {
  display: flex;
  min-height: 180px;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

#pos .pos-card-body strong {
  display: block;
  color: #001b44;
  font-size: 16px;
  line-height: 1.35;
}

#pos .pos-card-body small {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 12px;
}

#pos .pos-card-meta {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  color: #001b44;
  font-size: 12px;
  font-weight: 850;
}

#pos .pos-card-meta b {
  color: #004da8;
  font-size: 18px;
  font-weight: 950;
  white-space: normal;
  text-align: right;
}

#pos .pos-card-actions {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

#pos .pos-card-actions input,
#pos .pos-card-actions button {
  min-height: 42px;
  border-radius: 8px;
}

#pos .pos-card-actions input {
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}

#pos .pos-card-actions button {
  background: #004da8;
  color: #ffffff;
  font-weight: 900;
}

#pos .pos-side {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  min-height: calc(100vh - 86px);
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

#pos .pos-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #dbe3ef;
}

#pos .pos-cart-head h2 {
  margin: 0;
  color: #004da8;
  font-size: 18px;
  font-weight: 900;
}

#pos .pos-cart-head button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: #e5484d;
  padding: 0;
  box-shadow: none;
  font-size: 13px;
}

#pos .pos-client-field {
  margin: 16px 24px;
}

#pos .pos-client-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#pos .pos-client-field input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd6e5;
  border-radius: 8px;
  background: #f7f9fe;
  color: #667085;
}

#pos .pos-cart {
  display: grid;
  align-content: start;
  gap: 0;
  max-height: none;
  overflow: auto;
  padding: 0;
}

#pos .pos-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid #dbe3ef;
  border-radius: 0;
  background: #ffffff;
  padding: 18px 24px;
}

#pos .pos-cart-info strong {
  color: #182235;
  font-size: 14px;
}

#pos .pos-cart-info span {
  color: #475569;
  font-size: 13px;
}

#pos .pos-cart-line-total {
  color: #004da8;
  font-size: 15px;
  text-align: right;
}

#pos .pos-cart-qty {
  display: inline-grid;
  grid-template-columns: 34px 48px 34px;
  grid-column: 1 / 2;
  width: max-content;
  border-radius: 8px;
  overflow: hidden;
  background: #dde8f8;
}

#pos .pos-cart-qty button,
#pos .pos-cart-qty input {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #263244;
  text-align: center;
  font-weight: 900;
}

#pos .pos-cart-remove {
  grid-column: 2 / 3;
  border: 0;
  background: transparent;
  color: #e5484d;
  padding: 0;
  box-shadow: none;
  font-size: 12px;
}

#pos .pos-checkout-area {
  border-top: 1px solid #dbe3ef;
  padding: 22px 24px 24px;
}

#pos .pos-summary {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

#pos .pos-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 750;
}

#pos .pos-summary-line.total {
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid #dbe3ef;
}

#pos .pos-summary-line.total span {
  color: #182235;
  font-size: 16px;
  text-transform: uppercase;
}

#pos .pos-summary-line.total strong {
  color: #004da8;
  font-size: 34px;
  line-height: 1;
}

#pos .payment-calculator {
  display: grid;
  gap: 12px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#pos .payment-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #dde8f8;
  padding: 4px;
}

#pos .payment-method {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f4b5f;
  box-shadow: none;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

#pos .payment-method.active {
  background: #ffffff;
  color: #004da8;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

#pos .payment-method span {
  font-size: 18px;
}

#pos .payment-cash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#pos #posPaidWrap,
#pos .change-box {
  display: grid;
  gap: 8px;
  color: #263244;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

#pos #posPaidAmount,
#pos .change-box strong {
  min-height: 54px;
  border: 2px solid #0065e8;
  border-radius: 10px;
  background: #ffffff;
  color: #004da8;
  padding: 0 14px;
  font-size: 18px;
}

#pos .change-box strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-color: #ffd1d1;
  background: #ffdada;
  color: #e5484d;
}

#pos .pos-checkout {
  width: 100%;
  min-height: 58px;
  margin-top: 16px;
  border-radius: 14px;
  background: #004da8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 12px 24px rgba(0, 77, 168, .24);
}

@media (max-width: 1060px) {
  #pos .pos-shell {
    grid-template-columns: 1fr;
  }

  #pos .pos-side {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 720px) {
  #pos .pos-catalog-header {
    align-items: stretch;
    flex-direction: column;
  }

  #pos .pos-search-wrap {
    min-width: 0;
  }

  #pos .pos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
  }

  #pos .pos-card {
    min-height: 320px;
    padding: 10px;
  }

  #pos .pos-card-image {
    height: 128px;
    min-height: 128px;
  }

  #pos .pos-card-actions,
  #pos .payment-cash-grid {
    grid-template-columns: 1fr;
  }

  #pos .pos-summary-line.total strong {
    font-size: 28px;
  }
}

/* Consistent destructive actions across every module */
button.delete-action,
#sales button.delete-action,
#accounting button.delete-action,
#pos button.delete-action,
.fixed-expense-list button.delete-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dc2626 !important;
  border-radius: 7px;
  background: #dc2626 !important;
  color: #ffffff !important;
  box-shadow: 0 7px 16px rgba(220, 38, 38, .18);
  font-weight: 800;
}

button.delete-action.delete-action-icon,
#sales button.delete-action.delete-action-icon,
#accounting button.delete-action.delete-action-icon,
#pos button.delete-action.delete-action-icon,
.fixed-expense-list button.delete-action.delete-action-icon {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}

button.delete-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2.2;
  pointer-events: none;
}

button.delete-action span {
  pointer-events: none;
}

button.delete-action:disabled {
  border-color: #e9a5a9 !important;
  background: #e9a5a9 !important;
  color: #fff !important;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  button.delete-action:not(:disabled):hover,
  #sales button.delete-action:not(:disabled):hover,
  #accounting button.delete-action:not(:disabled):hover,
  #pos button.delete-action:not(:disabled):hover {
    border-color: #b91c1c !important;
    background: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(185, 28, 28, .25);
    transform: translateY(-1px);
  }
}

html[data-theme="dark"] button.delete-action,
html[data-theme="dark"] #sales button.delete-action,
html[data-theme="dark"] #accounting button.delete-action,
html[data-theme="dark"] #pos button.delete-action,
html[data-theme="dark"] .fixed-expense-list button.delete-action {
  border-color: #e5484d !important;
  background: #c9343b !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] button.delete-action:disabled {
  border-color: #704148 !important;
  background: #704148 !important;
  color: #d6b5b8 !important;
}

@media (max-width: 640px) {
  .topbar { display: grid; }
  .brand h1 { font-size: 25px; }
  .auth-screen { min-height: auto; padding-top: 6px; }
  .auth-hero { min-height: auto; padding: 24px; }
  .auth-hero h2 { font-size: 31px; }
  .auth-hero p { font-size: 14px; }
  .preview-grid { grid-template-columns: 1fr; }
  .auth-panel-head, .auth-panel-body { padding: 18px; }
  .metrics { grid-template-columns: 1fr; }
  .accounting-metrics { grid-template-columns: 1fr; }
  .settings-preview { grid-template-columns: 1fr; }
  .product-photo-preview { align-items: flex-start; flex-direction: column; }
  .product-photo-preview-image { width: 100%; max-width: 220px; height: 150px; }
  .pos-grid { grid-template-columns: 1fr; }
  .pos-card {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 116px;
  }
  .pos-card-image {
    width: 72px;
    min-height: 96px;
  }
  .pos-card-actions { grid-template-columns: 70px 1fr; }
  main { padding: 12px; }
}

/* Sales history - Stitch reference */
body.sales-focus > header,
body.sales-focus .command-center,
body.sales-focus .metrics,
body.sales-focus .insight-grid,
body.sales-focus main > .tabs {
  display: none;
}

body.sales-focus main {
  max-width: none;
  padding: 0;
}

#sales.sales-dashboard.active {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  background: #f4f7fc;
  color: #10243e;
}

#sales .sales-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 30px 16px 24px;
  border-right: 1px solid #dce5f1;
  background: #e9f1ff;
}

#sales .sales-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 42px;
}

#sales .sales-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #0055ad;
  color: #ffffff;
  font-size: 23px;
  font-weight: 900;
}

#sales .sales-brand strong,
#sales .sales-brand span {
  display: block;
}

#sales .sales-brand strong {
  color: #003f88;
  font-size: 18px;
  line-height: 1.1;
}

#sales .sales-brand span {
  margin-top: 5px;
  color: #20314b;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

#sales .sales-side-nav,
#sales .sales-side-footer {
  display: grid;
  gap: 7px;
}

#sales .sales-side-nav .tab,
#sales .sales-side-footer .tab,
#sales .sales-logout {
  width: 100%;
  min-height: 46px;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #24334b;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}

#sales .sales-side-nav .tab span,
#sales .sales-side-footer .tab span,
#sales .sales-logout span {
  width: 22px;
  color: #174a82;
  font-size: 20px;
  text-align: center;
}

#sales .sales-side-nav .tab.active {
  background: #075bc5;
  color: #ffffff;
  box-shadow: 0 7px 15px rgba(0, 67, 149, .2);
}

#sales .sales-side-nav .tab.active span {
  color: #ffffff;
}

#sales .sales-side-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #ccd9ea;
}

#sales .sales-logout,
#sales .sales-logout span {
  color: #ef3448;
}

#sales .sales-main {
  min-width: 0;
}

#sales .sales-topbar {
  position: static;
  height: 72px;
  display: grid;
  grid-template-columns: auto minmax(220px, 330px) 1fr;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid #dfe7f2;
  background: #ffffff;
  box-shadow: none;
}

#sales .sales-topbar h2 {
  margin: 0;
  color: #00489a;
  font-size: 20px;
}

#sales .sales-search-wrap {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: 22px;
  background: #f0f4fc;
}

#sales .sales-search-wrap span {
  color: #77849a;
  font-size: 18px;
}

#sales .sales-search-wrap input {
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#sales .sales-user-summary {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

#sales .sales-user-summary div {
  text-align: right;
}

#sales .sales-user-summary strong,
#sales .sales-user-summary span {
  display: block;
}

#sales .sales-user-summary strong {
  font-size: 14px;
}

#sales .sales-user-summary span {
  margin-top: 3px;
  color: #607089;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

#sales .sales-user-summary b {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid #075bc5;
  border-radius: 50%;
  background: #d9e9ff;
  color: #075bc5;
  font-size: 13px;
}

#sales .sales-content {
  padding: 30px 30px 48px;
}

#sales .sales-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

#sales .sales-heading-row h2 {
  margin: 0 0 6px;
  color: #0c2340;
  font-size: 21px;
}

#sales .sales-heading-row p {
  margin: 0;
  color: #40526c;
  font-size: 14px;
}

#sales #openSalesRegister {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  background: #004fa9;
  box-shadow: 0 7px 14px rgba(0, 73, 158, .2);
  white-space: nowrap;
}

#sales #openSalesRegister span {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  margin-right: 7px;
  border-radius: 50%;
  background: #ffffff;
  color: #0054b3;
}

#sales .sales-filter-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(190px, .9fr) minmax(190px, .9fr);
  align-items: end;
  gap: 14px;
  padding: 22px;
  border: 1px solid #e2e8f1;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(23, 48, 82, .04);
}

#sales .sales-filter-card label {
  color: #36445b;
  font-size: 12px;
  font-weight: 900;
}

#sales .sales-filter-card input,
#sales .sales-filter-card button {
  min-height: 45px;
  margin-top: 8px;
  border-radius: 12px;
}

#sales .sales-filter-card input {
  border: 0;
  background: #eef4ff;
}

#sales .sales-filter-card .secondary {
  border: 1px solid #ccd5e3;
  background: #ffffff;
  color: #25344c;
}

#sales .sales-filter-card .danger {
  border: 0;
  background: #fff0f2;
  color: #e54858;
}

#sales .sales-filter-card .danger:disabled {
  opacity: .48;
}

#sales .sales-table-card {
  margin-top: 24px;
  overflow: hidden;
  border: 1px solid #e0e7f1;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(23, 48, 82, .045);
}

#sales .table-wrap {
  overflow: auto;
}

#sales .sales-history-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

#sales .sales-history-table th {
  height: 54px;
  padding: 0 14px;
  border-bottom: 1px solid #dfe7f2;
  background: #edf3ff;
  color: #25344c;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-align: left;
}

#sales .sales-history-table td {
  min-height: 70px;
  padding: 15px 14px;
  border-bottom: 1px solid #edf1f6;
  color: #15263d;
  font-size: 13px;
  vertical-align: middle;
}

#sales .sales-history-table tr:last-child td {
  border-bottom: 0;
}

#sales .sales-history-table tbody tr:hover {
  background: #f8fbff;
}

#sales .sales-history-table small {
  display: block;
  margin-top: 5px;
  color: #718098;
  font-size: 10px;
}

#sales .sales-date {
  white-space: nowrap;
}

#sales .sales-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

#sales .sales-product-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e4efff;
  color: #0059ba;
  font-size: 14px;
}

#sales .sales-total {
  color: #004a9f;
  font-size: 15px;
}

#sales .sales-profit {
  color: #00a56f;
  font-size: 15px;
  white-space: nowrap;
}

#sales .sales-payment {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

#sales .sales-payment.cash {
  background: #e5f8ef;
  color: #009766;
}

#sales .sales-payment.card {
  background: #e7f5ff;
  color: #1590d0;
}

#sales .sales-payment.transfer {
  background: #eeeaff;
  color: #6248bd;
}

#sales .sales-history-table em {
  color: #40506a;
  font-style: italic;
}

#sales .sales-row-action {
  width: 48px;
}

#sales .sales-delete-one {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #c5ceda;
}

#sales .sales-delete-one:hover {
  background: #fff0f2;
  color: #e54858;
}

#sales .select-cell {
  width: 42px;
  text-align: center;
}

#sales .sales-register-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 70;
  width: min(930px, calc(100vw - 28px));
  max-height: calc(100vh - 34px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(15, 35, 64, .28);
}

#sales .sales-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 69;
  background: rgba(10, 27, 50, .38);
  backdrop-filter: blur(2px);
}

#sales .sales-register-modal .panel-head {
  padding: 20px 22px;
  background: #ffffff;
}

#sales .sales-register-modal .panel-body {
  padding: 22px;
}

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

#sales .sales-register-modal .sales-grid button {
  grid-column: 1 / -1;
  min-height: 48px;
  border-radius: 11px;
}

@media (max-width: 1050px) {
  #sales.sales-dashboard.active {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  #sales .sales-filter-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Informative product highlights in reports. */
#reports .report-product-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#reports .report-product-highlight {
  min-width: 0;
  padding: 18px;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 35, 64, .055);
}

#reports .report-product-highlight span,
#reports .report-product-highlight strong,
#reports .report-product-highlight small {
  display: block;
}

#reports .report-product-highlight span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #52708f;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

#reports .report-product-highlight span svg {
  width: 18px;
  height: 18px;
  color: #0964c6;
}

#reports .report-product-highlight strong {
  margin-top: 14px;
  color: #10243f;
  font-size: 18px;
  overflow-wrap: anywhere;
}

#reports .report-product-highlight small {
  margin-top: 7px;
  color: #687b92;
  line-height: 1.4;
}

#reports .report-product-ranking {
  grid-column: span 2;
}

#reports .report-product-ranking ol {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

#reports .report-product-ranking li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(13, 78, 216, .1);
  border-radius: 10px;
  background: #f8fbff;
}

#reports .report-product-ranking li b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(9, 100, 198, .11);
  color: #074c99;
  font-size: 12px;
}

#reports .report-product-ranking li span {
  display: block;
  min-width: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: none;
}

#reports .report-product-ranking li strong {
  margin: 0;
  color: #10243f;
  font-size: 14px;
  line-height: 1.25;
}

#reports .report-product-ranking li small {
  margin-top: 2px;
  color: #687b92;
  font-size: 12px;
}

#reports .report-product-ranking li.is-empty {
  display: block;
  color: #687b92;
}

html[data-theme="dark"] #reports .report-product-highlight {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] #reports .report-product-highlight span,
html[data-theme="dark"] #reports .report-product-highlight small {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #reports .report-product-highlight strong {
  color: var(--dark-text);
}

html[data-theme="dark"] #reports .report-product-highlight span svg {
  color: var(--dark-blue);
}

html[data-theme="dark"] #reports .report-product-ranking li {
  border-color: rgba(147, 197, 253, .14);
  background: rgba(15, 23, 42, .42);
}

html[data-theme="dark"] #reports .report-product-ranking li b {
  background: rgba(96, 165, 250, .18);
  color: #bfdbfe;
}

html[data-theme="dark"] #reports .report-product-ranking li strong {
  color: var(--dark-text);
}

html[data-theme="dark"] #reports .report-product-ranking li small,
html[data-theme="dark"] #reports .report-product-ranking li.is-empty {
  color: var(--dark-text-secondary);
}

@media (max-width: 1100px) {
  #reports .report-product-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #reports .report-product-highlights {
    grid-template-columns: 1fr;
  }

  #reports .report-product-ranking {
    grid-column: auto;
  }
}

@media (max-width: 780px) {
  #sales.sales-dashboard.active {
    grid-template-columns: 1fr;
  }

  #sales .sales-sidebar {
    min-height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid #dce5f1;
  }

  #sales .sales-brand {
    padding: 2px 4px 12px;
  }

  #sales .sales-side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  #sales .sales-side-nav .tab {
    width: auto;
    min-width: max-content;
    min-height: 40px;
    padding: 0 13px;
  }

  #sales .sales-side-nav .tab span {
    display: none;
  }

  #sales .sales-side-footer {
    display: none;
  }

  #sales .sales-topbar {
    height: auto;
    grid-template-columns: auto 1fr;
    padding: 14px;
  }

  #sales .sales-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #sales .sales-user-summary {
    grid-column: 2;
    grid-row: 1;
  }

  #sales .sales-content {
    padding: 20px 14px 34px;
  }

  #sales .sales-heading-row {
    align-items: flex-start;
  }

  #sales .sales-filter-card {
    padding: 16px;
  }
}

.report-range-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(190px, 1fr);
  gap: 14px;
  align-items: end;
}

.report-range-controls label,
.receipt-settings label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

.report-range-summary {
  min-height: 46px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 12px;
  border: 1px solid var(--border, #d7e0ec);
  border-radius: 8px;
  background: var(--surface-soft, #f4f7fb);
}

.report-range-summary span { color: var(--text-muted, #637083); font-size: 12px; }
.report-range-summary strong { color: var(--text, #14233b); }

.receipt-settings {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border, #d7e0ec);
  border-radius: 8px;
}

.receipt-settings legend { padding: 0 6px; font-weight: 800; }
.receipt-last-button { width: 100%; margin-top: 8px; justify-content: center; }

html[data-theme="dark"] .report-range-summary {
  background: #111c29;
  border-color: #34465b;
}

html[data-theme="dark"] .report-range-summary strong { color: #f2f7ff; }

@media (max-width: 900px) {
  .report-range-controls { grid-template-columns: 1fr 1fr; }
}

/* Reportes 3.0: resumen ejecutivo claro, contrastado y con color controlado. */
#reports.reports-redesign { max-width: 1500px; margin: 0 auto; padding: 34px; background: #fffdf9 !important; color: #162238 !important; }
#reports.reports-redesign .report-hero { border: 1px solid #d9e3ef !important; border-left: 8px solid #173f70 !important; border-radius: 12px !important; background: #ffffff !important; box-shadow: 0 7px 22px rgba(20, 47, 82, .08) !important; color: #162238 !important; }
#reports.reports-redesign .report-hero .panel-head { align-items: flex-start; padding: 28px 30px 12px; background: #ffffff !important; }
#reports.reports-redesign .report-hero :is(h2, p, span, strong) { color: #162238 !important; }
#reports.reports-redesign .report-hero h2 { font-size: 30px; letter-spacing: -.03em; }
#reports.reports-redesign .report-hero p { color: #50627c !important; font-size: 15px; }
#reports.reports-redesign .report-hero .report-eyebrow { color: #0f766e !important; }
#reports.reports-redesign .report-period-badge { min-width: 235px; border: 1px solid #a9dbd4 !important; border-radius: 9px; background: #e8faf7 !important; }
#reports.reports-redesign .report-period-badge span { color: #17635c !important; }
#reports.reports-redesign .report-period-badge strong { color: #123a45 !important; font-size: 16px; }
#reports.reports-redesign .report-range-controls { grid-template-columns: 1.25fr 1fr 1fr .9fr; padding: 12px 30px 28px; background: #ffffff; }
#reports.reports-redesign .report-range-controls label { color: #293a53 !important; }
#reports.reports-redesign .report-range-controls :is(select,input) { min-height: 46px; border: 1px solid #bccbde !important; border-radius: 7px; background: #fff !important; color: #162238 !important; font-weight: 700; }
#reports.reports-redesign .report-range-summary { align-self: end; min-height: 46px; border: 1px dashed #9bb1ca !important; border-radius: 7px; background: #f7fbff !important; }
#reports.reports-redesign .report-range-summary :is(span,strong) { color: #294463 !important; }
#reports.reports-redesign .report-kpis { position: relative; margin: 24px 0 30px; padding: 18px 0 0; border-top: 1px solid #e2e8f0; }
#reports.reports-redesign .report-kpis::before { content: "Resultado financiero"; position: absolute; top: -11px; left: 0; padding-right: 12px; background: #fffdf9; color: #2d4667; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
#reports.reports-redesign .net-profit-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
#reports.reports-redesign .net-profit-grid article { min-height: 126px; padding: 18px; border: 1px solid #dce5ef !important; border-radius: 9px !important; background: #fff !important; box-shadow: none !important; }
#reports.reports-redesign .net-profit-grid span { color: #405570 !important; font-size: 11px; }
#reports.reports-redesign .net-profit-grid strong { color: #162238 !important; font-size: 24px; }
#reports.reports-redesign .net-profit-grid small { color: #62748d !important; font-size: 12px; }
#reports.reports-redesign .net-profit-grid .kpi-sales { border-top: 5px solid #2563eb !important; background: #f5f8ff !important; }
#reports.reports-redesign .net-profit-grid .kpi-profit { border-top: 5px solid #0f766e !important; background: #effcf8 !important; }
#reports.reports-redesign .net-profit-grid .negative { border-top: 5px solid #e06b37 !important; background: #fff7f2 !important; }
#reports.reports-redesign .net-profit-grid .net-result { border: 2px solid #6f4acb !important; background: #f7f2ff !important; }
#reports.reports-redesign .net-profit-grid .net-result :is(span,strong,small) { color: #38245f !important; }
#reports.reports-redesign .reports-dashboard-grid { grid-template-columns: 1.45fr 1fr 1fr; gap: 16px; }
#reports.reports-redesign .reports-dashboard-grid .panel { border: 1px solid #dce5ef !important; border-radius: 10px !important; background: #fff !important; box-shadow: none !important; }
#reports.reports-redesign .reports-dashboard-grid .panel-head { padding: 19px 20px 2px; }
#reports.reports-redesign .reports-dashboard-grid .panel-head h2 { color: #162238 !important; font-size: 18px; }
#reports.reports-redesign .report-eyebrow { color: #315a8e !important; }
#reports.reports-redesign .trend-card { grid-column: span 2; border-top: 5px solid #2563eb !important; }
#reports.reports-redesign .payments-card { border-top: 5px solid #0f766e !important; }
#reports.reports-redesign .report-overview-card { border-top: 5px solid #6f4acb !important; }
#reports.reports-redesign .report-products-panel { grid-column: span 2; border-top: 5px solid #e06b37 !important; }
#reports.reports-redesign .report-top-products { border-top: 5px solid #173f70 !important; }
#reports.reports-redesign .report-bars { border-color: #cfdae7; }
#reports.reports-redesign .report-bar i { background: linear-gradient(#5a90e8, #1e4e9c); }
#reports.reports-redesign .report-bar .bar-value { color: #223c60 !important; font-weight: 800; }
#reports.reports-redesign .report-bar small, #reports.reports-redesign .chart-note, #reports.reports-redesign .report-empty-state { color: #536984 !important; }
#reports.reports-redesign .payment-donut::before { background: #fff !important; }
#reports.reports-redesign .payment-donut span { color: #162238 !important; }
#reports.reports-redesign .payment-donut small { color: #536984 !important; }
#reports.reports-redesign .payment-legend span { color: #334c6b !important; }
#reports.reports-redesign .payment-legend strong { color: #162238 !important; }
#reports.reports-redesign .report-stat { border-color: #dbe5f0 !important; border-radius: 7px; background: #fbfdff !important; }
#reports.reports-redesign .report-stat span { color: #526a87 !important; }
#reports.reports-redesign .report-stat strong { color: #162238 !important; }
#reports.reports-redesign .report-product-highlight { border: 1px solid #dbe5f0 !important; background: #fbfdff !important; }
#reports.reports-redesign .report-product-highlight :is(span,strong,small) { color: #162238 !important; }
#reports.reports-redesign .report-product-highlight small { color: #526a87 !important; }
#reports.reports-redesign th { background: #eaf1fa !important; color: #203957 !important; }
#reports.reports-redesign td { color: #1e2d42 !important; border-color: #e0e7f0 !important; }
html[data-theme="dark"] #reports.reports-redesign { background: #fffdf9 !important; color: #162238 !important; }
html[data-theme="dark"] #reports.reports-redesign .report-hero { background: #fff !important; }
html[data-theme="dark"] #reports.reports-redesign .report-hero :is(h2, p, span, strong), html[data-theme="dark"] #reports.reports-redesign :is(strong, th, td), html[data-theme="dark"] #reports.reports-redesign :is(span, small, p) { color: #162238 !important; }
html[data-theme="dark"] #reports.reports-redesign .report-hero p, html[data-theme="dark"] #reports.reports-redesign :is(.report-stat span, .report-bar small, .chart-note, .report-empty-state, .payment-donut small, .report-product-highlight small) { color: #536984 !important; }
html[data-theme="dark"] #reports.reports-redesign .report-period-badge span { color: #17635c !important; }
html[data-theme="dark"] #reports.reports-redesign .report-period-badge strong { color: #123a45 !important; }
html[data-theme="dark"] #reports.reports-redesign .net-profit-grid .net-result :is(span,strong,small) { color: #38245f !important; }
@media (max-width: 1100px) { #reports.reports-redesign .net-profit-grid { grid-template-columns: repeat(3, 1fr); } #reports.reports-redesign .reports-dashboard-grid { grid-template-columns: 1fr 1fr; } #reports.reports-redesign .trend-card, #reports.reports-redesign .report-products-panel { grid-column: span 2; } }
@media (max-width: 700px) { #reports.reports-redesign { padding: 18px; } #reports.reports-redesign .net-profit-grid, #reports.reports-redesign .reports-dashboard-grid, #reports.reports-redesign .report-range-controls { grid-template-columns: 1fr; } #reports.reports-redesign .trend-card, #reports.reports-redesign .report-products-panel { grid-column: auto; } }

/* Reportes 3.1: misma composición, modo oscuro uniforme y acentos luminosos. */
#reports.reports-redesign { background: #101923 !important; color: #eef4ff !important; }
#reports.reports-redesign .report-hero { border-color: #32465c !important; border-left-color: #7dd3fc !important; background: #172536 !important; box-shadow: 0 10px 28px rgba(0, 0, 0, .24) !important; }
#reports.reports-redesign .report-hero .panel-head, #reports.reports-redesign .report-range-controls { background: #172536 !important; }
#reports.reports-redesign .report-hero :is(h2, p, span, strong) { color: #eef4ff !important; }
#reports.reports-redesign .report-hero p { color: #c8d7e9 !important; }
#reports.reports-redesign .report-hero .report-eyebrow { color: #7dd3fc !important; }
#reports.reports-redesign .report-period-badge { border-color: #4d7ea8 !important; background: #20354a !important; }
#reports.reports-redesign .report-period-badge span { color: #b9ddff !important; }
#reports.reports-redesign .report-period-badge strong { color: #ffffff !important; }
#reports.reports-redesign .report-range-controls label { color: #e6effa !important; }
#reports.reports-redesign .report-range-controls :is(select,input) { border-color: #46617d !important; background: #0f1924 !important; color: #f3f7fc !important; }
#reports.reports-redesign .report-range-summary { border-color: #4d7ea8 !important; background: #1d3043 !important; }
#reports.reports-redesign .report-range-summary :is(span,strong) { color: #d9ecff !important; }
#reports.reports-redesign .report-kpis { border-color: #304357; }
#reports.reports-redesign .report-kpis::before { background: #101923; color: #b9cde3; }
#reports.reports-redesign .net-profit-grid article { border-color: #354b63 !important; background: #172536 !important; }
#reports.reports-redesign .net-profit-grid :is(span, strong, small) { color: #eef4ff !important; }
#reports.reports-redesign .net-profit-grid span, #reports.reports-redesign .net-profit-grid small { color: #c3d1e2 !important; }
#reports.reports-redesign .net-profit-grid .kpi-sales { border-top-color: #7dd3fc !important; background: #162b3c !important; }
#reports.reports-redesign .net-profit-grid .kpi-profit { border-top-color: #5eead4 !important; background: #14332f !important; }
#reports.reports-redesign .net-profit-grid .negative { border-top-color: #fbbf77 !important; background: #382b21 !important; }
#reports.reports-redesign .net-profit-grid .net-result { border-color: #c4b5fd !important; background: #2b2350 !important; }
#reports.reports-redesign .net-profit-grid .net-result :is(span,strong,small) { color: #f2eeff !important; }
#reports.reports-redesign .reports-dashboard-grid .panel { border-color: #304357 !important; background: #172536 !important; }
#reports.reports-redesign .reports-dashboard-grid .panel-head { background: #172536 !important; }
#reports.reports-redesign .reports-dashboard-grid .panel-head h2 { color: #f2f6fc !important; }
#reports.reports-redesign .report-eyebrow { color: #a5f3fc !important; }
#reports.reports-redesign .trend-card { border-top-color: #7dd3fc !important; }
#reports.reports-redesign .payments-card { border-top-color: #5eead4 !important; }
#reports.reports-redesign .report-overview-card { border-top-color: #c4b5fd !important; }
#reports.reports-redesign .report-products-panel { border-top-color: #fbbf77 !important; }
#reports.reports-redesign .report-top-products { border-top-color: #f9a8d4 !important; }
#reports.reports-redesign .report-bars { border-color: #3c526a; }
#reports.reports-redesign .report-bar i { background: linear-gradient(#7dd3fc, #38bdf8) !important; }
#reports.reports-redesign .report-bar .bar-value { color: #e6f5ff !important; }
#reports.reports-redesign :is(.report-bar small, .chart-note, .report-empty-state) { color: #b9cbe0 !important; }
#reports.reports-redesign .payment-donut::before { background: #172536 !important; }
#reports.reports-redesign .payment-donut span { color: #ffffff !important; }
#reports.reports-redesign .payment-donut small { color: #b9cbe0 !important; }
#reports.reports-redesign .payment-legend span { color: #d7e5f5 !important; }
#reports.reports-redesign .payment-legend strong { color: #ffffff !important; }
#reports.reports-redesign .report-stat { border-color: #354b63 !important; background: #1b2b3c !important; }
#reports.reports-redesign .report-stat span { color: #b9cbe0 !important; }
#reports.reports-redesign .report-stat strong { color: #ffffff !important; }
#reports.reports-redesign .report-product-highlight { border-color: #354b63 !important; background: #1b2b3c !important; }
#reports.reports-redesign .report-product-highlight :is(span,strong) { color: #f3f7fc !important; }
#reports.reports-redesign .report-product-highlight small { color: #b9cbe0 !important; }
#reports.reports-redesign th { background: #213447 !important; color: #dcecff !important; }
#reports.reports-redesign td { color: #eaf2fc !important; border-color: #304357 !important; }
html[data-theme="dark"] #reports.reports-redesign { background: #101923 !important; color: #eef4ff !important; }
html[data-theme="dark"] #reports.reports-redesign :is(.panel, .report-line, tbody tr) { background: #172536 !important; border-color: #304357 !important; }
html[data-theme="dark"] #reports.reports-redesign :is(strong, th, td) { color: #eef4ff !important; }
html[data-theme="dark"] #reports.reports-redesign :is(span, small, p) { color: #b9cbe0 !important; }
html[data-theme="dark"] #reports.reports-redesign .report-hero :is(h2, p, span, strong) { color: #eef4ff !important; }

/* Capa final de legibilidad: evita que reglas anteriores dejen texto negro. */
#reports.reports-redesign .net-profit-grid article :is(span, strong, small),
#reports.reports-redesign .report-overview-card :is(span, strong, small),
#reports.reports-redesign .report-product-highlights :is(span, strong, small, b, li),
#reports.reports-redesign .report-top-products :is(th, td, strong, span, small),
#reports.reports-redesign .payment-legend :is(span, strong),
#reports.reports-redesign .trend-card :is(span, strong, small, p),
#reports.reports-redesign .payments-card :is(span, strong, small, p) {
  color: #f1f6fd !important;
  opacity: 1 !important;
}

#reports.reports-redesign .net-profit-grid article :is(span, small),
#reports.reports-redesign .report-overview-card .report-stat span,
#reports.reports-redesign .report-product-highlights :is(span, small),
#reports.reports-redesign .trend-card :is(.chart-note, .report-bar small),
#reports.reports-redesign .payments-card .payment-donut small {
  color: #c9d8e9 !important;
}

#reports.reports-redesign .report-product-highlights .report-product-ranking li,
#reports.reports-redesign .report-product-highlights .report-product-highlight,
#reports.reports-redesign .report-top-products tbody tr {
  color: #f1f6fd !important;
}

#reports.reports-redesign .report-product-highlights .report-product-ranking li b {
  color: #ffffff !important;
  background: #2a4d72 !important;
}

/* Regla absoluta solicitada: TODO el texto y número en Reportes es blanco. */
#reports.reports-redesign,
#reports.reports-redesign * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

#reports.reports-redesign svg {
  stroke: #ffffff !important;
}

#reports.reports-redesign :is(input, select, option) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background-color: #0f1924 !important;
}

@media (max-width: 560px) {
  .report-range-controls { grid-template-columns: 1fr; }
}

.worker-permission-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.worker-permission-card {
  display: grid;
  align-content: start;
  gap: 2px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border, #d7e0ec);
  border-radius: 8px;
  background: var(--surface, #fff);
  box-shadow: 0 8px 22px rgba(21, 45, 78, .06);
}

.worker-permission-card legend {
  padding: 0 7px;
  color: var(--primary, #0758b5);
  font-weight: 850;
}

.permission-switch {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--border-soft, #edf1f6);
}

.permission-switch:last-child { border-bottom: 0; }
.permission-switch input { width: 20px; height: 20px; accent-color: #0868d8; }
.permission-switch span { display: grid; gap: 2px; }
.permission-switch b { font-size: 13px; }
.permission-switch small { color: var(--text-muted, #6d7a8c); font-size: 10px; }

html[data-theme="dark"] .worker-permission-card {
  background: #162231;
  border-color: #34465b;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

@media (max-width: 1050px) { .worker-permission-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .worker-permission-groups { grid-template-columns: 1fr; } }

/* Cash register module */
.cash-register-page { padding: 24px; background: var(--page-bg, #f4f7fb); }
.cash-register-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.cash-register-header h2 { margin:4px 0; font-size:26px; }
.cash-register-header p { margin:0; color:var(--muted, #667085); }
.cash-register-live, .cash-register-status { display:inline-flex; align-items:center; gap:8px; border:1px solid #e1a943; border-radius:8px; background:#fff8e8; color:#8a4b08; font-weight:800; }
.cash-register-live { padding:10px 14px; }
.cash-register-live.open, .cash-register-status.open { border-color:#65c99a; background:#eafaf2; color:#087a4b; }
.cash-register-status { min-height:36px; padding:0 11px; cursor:pointer; }
.cash-register-current { display:grid; grid-template-columns:minmax(280px, 420px) minmax(0, 1fr); gap:18px; margin-bottom:18px; }
.cash-register-current > .panel:only-child { grid-column:1 / -1; max-width:520px; }
.cash-register-page .panel { border:1px solid var(--border, #d7e0ec); border-radius:8px; background:var(--surface, #fff); box-shadow:0 12px 30px rgba(15,45,84,.09); }
.cash-register-page .panel-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.cash-register-page .panel-title h3 { margin:3px 0 0; font-size:20px; }
.cash-register-page form.panel, .cash-session-panel { padding:20px; }
.cash-register-page label { display:grid; gap:7px; margin-bottom:14px; font-weight:700; }
.cash-register-page input, .cash-register-page textarea { width:100%; }
.cash-register-page form button { display:inline-flex; align-items:center; justify-content:center; gap:8px; width:100%; }
.cash-summary-grid { display:grid; grid-template-columns:repeat(4, minmax(120px,1fr)); gap:10px; }
.cash-summary-grid article { padding:13px; border:1px solid var(--border, #d7e0ec); border-radius:8px; background:var(--surface-soft, #f7f9fc); }
.cash-summary-grid span, .cash-detail-grid span { display:block; color:var(--muted, #667085); font-size:12px; margin-bottom:5px; }
.cash-summary-grid strong { font-size:17px; }
.cash-withdrawal-form, .cash-close-form { margin-top:18px; padding-top:18px; border-top:1px solid var(--border, #d7e0ec); }
.cash-withdrawal-form > div { display:grid; grid-template-columns:1fr 1fr 2fr; gap:10px; }
.cash-difference-preview { display:flex; justify-content:space-between; padding:12px; margin-bottom:14px; border-radius:8px; background:#edf8f3; color:#087a4b; }
.cash-difference-preview.waiting { background:#f3f5f8; color:#667085; }
.cash-difference-preview.balanced { background:#eafaf2; color:#087a4b; }
.cash-difference-preview.positive { background:#eef4ff; color:#175cd3; }
.cash-difference-preview.negative { background:#fff0ee; color:#d92d20; }
.cash-difference.negative { color:#d92d20; }
.cash-history-panel, .cash-detail-panel { padding:20px; margin-top:18px; }
.cash-history-table { min-width:1180px; }
.cash-row-actions { display:flex; gap:7px; }
.cash-row-actions button { white-space:nowrap; }
.status-badge { display:inline-flex; padding:5px 9px; border-radius:999px; background:#e9edf3; color:#475467; font-size:11px; font-weight:800; }
.status-badge.active { background:#e6f8ef; color:#087a4b; }
.cash-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(140px,1fr)); gap:1px; overflow:hidden; border:1px solid var(--border, #d7e0ec); border-radius:8px; background:var(--border, #d7e0ec); }
.cash-detail-grid > div { padding:14px; background:var(--surface, #fff); }

html[data-theme="dark"] .cash-register-page { background:#101923; }
html[data-theme="dark"] .cash-register-page .panel { border-color:#34465b; background:#182432; }
html[data-theme="dark"] .cash-register-page input,
html[data-theme="dark"] .cash-register-page textarea { border-color:#40546b; background:#111c28; color:#f4f7fb; }
html[data-theme="dark"] .cash-register-live,
html[data-theme="dark"] .cash-register-status { border-color:#765517; background:#2f2819; color:#ffd88a; }
html[data-theme="dark"] .cash-register-live.open,
html[data-theme="dark"] .cash-register-status.open { border-color:#286b4d; background:#142d25; color:#72e2ad; }
html[data-theme="dark"] .cash-summary-grid article,
html[data-theme="dark"] .cash-detail-grid > div { border-color:#34465b; background:#14202d; }
html[data-theme="dark"] .cash-difference-preview { background:#142d25; color:#72e2ad; }
html[data-theme="dark"] .cash-difference-preview.waiting { background:#202d3b; color:#b8c6d9; }
html[data-theme="dark"] .cash-difference-preview.positive { background:#172b49; color:#8eb9ff; }
html[data-theme="dark"] .cash-difference-preview.negative { background:#3a2022; color:#ff9b94; }

/* Ditaessence POS refinements */
#pos .pos-card-image,
#pos .pos-card-image.has-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #162231 !important;
}

.pos-client-field select,
.pos-sale-date-field input,
.pos-discount-box input,
.customer-grid input {
  width: 100%;
}

.pos-sale-date-field {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.pos-sale-date-field span {
  color: #9eb2ca;
  font-weight: 800;
  font-size: 13px;
}

.pos-sale-date-field input {
  border: 1px solid #5f7da4;
  border-radius: 8px;
  padding: 11px 42px 11px 12px;
  background-color: #f8fbff;
  color: #0f172a;
  font-weight: 900;
}

#pos .date-control-panel {
  margin-bottom: 12px;
}

#pos .date-control-panel .date-readable {
  color: #c7d6e8;
}

#pos .date-control-panel .date-quick {
  border-color: rgba(147, 197, 253, .5);
  background: rgba(96, 165, 250, .16);
  color: #eaf3ff;
}

#pos .date-control-panel .date-quick.today,
#pos .date-control-panel .date-calendar-button {
  border-color: #60a5fa;
  background: #0b6eea;
  color: #ffffff;
}

.pos-customer-add {
  width: 100%;
  justify-content: center;
  margin: 8px 0 10px;
}

.pos-discount-box {
  border: 1px solid var(--line, #d7e0ec);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(13, 78, 216, .06);
}

.pos-discount-box summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 800;
}

.pos-discount-box label {
  display: block;
  margin-top: 10px;
}

.customer-modal {
  width: min(760px, calc(100vw - 24px));
}

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

.customer-grid .wide {
  grid-column: 1 / -1;
}

#sales .sales-register-modal > .panel-head,
#customerModal > .panel-head {
  background: #111923 !important;
  color: #f4f7fb !important;
  border-bottom-color: #2e3c4d !important;
}

#sales .sales-register-modal > .panel-head h2,
#customerModal > .panel-head h2 {
  color: #f4f7fb !important;
}

#customerModal:not(.hidden) {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 205 !important;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px) !important;
  overflow: auto !important;
  transform: translate(-50%, -50%) !important;
}

.customers-dashboard.active {
  display: block;
  padding: 24px;
  min-height: calc(100dvh - 48px);
  background: #0f151d;
  color: #f4f7fb;
}

.customers-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.customers-header h2 {
  margin: 4px 0;
  font-size: 32px;
  color: #f4f7fb;
}

.customers-header p {
  margin: 0;
  color: #9eb2ca;
}

.customers-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.customers-stats article,
.customers-list-card,
.customer-detail-card {
  border: 1px solid #2b3a4d;
  border-radius: 8px;
  background: #18212c;
}

.customers-stats article {
  padding: 14px;
}

.customers-stats small,
.customer-info-grid small {
  display: block;
  color: #9eb2ca;
  font-weight: 700;
  margin-bottom: 6px;
}

.customers-stats strong {
  font-size: 24px;
  color: #8eb9ff;
}

.customers-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.customers-list-card {
  padding: 14px;
}

.customers-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #34465b;
  border-radius: 8px;
  padding: 10px;
  background: #121a23;
  margin-bottom: 12px;
}

.customers-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #f4f7fb;
  background: transparent;
}

.customers-list {
  display: grid;
  gap: 8px;
}

.customer-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid #2b3a4d;
  border-radius: 8px;
  padding: 12px;
  background: #121a23;
  color: #f4f7fb;
}

.customer-list-item.active {
  border-color: #60a5fa;
  background: #17365e;
}

.customer-list-item span,
.customer-list-item small {
  color: #9eb2ca;
}

.wholesale-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 7px;
  border: 1px solid #1d72c9;
  border-radius: 999px;
  background: #12345a;
  color: #9ed0ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
  vertical-align: middle;
}

.customer-detail-card {
  min-height: 520px;
  padding: 18px;
}

.customer-detail-empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #9eb2ca;
  text-align: center;
}

.customer-detail-empty svg {
  width: 42px;
  height: 42px;
  color: #60a5fa;
}

.customer-detail-head,
.customer-purchases-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-detail-head h3 {
  margin: 4px 0;
  font-size: 26px;
  color: #f4f7fb;
}

.customer-detail-head p {
  margin: 0;
  color: #9eb2ca;
}

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

.customer-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.customer-info-grid > div,
.customer-notes {
  border: 1px solid #2b3a4d;
  border-radius: 8px;
  padding: 12px;
  background: #121a23;
}

.customer-info-grid strong {
  color: #f4f7fb;
}

.customer-notes {
  color: #c7d4e5;
}

.customer-purchases {
  margin-top: 18px;
}

.customer-purchase-dates {
  margin-top: 18px;
}

.customer-purchase-date-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.customer-purchase-date {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 12px;
  border: 1px solid #2b3a4d;
  border-radius: 8px;
  background: #121a23;
}

.customer-purchase-date span {
  color: #f4f7fb;
  font-weight: 800;
}

.customer-purchase-date small {
  color: #9eb2ca;
}

.customer-purchase-date b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: #8eb9ff;
  white-space: nowrap;
}

.customer-purchases-head h3 {
  margin: 0;
  color: #f4f7fb;
}

.customer-purchases-head strong {
  color: #8eb9ff;
}

.customer-purchase-list {
  display: grid;
  gap: 10px;
}

.customer-purchase-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #2b3a4d;
  border-radius: 8px;
  padding: 10px;
  background: #121a23;
}

.customer-purchase-image {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #213044;
  background-size: cover;
  background-position: center;
}

.customer-purchase-image.has-image {
  color: transparent;
}

.customer-purchase-item span,
.customer-purchase-item small {
  display: block;
  color: #9eb2ca;
}

.customer-purchase-item b {
  color: #8eb9ff;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .customers-stats,
  .customers-layout,
  .customer-info-grid {
    grid-template-columns: 1fr;
  }

  .customers-header,
  .customer-detail-head,
  .customer-purchases-head {
    display: grid;
  }

  .customer-purchase-item {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .customer-purchase-item b {
    grid-column: 2;
  }

  .customer-purchase-image {
    width: 56px;
    height: 56px;
  }
}

#sales .sales-register-modal > .panel-head .section-kicker,
#sales .customer-modal > .panel-head .section-kicker {
  color: #60a5fa !important;
}

#sales .customer-modal:not(.hidden) {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 205 !important;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  transform: translate(-50%, -50%) !important;
}

#customerModalBackdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 195 !important;
  background: rgba(5, 9, 14, .62);
}

html[data-theme="dark"] .pos-discount-box {
  border-color: #34465b;
  background: rgba(96, 165, 250, .10);
}

@media (max-width: 640px) {
  .customer-grid {
    grid-template-columns: 1fr;
  }
}

.settings-toggle { grid-column:1 / -1; display:flex !important; align-items:flex-start; gap:10px; padding:13px; border:1px solid var(--border, #d7e0ec); border-radius:8px; }
.settings-toggle input { width:18px !important; margin-top:2px; }
.settings-toggle span { display:grid; gap:3px; }
.settings-toggle small { color:var(--muted, #667085); font-weight:400; }

@media (max-width: 1000px) {
  .cash-register-current { grid-template-columns:1fr; }
  .cash-summary-grid, .cash-detail-grid { grid-template-columns:repeat(2,minmax(120px,1fr)); }
}
@media (max-width: 700px) {
  .cash-register-page { padding:14px 10px 90px; }
  .cash-register-header { align-items:flex-start; flex-direction:column; }
  .cash-register-live { width:100%; }
  .cash-summary-grid { grid-template-columns:1fr 1fr; }
  .cash-detail-grid { grid-template-columns:1fr; }
  .cash-withdrawal-form > div { grid-template-columns:1fr; }
  .cash-history-panel, .cash-detail-panel, .cash-register-page form.panel, .cash-session-panel { padding:15px; }
}

@media (max-width: 560px) {
  #sales .sales-heading-row {
    display: grid;
  }

  #sales #openSalesRegister {
    width: 100%;
  }

  #sales .sales-filter-card,
  #sales .sales-register-modal .sales-grid {
    grid-template-columns: 1fr;
  }

  #sales .sales-table-card {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #sales .table-wrap {
    overflow: visible;
  }

  #sales .sales-history-table {
    min-width: 0;
  }

  #sales .sales-history-table thead {
    display: none;
  }

  #sales .sales-history-table,
  #sales .sales-history-table tbody,
  #sales .sales-history-table tr,
  #sales .sales-history-table td {
    display: block;
    width: 100%;
  }

  #sales .sales-history-table tr {
    position: relative;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #dfe7f2;
    border-radius: 13px;
    background: #ffffff;
  }

  #sales .sales-history-table td {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border: 0;
    text-align: right;
  }

  #sales .sales-history-table td::before {
    content: attr(data-label);
    color: #708097;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #sales .sales-history-table .select-cell,
  #sales .sales-history-table .sales-row-action {
    width: auto;
  }

  #sales .sales-history-table .sales-product-cell {
    justify-content: flex-end;
  }

  #sales .sales-user-summary div {
    display: none;
  }
}

/* Modern commercial skin */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --field: #ffffff;
  --line: #dbe4f0;
  --ink: #142033;
  --muted: #64748b;
  --primary: #0d4ed8;
  --primary2: #38bdf8;
  --primary-dark: #0b3fae;
  --danger: #e5484d;
  --ok: #0f9f6e;
  --warn: #f59e0b;
  --radius: 8px;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(56, 189, 248, .18), transparent 34%),
    linear-gradient(180deg, #f8fbff 0, #eef4fb 56%, #f7fafc 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

body > header {
  position: sticky;
  top: 0;
  z-index: 12;
  background:
    linear-gradient(135deg, rgba(7, 23, 55, .98), rgba(15, 56, 130, .96)),
    #0f2a4d;
  border-bottom: 1px solid rgba(148, 163, 184, .34);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

.topbar {
  max-width: 1320px;
  padding: 16px 20px;
}

main {
  max-width: 1320px;
  padding: 20px;
}

.brand h1 {
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 30px;
  letter-spacing: 0;
}

.brand p {
  max-width: 720px;
  color: #cbdcff;
}

.logo-mark {
  width: 64px;
  height: 64px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.04)),
    linear-gradient(135deg, #0d4ed8, #38bdf8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.34), 0 14px 28px rgba(0, 0, 0, .20);
}

.pill {
  border-color: rgba(148, 163, 184, .42);
  background: #f8fafc;
  color: #334155;
}

.actions .pill {
  background: rgba(255,255,255,.12);
  color: #eff6ff;
  border-color: rgba(255,255,255,.26);
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(236, 245, 255, .92)),
    #ffffff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .10);
}

.section-kicker {
  display: inline-flex;
  width: max-content;
  margin-bottom: 8px;
  border: 1px solid rgba(13, 78, 216, .18);
  border-radius: 999px;
  background: #eaf2ff;
  color: #0d4ed8;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.command-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.command-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.command-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.metric,
.panel,
.insight-card {
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 38px rgba(15, 23, 42, .08);
}

.metric {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 18px;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #0d4ed8;
}

.metric::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: rgba(13, 78, 216, .08);
}

.metric.accent-green::before { background: #0f9f6e; }
.metric.accent-green::after { background: rgba(15, 159, 110, .10); }
.metric.accent-violet::before { background: #7c3aed; }
.metric.accent-violet::after { background: rgba(124, 58, 237, .10); }
.metric.accent-orange::before { background: #f59e0b; }
.metric.accent-orange::after { background: rgba(245, 158, 11, .12); }
.metric.accent-slate::before { background: #334155; }
.metric.accent-slate::after { background: rgba(51, 65, 85, .08); }

.metric span {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  position: relative;
  z-index: 1;
  color: #0f172a;
  font-size: 27px;
  letter-spacing: 0;
}

.metric small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 9px;
  color: #64748b;
  font-weight: 800;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr .95fr;
  gap: 14px;
  margin-bottom: 16px;
}

.insight-card {
  padding: 16px;
  min-height: 182px;
}

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

.insight-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-head strong {
  color: #0f172a;
  text-align: right;
  overflow-wrap: anywhere;
}

.bar-list,
.mini-list {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 92px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.bar-row span,
.bar-row strong {
  color: #64748b;
}

.bar-row i {
  display: block;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.bar-row b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0d4ed8, #38bdf8);
}

.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  font-weight: 800;
}

.mini-row span {
  min-width: 0;
  color: #334155;
  overflow-wrap: anywhere;
}

.mini-row strong {
  white-space: nowrap;
  color: #0d4ed8;
}

.mini-row strong.warn { color: #b45309; }
.mini-row strong.bad { color: #b91c1c; }
.mini-row.good strong { color: #047857; }

.insight-note {
  margin: 0;
  color: #64748b;
  line-height: 1.45;
  font-weight: 700;
}

.tabs {
  position: sticky;
  top: 98px;
  z-index: 10;
  gap: 8px;
  padding: 10px;
  margin-bottom: 14px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .08);
  backdrop-filter: blur(12px);
}

.tab {
  min-height: 42px;
  background: transparent;
  color: #475569;
  border-color: transparent;
}

.tab:hover {
  background: #eef6ff;
  color: #0d4ed8;
}

.tab.active {
  background: linear-gradient(135deg, #0d4ed8, #1d75f0);
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(13, 78, 216, .24);
}

.panel-head {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  padding: 15px 16px;
}

.panel-head h2 {
  color: #0f172a;
  font-size: 18px;
}

.panel-body {
  padding: 16px;
}

input,
select {
  min-height: 43px;
  border-color: #cbd5e1;
  background: #ffffff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .18);
}

button,
.file-button {
  min-height: 43px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0d4ed8, #1d75f0);
  box-shadow: 0 10px 22px rgba(13, 78, 216, .18);
}

button.secondary,
.file-button {
  background: #f8fafc;
  color: #0d4ed8;
  border-color: #cbd5e1;
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 10px 22px rgba(220, 38, 38, .16);
}

.toolbar {
  gap: 10px;
}

.stock-alerts {
  border-color: rgba(15, 159, 110, .22);
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.stock-alerts.warn {
  border-color: rgba(245, 158, 11, .28);
  background: linear-gradient(135deg, #fff7ed, #ffffff);
}

.table-wrap {
  border-color: rgba(148, 163, 184, .32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

table {
  font-size: 13px;
}

th {
  background: #f1f5f9;
  color: #64748b;
}

tbody tr:hover {
  background: #f8fbff;
}

.pos-shell {
  grid-template-columns: minmax(0, 1fr) minmax(320px, .38fr);
}

.pos-card {
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 146px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.pos-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 78, 216, .28);
  box-shadow: 0 18px 32px rgba(15, 23, 42, .10);
}

.pos-card-image {
  width: 96px;
  min-height: 120px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.04)),
    linear-gradient(135deg, #0d4ed8, #38bdf8);
}

.pos-side {
  position: sticky;
  top: 162px;
}

.pos-summary-line.total strong {
  color: #0d4ed8;
}

.auth-hero {
  background:
    radial-gradient(circle at 18% 18%, rgba(56, 189, 248, .28), transparent 28%),
    linear-gradient(135deg, #071737, #0d4ed8 64%, #38bdf8);
}

.auth-card {
  box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.settings-preview {
  background:
    radial-gradient(circle at 16% 20%, rgba(56, 189, 248, .18), transparent 30%),
    linear-gradient(135deg, #ffffff, #edf6ff);
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .command-center {
    grid-template-columns: 1fr;
  }

  .command-actions {
    justify-content: flex-start;
  }
}

/* POS checkout refinements */
.pos-card {
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 152px;
}

.pos-card-image {
  width: 132px;
  min-height: 132px;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
}

.pos-card-image.has-image {
  background-size: contain;
  background-repeat: no-repeat;
  background-color: #f8fafc;
}

.pos-card-body {
  min-width: 0;
}

.pos-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.pos-card-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pos-card-meta b {
  max-width: 132px;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: right;
  line-height: 1.1;
}

.pos-card-actions {
  grid-template-columns: minmax(78px, 96px) minmax(104px, 1fr);
}

.pos-card-actions input {
  font-weight: 900;
  font-size: 16px;
}

.payment-calculator {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(13, 78, 216, .16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 78, 216, .06), rgba(56, 189, 248, .08)),
    #ffffff;
}

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

.payment-method {
  min-height: 38px;
  padding-inline: 8px;
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: none;
  font-size: 12px;
}

.payment-method.active {
  background: linear-gradient(135deg, #0d4ed8, #1d75f0);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(13, 78, 216, .18);
}

.change-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(15, 159, 110, .24);
  border-radius: 8px;
  background: #f0fdf4;
  padding: 12px;
}

.change-box span {
  color: #047857;
  font-weight: 900;
}

.change-box strong {
  color: #065f46;
  font-size: 24px;
  overflow-wrap: anywhere;
  text-align: right;
}

@media (max-width: 720px) {
  .pos-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .pos-card-image {
    width: 96px;
    min-height: 112px;
  }

  .payment-methods {
    grid-template-columns: 1fr;
  }
}

/* Premium login skin adapted from the provided reference */
body.auth-mode header {
  display: none;
}

body.auth-mode main {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.auth-mode .auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 0;
  padding: 0;
  background: #ffffff;
}

body.auth-mode .auth-hero {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 46px 48px;
  background:
    radial-gradient(circle at 72% 28%, rgba(56, 189, 248, .18), transparent 26%),
    linear-gradient(135deg, #121a2c 0%, #0d4ed8 100%);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

body.auth-mode .auth-hero::after {
  display: none;
}

.auth-pos-photo {
  position: absolute;
  top: 22%;
  right: 9%;
  z-index: 1;
  width: min(31vw, 310px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.46);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0,0,0,.28);
  transform: rotate(2deg);
}
.auth-pos-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, transparent 45%, rgba(8,52,129,.20)); }
.auth-pos-photo img { display: block; width: 100%; aspect-ratio: 1.08; object-fit: cover; }

.auth-brand-block {
  display: flex;
  gap: 16px;
  align-items: center;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #ffffff;
  color: #0058be;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  box-shadow: 0 14px 30px rgba(0,0,0,.16);
}

.auth-brand-block strong {
  display: block;
  color: #ffffff;
  font-size: 28px;
  line-height: 1.05;
}

.auth-brand-block span {
  display: block;
  margin-top: 5px;
  color: rgba(255,255,255,.72);
  font-weight: 800;
}

.auth-message {
  align-self: end;
  max-width: 480px;
  margin-bottom: 30px;
}

body.auth-mode .auth-kicker {
  display: inline-flex;
  width: max-content;
  margin-bottom: 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(33, 112, 228, .28);
  color: #ffffff;
  padding: 8px 13px;
  font-weight: 900;
}

body.auth-mode .auth-hero h2 {
  max-width: 520px;
  margin: 0;
  font-size: 43px;
  line-height: 1.18;
  font-weight: 700;
}

body.auth-mode .auth-hero p {
  margin: 20px 0 0;
  max-width: 520px;
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.48;
}

body.auth-mode .auth-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 32px;
}

body.auth-mode .auth-highlights span {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  background: rgba(255,255,255,.10);
  color: #ffffff;
  padding: 14px 16px;
  font-weight: 900;
}

body.auth-mode .auth-highlights i {
  color: #89ceff;
  font-style: normal;
  font-size: 20px;
}

.auth-copyright {
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 34px;
  color: rgba(255,255,255,.48);
  font-weight: 800;
}

.auth-form-side {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px;
  background: #ffffff;
}

body.auth-mode .auth-card {
  width: min(100%, 31rem);
  min-height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

body.auth-mode .auth-panel-head {
  padding: 0 0 22px;
  border: 0;
  background: transparent;
}

body.auth-mode .auth-panel-head span {
  color: #0058be;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.auth-mode .auth-panel-head h2 {
  color: #191c1e;
  font-size: 28px;
  font-weight: 500;
}

body.auth-mode .auth-login-copy { margin: 10px 0 0; color: #667085; font-size: 14px; line-height: 1.45; }

body.auth-mode .auth-panel-body {
  padding: 0;
  display: grid;
  align-content: start;
}

body.auth-mode .auth-form {
  gap: 12px;
}

body.auth-mode .auth-form label {
  color: #45464d;
  font-size: 14px;
  font-weight: 600;
}

body.auth-mode .auth-form input {
  min-height: 52px;
  border-radius: 10px;
  border-color: #c6c6cd;
  background: #f2f4f6;
  padding: 12px 14px;
  font-size: 14px;
}

body.auth-mode .auth-form input:focus {
  border-color: #0058be;
  box-shadow: 0 0 0 4px rgba(0, 88, 190, .14);
  background: #ffffff;
}

body.auth-mode #authBtn,
body.auth-mode #sendResetCode,
body.auth-mode #confirmReset {
  min-height: 52px;
  border-radius: 10px;
  background: #0058be;
  box-shadow: 0 10px 18px rgba(0, 88, 190, .22);
  font-size: 14px;
}

body.auth-mode #toggleSignup,
body.auth-mode .subtle-link,
body.auth-mode #backToLogin {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #0058be;
}

body.auth-mode .subtle-link {
  color: #76777d;
}

body.auth-mode .auth-foot {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 26px;
  color: #76777d;
  opacity: .72;
}

body.auth-mode .auth-foot span {
  border: 0;
  background: transparent;
  padding: 0;
}

body.auth-mode .auth-notice {
  margin-top: 8px;
}

@media (max-width: 900px) {
  body.auth-mode .auth-screen {
    grid-template-columns: 1fr;
  }
  .auth-pos-photo { top: 25%; right: 7%; width: min(48vw, 280px); }

  body.auth-mode .auth-hero {
    min-height: auto;
    padding: 28px 24px;
  }

  .auth-form-side {
    min-height: auto;
    padding: 34px 24px;
  }

  body.auth-mode .auth-hero h2 {
    font-size: 34px;
  }

  .auth-copyright {
    display: none;
  }
}

/* DitaPOS premium finish: shared visual polish only */
:root {
  --premium-line: #dce4ee;
  --premium-line-strong: #c9d5e4;
  --premium-shadow-xs: 0 1px 2px rgba(15, 35, 64, .035), 0 3px 9px rgba(15, 35, 64, .035);
  --premium-shadow-sm: 0 1px 2px rgba(15, 35, 64, .04), 0 8px 22px rgba(15, 35, 64, .055);
  --premium-shadow-md: 0 2px 5px rgba(15, 35, 64, .045), 0 14px 34px rgba(15, 35, 64, .075);
  --premium-shadow-button: 0 5px 14px rgba(7, 91, 197, .17);
  --premium-ease: cubic-bezier(.2, .75, .25, 1);
  --premium-fast: 160ms;
  --premium-normal: 210ms;
}

html {
  color-scheme: light;
  scrollbar-color: #b8c8dc transparent;
  scrollbar-width: thin;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(37, 99, 235, .18);
  color: #0d315d;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b8c8dc;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #94a9c2;
  background-clip: padding-box;
}

button,
.file-button,
.tab,
.icon-action,
[role="button"] {
  transition:
    color var(--premium-fast) var(--premium-ease),
    background-color var(--premium-fast) var(--premium-ease),
    border-color var(--premium-fast) var(--premium-ease),
    box-shadow var(--premium-fast) var(--premium-ease),
    opacity var(--premium-fast) var(--premium-ease),
    transform var(--premium-fast) var(--premium-ease),
    filter var(--premium-fast) var(--premium-ease);
}

button:not(:disabled),
.file-button,
.tab:not(:disabled),
.icon-action:not(:disabled) {
  cursor: pointer;
}

button:not(.secondary):not(.danger):not(.tab):not(.icon-action):not(.app-sidebar-logout) {
  box-shadow: var(--premium-shadow-button);
}

button.secondary,
.file-button.secondary {
  border-color: var(--premium-line-strong);
  background: #f7faff;
  box-shadow: var(--premium-shadow-xs);
}

button.danger {
  box-shadow: 0 5px 14px rgba(220, 38, 38, .14);
}

button:disabled,
.tab:disabled {
  filter: saturate(.72);
  box-shadow: none !important;
}

button:focus-visible,
.file-button:focus-visible,
.tab:focus-visible,
.icon-action:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .22);
  outline-offset: 2px;
}

input,
select,
textarea {
  border-color: var(--premium-line-strong);
  background-color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(15, 35, 64, .025);
  transition:
    border-color var(--premium-fast) var(--premium-ease),
    box-shadow var(--premium-fast) var(--premium-ease),
    background-color var(--premium-fast) var(--premium-ease);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #aebed2;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4d8bd5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), 0 1px 2px rgba(15, 35, 64, .04);
}

input::placeholder,
textarea::placeholder {
  color: #8795a8;
  opacity: 1;
}

.panel,
.metric,
.inventory-kpi,
.insight-card,
.period-card,
.accounting-form-card,
.accounting-history-card,
.sales-filter-card,
.sales-table-card,
.fixed-expense-kpis article,
.net-profit-grid article,
.security-status-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-sm);
  transition:
    border-color var(--premium-normal) var(--premium-ease),
    box-shadow var(--premium-normal) var(--premium-ease),
    transform var(--premium-normal) var(--premium-ease);
}

.panel:hover,
.accounting-history-card:hover,
.sales-table-card:hover {
  border-color: #d2deeb;
  box-shadow: var(--premium-shadow-md);
}

.panel-head {
  border-bottom-color: var(--premium-line);
  background: #f8faff;
}

.table-wrap,
.inventory-list-panel,
.accounting-history-card,
.sales-table-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-xs);
}

table thead,
table thead tr {
  background: #f1f5fb;
}

table th {
  color: #40516a;
  letter-spacing: .01em;
}

table td,
table th {
  border-color: #e8edf4;
}

tbody tr {
  transition:
    background-color var(--premium-fast) var(--premium-ease),
    box-shadow var(--premium-fast) var(--premium-ease);
}

tbody tr:hover {
  background: #f6f9fe;
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, .32);
}

.app-sidebar {
  border-right-color: var(--premium-line);
  box-shadow: 5px 0 22px rgba(15, 35, 64, .045);
}

.app-sidebar-nav .tab {
  position: relative;
  transition:
    color var(--premium-fast) var(--premium-ease),
    background-color var(--premium-fast) var(--premium-ease),
    border-color var(--premium-fast) var(--premium-ease),
    box-shadow var(--premium-fast) var(--premium-ease),
    transform var(--premium-fast) var(--premium-ease);
}

.app-sidebar-nav .tab:hover {
  background: #f0f5fc;
  color: #174f91;
}

.app-sidebar-nav .tab.active {
  border-right-color: #075bc5;
  background: #eaf2ff;
  color: #064a9c;
  box-shadow: inset 0 0 0 1px rgba(7, 91, 197, .055);
}

.app-sidebar-nav .tab.active > svg {
  color: #075bc5;
  filter: drop-shadow(0 2px 3px rgba(7, 91, 197, .12));
}

.app-sidebar-user,
.inventory-user-card {
  border-radius: 8px;
  transition: background-color var(--premium-fast) var(--premium-ease);
}

.app-sidebar-user:hover,
.inventory-user-card:hover {
  background: rgba(226, 237, 252, .62);
}

.pill,
.sales-payment,
.status-badge {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 35, 64, .055);
}

.pos-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-xs);
  transition:
    border-color var(--premium-normal) var(--premium-ease),
    box-shadow var(--premium-normal) var(--premium-ease),
    transform var(--premium-normal) var(--premium-ease);
}

.icon-action svg,
.sales-delete-one svg,
.app-sidebar-nav svg,
.payment-method svg {
  transition: transform var(--premium-fast) var(--premium-ease), color var(--premium-fast) var(--premium-ease);
}

.payment-method.active,
[data-inventory-filter].active,
.accounting-type-button.active {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12), var(--premium-shadow-xs);
}

.toast {
  border-color: rgba(21, 128, 61, .2);
  box-shadow: 0 18px 46px rgba(15, 35, 64, .16);
  animation: ditapos-toast-in var(--premium-normal) var(--premium-ease) both;
}

.toast.error {
  border-color: rgba(220, 38, 38, .28);
}

.view.active {
  animation: ditapos-view-in 190ms var(--premium-ease);
}

#sales .sales-register-modal:not(.hidden) {
  animation: ditapos-modal-in var(--premium-normal) var(--premium-ease) both;
}

#sales .sales-modal-backdrop:not(.hidden),
.mobile-pos-cart-backdrop:not(.hidden) {
  animation: ditapos-fade-in var(--premium-fast) ease-out both;
}

@media (hover: hover) and (pointer: fine) {
  button:not(:disabled):hover,
  .file-button:hover {
    filter: brightness(1.025) saturate(1.02);
    transform: translateY(-1px);
  }

  button.secondary:not(:disabled):hover,
  .file-button.secondary:hover {
    border-color: #aebfd4;
    background: #ffffff;
    box-shadow: var(--premium-shadow-sm);
  }

  button.danger:not(:disabled):hover {
    filter: brightness(1.04) saturate(1.04);
  }

  .metric:hover,
  .inventory-kpi:hover,
  .insight-card:hover,
  .period-card:hover,
  .fixed-expense-kpis article:hover,
  .net-profit-grid article:not(.net-result):hover,
  .security-status-card:hover {
    border-color: #cbd9e8;
    box-shadow: var(--premium-shadow-md);
    transform: translateY(-2px);
  }

  .pos-card:not(.disabled):hover {
    border-color: #b9cde6;
    box-shadow: 0 3px 8px rgba(15, 35, 64, .045), 0 16px 34px rgba(15, 35, 64, .095);
    transform: translateY(-2px);
  }

  .icon-action:hover svg,
  .sales-delete-one:hover svg {
    transform: scale(1.08);
  }
}

button:not(:disabled):active,
.file-button:active,
.tab:not(:disabled):active,
.icon-action:not(:disabled):active {
  transform: translateY(0) scale(.985);
  transition-duration: 90ms;
}

@keyframes ditapos-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ditapos-modal-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ditapos-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ditapos-toast-in {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 920px) {
  .app-sidebar {
    box-shadow: 0 5px 18px rgba(15, 35, 64, .055);
  }

  .app-sidebar-nav .tab.active {
    border-right-color: transparent;
    box-shadow: inset 0 -2px 0 #075bc5;
  }
}

@media (max-width: 760px) {
  .panel,
  .metric,
  .inventory-kpi,
  .pos-card,
  .accounting-form-card,
  .accounting-history-card,
  .sales-filter-card,
  .sales-table-card {
    box-shadow: var(--premium-shadow-xs);
  }

  tbody tr:hover {
    box-shadow: none;
  }
}

/* High-throughput POS interactions: quick feedback without layout shifts. */
#pos .pos-card:not(.disabled) {
  cursor: pointer;
  will-change: transform, box-shadow;
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

#pos .pos-card:focus-visible {
  outline: 3px solid rgba(54, 139, 236, .38);
  outline-offset: 2px;
  border-color: #4b96e8;
}

#pos .pos-card-actions button,
#pos .pos-checkout,
#pos .pos-cart-head button,
#pos .pos-cart-remove,
#pos .pos-cart-qty button {
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

#pos .pos-cart-item {
  animation: pos-line-in 170ms ease-out both;
}

@keyframes pos-line-in {
  from { opacity: .65; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (hover: hover) and (pointer: fine) {
  #pos .pos-card:not(.disabled):hover {
    transform: translateY(-4px);
    border-color: #a9c8eb;
    box-shadow: 0 18px 34px rgba(18, 52, 86, .15);
  }

  #pos .pos-card-actions button:not(:disabled):hover,
  #pos .pos-checkout:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 77, 168, .25);
  }

  #pos .pos-cart-head button:not(:disabled):hover,
  #pos .pos-cart-remove:not(:disabled):hover {
    color: #c92635;
  }
}

#pos .pos-card-actions button:not(:disabled):active,
#pos .pos-checkout:not(:disabled):active,
#pos .pos-cart-head button:not(:disabled):active,
#pos .pos-cart-remove:not(:disabled):active,
#pos .pos-cart-qty button:not(:disabled):active {
  transform: scale(.97);
}

#pos #posSearch:focus {
  border-color: #4b96e8;
  box-shadow: 0 0 0 4px rgba(54, 139, 236, .14);
}

html[data-theme="dark"] #pos .pos-card:not(.disabled):hover {
  border-color: #56789e;
  box-shadow: 0 18px 34px rgba(0, 0, 0, .34);
}

/* Fixed expenses, net profit and final responsive safeguards */
.view:not(.active) {
  display: none !important;
}

body.app-mode #fixed-expenses {
  width: 100%;
  min-width: 0;
  padding: 28px;
}

.fixed-expenses-head,
.net-profit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.fixed-expenses-head h2,
.fixed-expenses-head p,
.net-profit-head h2,
.net-profit-head p {
  margin: 0;
}

.fixed-expenses-head p,
.net-profit-head p {
  margin-top: 6px;
  color: #65748a;
}

.period-selector,
.net-profit-head label {
  display: grid;
  min-width: 190px;
  gap: 6px;
  color: #53637a;
  font-size: 12px;
  font-weight: 800;
}

.fixed-expense-kpis,
.net-profit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fixed-expense-kpis article,
.net-profit-grid article {
  display: grid;
  align-content: center;
  min-height: 126px;
  padding: 20px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 48, 82, .06);
}

.fixed-expense-kpis svg {
  width: 22px;
  color: #0759b8;
}

.fixed-expense-kpis span,
.net-profit-grid span {
  margin-top: 12px;
  color: #65748a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fixed-expense-kpis strong,
.net-profit-grid strong {
  margin-top: 6px;
  color: #10243f;
  font-size: 24px;
}

.fixed-expense-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fixed-expense-form .panel-body {
  display: grid;
  gap: 14px;
}

.fixed-expense-form label:not(.fixed-active-toggle) {
  display: grid;
  gap: 7px;
  color: #435269;
  font-size: 12px;
  font-weight: 800;
}

.fixed-active-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #31445d;
  font-weight: 800;
}

.fixed-active-toggle input {
  width: 20px;
  height: 20px;
}

.fixed-form-actions,
.fixed-expense-list .row-actions {
  display: flex;
  gap: 8px;
}

.fixed-form-actions button:first-child {
  flex: 1;
}

.fixed-expense-list .is-inactive {
  opacity: .58;
}

.fixed-expense-list .pill.ok {
  background: #e8f7ef;
  color: #07814e;
}

.fixed-expense-list .icon-action,
#sales .sales-delete-one {
  display: inline-grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8e2ee;
  border-radius: 7px;
  background: #fff;
  color: #40536b;
}

.fixed-expense-list .icon-action.danger,
#sales .sales-delete-one {
  color: #d93b4b;
}

.fixed-expense-list .icon-action svg,
#sales .sales-delete-one svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.net-profit-panel {
  border-top: 3px solid #0759b8;
}

.net-profit-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 20px;
}

.net-profit-grid article {
  min-height: 116px;
  box-shadow: none;
}

.net-profit-grid .negative strong {
  color: #c93445;
}

.net-profit-grid .positive strong {
  color: #07814e;
}

.net-profit-grid .net-result {
  border-color: #0759b8;
  background: #0759b8;
}

.net-profit-grid .net-result span,
.net-profit-grid .net-result strong {
  color: #fff;
}

.net-profit-grid .net-result.is-negative {
  border-color: #b92234;
  background: #b92234;
}

.net-formula {
  margin: 0 20px 20px;
  color: #65748a;
  font-size: 12px;
}

#pos .payment-split-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #eef5ff;
  color: #53637a;
  font-size: 12px;
}

#pos .payment-split-summary.hidden {
  display: none;
}

#pos .payment-split-summary strong {
  color: #0759b8;
}

@media (min-width: 1061px) {
  body.app-mode #pos.pos-dashboard.active,
  body.app-mode #pos .pos-shell,
  body.app-mode #pos .pos-catalog,
  body.app-mode #pos .pos-side {
    height: 100vh;
    min-height: 0;
    max-height: 100vh;
  }

  body.app-mode #pos.pos-dashboard.active,
  body.app-mode #pos .pos-catalog,
  body.app-mode #pos .pos-side {
    overflow: hidden;
  }

  body.app-mode #pos .pos-grid,
  body.app-mode #pos .pos-cart {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Stable native date controls across every module and theme. */
body.app-mode input[type="date"] {
  padding-right: 12px !important;
  background-image: none !important;
}

body.app-mode input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  pointer-events: none;
}

.date-input-wrap {
  position: relative;
  display: block;
}

.date-input-wrap input[type="date"] {
  width: 100%;
  padding-right: 48px !important;
}

.date-picker-icon {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #60a5fa;
  box-shadow: none;
}

.date-picker-icon:hover,
.date-picker-icon:focus-visible {
  background: rgba(96, 165, 250, .16);
  color: #93c5fd;
  outline: none;
}

.date-picker-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

/* Every full-screen dialog uses the viewport as its single centering reference. */
#inventory.product-editor-open,
#inventory:has(.quick-stock-entry:not(.hidden)),
#sales:has(.sales-register-modal:not(.hidden)) {
  transform: none !important;
  animation: none !important;
}

#inventory.product-editor-open .inventory-form-panel,
#inventory .quick-stock-entry:not(.hidden),
#sales .sales-register-modal:not(.hidden) {
  position: fixed !important;
  inset: auto !important;
  top: 50% !important;
  left: 50% !important;
  z-index: 200 !important;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  transform: translate(-50%, -50%) !important;
  animation: none !important;
}

#inventory .inventory-form-backdrop,
#inventory .inventory-entry-backdrop,
#sales .sales-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 190 !important;
}

#inventory .inventory-form-panel > .panel-head,
#inventory .quick-stock-entry > .panel-head,
#sales .sales-register-modal > .panel-head {
  position: sticky;
  top: 0;
  z-index: 4;
}

@media (max-width: 640px) {
  #inventory.product-editor-open .inventory-form-panel,
  #inventory .quick-stock-entry:not(.hidden),
  #sales .sales-register-modal:not(.hidden) {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px) !important;
  }
}

/* Sales profit is emphasized by color only, not by a badge container. */
html[data-theme="dark"] #sales .sales-profit {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--dark-green);
}

/* Optional barcode and fast stock-entry workflow. */
#inventory .product-code-field > span {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 7px;
}

#inventory .product-code-field input {
  min-width: 0;
  flex: 1;
  margin-top: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#inventory .product-code-field button {
  min-height: 46px;
  flex: 0 0 auto;
  padding: 0 15px;
  border-radius: 10px;
}

#openQuickStockEntry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#openQuickStockEntry svg {
  width: 17px;
  height: 17px;
}

.inventory-entry-backdrop {
  position: fixed;
  inset: 0;
  z-index: 170;
  background: rgba(10, 22, 38, .48);
  backdrop-filter: blur(3px);
}

.quick-stock-entry {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 180;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  transform: translate(-50%, -50%);
  overflow: auto;
  border: 1px solid #d7e1ed;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(12, 30, 54, .28);
}

.quick-stock-entry > .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #dce5ef;
  background: #ffffff;
}

.quick-stock-entry > .panel-head h2,
.quick-stock-entry > .panel-head p {
  margin: 0;
}

.quick-stock-entry > .panel-head p {
  margin-top: 5px;
  color: #65748a;
}

.quick-stock-entry-body {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.quick-stock-entry-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #f8faff;
}

.quick-stock-entry-form label {
  color: #293850;
  font-size: 12px;
  font-weight: 800;
}

.quick-stock-entry-form input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
}

#quickStockBarcode {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.quick-stock-match {
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px dashed #cfdae8;
  border-radius: 10px;
  background: #ffffff;
  color: #6c7b8f;
  font-size: 13px;
}

.quick-stock-match.found {
  border-style: solid;
  border-color: #9fdcc3;
  background: #edfbf5;
  color: #116b4d;
}

.quick-stock-match strong,
.quick-stock-match span {
  display: block;
}

.quick-stock-history {
  min-width: 0;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  overflow: hidden;
}

.quick-stock-history-head {
  padding: 17px 18px;
  border-bottom: 1px solid #dce5ef;
}

.quick-stock-history-head h3,
.quick-stock-history-head p {
  margin: 0;
}

.quick-stock-history-head p {
  margin-top: 4px;
  color: #65748a;
  font-size: 12px;
}

.quick-stock-history table {
  min-width: 690px;
}

.quick-stock-history th,
.quick-stock-history td {
  padding: 13px 14px;
  white-space: nowrap;
}

.movement-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #315170;
  font-size: 12px;
}

.stock-entry-quantity {
  color: #087a55;
}

html[data-theme="dark"] .quick-stock-entry,
html[data-theme="dark"] .quick-stock-entry > .panel-head,
html[data-theme="dark"] .quick-stock-history,
html[data-theme="dark"] .quick-stock-match {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text);
}

html[data-theme="dark"] .quick-stock-entry-form {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
}

html[data-theme="dark"] .quick-stock-entry-form label,
html[data-theme="dark"] .quick-stock-history-head h3,
html[data-theme="dark"] .quick-stock-history td {
  color: var(--dark-text);
}

html[data-theme="dark"] .quick-stock-entry > .panel-head p,
html[data-theme="dark"] .quick-stock-history-head p,
html[data-theme="dark"] .movement-code {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] .quick-stock-history-head,
html[data-theme="dark"] .quick-stock-history th,
html[data-theme="dark"] .quick-stock-history td {
  border-color: var(--dark-border);
}

html[data-theme="dark"] .quick-stock-history th {
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] .quick-stock-match.found {
  border-color: #347358;
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] .stock-entry-quantity {
  color: var(--dark-green);
}

@media (max-width: 760px) {
  #inventory .product-code-field > span {
    flex-direction: column;
  }

  #inventory .product-code-field button {
    width: 100%;
  }

  .quick-stock-entry {
    inset: 0;
    width: 100%;
    max-height: 100dvh;
    transform: none;
    border: 0;
    border-radius: 0;
  }

  .quick-stock-entry > .panel-head {
    padding: 15px;
  }

  .quick-stock-entry > .panel-head h2 {
    font-size: 19px;
  }

  .quick-stock-entry > .panel-head p {
    display: none;
  }

  .quick-stock-entry-body {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .quick-stock-entry-form {
    padding: 15px;
  }
}

@media (max-width: 1100px) {
  .net-profit-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  body.app-mode #fixed-expenses {
    padding: 16px 12px 28px;
  }

  .fixed-expense-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #reports.view:not(.active) {
    display: none !important;
  }

  #reports.view.active {
    display: grid;
    gap: 10px;
  }

  .fixed-expenses-head,
  .net-profit-head {
    align-items: stretch;
    flex-direction: column;
  }

  .period-selector,
  .net-profit-head label {
    width: 100%;
  }

  .fixed-expense-kpis,
  .net-profit-grid {
    grid-template-columns: 1fr;
  }

  .fixed-expense-kpis article,
  .net-profit-grid article {
    min-height: 98px;
  }

  .fixed-expense-list .table-wrap {
    overflow: visible;
  }

  .fixed-expense-list table,
  .fixed-expense-list tbody,
  .fixed-expense-list tr,
  .fixed-expense-list td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .fixed-expense-list thead {
    display: none;
  }

  .fixed-expense-list tbody tr {
    margin: 10px 0;
    padding: 14px;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    background: #fff;
  }

  .fixed-expense-list td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }

  .fixed-expense-list td::before {
    content: attr(data-label);
    color: #65748a;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
  }

  #pos .payment-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Split payments */
#pos .payment-methods {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#pos .payment-method > svg {
  width: 19px;
  height: 19px;
}

#pos .payment-split-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#pos .payment-split-grid.hidden {
  display: none;
}

#pos .payment-split-grid label {
  display: grid;
  gap: 7px;
  color: #435269;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

#pos .payment-split-grid input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #bfcde0;
  border-radius: 9px;
  background: #ffffff;
  color: #0c4d99;
  font-size: 16px;
  font-weight: 800;
}

#sales .sales-payment.split {
  background: #eee9ff;
  color: #6846b7;
}

.mobile-pos-cart-bar,
.mobile-pos-cart-backdrop,
.mobile-cart-close {
  display: none;
}

/* Mobile-first operational layout */
@media (max-width: 760px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.app-mode {
    padding-bottom: 74px;
    background: #f4f7fb;
  }

  body.app-mode main {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  body.app-mode #appView:not(.hidden) {
    display: block;
  }

  body.app-mode .app-workspace {
    min-height: calc(100dvh - 74px);
    padding-bottom: 12px;
  }

  .app-sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 120;
    width: 100%;
    height: 72px;
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid #d6e0ed;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 24px rgba(20, 42, 72, .1);
  }

  .app-sidebar-brand,
  .app-sidebar-footer {
    display: none !important;
  }

  .app-sidebar-nav {
    display: flex;
    height: 100%;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 1px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .app-sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .app-sidebar-nav .tab {
    display: grid;
    min-width: 76px;
    min-height: 58px;
    flex: 1 0 76px;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 5px;
    border: 0;
    border-radius: 8px;
    color: #657389;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    scroll-snap-align: start;
  }

  .app-sidebar-nav .tab > svg {
    width: 20px;
    height: 20px;
    color: currentColor;
  }

  .app-sidebar-nav .tab.active {
    border: 0;
    background: #e9f2ff;
    color: #0759b8;
    box-shadow: none;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    max-width: 100%;
  }

  .panel {
    border-radius: 8px;
  }

  .panel-head,
  .panel-body {
    padding: 16px;
  }

  .grid-form,
  .auth-grid,
  .settings-fields,
  .settings-layout,
  .period-grid {
    grid-template-columns: 1fr !important;
  }

  .grid-form button,
  .auth-grid button,
  .settings-actions button {
    width: 100%;
    min-height: 48px;
  }

  body.app-mode #users,
  body.app-mode #reports,
  body.app-mode #settings,
  body.app-mode #updates {
    padding: 14px 10px 24px;
  }

  /* Point of sale */
  body.app-mode #pos.pos-dashboard.active {
    min-height: calc(100dvh - 74px);
    background: #f4f7fb;
  }

  #pos .pos-shell {
    display: block;
    min-height: 0;
  }

  #pos .pos-catalog {
    min-height: calc(100dvh - 74px);
    padding-bottom: 88px;
  }

  #pos .pos-catalog-header {
    position: sticky;
    top: 0;
    z-index: 25;
    display: grid;
    gap: 10px;
    padding: 12px 10px 10px;
    border-bottom: 1px solid #dbe4f0;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(10px);
  }

  #pos .pos-search-wrap,
  #pos .pos-search-wrap input {
    width: 100%;
    min-width: 0;
  }

  #pos .pos-search-wrap input {
    min-height: 48px;
    padding: 0 14px;
  }

  #pos .pos-filter-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  #pos .pos-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  #pos .pos-filter-tabs button {
    min-width: max-content;
    min-height: 40px;
    padding: 0 14px;
  }

  #pos #posStockFilter {
    display: none;
  }

  #pos .pos-catalog-status {
    padding: 10px 10px 0;
  }

  #pos .pos-grid {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
  }

  #pos .pos-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 138px;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
  }

  #pos .pos-card:hover {
    transform: none;
  }

  #pos .pos-card-image,
  #pos .pos-card-image.has-image {
    width: 92px;
    height: 112px;
    min-height: 112px;
    align-self: center;
    border-radius: 7px;
  }

  #pos .pos-card-body {
    min-height: 0;
    gap: 7px;
  }

  #pos .pos-card-body strong {
    font-size: 15px;
    line-height: 1.25;
  }

  #pos .pos-card-meta {
    align-items: center;
  }

  #pos .pos-card-meta b {
    font-size: 17px;
  }

  #pos .pos-card-actions {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 7px;
  }

  #pos .pos-card-actions input,
  #pos .pos-card-actions button {
    min-height: 44px;
  }

  #pos .pos-side {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: block;
    width: 100%;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    transform: translateY(102%);
    transition: transform .22s ease;
    background: #ffffff;
    overscroll-behavior: contain;
  }

  body.pos-cart-open {
    overflow: hidden;
  }

  body.pos-cart-open #pos .pos-side {
    transform: translateY(0);
  }

  .mobile-pos-cart-backdrop {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: block;
    visibility: hidden;
    background: rgba(13, 27, 47, .42);
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
  }

  body.pos-cart-open .mobile-pos-cart-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .mobile-pos-cart-bar {
    position: fixed;
    right: 10px;
    bottom: 82px;
    left: 10px;
    z-index: 110;
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 17px;
    border-radius: 10px;
    background: #0759b8;
    box-shadow: 0 12px 30px rgba(7, 62, 132, .28);
  }

  body.pos-cart-open .mobile-pos-cart-bar {
    display: none;
  }

  .mobile-pos-cart-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-pos-cart-bar svg {
    width: 20px;
    height: 20px;
  }

  .mobile-pos-cart-bar b {
    display: grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 999px;
    background: #ffffff;
    color: #0759b8;
    font-size: 12px;
  }

  #pos .pos-cart-head {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 15px 16px;
    background: #ffffff;
  }

  #pos .pos-cart-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  #pos .mobile-cart-close {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    color: #24364f;
  }

  #pos .mobile-cart-close svg {
    width: 20px;
    height: 20px;
  }

  #pos .pos-client-field {
    margin: 12px 16px;
  }

  #pos .pos-cart-item {
    padding: 15px 16px;
  }

  #pos .pos-cart-qty {
    grid-template-columns: 42px 54px 42px;
  }

  #pos .pos-cart-qty button,
  #pos .pos-cart-qty input {
    min-height: 40px;
  }

  #pos .pos-checkout-area {
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  }

  #pos .payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  #pos .payment-method {
    min-height: 58px;
  }

  #pos .payment-cash-grid,
  #pos .payment-split-grid {
    grid-template-columns: 1fr;
  }

  #pos .pos-summary-line.total strong {
    font-size: 28px;
  }

  #pos .pos-checkout {
    min-height: 56px;
    font-size: 16px;
  }

  /* Inventory */
  #inventory.inventory-dashboard.active {
    min-height: 0;
    padding: 10px;
  }

  #inventory .inventory-main {
    min-width: 0;
  }

  #inventory .inventory-topbar {
    position: static;
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
  }

  #inventory .inventory-top-actions {
    display: grid;
    width: 100%;
  }

  #inventory .inventory-topbar button {
    width: 100%;
  }

  #inventory .inventory-kpis {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #inventory .inventory-kpi {
    min-height: 92px;
    padding: 16px;
    border-radius: 8px;
  }

  #inventory .inventory-kpi strong {
    font-size: 20px;
  }

  #inventory .inventory-controls,
  #inventory .inventory-control-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
  }

  #inventory .inventory-filter-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
  }

  #inventory .inventory-filter-tabs button {
    min-width: max-content;
  }

  #inventory .inventory-control-actions button,
  #inventory .inventory-control-actions select {
    width: 100%;
    min-height: 44px;
  }

  #inventory .inventory-row {
    margin: 9px 0;
    border-radius: 8px;
  }

  #inventory .inventory-form-panel {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  /* Sales and accounting */
  #sales .sales-topbar,
  #accounting .accounting-topbar {
    display: grid;
    height: auto;
    gap: 10px;
    padding: 14px 12px;
  }

  #sales .sales-search-wrap,
  #accounting .accounting-search-wrap {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  #sales .sales-content,
  #accounting .accounting-content {
    padding: 14px 10px 28px;
  }

  #sales .sales-heading-row {
    display: grid;
    gap: 12px;
  }

  #sales #openSalesRegister {
    width: 100%;
    min-height: 48px;
  }

  #sales .sales-filter-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  #sales .sales-filter-card button,
  #sales .sales-filter-card input {
    width: 100%;
    min-height: 46px;
  }

  #accounting .accounting-bento,
  #accounting .accounting-metric-grid,
  #accounting .accounting-form-pair,
  #accounting .accounting-filters {
    grid-template-columns: 1fr;
  }

  #accounting .accounting-stat {
    min-height: 112px;
    border-radius: 8px;
  }

  #accounting .accounting-form-card,
  #accounting .accounting-history-card {
    border-radius: 8px;
  }

  #accounting .accounting-save,
  #accounting .accounting-cancel {
    min-height: 48px;
  }

  /* Reports and remaining tables become readable cards */
  #reports {
    display: grid;
    gap: 10px;
  }

  #reports .panel {
    margin: 0;
  }

  #reports .report-line {
    align-items: flex-start;
    gap: 14px;
  }

  #reports .report-line strong {
    max-width: 55%;
    text-align: right;
    overflow-wrap: anywhere;
  }

  #reports .table-wrap,
  #users .table-wrap {
    overflow: visible;
  }

  #reports table,
  #reports tbody,
  #reports tr,
  #reports td,
  #users table,
  #users tbody,
  #users tr,
  #users td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  #reports thead,
  #users thead {
    display: none;
  }

  #reports tbody tr,
  #users tbody tr {
    display: grid;
    gap: 9px;
    margin: 10px 0;
    padding: 14px;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    background: #ffffff;
  }

  #reports td,
  #users td {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    text-align: right;
  }

  #reports td::before,
  #users td::before {
    content: attr(data-label);
    color: #6b7a90;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #users td {
    align-items: stretch;
    flex-direction: column;
    text-align: left;
  }

  #users .table-input,
  #users .user-actions,
  #users .user-actions button {
    width: 100%;
  }

  #users .user-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .security-page-head {
    gap: 14px;
  }

  .security-page-head > button {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  #pos .payment-methods {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #pos .payment-split-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Inventory redesign - scoped to inventory only */
#inventory.inventory-dashboard {
  gap: 22px;
  background: #f4f7fb;
  border-radius: 8px;
  padding: 22px;
}

#inventory .inventory-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

#inventory .inventory-topbar h2 {
  margin: 0;
  color: #142033;
  font-size: 26px;
}

#inventory .inventory-topbar button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: #004191;
  box-shadow: 0 12px 24px rgba(0, 65, 145, .22);
  text-transform: uppercase;
}

#inventory .inventory-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

#inventory .inventory-kpi {
  min-height: 150px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #dce4ef;
  border-radius: 16px;
  background: #ffffff;
  padding: 24px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
}

#inventory .kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eaf2ff;
  color: #004191;
  font-size: 22px;
  font-weight: 900;
}

#inventory .kpi-icon.warn {
  background: #fff4df;
  color: #f59e0b;
}

#inventory .kpi-icon.info {
  background: #e8f5fb;
  color: #00668a;
}

#inventory .inventory-kpi small {
  display: block;
  color: #424753;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

#inventory .inventory-kpi strong {
  display: block;
  margin-top: 8px;
  color: #0b1c30;
  font-size: 22px;
}

#inventory .inventory-form-panel,
#inventory .inventory-list-panel {
  border: 1px solid #dce4ef;
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
}

#inventory .inventory-form-panel .panel-head,
#inventory .inventory-list-panel .panel-head {
  background: #ffffff;
}

#inventory .product-grid {
  grid-template-columns: minmax(220px, 1.3fr) repeat(6, minmax(120px, 1fr)) minmax(150px, .9fr) auto;
}

#inventory .product-grid input,
#inventory .product-grid select,
#inventory .inventory-toolbar input,
#inventory .inventory-toolbar select {
  border-radius: 14px;
  background: #eff4ff;
  border-color: transparent;
}

#inventory .inventory-toolbar {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, auto);
  align-items: center;
}

#inventory #inventorySearch {
  min-height: 44px;
  padding-left: 16px;
}

#inventory #inventoryFilter {
  min-height: 44px;
  font-weight: 800;
}

#inventory .stock-alerts {
  border-radius: 14px;
  margin-bottom: 16px;
}

#inventory .table-wrap {
  border: 1px solid #dce4ef;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
}

#inventory table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

#inventory th {
  padding: 18px 22px;
  background: #eaf2ff;
  color: #27364a;
  font-size: 12px;
  letter-spacing: .02em;
}

#inventory td {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(194, 198, 213, .42);
}

#inventory .inventory-row:hover {
  background: #f8fbff;
}

#inventory .product-cell {
  gap: 14px;
}

#inventory .product-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
}

#inventory .product-cell strong {
  color: #0b1c30;
  font-size: 15px;
}

#inventory .product-cell small {
  color: #727784;
  font-weight: 700;
}

#inventory .price-text {
  color: #004191;
}

#inventory .margin-text {
  color: #0f9f6e;
}

#inventory .stock-bad {
  color: #e5484d;
}

#inventory .stock-warn {
  color: #f59e0b;
}

#inventory .pill {
  min-height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 159, 110, .10);
  color: #0f9f6e;
  font-size: 10px;
  text-transform: uppercase;
}

#inventory .pill.warn {
  background: rgba(245, 158, 11, .12);
  color: #f59e0b;
}

#inventory .pill.bad {
  background: rgba(229, 72, 77, .12);
  color: #e5484d;
}

#inventory .icon-action {
  min-width: 40px;
  min-height: 36px;
  border-radius: 10px;
}

@media (max-width: 1100px) {
  #inventory.inventory-dashboard {
    padding: 14px;
  }

  #inventory .inventory-kpis {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  #inventory .inventory-kpi {
    min-height: 112px;
  }

  #inventory .product-grid,
  #inventory .inventory-toolbar {
    grid-template-columns: 1fr;
  }

  #inventory table,
  #inventory thead,
  #inventory tbody,
  #inventory tr,
  #inventory th,
  #inventory td {
    display: block;
    min-width: 0;
  }

  #inventory thead {
    display: none;
  }

  #inventory .inventory-row {
    display: grid;
    gap: 10px;
    margin: 12px;
    border: 1px solid #dce4ef;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
  }

  #inventory td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-bottom: 0;
    padding: 4px 0;
  }

  #inventory td::before {
    content: attr(data-label);
    color: #727784;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #inventory td[data-label="Producto"] {
    display: block;
  }

  #inventory td[data-label="Producto"]::before {
    display: none;
  }

  #inventory .select-cell {
    justify-content: flex-start;
  }

  #inventory .row-actions {
    justify-content: flex-end;
  }
}

/* Inventory Stitch-style dashboard */
body.inventory-focus main {
  max-width: none;
  padding: 0;
}

body.inventory-focus .command-center,
body.inventory-focus .metrics,
body.inventory-focus .insight-grid,
body.inventory-focus main > .tabs {
  display: none;
}

#inventory.inventory-dashboard.active {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 86px);
  padding: 0;
  border-radius: 0;
  background: #f3f6fb;
}

#inventory .inventory-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: calc(100vh - 86px);
  padding: 28px 16px 22px;
  border-right: 1px solid #dbe3ef;
  background: #ffffff;
}

#inventory .inventory-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

#inventory .inventory-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0088ff, #004da8);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(0, 77, 168, .22);
}

#inventory .inventory-brand strong,
#inventory .inventory-user-card strong {
  display: block;
  color: #071529;
  font-size: 16px;
}

#inventory .inventory-brand span,
#inventory .inventory-user-card span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

#inventory .inventory-side-nav {
  display: grid;
  gap: 8px;
}

#inventory .inventory-side-nav .tab {
  width: 100%;
  min-height: 48px;
  justify-content: flex-start;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #263244;
  box-shadow: none;
  font-size: 16px;
  font-weight: 850;
}

#inventory .inventory-side-nav .tab span {
  width: 28px;
  color: #475569;
  font-size: 11px;
  font-weight: 900;
}

#inventory .inventory-side-nav .tab.active {
  background: #004da8;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 77, 168, .24);
}

#inventory .inventory-side-nav .tab.active span {
  color: #ffffff;
}

#inventory .inventory-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-radius: 12px;
  background: #eef4ff;
}

#inventory .inventory-user-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #cfe7ff;
  color: #004da8;
  font-weight: 900;
}

#inventory .inventory-main {
  min-width: 0;
  padding: 24px 32px 42px;
}

#inventory .inventory-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 32px;
  padding: 0;
  background: transparent;
}

#inventory .inventory-topbar h2 {
  color: #182235;
  font-size: 18px;
  font-weight: 900;
}

#inventory .inventory-top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: min(560px, 100%);
}

#inventory .inventory-search-wrap {
  flex: 1;
  position: relative;
}

#inventory .inventory-search-wrap span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#inventory #inventorySearch {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: #eaf1fb;
  padding: 0 18px;
  color: #1f2937;
}

#inventory .inventory-topbar button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 0 20px;
  background: #004da8;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(0, 77, 168, .22);
  font-size: 14px;
}

#inventory .inventory-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

#inventory .inventory-kpi {
  min-height: 162px;
  align-items: flex-start;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  padding: 24px;
  box-shadow: none;
}

#inventory .kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: #e6eef8;
  color: #0057b8;
  font-size: 12px;
  letter-spacing: 0;
}

#inventory .inventory-kpi div {
  display: grid;
  gap: 6px;
  padding-top: 64px;
  margin-left: -64px;
}

#inventory .inventory-kpi small {
  color: #223047;
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
}

#inventory .inventory-kpi strong {
  margin: 0;
  color: #071529;
  font-size: 17px;
  font-weight: 900;
}

#inventory .inventory-kpi em {
  color: #00a677;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

#inventory .inventory-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}

#inventory .inventory-filter-tabs,
#inventory .inventory-control-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#inventory .inventory-filter-tabs button,
#inventory .inventory-control-actions button,
#inventory .inventory-control-actions select {
  min-height: 41px;
  border: 1px solid #cbd6e5;
  border-radius: 10px;
  background: #ffffff;
  color: #263244;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: none;
}

#inventory .inventory-filter-tabs button.active {
  border-color: #004da8;
  background: #004da8;
  color: #ffffff;
}

#inventory #inventoryFilter {
  width: 1px;
  min-width: 1px;
  max-width: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

#inventory .inventory-control-actions .danger {
  background: #fff1f2;
  color: #be123c;
}

#inventory .inventory-list-panel {
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 46px rgba(15, 23, 42, .05);
}

#inventory .inventory-list-panel .table-wrap {
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}

#inventory table {
  width: 100%;
  min-width: 900px;
}

#inventory th {
  height: 78px;
  background: #eef4ff;
  color: #25334a;
  font-size: 16px;
  font-weight: 900;
}

#inventory td {
  height: 86px;
  color: #111827;
  font-size: 14px;
}

#inventory .product-thumb {
  width: 48px;
  height: 48px;
  border-radius: 9px;
}

#inventory .product-cell strong {
  max-width: 170px;
  color: #001b44;
  font-size: 16px;
  line-height: 1.45;
}

#inventory .product-cell small {
  color: #667085;
  font-size: 12px;
}

#inventory .price-text {
  color: #004da8;
  font-weight: 900;
}

#inventory .margin-text {
  color: #009f72;
  font-weight: 900;
}

#inventory .pill {
  min-height: 20px;
  padding: 4px 10px;
  background: #e8f8f1;
  color: #009f72;
  font-size: 10px;
  font-weight: 900;
}

#inventory .stock-alerts:not(:empty) {
  margin-bottom: 16px;
}

#inventory .inventory-form-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: none;
  background: rgba(15, 23, 42, .28);
  backdrop-filter: blur(2px);
}

#inventory.product-editor-open .inventory-form-backdrop {
  display: block;
}

#inventory .inventory-form-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  display: none;
  transform: translate(-50%, -50%);
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

#inventory.product-editor-open .inventory-form-panel {
  display: block;
}

#inventory .inventory-form-panel .panel-head {
  background: #ffffff;
  padding: 22px 24px;
}

#inventory .inventory-form-panel .panel-body {
  padding: 22px 24px 24px;
}

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

#inventory .product-grid label {
  color: #25334a;
  font-weight: 900;
}

#inventory .product-grid input {
  margin-top: 7px;
  min-height: 46px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid #d7e0ec;
}

/* La sección de precios debe ocupar ambas columnas del editor de producto. */
#inventory .product-grid > .wide {
  grid-column: 1 / -1;
}

#inventory .wholesale-price-tiers {
  min-width: 0;
  margin: 0;
  padding: 14px 18px 16px;
  border: 1px solid #8d98a8;
}

#inventory .wholesale-price-tiers legend {
  padding: 0 4px;
  font-size: 18px;
  font-weight: 800;
}

#inventory .wholesale-price-tiers .notice {
  margin: 0 0 12px;
}

#inventory .wholesale-tier-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#inventory .wholesale-tier-fields label {
  min-width: 0;
}

@media (max-width: 800px) {
  #inventory .wholesale-tier-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  #inventory .wholesale-tier-fields {
    grid-template-columns: 1fr;
  }
}

#inventory #saveBasicProduct {
  grid-column: 1 / -1;
  min-height: 48px;
  border-radius: 12px;
  background: #004da8;
}

@media (max-width: 980px) {
  body.inventory-focus main {
    padding: 0;
  }

  #inventory.inventory-dashboard.active {
    grid-template-columns: 1fr;
  }

  #inventory .inventory-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid #dbe3ef;
    padding: 16px;
  }

  #inventory .inventory-side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #inventory .inventory-side-nav .tab {
    justify-content: center;
    min-height: 44px;
    font-size: 13px;
  }

  #inventory .inventory-side-nav .tab span {
    display: none;
  }

  #inventory .inventory-user-card {
    display: none;
  }

  #inventory .inventory-main {
    padding: 18px 14px 28px;
  }

  #inventory .inventory-topbar,
  #inventory .inventory-top-actions,
  #inventory .inventory-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  #inventory .inventory-kpis {
    grid-template-columns: 1fr;
  }

  #inventory .inventory-kpi {
    min-height: 118px;
  }

  #inventory .inventory-kpi div {
    padding-top: 0;
    margin-left: 0;
  }

  #inventory .product-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .tabs {
    top: 90px;
  }

  .pos-side {
    position: static;
  }
}

@media (max-width: 640px) {
  body > header {
    position: static;
  }

  .tabs {
    position: static;
  }

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

  .command-copy h2 {
    font-size: 24px;
  }

  .bar-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .bar-row strong {
    grid-column: 2;
  }
}

/* Accounting dashboard - faithful Stitch adaptation */
body.accounting-focus > header,
body.accounting-focus .command-center,
body.accounting-focus .metrics,
body.accounting-focus .insight-grid,
body.accounting-focus main > .tabs {
  display: none;
}

body.accounting-focus main {
  max-width: none;
  padding: 0;
}

#accounting.accounting-dashboard.active {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
  background: #f4f7fb;
  color: #142033;
}

#accounting .accounting-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 16px;
  border-right: 1px solid #dfe6f0;
  background: #ffffff;
  box-shadow: 8px 0 28px rgba(15, 35, 64, .035);
}

#accounting .accounting-brand {
  padding: 0 20px 38px;
  color: #004598;
  font-size: 27px;
  font-weight: 900;
}

#accounting .accounting-side-nav {
  display: grid;
  gap: 4px;
}

#accounting .accounting-side-nav .tab {
  width: 100%;
  min-height: 50px;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 17px;
  border: 0;
  border-right: 4px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #525d70;
  font-size: 15px;
  font-weight: 600;
}

#accounting .accounting-side-nav .tab span {
  width: 22px;
  color: #727d8e;
  font-size: 21px;
  text-align: center;
}

#accounting .accounting-side-nav .tab.active {
  border-right-color: #004598;
  background: #eff4ff;
  color: #004598;
  font-weight: 900;
}

#accounting .accounting-side-nav .tab.active span {
  color: #004598;
}

#accounting .accounting-main {
  min-width: 0;
}

#accounting .accounting-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(250px, 340px) auto;
  align-items: center;
  gap: 22px;
  padding: 0 30px;
  border-bottom: 1px solid #e2e8f1;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 12px rgba(15, 35, 64, .035);
  backdrop-filter: blur(10px);
}

#accounting .accounting-topbar h2 {
  margin: 0;
  color: #004598;
  font-size: 19px;
}

#accounting .accounting-search-wrap {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #e0e7f2;
  border-radius: 24px;
  background: #f1f5fd;
}

#accounting .accounting-search-wrap span {
  color: #7a8698;
  font-size: 19px;
}

#accounting .accounting-search-wrap input {
  min-height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#accounting .accounting-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#accounting .accounting-top-actions button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  color: #536075;
}

#accounting .accounting-top-actions b {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  margin-left: 4px;
  border: 2px solid #b8d0ed;
  border-radius: 50%;
  background: #e8f2ff;
  color: #0054ac;
  font-size: 12px;
}

#accounting .accounting-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 30px 46px;
}

#accounting .accounting-bento {
  display: grid;
  grid-template-columns: minmax(280px, 4fr) minmax(560px, 8fr);
  gap: 16px;
  align-items: stretch;
}

#accounting .accounting-form-card,
#accounting .accounting-stat,
#accounting .accounting-history-card {
  border: 1px solid #e4e9f1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 35, 64, .075);
}

#accounting .accounting-form-card {
  padding: 20px;
  border-top: 4px solid #004598;
}

#accounting .accounting-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 21px;
}

#accounting .accounting-card-title span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #0056b8;
  border-radius: 50%;
  color: #0056b8;
  font-weight: 900;
}

#accounting .accounting-card-title h2 {
  margin: 0;
  font-size: 18px;
}

#accounting #accountingForm {
  display: grid;
  gap: 14px;
}

#accounting #accountingForm label,
#accounting .accounting-type-field legend,
#accounting .accounting-filters label {
  color: #293850;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

#accounting .accounting-type-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#accounting .accounting-type-field legend {
  margin-bottom: 8px;
}

#accounting .accounting-type-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#accounting .accounting-type-buttons button {
  min-height: 48px;
  border: 2px solid #c8d0de;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: none;
  color: #4f5d72;
  font-size: 15px;
}

#accounting .accounting-type-buttons button span {
  margin-right: 7px;
  font-size: 18px;
}

#accounting .accounting-type-buttons #accountingIncomeType.active {
  border-color: #0058bd;
  background: #f3f7ff;
  color: #0051ad;
}

#accounting .accounting-type-buttons #accountingExpenseType.active {
  border-color: #c71c27;
  background: #fff6f6;
  color: #c71c27;
}

#accounting #accountingForm input,
#accounting #accountingForm textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 1px solid #cfd7e4;
  border-radius: 9px;
  background: #ffffff;
}

#accounting #accountingForm textarea {
  min-height: 74px;
  resize: vertical;
}

#accounting .accounting-form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#accounting .accounting-save {
  min-height: 52px;
  margin-top: 7px;
  border-radius: 10px;
  background: #0051ad;
  box-shadow: 0 8px 18px rgba(0, 74, 157, .2);
}

#accounting .accounting-cancel {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #e23e4c;
}

#accounting .accounting-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#accounting .accounting-stat {
  min-width: 0;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border-top: 4px solid #0050a8;
  overflow: hidden;
}

#accounting .accounting-stat.income { border-top-color: #16a173; }
#accounting .accounting-stat.expense { border-top-color: #c8202a; }
#accounting .accounting-stat.profit { border-top-color: #f0a000; }
#accounting .accounting-stat.balance { border-top-color: #007692; }

#accounting .accounting-stat > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#accounting .accounting-stat .stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e8f0fb;
  color: #0050a8;
  font-size: 20px;
}

#accounting .accounting-stat .stat-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

#accounting .accounting-stat.income .stat-icon { background: #e4f5ee; color: #0b9c6d; }
#accounting .accounting-stat.expense .stat-icon { background: #fbe7e8; color: #cb1d28; }
#accounting .accounting-stat.profit .stat-icon { background: #fff3dc; color: #ed9b00; }
#accounting .accounting-stat.balance .stat-icon { background: #e2f1f5; color: #007692; }

#accounting .accounting-stat em {
  color: #0050a8;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

#accounting .accounting-stat.income em { color: #0b9c6d; }
#accounting .accounting-stat.expense em { color: #cb1d28; }

#accounting .accounting-stat small,
#accounting .accounting-stat strong {
  display: block;
}

#accounting .accounting-stat small {
  margin-bottom: 6px;
  color: #495970;
  font-size: 13px;
}

#accounting .accounting-stat strong {
  color: #071d39;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

#accounting .accounting-stat.expense strong {
  color: #c41420;
}

#accounting .accounting-stat.result {
  position: relative;
  border: 0;
  background: #064a9f;
  color: #ffffff;
}

#accounting .accounting-stat.result::after {
  content: "";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 70px;
  height: 46px;
  border: 9px solid rgba(255,255,255,.08);
  border-radius: 10px;
}

#accounting .accounting-stat.result .stat-icon {
  position: relative;
  z-index: 1;
  background: rgba(255,255,255,.18);
  color: #ffffff;
}

#accounting .accounting-stat.result em {
  position: relative;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: #00a66f;
  color: #ffffff;
  font-size: 9px;
}

#accounting .accounting-stat.result.negative em {
  background: #d62d3b;
}

#accounting .accounting-stat.result small {
  color: #bcd4f3;
}

#accounting .accounting-stat.result strong {
  color: #ffffff;
}

#accounting .accounting-history-card {
  margin-top: 22px;
  overflow: hidden;
}

#accounting .accounting-history-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid #e6ebf2;
}

#accounting .accounting-history-head h2 {
  margin: 0;
  font-size: 18px;
  text-transform: capitalize;
}

#accounting .accounting-history-head h2 span {
  color: #0051ad;
  font-size: 21px;
}

#accounting .accounting-history-head > div {
  display: flex;
  gap: 8px;
}

#accounting .accounting-history-head button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #cdd6e3;
  border-radius: 9px;
  background: #ffffff;
  color: #26364d;
}

#accounting .accounting-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid #e6ebf2;
  background: #f8faff;
}

#accounting .accounting-filters select,
#accounting .accounting-filters input,
#accounting .accounting-filters button {
  min-height: 42px;
  margin-top: 6px;
  border-radius: 8px;
}

#accounting .accounting-history-card .table-wrap {
  overflow: auto;
}

#accounting .accounting-history-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

#accounting .accounting-history-table th {
  padding: 15px 20px;
  border-bottom: 1px solid #e4eaf2;
  background: #f5f7fb;
  color: #293850;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .03em;
  text-align: left;
  text-transform: uppercase;
}

#accounting .accounting-history-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #edf1f5;
  color: #182940;
  font-size: 13px;
  vertical-align: middle;
}

#accounting .accounting-history-table tbody tr:hover {
  background: #f8fbff;
}

#accounting .accounting-kind {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

#accounting .accounting-kind.income {
  background: #e2f6ee;
  color: #099a69;
}

#accounting .accounting-kind.expense {
  background: #fbe7e8;
  color: #ca1b26;
}

#accounting .accounting-value {
  white-space: nowrap;
}

#accounting .accounting-value.income { color: #00a16d; }
#accounting .accounting-value.expense { color: #c71c27; }

#accounting .accounting-history-table em {
  color: #526078;
  font-style: italic;
}

#accounting .accounting-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

#accounting .accounting-user b {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcedff;
  color: #0052aa;
  font-size: 9px;
}

#accounting .accounting-row-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
}

#accounting .accounting-row-actions button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: #0051ad;
}

#accounting .accounting-row-actions button:hover {
  background: #eaf2ff;
}

#accounting .accounting-row-actions button.delete {
  color: #d51e2b;
}

#accounting .accounting-row-actions button.delete:hover {
  background: #fff0f1;
}

#accounting #accountingEmpty {
  padding: 54px 20px;
  text-align: center;
}

#accounting #accountingEmpty strong,
#accounting #accountingEmpty span {
  display: block;
}

#accounting #accountingEmpty strong {
  margin-bottom: 8px;
  color: #1a2b43;
}

#accounting #accountingEmpty span {
  color: #6d7b90;
}

@media (max-width: 1120px) {
  #accounting .accounting-bento {
    grid-template-columns: minmax(270px, 1fr) minmax(430px, 2fr);
  }

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

@media (max-width: 860px) {
  #accounting.accounting-dashboard.active {
    grid-template-columns: 1fr;
  }

  #accounting .accounting-sidebar {
    min-height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid #dfe6f0;
  }

  #accounting .accounting-brand {
    padding: 0 6px 12px;
    font-size: 21px;
  }

  #accounting .accounting-side-nav {
    display: flex;
    overflow-x: auto;
  }

  #accounting .accounting-side-nav .tab {
    width: auto;
    min-width: max-content;
    min-height: 42px;
    padding: 0 13px;
    border-right: 0;
    border-bottom: 3px solid transparent;
  }

  #accounting .accounting-side-nav .tab.active {
    border-bottom-color: #004598;
  }

  #accounting .accounting-side-nav .tab span {
    display: none;
  }

  #accounting .accounting-topbar {
    position: static;
    grid-template-columns: 1fr auto;
    padding: 14px 18px;
  }

  #accounting .accounting-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #accounting .accounting-content {
    padding: 20px 14px 36px;
  }

  #accounting .accounting-bento {
    grid-template-columns: 1fr;
  }

  #accounting .accounting-form-card {
    order: 2;
  }

  #accounting .accounting-metric-grid {
    order: 1;
  }
}

@media (max-width: 600px) {
  #accounting .accounting-metric-grid,
  #accounting .accounting-form-pair,
  #accounting .accounting-filters {
    grid-template-columns: 1fr;
  }

  #accounting .accounting-stat {
    min-height: 145px;
  }

  #accounting .accounting-history-head {
    align-items: flex-start;
    flex-direction: column;
  }

  #accounting .accounting-history-head > div,
  #accounting .accounting-history-head button {
    width: 100%;
  }

  #accounting .accounting-history-card {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  #accounting .accounting-history-head,
  #accounting .accounting-filters {
    border: 1px solid #e0e7f1;
    background: #ffffff;
  }

  #accounting .accounting-history-head {
    border-radius: 13px 13px 0 0;
  }

  #accounting .accounting-history-table,
  #accounting .accounting-history-table tbody,
  #accounting .accounting-history-table tr,
  #accounting .accounting-history-table td {
    display: block;
    width: 100%;
  }

  #accounting .accounting-history-table {
    min-width: 0;
  }

  #accounting .accounting-history-table thead {
    display: none;
  }

  #accounting .accounting-history-table tr {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 13px;
    background: #ffffff;
  }

  #accounting .accounting-history-table td {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border: 0;
    text-align: right;
  }

  #accounting .accounting-history-table td::before {
    content: attr(data-label);
    color: #748198;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }

  #accounting .accounting-user,
  #accounting .accounting-row-actions {
    justify-content: flex-end;
  }
}

/* Modern-workspace navigation and overflow correction */
body.inventory-focus,
body.pos-focus,
body.sales-focus,
body.accounting-focus {
  overflow-x: hidden;
}

body.inventory-focus .legacy-main-tabs,
body.pos-focus .legacy-main-tabs,
body.sales-focus .legacy-main-tabs,
body.accounting-focus .legacy-main-tabs {
  display: none !important;
}

#appView,
#inventory.inventory-dashboard,
#inventory .inventory-main,
#pos.pos-dashboard,
#sales.sales-dashboard,
#accounting.accounting-dashboard {
  min-width: 0;
  max-width: 100%;
}

#inventory .inventory-main {
  width: 100%;
  overflow: hidden;
}

#inventory .inventory-side-nav .tab span {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

#inventory .inventory-top-actions {
  width: min(560px, 100%);
  min-width: 0;
}

#inventory .inventory-top-actions > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

#inventory .inventory-kpi,
#inventory .inventory-kpi div {
  min-width: 0;
}

@media (max-width: 1250px) {
  #inventory.inventory-dashboard.active {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  #inventory .inventory-main {
    padding-right: 20px;
    padding-left: 20px;
  }

  #inventory .inventory-kpis {
    gap: 14px;
  }

  #inventory .inventory-kpi {
    padding: 18px;
  }

  #inventory .inventory-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  #inventory .inventory-control-actions {
    width: 100%;
  }
}

/* Unified application shell */
body.app-mode {
  overflow-x: hidden;
  background: #f4f7fb;
}

body.app-mode > header,
body.app-mode .command-center,
body.app-mode #appView > .app-workspace > .metrics,
body.app-mode .insight-grid,
body.app-mode .legacy-main-tabs {
  display: none !important;
}

body.app-mode main {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
}

body.app-mode #appView:not(.hidden) {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: #f4f7fb;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid #dce5f1;
  background: #eaf2ff;
  box-shadow: 7px 0 24px rgba(15, 35, 64, .04);
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 28px;
}

.app-sidebar-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #075bc5;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(7, 91, 197, .18);
}

.app-sidebar-brand strong,
.app-sidebar-brand span {
  display: block;
}

.app-sidebar-brand strong {
  color: #073b7a;
  font-size: 18px;
}

.app-sidebar-brand span {
  max-width: 150px;
  margin-top: 4px;
  overflow: hidden;
  color: #5c6c83;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
}

.app-sidebar-nav .tab {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: #2c3d55;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
}

.app-sidebar-nav .tab span {
  width: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  color: #35628f;
  font-size: 18px;
  line-height: 1;
}

.app-sidebar-nav .tab:hover {
  background: #dceaff;
}

.app-sidebar-nav .tab.active {
  background: #075bc5;
  color: #ffffff;
  box-shadow: 0 8px 17px rgba(7, 91, 197, .19);
}

.app-sidebar-nav .tab.active span {
  color: #ffffff;
}

.app-sidebar-footer {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #cedbed;
}

.app-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.app-sidebar-user > b {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #cfe4ff;
  color: #0754a8;
  font-size: 11px;
}

.app-sidebar-user strong,
.app-sidebar-user span {
  display: block;
}

.app-sidebar-user strong {
  color: #15283f;
  font-size: 12px;
}

.app-sidebar-user span {
  margin-top: 3px;
  color: #6c7b8f;
  font-size: 10px;
}

.app-sidebar-footer button {
  width: 100%;
  min-height: 38px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 12px;
}

.app-sidebar-logout {
  border: 1px solid #f2cbd0;
  background: #fff6f7;
  color: #cf3040;
}

.app-workspace {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  background: #f4f7fb;
}

/* Each section now uses the shared shell instead of its private sidebar. */
body.app-mode #inventory .inventory-sidebar,
body.app-mode #sales .sales-sidebar,
body.app-mode #accounting .accounting-sidebar {
  display: none !important;
}

body.app-mode #inventory.inventory-dashboard.active,
body.app-mode #sales.sales-dashboard.active,
body.app-mode #accounting.accounting-dashboard.active {
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body.app-mode #inventory .inventory-main,
body.app-mode #sales .sales-main,
body.app-mode #accounting .accounting-main,
body.app-mode #pos,
body.app-mode #users,
body.app-mode #reports,
body.app-mode #settings,
body.app-mode #updates {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.app-mode #users,
body.app-mode #reports,
body.app-mode #settings,
body.app-mode #updates {
  padding: 28px;
}

body.app-mode #pos.pos-dashboard.active {
  min-height: 100vh;
}

@media (max-width: 920px) {
  body.app-mode #appView:not(.hidden) {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: auto;
    max-height: none;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid #d7e2f0;
  }

  .app-sidebar-brand {
    padding: 0 3px 9px;
  }

  .app-sidebar-logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .app-sidebar-brand span {
    display: none;
  }

  .app-sidebar-nav {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
  }

  .app-sidebar-nav .tab {
    width: auto;
    min-width: max-content;
    min-height: 40px;
    padding: 0 13px;
  }

  .app-sidebar-nav .tab span {
    display: none;
  }

  .app-sidebar-footer {
    position: absolute;
    top: 10px;
    right: 12px;
    display: flex;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .app-sidebar-user,
  #appSidebarInstall {
    display: none !important;
  }

  .app-sidebar-logout {
    width: auto !important;
    min-height: 34px !important;
    padding: 0 11px;
  }

  body.app-mode #users,
  body.app-mode #reports,
  body.app-mode #settings,
  body.app-mode #updates {
    padding: 16px 12px 28px;
  }
}

@media (max-width: 560px) {
  .app-sidebar-brand strong {
    font-size: 16px;
  }

  .app-sidebar-logout {
    font-size: 0 !important;
  }

  .app-sidebar-logout::after {
    content: "Salir";
    font-size: 11px;
  }
}

/* Shared sidebar matched to the selected Stitch reference */
.app-sidebar {
  border-color: #e2e6ef;
  background: #fbfbff;
  box-shadow: none;
}

.app-sidebar-logo,
.app-sidebar-brand span {
  display: none;
}

.app-sidebar-brand strong {
  color: #003f8f;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0;
}

.app-sidebar-nav .tab {
  background: transparent;
  color: #4f5665;
  box-shadow: none;
  font-weight: 500;
}

.app-sidebar-nav .tab span {
  color: #7b818e;
}

.app-sidebar-nav .tab:hover {
  background: #f1f5fc;
  color: #174f91;
}

.app-sidebar-nav .tab.active {
  background: #edf3ff;
  color: #004699;
  box-shadow: none;
  font-weight: 800;
}

.app-sidebar-nav .tab.active span {
  color: #004699;
}

@media (min-width: 921px) {
  body.app-mode #appView:not(.hidden) {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .app-sidebar {
    width: 264px;
    padding: 0 16px 18px 42px;
  }

  .app-sidebar-brand {
    min-height: 116px;
    padding: 48px 4px 30px;
  }

  .app-sidebar-nav {
    gap: 1px;
  }

  .app-sidebar-nav .tab {
    min-height: 51px;
    gap: 12px;
    padding: 0 15px 0 4px;
    border: 0;
    border-right: 4px solid transparent;
    border-radius: 0;
    font-size: 16px;
  }

  .app-sidebar-nav .tab span {
    width: 24px;
    flex-basis: 24px;
    font-size: 19px;
  }

  .app-sidebar-nav .tab.active {
    border-right-color: #004699;
  }

  .app-sidebar-footer {
    margin-right: 16px;
  }
}

/* Compact correction: real icons, restrained type and no heavy focus ring. */
.app-sidebar-brand strong {
  font-size: 22px;
  line-height: 1.15;
}

.app-sidebar-nav .tab {
  appearance: none;
  outline: none;
  color: #4d5667;
  font-size: 14px;
  font-weight: 500;
}

.app-sidebar-nav .tab > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #7d8491;
  stroke-width: 2;
}

.app-sidebar-nav .tab.active {
  color: #064a9c;
  font-weight: 700;
}

.app-sidebar-nav .tab.active > svg {
  color: #064a9c;
}

.app-sidebar-nav .tab:focus,
.app-sidebar-nav .tab:active {
  outline: none;
}

.app-sidebar-nav .tab:focus-visible {
  outline: 2px solid #a9c8ee;
  outline-offset: -2px;
}

@media (min-width: 921px) {
  body.app-mode #appView:not(.hidden) {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .app-sidebar {
    width: 238px;
    padding: 0 12px 16px 30px;
  }

  .app-sidebar-brand {
    min-height: 96px;
    padding: 35px 4px 22px;
  }

  .app-sidebar-nav .tab {
    min-height: 44px;
    gap: 12px;
    padding: 0 12px 0 4px;
    font-size: 14px;
  }

  .app-sidebar-footer {
    margin-right: 12px;
  }
}

/* Brand and inventory toolbar refinement */
.app-sidebar-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 10px;
  background: linear-gradient(145deg, #075bc5, #2188eb);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(7, 91, 197, .2);
}

.app-sidebar-brand {
  gap: 10px;
}

.app-sidebar-brand strong {
  color: #073f87;
  font-size: 19px;
  line-height: 1.1;
}

.app-sidebar-brand span {
  display: block;
  max-width: 130px;
  margin-top: 4px;
  color: #748197;
  font-size: 10px;
  font-weight: 700;
}

#inventory .inventory-topbar {
  min-height: 70px;
  margin-bottom: 24px;
  padding: 10px 12px 10px 18px;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 48, 82, .055);
}

#inventory .inventory-topbar h2 {
  color: #10243f;
  font-size: 20px;
  letter-spacing: 0;
}

#inventory .inventory-top-actions {
  width: min(640px, 100%);
  gap: 12px;
}

#inventory .inventory-search-wrap {
  position: relative;
  min-width: 0;
}

#inventory .inventory-search-wrap > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #5f7189;
  pointer-events: none;
}

#inventory #inventorySearch {
  min-height: 46px;
  padding: 0 18px 0 46px;
  border: 1px solid #c7d4e5;
  border-radius: 11px;
  background: #ffffff;
  color: #1d2d43;
  box-shadow: 0 3px 10px rgba(28, 56, 94, .06);
}

#inventory #inventorySearch::placeholder {
  color: #738198;
  opacity: 1;
}

#inventory #inventorySearch:focus {
  border-color: #4489d8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 118, 205, .14);
}

#inventory .inventory-topbar button {
  min-height: 46px;
  border-radius: 10px;
  white-space: nowrap;
}

@media (min-width: 921px) {
  .app-sidebar-brand {
    min-height: 82px;
    padding: 20px 2px 16px;
  }
}

/* Shared business identity and consistent page chrome */
.app-sidebar-logo.has-image {
  border-color: #d6e2f2;
  background-color: #ffffff;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  color: transparent;
}

.inventory-kpi .kpi-icon > svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

body.app-mode #sales .sales-user-summary,
body.app-mode #accounting .accounting-top-actions {
  display: none !important;
}

body.app-mode #sales .sales-topbar {
  grid-template-columns: auto minmax(260px, 430px);
  justify-content: space-between;
}

body.app-mode #accounting .accounting-topbar {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 430px);
}

/* Cloud data and security */
#updates {
  padding: 28px clamp(18px, 3vw, 42px) 48px;
}

.security-page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.security-page-head h2 {
  margin: 4px 0 6px;
  color: #10243f;
  font-size: 26px;
  letter-spacing: 0;
}

.security-page-head p {
  margin: 0;
  color: #65748a;
}

.security-page-head > button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  white-space: nowrap;
}

.security-page-head > button svg {
  width: 18px;
  height: 18px;
}

.security-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.security-status-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  min-height: 156px;
  padding: 22px;
  border: 1px solid #dce5f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 48, 82, .06);
}

.security-status-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 8px;
  background: #eaf2ff;
  color: #0759b8;
}

.security-status-icon.success {
  background: #e8f7ef;
  color: #07814e;
}

.security-status-icon svg {
  width: 20px;
  height: 20px;
}

.security-status-card small,
.security-status-card strong,
.security-status-card p {
  display: block;
}

.security-status-card small {
  margin: 2px 0 10px;
  color: #65748a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.security-status-card strong {
  color: #10243f;
  font-size: 18px;
}

.security-status-card strong.warning {
  color: #b25b00;
}

.security-status-card p {
  margin: 8px 0 0;
  color: #65748a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.security-guidance {
  border-radius: 8px;
}

.security-guidance .panel-body {
  padding: 24px;
}

.security-guidance-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e9f2;
}

.security-guidance-title > svg {
  width: 26px;
  height: 26px;
  color: #0759b8;
}

.security-guidance-title h3,
.security-guidance-title p {
  margin: 0;
}

.security-guidance-title h3 {
  color: #10243f;
}

.security-guidance-title p {
  margin-top: 4px;
  color: #65748a;
}

.security-check-list {
  display: grid;
  gap: 14px;
  padding-top: 20px;
}

.security-check-list p {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 0;
  color: #53637a;
  line-height: 1.5;
}

.security-check-list svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin-top: 2px;
  color: #07814e;
}

@media (max-width: 900px) {
  .security-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .security-status-grid {
    grid-template-columns: 1fr;
  }

  .security-status-card {
    min-height: auto;
  }

  body.app-mode #sales .sales-topbar,
  body.app-mode #accounting .accounting-topbar {
    grid-template-columns: 1fr;
  }
}

/* Premium precedence layer: intentionally last, visual properties only */
.panel,
.metric,
.inventory-kpi,
.insight-card,
.period-card,
.accounting-form-card,
.accounting-history-card,
.sales-filter-card,
.sales-table-card,
.fixed-expense-kpis article,
.net-profit-grid article,
.security-status-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-sm);
  transition:
    border-color var(--premium-normal) var(--premium-ease),
    box-shadow var(--premium-normal) var(--premium-ease),
    transform var(--premium-normal) var(--premium-ease);
}

.panel:hover,
.accounting-history-card:hover,
.sales-table-card:hover {
  border-color: #d2deeb;
  box-shadow: var(--premium-shadow-md);
}

.panel-head {
  border-bottom-color: var(--premium-line);
  background: #f8faff;
}

.table-wrap,
.inventory-list-panel,
.accounting-history-card,
.sales-table-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-xs);
}

input,
select,
textarea {
  border-color: var(--premium-line-strong);
  box-shadow: inset 0 1px 1px rgba(15, 35, 64, .025);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4d8bd5;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12), 0 1px 2px rgba(15, 35, 64, .04);
}

.app-sidebar {
  border-right-color: var(--premium-line);
  box-shadow: 5px 0 22px rgba(15, 35, 64, .045);
}

.app-sidebar-nav .tab:hover {
  background: #f0f5fc;
  color: #174f91;
}

.app-sidebar-nav .tab.active {
  border-right-color: #075bc5;
  background: #eaf2ff;
  color: #064a9c;
  box-shadow: inset 0 0 0 1px rgba(7, 91, 197, .055);
}

.pos-card {
  border-color: var(--premium-line);
  box-shadow: var(--premium-shadow-xs);
}

tbody tr:hover {
  background: #f6f9fe;
  box-shadow: inset 3px 0 0 rgba(37, 99, 235, .32);
}

@media (hover: hover) and (pointer: fine) {
  .metric:hover,
  .inventory-kpi:hover,
  .insight-card:hover,
  .period-card:hover,
  .fixed-expense-kpis article:hover,
  .net-profit-grid article:not(.net-result):hover,
  .security-status-card:hover {
    border-color: #cbd9e8;
    box-shadow: var(--premium-shadow-md);
    transform: translateY(-2px);
  }

  .pos-card:not(.disabled):hover {
    border-color: #b9cde6;
    box-shadow: 0 3px 8px rgba(15, 35, 64, .045), 0 16px 34px rgba(15, 35, 64, .095);
    transform: translateY(-2px);
  }
}

@media (max-width: 920px) {
  .app-sidebar {
    box-shadow: 0 5px 18px rgba(15, 35, 64, .055);
  }

  .app-sidebar-nav .tab.active {
    border-right-color: transparent;
    box-shadow: inset 0 -2px 0 #075bc5;
  }
}

@media (max-width: 760px) {
  .panel,
  .metric,
  .inventory-kpi,
  .pos-card,
  .accounting-form-card,
  .accounting-history-card,
  .sales-filter-card,
  .sales-table-card {
    box-shadow: var(--premium-shadow-xs);
  }

  tbody tr:hover {
    box-shadow: none;
  }
}

/* Theme controls */
.theme-settings {
  min-width: 0;
  margin: 2px 0 0;
  padding: 16px;
  border: 1px solid var(--premium-line);
  border-radius: 8px;
  background: #f8faff;
}

.theme-settings legend {
  padding: 0 7px;
  color: #263b56;
  font-size: 13px;
  font-weight: 850;
}

.theme-settings p {
  margin: 0 0 12px;
  color: #697a90;
  font-size: 12px;
  line-height: 1.45;
}

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

.theme-options button {
  min-width: 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #cdd9e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--premium-shadow-xs) !important;
  color: #4e6077;
  font-size: 12px;
  font-weight: 800;
}

.theme-options button svg {
  width: 17px;
  height: 17px;
}

.theme-options button.active {
  border-color: #3f82d0;
  background: #eaf3ff;
  color: #0759b8;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .11) !important;
}

/* Slightly richer entry motion without changing module structure */
.view.active > .panel:not(.inventory-form-panel):not(.quick-stock-entry):not(.sales-register-modal),
.view.active .inventory-kpi,
.view.active .fixed-expense-kpis > article {
  animation: ditapos-card-in 220ms var(--premium-ease) both;
}

.view.active > .panel:not(.inventory-form-panel):not(.quick-stock-entry):not(.sales-register-modal):nth-child(2),
.view.active .inventory-kpi:nth-child(2),
.view.active .fixed-expense-kpis > article:nth-child(2) {
  animation-delay: 25ms;
}

.view.active > .panel:not(.inventory-form-panel):not(.quick-stock-entry):not(.sales-register-modal):nth-child(3),
.view.active .inventory-kpi:nth-child(3),
.view.active .fixed-expense-kpis > article:nth-child(3) {
  animation-delay: 45ms;
}

@keyframes ditapos-card-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Professional dark theme */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f151d;
  --surface: #18212c;
  --surface2: #202a36;
  --field: #131b24;
  --line: #2c3948;
  --ink: #edf3fa;
  --muted: #9cabbc;
  --primary: #3b82f6;
  --primary2: #60a5fa;
  --primary-dark: #8bbcff;
  --danger: #f16d78;
  --ok: #45c98a;
  --warn: #f4b34f;
  --premium-line: #2b3847;
  --premium-line-strong: #3a495a;
  --premium-shadow-xs: 0 1px 2px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .11);
  --premium-shadow-sm: 0 2px 4px rgba(0, 0, 0, .17), 0 10px 26px rgba(0, 0, 0, .16);
  --premium-shadow-md: 0 4px 9px rgba(0, 0, 0, .2), 0 18px 44px rgba(0, 0, 0, .2);
  --premium-shadow-button: 0 6px 18px rgba(24, 107, 220, .25);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.app-mode,
html[data-theme="dark"] body.app-mode #appView:not(.hidden),
html[data-theme="dark"] .app-workspace {
  background: #0f151d;
  color: #edf3fa;
}

html[data-theme="dark"] body > header {
  border-bottom-color: #367fd5;
  background: #111923;
}

html[data-theme="dark"] .app-sidebar {
  border-color: #293544;
  background: #141c26;
  box-shadow: 6px 0 28px rgba(0, 0, 0, .2);
}

html[data-theme="dark"] .app-sidebar-brand strong {
  color: #f3f7fc;
}

html[data-theme="dark"] .app-sidebar-brand span,
html[data-theme="dark"] .app-sidebar-user span {
  color: #91a1b4;
}

html[data-theme="dark"] .app-sidebar-nav .tab {
  color: #aebaca;
}

html[data-theme="dark"] .app-sidebar-nav .tab > svg {
  color: #8191a5;
}

html[data-theme="dark"] .app-sidebar-nav .tab:hover {
  background: #202c3a;
  color: #e4effd;
}

html[data-theme="dark"] .app-sidebar-nav .tab.active {
  border-right-color: #4d91e3;
  background: #1d3450;
  color: #9bc8ff;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .12);
}

html[data-theme="dark"] .app-sidebar-nav .tab.active > svg {
  color: #69adff;
}

html[data-theme="dark"] .app-sidebar-footer {
  border-color: #2b3847;
}

html[data-theme="dark"] .app-sidebar-user strong {
  color: #edf3fa;
}

html[data-theme="dark"] .app-sidebar-user > b,
html[data-theme="dark"] .inventory-user-avatar {
  background: #263b55;
  color: #a8d0ff;
}

html[data-theme="dark"] .app-sidebar-user:hover,
html[data-theme="dark"] .inventory-user-card:hover {
  background: #1c2734;
}

html[data-theme="dark"] .app-sidebar-logout {
  border-color: #61313a;
  background: #2a1c22;
  color: #ff9ca5;
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .inventory-kpi,
html[data-theme="dark"] .insight-card,
html[data-theme="dark"] .period-card,
html[data-theme="dark"] .accounting-form-card,
html[data-theme="dark"] .accounting-history-card,
html[data-theme="dark"] .sales-filter-card,
html[data-theme="dark"] .sales-table-card,
html[data-theme="dark"] .fixed-expense-kpis article,
html[data-theme="dark"] .net-profit-grid article,
html[data-theme="dark"] .security-status-card,
html[data-theme="dark"] .settings-preview,
html[data-theme="dark"] .inventory-list-panel {
  border-color: #2b3847;
  background: #18212c;
  box-shadow: var(--premium-shadow-sm);
}

html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .inventory-table thead,
html[data-theme="dark"] table thead,
html[data-theme="dark"] table thead tr {
  border-color: #2d3b4b;
  background: #202a36;
}

html[data-theme="dark"] table,
html[data-theme="dark"] table tbody,
html[data-theme="dark"] table tbody tr,
html[data-theme="dark"] .table-wrap {
  border-color: #2b3847;
  background: #18212c;
}

html[data-theme="dark"] table td,
html[data-theme="dark"] table th {
  border-color: #273442;
}

html[data-theme="dark"] table th {
  color: #aebccd;
}

html[data-theme="dark"] tbody tr:hover {
  background: #1e2a37;
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, .55);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .table-input {
  border-color: #3a495a;
  background: #121a23;
  color: #edf3fa;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] input:hover:not(:disabled),
html[data-theme="dark"] select:hover:not(:disabled),
html[data-theme="dark"] textarea:hover:not(:disabled) {
  border-color: #53657a;
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: #5798e5;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .2), inset 0 1px 2px rgba(0, 0, 0, .15);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #718196;
}

html[data-theme="dark"] input:disabled,
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] select:disabled {
  background: #18212b;
  color: #8897a9;
}

html[data-theme="dark"] button.secondary,
html[data-theme="dark"] .file-button.secondary,
html[data-theme="dark"] .icon-action,
html[data-theme="dark"] #sales .sales-delete-one {
  border-color: #3a495a;
  background: #202a36;
  color: #c4d1df;
}

html[data-theme="dark"] button.secondary:hover,
html[data-theme="dark"] .file-button.secondary:hover,
html[data-theme="dark"] .icon-action:hover {
  border-color: #50637a;
  background: #263342;
}

html[data-theme="dark"] .theme-settings {
  border-color: #2e3d4d;
  background: #151e28;
}

html[data-theme="dark"] .theme-settings legend {
  color: #dce7f4;
}

html[data-theme="dark"] .theme-settings p {
  color: #91a1b4;
}

html[data-theme="dark"] .theme-options button {
  border-color: #354555;
  background: #1c2733;
  color: #aebccd;
}

html[data-theme="dark"] .theme-options button:hover {
  border-color: #4d6278;
  background: #233140;
}

html[data-theme="dark"] .theme-options button.active {
  border-color: #5798e5;
  background: #1b3b60;
  color: #add2ff;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, .14) !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] .panel-head h2,
html[data-theme="dark"] .panel-head h3,
html[data-theme="dark"] .metric strong,
html[data-theme="dark"] .inventory-kpi strong,
html[data-theme="dark"] .fixed-expense-kpis strong,
html[data-theme="dark"] .net-profit-grid strong,
html[data-theme="dark"] label {
  color: #edf3fa;
}

html[data-theme="dark"] p,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .empty,
html[data-theme="dark"] .net-formula,
html[data-theme="dark"] .fixed-expenses-head p,
html[data-theme="dark"] .net-profit-head p {
  color: #9cabbc;
}

html[data-theme="dark"] #inventory .inventory-main,
html[data-theme="dark"] #sales .sales-main,
html[data-theme="dark"] #accounting .accounting-main,
html[data-theme="dark"] #pos,
html[data-theme="dark"] #users,
html[data-theme="dark"] #reports,
html[data-theme="dark"] #settings,
html[data-theme="dark"] #fixed-expenses {
  background: #0f151d;
}

html[data-theme="dark"] #inventory .inventory-topbar,
html[data-theme="dark"] #sales .sales-topbar,
html[data-theme="dark"] #accounting .accounting-topbar,
html[data-theme="dark"] #pos .pos-catalog-header,
html[data-theme="dark"] #pos .pos-cart-head {
  border-color: #2b3847;
  background: #18212c;
  box-shadow: var(--premium-shadow-xs);
}

html[data-theme="dark"] #inventory #inventorySearch {
  border-color: #3a495a;
  background: #121a23;
  color: #edf3fa;
  box-shadow: var(--premium-shadow-xs);
}

html[data-theme="dark"] #pos .pos-shell,
html[data-theme="dark"] #pos .pos-catalog,
html[data-theme="dark"] #pos .pos-side {
  border-color: #2b3847;
  background: #121a23;
}

html[data-theme="dark"] #pos .pos-card,
html[data-theme="dark"] #pos .pos-cart-item,
html[data-theme="dark"] #pos .payment-calculator,
html[data-theme="dark"] #pos .pos-summary,
html[data-theme="dark"] #pos .pos-client-field input {
  border-color: #2f3d4d;
  background: #18212c;
  color: #edf3fa;
}

html[data-theme="dark"] #pos .pos-cart-info strong {
  color: #f4f7fb;
}

html[data-theme="dark"] #pos .pos-cart-info span {
  color: #c7d6e8;
}

html[data-theme="dark"] #pos .pos-cart-line-total {
  color: #60a5fa;
}

html[data-theme="dark"] #pos .pos-card:not(.disabled):hover {
  border-color: #496b91;
  background: #1c2733;
  box-shadow: var(--premium-shadow-md);
}

html[data-theme="dark"] #pos .payment-method {
  border-color: #344454;
  background: #18222e;
  color: #9eacbd;
}

html[data-theme="dark"] #pos .payment-method.active {
  border-color: #5798e5;
  background: #1b3b60;
  color: #b8d9ff;
}

html[data-theme="dark"] #pos .payment-split-summary {
  background: #182f49;
  color: #a8b8c9;
}

html[data-theme="dark"] #pos .payment-split-summary strong {
  color: #8fc1ff;
}

html[data-theme="dark"] .stock-alerts.ok {
  border-color: #285841;
  background: #152920;
  color: #77dca8;
}

html[data-theme="dark"] .pill,
html[data-theme="dark"] .sales-payment,
html[data-theme="dark"] .status-badge {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}

html[data-theme="dark"] .pill.warn {
  background: #392b18;
  color: #f6c36f;
}

html[data-theme="dark"] .pill.bad {
  background: #3b2027;
  color: #ff9aa4;
}

html[data-theme="dark"] .pill.ok,
html[data-theme="dark"] .sales-profit {
  background: #173326;
  color: #66dca0;
}

html[data-theme="dark"] .net-profit-grid .net-result {
  border-color: #367fd5;
  background: #124f98;
}

html[data-theme="dark"] #sales .sales-register-modal {
  border-color: #344454;
  background: #18212c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}

html[data-theme="dark"] #sales .sales-modal-backdrop {
  background: rgba(5, 9, 14, .7);
  backdrop-filter: blur(4px);
}

html[data-theme="dark"] .toast {
  border-color: #2b694a;
  background: #183426;
  color: #91e8b9;
}

html[data-theme="dark"] .toast.error {
  border-color: #71343f;
  background: #3a2026;
  color: #ffadb5;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: #435268;
  background-clip: padding-box;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: #596b83;
  background-clip: padding-box;
}

html[data-theme="dark"] ::selection {
  background: rgba(96, 165, 250, .28);
  color: #ffffff;
}

body,
.app-sidebar,
.app-workspace,
.panel,
.metric,
.inventory-kpi,
.pos-card,
.accounting-form-card,
.accounting-history-card,
.sales-filter-card,
.sales-table-card,
input,
select,
textarea {
  transition:
    background-color var(--premium-normal) var(--premium-ease),
    border-color var(--premium-normal) var(--premium-ease),
    color var(--premium-normal) var(--premium-ease),
    box-shadow var(--premium-normal) var(--premium-ease);
}

@media (max-width: 560px) {
  .theme-options {
    grid-template-columns: 1fr;
  }

  .theme-options button {
    justify-content: flex-start;
    padding-inline: 16px;
  }
}

html[data-theme="dark"] .auth-form-side {
  background: #111923;
}

html[data-theme="dark"] body.auth-mode .auth-card,
html[data-theme="dark"] body.auth-mode .auth-panel-head,
html[data-theme="dark"] body.auth-mode .auth-panel-body {
  background: transparent;
}

html[data-theme="dark"] body.auth-mode .auth-panel-head h2,
html[data-theme="dark"] body.auth-mode .auth-form label {
  color: #edf3fa;
}

html[data-theme="dark"] body.auth-mode .auth-panel-head span,
html[data-theme="dark"] body.auth-mode #toggleSignup,
html[data-theme="dark"] body.auth-mode #backToLogin {
  color: #69adff;
}

html[data-theme="dark"] body.auth-mode .subtle-link,
html[data-theme="dark"] body.auth-mode .auth-foot,
html[data-theme="dark"] body.auth-mode .auth-notice {
  color: #9cabbc;
}

html[data-theme="dark"] body.auth-mode .auth-form input {
  border-color: #3a495a;
  background: #18212c;
  color: #edf3fa;
}

html[data-theme="dark"] body.auth-mode .auth-form input:focus {
  border-color: #5798e5;
  background: #1c2733;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Dark theme contrast audit: semantic roles and module-specific safeguards. */
html[data-theme="dark"] {
  --dark-bg: #0f151d;
  --dark-surface: #18212c;
  --dark-surface-raised: #202a36;
  --dark-field: #121a23;
  --dark-border: #3a495a;
  --dark-text: #edf3fa;
  --dark-text-secondary: #b7c4d3;
  --dark-text-muted: #9baabd;
  --dark-placeholder: #8999ad;
  --dark-blue: #8fc1ff;
  --dark-green: #6ee7ad;
  --dark-amber: #f5c76d;
  --dark-red: #ff9fa8;
  --dark-success-bg: #153629;
  --dark-warning-bg: #3b2c16;
  --dark-danger-bg: #3c2027;
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.app-mode,
html[data-theme="dark"] body.app-mode #appView:not(.hidden),
html[data-theme="dark"] body.app-mode .app-workspace,
html[data-theme="dark"] body.app-mode .tab-content,
html[data-theme="dark"] body.app-mode .tab-content.active {
  background: var(--dark-bg);
  color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode :where(h1, h2, h3, h4, strong, legend, label) {
  color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode :where(p, small, .muted, .help, .hint) {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] body.app-mode :where(input, select, textarea) {
  border-color: var(--dark-border);
  background: var(--dark-field);
  color: var(--dark-text);
  color-scheme: dark;
}

html[data-theme="dark"] body.app-mode :where(input, textarea)::placeholder {
  color: var(--dark-placeholder);
  opacity: 1;
}

html[data-theme="dark"] body.app-mode :where(input, select, textarea):focus {
  border-color: #69a9f5;
  box-shadow: 0 0 0 3px rgba(105, 169, 245, .2);
}

html[data-theme="dark"] .app-sidebar {
  border-color: var(--dark-border);
  background: #141d27;
}

html[data-theme="dark"] .app-sidebar-brand strong,
html[data-theme="dark"] .app-sidebar-user strong {
  color: var(--dark-text);
}

html[data-theme="dark"] .app-sidebar-brand span,
html[data-theme="dark"] .app-sidebar-user span {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] .app-sidebar-nav .tab {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] .app-sidebar-nav .tab > svg,
html[data-theme="dark"] .app-sidebar-nav .tab span {
  color: var(--dark-text-muted);
}

html[data-theme="dark"] .app-sidebar-nav .tab:hover {
  background: #213249;
  color: var(--dark-text);
}

html[data-theme="dark"] .app-sidebar-nav .tab.active {
  border-color: #69a9f5;
  background: #17365e;
  color: #ffffff;
}

html[data-theme="dark"] .app-sidebar-nav .tab.active > svg,
html[data-theme="dark"] .app-sidebar-nav .tab.active span {
  color: #ffffff;
}

html[data-theme="dark"] .app-sidebar-footer {
  border-color: var(--dark-border);
}

html[data-theme="dark"] .app-sidebar-user > b {
  background: #24466f;
  color: #ffffff;
}

/* Inventory */
html[data-theme="dark"] #inventory.inventory-dashboard,
html[data-theme="dark"] #inventory .inventory-main {
  background: var(--dark-bg);
  color: var(--dark-text);
}

html[data-theme="dark"] #inventory .inventory-topbar,
html[data-theme="dark"] #inventory .inventory-kpi,
html[data-theme="dark"] #inventory .inventory-list-panel,
html[data-theme="dark"] #inventory .inventory-form-panel,
html[data-theme="dark"] #inventory .inventory-form-panel .panel-head,
html[data-theme="dark"] #inventory .inventory-list-panel .panel-head,
html[data-theme="dark"] #inventory .table-wrap {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #inventory .inventory-topbar h2,
html[data-theme="dark"] #inventory .inventory-kpi strong,
html[data-theme="dark"] #inventory .product-cell strong,
html[data-theme="dark"] #inventory td,
html[data-theme="dark"] #inventory .product-grid label {
  color: var(--dark-text);
}

html[data-theme="dark"] #inventory .inventory-kpi small,
html[data-theme="dark"] #inventory .product-cell small,
html[data-theme="dark"] #inventory td::before {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #inventory .inventory-kpi em,
html[data-theme="dark"] #inventory .margin-text {
  color: var(--dark-green);
}

html[data-theme="dark"] #inventory .price-text {
  color: var(--dark-blue);
}

html[data-theme="dark"] #inventory .stock-bad { color: var(--dark-red); }
html[data-theme="dark"] #inventory .stock-warn { color: var(--dark-amber); }

html[data-theme="dark"] #inventory .kpi-icon {
  background: #1b3a60;
  color: var(--dark-blue);
}

html[data-theme="dark"] #inventory .kpi-icon.warn {
  background: var(--dark-warning-bg);
  color: var(--dark-amber);
}

html[data-theme="dark"] #inventory .kpi-icon.info {
  background: #173a49;
  color: #83d9f2;
}

html[data-theme="dark"] #inventory th {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #inventory td {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #inventory .inventory-row:hover td {
  background: #213044;
}

html[data-theme="dark"] #inventory .inventory-filter-tabs button,
html[data-theme="dark"] #inventory .inventory-control-actions button,
html[data-theme="dark"] #inventory .inventory-control-actions select {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #inventory .inventory-filter-tabs button.active {
  border-color: #4f9cf5;
  background: #2469b8;
  color: #ffffff;
}

html[data-theme="dark"] #inventory .inventory-control-actions .danger {
  border-color: #75404a;
  background: var(--dark-danger-bg);
  color: var(--dark-red);
}

html[data-theme="dark"] #inventory .product-grid input,
html[data-theme="dark"] #inventory .product-grid select,
html[data-theme="dark"] #inventory .inventory-toolbar input,
html[data-theme="dark"] #inventory .inventory-toolbar select {
  border-color: var(--dark-border);
  background: var(--dark-field);
  color: var(--dark-text);
}

html[data-theme="dark"] #inventory .pill.ok,
html[data-theme="dark"] #inventory .pill:not(.danger):not(.warn) {
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] #inventory .pill.warn {
  background: var(--dark-warning-bg);
  color: var(--dark-amber);
}

html[data-theme="dark"] #inventory .pill.danger {
  background: var(--dark-danger-bg);
  color: var(--dark-red);
}

/* Focused stability fixes: product editor and dark form controls. */
#inventory.product-editor-open {
  transform: none !important;
  animation: none !important;
}

#inventory .inventory-form-backdrop {
  z-index: 190;
}

#inventory .inventory-form-panel {
  z-index: 200;
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#inventory .inventory-form-panel .panel-head {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid #dbe3ef;
}

#accounting .accounting-stat .stat-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
}

html[data-theme="dark"] body.app-mode input[type="date"] {
  border-color: var(--dark-border) !important;
  background-color: var(--dark-field) !important;
  background-image: none !important;
  color: var(--dark-text) !important;
  color-scheme: dark;
  -webkit-text-fill-color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode .date-readable {
  color: #b6c5d8;
}

html[data-theme="dark"] body.app-mode .date-quick {
  border-color: rgba(96, 165, 250, .45);
  background: rgba(37, 99, 235, .18);
  color: #dbeafe;
}

html[data-theme="dark"] body.app-mode .date-quick.today,
html[data-theme="dark"] body.app-mode .date-calendar-button {
  border-color: #60a5fa;
  background: #0b6eea;
  color: #ffffff;
}

html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit,
html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit-fields-wrapper,
html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit-text,
html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit-month-field,
html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit-day-field,
html[data-theme="dark"] body.app-mode input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--dark-text) !important;
}

html[data-theme="dark"] body.app-mode #posSearch,
html[data-theme="dark"] body.app-mode #inventorySearch,
html[data-theme="dark"] body.app-mode #saleProductSearch,
html[data-theme="dark"] body.app-mode input[type="search"] {
  border-color: var(--dark-border) !important;
  background: var(--dark-field) !important;
  color: var(--dark-text) !important;
  -webkit-text-fill-color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode .sales-search-wrap,
html[data-theme="dark"] body.app-mode .accounting-search-wrap {
  border-color: var(--dark-border) !important;
  background: var(--dark-field) !important;
}

html[data-theme="dark"] body.app-mode .sales-search-wrap input,
html[data-theme="dark"] body.app-mode .accounting-search-wrap input {
  border: 0 !important;
  background: transparent !important;
  color: var(--dark-text) !important;
  -webkit-text-fill-color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode input::placeholder,
html[data-theme="dark"] body.app-mode textarea::placeholder {
  color: var(--dark-placeholder) !important;
  -webkit-text-fill-color: var(--dark-placeholder);
  opacity: 1;
}

@media (max-width: 640px) {
  #inventory .inventory-form-panel {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  #inventory .inventory-form-panel .panel-head,
  #inventory .inventory-form-panel .panel-body {
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* Point of sale */
html[data-theme="dark"] #pos,
html[data-theme="dark"] #pos .pos-catalog,
html[data-theme="dark"] #pos .pos-cart,
html[data-theme="dark"] #pos .pos-card,
html[data-theme="dark"] #pos .payment-methods,
html[data-theme="dark"] #pos .payment-split-grid {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  color: var(--dark-text);
}

html[data-theme="dark"] #pos .pos-card-body strong,
html[data-theme="dark"] #pos .pos-card-meta b,
html[data-theme="dark"] #pos .cart-item strong,
html[data-theme="dark"] #pos .cart-summary strong,
html[data-theme="dark"] #pos .pos-total,
html[data-theme="dark"] #pos .payment-method strong,
html[data-theme="dark"] #pos .payment-split-grid label {
  color: var(--dark-text);
}

html[data-theme="dark"] #pos .pos-card-body small,
html[data-theme="dark"] #pos .pos-card-meta,
html[data-theme="dark"] #pos .cart-item small,
html[data-theme="dark"] #pos .cart-summary,
html[data-theme="dark"] #pos .payment-method span,
html[data-theme="dark"] #pos .empty-state {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #pos .pos-card-meta b,
html[data-theme="dark"] #pos .pos-total strong {
  color: var(--dark-blue);
}

html[data-theme="dark"] #pos .cart-item,
html[data-theme="dark"] #pos .cart-summary,
html[data-theme="dark"] #pos .pos-toolbar,
html[data-theme="dark"] #pos .pos-cart-head,
html[data-theme="dark"] #pos .pos-checkout {
  border-color: var(--dark-border);
}

html[data-theme="dark"] #pos .qty-control button,
html[data-theme="dark"] #pos .payment-method {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--dark-text);
}

html[data-theme="dark"] #pos .payment-method.active {
  border-color: #69a9f5;
  background: #17365e;
  color: #ffffff;
}

html[data-theme="dark"] #pos .pos-card-actions input,
html[data-theme="dark"] #pos #posPaidAmount,
html[data-theme="dark"] #pos #posChangeAmount,
html[data-theme="dark"] #pos .payment-split-grid input {
  border-color: var(--dark-border);
  background: var(--dark-field);
  color: var(--dark-text);
}

html[data-theme="dark"] #pos #posChangeAmount.positive {
  border-color: #347358;
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] #pos .remove-line,
html[data-theme="dark"] #pos .clear-cart {
  color: var(--dark-red);
}

/* Sales */
html[data-theme="dark"] #sales.sales-dashboard,
html[data-theme="dark"] #sales .sales-main {
  background: var(--dark-bg);
  color: var(--dark-text);
}

html[data-theme="dark"] #sales .sales-topbar,
html[data-theme="dark"] #sales .sales-filter-card,
html[data-theme="dark"] #sales .sales-table-card,
html[data-theme="dark"] #sales .sales-modal-card {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #sales :where(h1, h2, h3, strong, label, td) {
  color: var(--dark-text);
}

html[data-theme="dark"] #sales :where(p, small, em, td::before) {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #sales th {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #sales td,
html[data-theme="dark"] #sales .sales-table-row {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #sales tbody tr:hover td {
  background: #213044;
}

html[data-theme="dark"] #sales .sales-total { color: var(--dark-blue); }
html[data-theme="dark"] #sales .sales-profit { color: var(--dark-green); }

html[data-theme="dark"] #sales .sales-payment.cash {
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] #sales .sales-payment.card {
  background: #16364d;
  color: #8bd9ff;
}

html[data-theme="dark"] #sales .sales-payment.transfer {
  background: #242d54;
  color: #b8c5ff;
}

html[data-theme="dark"] #sales .sales-payment.split {
  background: var(--dark-warning-bg);
  color: var(--dark-amber);
}

/* Accounting */
html[data-theme="dark"] #accounting.accounting-dashboard,
html[data-theme="dark"] #accounting .accounting-main,
html[data-theme="dark"] #accounting .accounting-content {
  background: var(--dark-bg);
  color: var(--dark-text);
}

html[data-theme="dark"] #accounting .accounting-form-card,
html[data-theme="dark"] #accounting .accounting-stat,
html[data-theme="dark"] #accounting .accounting-history-card,
html[data-theme="dark"] #accounting .accounting-topbar {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #accounting #accountingForm label,
html[data-theme="dark"] #accounting .accounting-type-field legend,
html[data-theme="dark"] #accounting .accounting-filters label,
html[data-theme="dark"] #accounting .accounting-card-title h2,
html[data-theme="dark"] #accounting .accounting-history-head h2,
html[data-theme="dark"] #accounting .accounting-stat strong,
html[data-theme="dark"] #accounting td {
  color: var(--dark-text);
}

html[data-theme="dark"] #accounting .accounting-stat small,
html[data-theme="dark"] #accounting td::before,
html[data-theme="dark"] #accounting td em {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #accounting .accounting-type-buttons button,
html[data-theme="dark"] #accounting .accounting-history-head button {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #accounting .accounting-type-buttons #accountingIncomeType.active {
  border-color: #69a9f5;
  background: #17365e;
  color: #b8d8ff;
}

html[data-theme="dark"] #accounting .accounting-type-buttons #accountingExpenseType.active {
  border-color: #a9535e;
  background: var(--dark-danger-bg);
  color: var(--dark-red);
}

html[data-theme="dark"] #accounting #accountingForm input,
html[data-theme="dark"] #accounting #accountingForm textarea,
html[data-theme="dark"] #accounting .accounting-filters input,
html[data-theme="dark"] #accounting .accounting-filters select {
  border-color: var(--dark-border);
  background: var(--dark-field);
  color: var(--dark-text);
}

html[data-theme="dark"] #accounting .accounting-filters,
html[data-theme="dark"] #accounting .accounting-history-head,
html[data-theme="dark"] #accounting .accounting-history-table th,
html[data-theme="dark"] #accounting .accounting-history-table td {
  border-color: var(--dark-border);
}

html[data-theme="dark"] #accounting .accounting-filters,
html[data-theme="dark"] #accounting .accounting-history-table th {
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #accounting .accounting-history-table td {
  background: var(--dark-surface);
}

html[data-theme="dark"] #accounting .accounting-history-table tbody tr:hover td {
  background: #213044;
}

html[data-theme="dark"] #accounting .accounting-stat.income strong,
html[data-theme="dark"] #accounting .accounting-stat.income em { color: var(--dark-green); }
html[data-theme="dark"] #accounting .accounting-stat.expense strong,
html[data-theme="dark"] #accounting .accounting-stat.expense em { color: var(--dark-red); }
html[data-theme="dark"] #accounting .accounting-stat.profit em { color: var(--dark-amber); }

html[data-theme="dark"] #accounting .accounting-stat.income .stat-icon {
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] #accounting .accounting-stat.expense .stat-icon {
  background: var(--dark-danger-bg);
  color: var(--dark-red);
}

html[data-theme="dark"] #accounting .accounting-stat.profit .stat-icon {
  background: var(--dark-warning-bg);
  color: var(--dark-amber);
}

/* Fixed expenses, reports, users, settings and updates */
html[data-theme="dark"] #fixed-expenses,
html[data-theme="dark"] #reports,
html[data-theme="dark"] #users,
html[data-theme="dark"] #settings,
html[data-theme="dark"] #updates {
  background: var(--dark-bg);
  color: var(--dark-text);
}

html[data-theme="dark"] #fixed-expenses :where(.panel, .fixed-expense-kpis article, tbody tr),
html[data-theme="dark"] #reports :where(.panel, .report-line, tbody tr),
html[data-theme="dark"] #users :where(.panel, tbody tr),
html[data-theme="dark"] #settings :where(.panel, .settings-preview, .theme-option),
html[data-theme="dark"] #updates :where(.panel, .update-card) {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

html[data-theme="dark"] #fixed-expenses :where(label, strong, td),
html[data-theme="dark"] #reports :where(strong, th, td),
html[data-theme="dark"] #users :where(strong, label, th, td),
html[data-theme="dark"] #settings :where(strong, label, .settings-preview strong),
html[data-theme="dark"] #updates :where(strong, label) {
  color: var(--dark-text);
}

html[data-theme="dark"] #fixed-expenses :where(span, small, td::before),
html[data-theme="dark"] #reports :where(span, small, td::before, .report-line span),
html[data-theme="dark"] #users :where(span, small, td::before),
html[data-theme="dark"] #settings :where(span, small, p, .settings-preview p),
html[data-theme="dark"] #updates :where(span, small, p) {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #fixed-expenses th,
html[data-theme="dark"] #reports th,
html[data-theme="dark"] #users th {
  border-color: var(--dark-border);
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #fixed-expenses td,
html[data-theme="dark"] #reports td,
html[data-theme="dark"] #users td {
  border-color: var(--dark-border);
}

html[data-theme="dark"] #fixed-expenses tbody tr:hover,
html[data-theme="dark"] #reports tbody tr:hover,
html[data-theme="dark"] #users tbody tr:hover {
  background: #213044;
}

html[data-theme="dark"] #fixed-expenses .pill.ok {
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

html[data-theme="dark"] #fixed-expenses .pill:not(.ok) {
  background: var(--dark-surface-raised);
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] #reports .report-line strong,
html[data-theme="dark"] #reports .metric strong,
html[data-theme="dark"] #fixed-expenses .fixed-expense-kpis strong {
  color: var(--dark-text);
}

/* Reportes 2.0: tablero visual y fácil de interpretar. */
#reports.reports-redesign { padding: 28px; background: #f4f7fc; color: #172033; }
#reports .report-hero { overflow: hidden; border: 0; border-radius: 22px; background: linear-gradient(125deg, #152d68, #3567d6 58%, #40a3db); color: #fff; box-shadow: 0 18px 38px rgba(30, 78, 173, .24); }
#reports .report-hero .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px 16px; border: 0; background: transparent; }
#reports .report-hero h2, #reports .report-hero p, #reports .report-hero span, #reports .report-hero strong { color: #fff !important; }
#reports .report-hero h2 { margin: 4px 0 5px; font-size: clamp(24px, 3vw, 34px); }
#reports .report-hero p { opacity: .86; }
#reports .report-eyebrow { display: block; color: #3667d4; font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
#reports .report-hero .report-eyebrow { color: #b8d9ff !important; }
#reports .report-period-badge { min-width: 215px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.32); border-radius: 14px; background: rgba(6, 22, 61, .22); }
#reports .report-period-badge span { display: block; font-size: 11px; opacity: .75; text-transform: uppercase; }
#reports .report-period-badge strong { display: block; margin-top: 4px; font-size: 15px; }
#reports .report-range-controls { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; padding: 16px 30px 28px; }
#reports .report-range-controls label { color: #fff; font-size: 12px; font-weight: 800; }
#reports .report-range-controls :is(select,input) { width: 100%; margin-top: 6px; border: 0; border-radius: 10px; background: #fff; color: #172033; }
#reports .report-range-summary { border: 1px solid rgba(255,255,255,.3); border-radius: 10px; background: rgba(4,18,50,.2); }
#reports .report-range-summary span, #reports .report-range-summary strong { color: #fff !important; }
#reports .report-kpis { margin: 22px 0; }
#reports .net-profit-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 14px; }
#reports .net-profit-grid article { min-height: 145px; padding: 22px; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 10px 25px rgba(34, 59, 112, .09); }
#reports .net-profit-grid span { color: #52627c !important; font-size: 12px; font-weight: 800; text-transform: uppercase; }
#reports .net-profit-grid strong { display: block; margin: 11px 0 7px; color: #172033 !important; font-size: clamp(20px, 2.1vw, 29px); }
#reports .net-profit-grid small { color: #72809a !important; }
#reports .net-profit-grid .kpi-sales { border-top: 5px solid #2563eb; }
#reports .net-profit-grid .kpi-profit { border-top: 5px solid #8b5cf6; }
#reports .net-profit-grid .negative { border-top: 5px solid #f97316; }
#reports .net-profit-grid .net-result { border: 0; background: linear-gradient(135deg,#0e9f6e,#26c47f); }
#reports .net-profit-grid .net-result :is(span,strong,small) { color: #fff !important; }
#reports .reports-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, .9fr); gap: 18px; }
#reports .reports-dashboard-grid .panel { margin: 0; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 10px 26px rgba(34, 59, 112, .08); overflow: hidden; }
#reports .reports-dashboard-grid .panel-head { padding: 21px 23px 4px; border: 0; background: transparent; }
#reports .reports-dashboard-grid .panel-head h2 { margin: 4px 0; color: #172033; font-size: 19px; }
#reports .reports-dashboard-grid .panel-body { padding: 18px 23px 23px; }
#reports .trend-card { min-height: 300px; }
#reports .report-bars { height: 190px; display: flex; align-items: end; justify-content: space-between; gap: 8px; padding-top: 14px; border-bottom: 1px solid #dce5f3; }
#reports .report-bar { flex: 1; min-width: 21px; height: 100%; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 6px; }
#reports .report-bar i { width: 100%; min-height: 5px; border-radius: 7px 7px 2px 2px; background: linear-gradient(#55a7ff,#2563eb); }
#reports .report-bar .bar-value { color: #44536d !important; font-size: 10px; white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); }
#reports .report-bar small { color: #70809a !important; font-weight: 800; }
#reports .chart-note, #reports .report-empty-state { color: #71809a !important; font-size: 13px; }
#reports .payments-card { min-height: 300px; }
#reports .payment-donut { width: 146px; height: 146px; display: grid; place-items: center; margin: 8px auto 18px; border-radius: 50%; }
#reports .payment-donut::before { content: ""; width: 96px; height: 96px; border-radius: 50%; background: #fff; grid-area: 1 / 1; }
#reports .payment-donut span { z-index: 1; grid-area: 1 / 1; color: #172033 !important; font-size: 23px; font-weight: 900; text-align: center; }
#reports .payment-donut small { display: block; color: #71809a !important; font-size: 10px; font-weight: 700; }
#reports .payment-legend { display: grid; gap: 9px; }
#reports .payment-legend div { display: grid; grid-template-columns: 11px 1fr auto; gap: 8px; align-items: center; }
#reports .payment-legend i { width: 10px; height: 10px; border-radius: 50%; }
#reports .payment-legend span { color: #53627c !important; }
#reports .payment-legend strong { color: #172033 !important; font-size: 13px; }
#reports .report-overview-card { min-height: 250px; }
#reports .report-overview-card .panel-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
#reports .report-stat { padding: 13px; border: 1px solid #e6ecf6; border-radius: 12px; background: #fafcff; }
#reports .report-stat span { display: block; color: #687791 !important; font-size: 11px; font-weight: 800; }
#reports .report-stat strong { display: block; margin-top: 5px; color: #172033 !important; font-size: 17px; }
#reports .report-product-highlights { grid-template-columns: repeat(2, 1fr); gap: 12px; }
#reports .report-product-highlight { border-radius: 13px; }
#reports .report-top-products { grid-column: 1 / -1; }
#reports .report-top-products table { font-size: 14px; }
html[data-theme="dark"] #reports.reports-redesign { background: #f4f7fc; color: #172033; }
html[data-theme="dark"] #reports.reports-redesign :is(.panel, .report-line, tbody tr) { background: #fff; border-color: #e6ecf6; }
html[data-theme="dark"] #reports.reports-redesign :is(strong, th, td) { color: #172033 !important; }
html[data-theme="dark"] #reports.reports-redesign :is(span, small, p) { color: #687791 !important; }
html[data-theme="dark"] #reports.reports-redesign .report-hero :is(h2, p, span, strong) { color: #fff !important; }
@media (max-width: 1050px) { #reports .net-profit-grid { grid-template-columns: repeat(3, 1fr); } #reports .report-range-controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { #reports.reports-redesign { padding: 14px; } #reports .report-hero .panel-head, #reports .report-range-controls { padding-left: 18px; padding-right: 18px; } #reports .report-hero .panel-head { align-items: start; flex-direction: column; } #reports .net-profit-grid, #reports .reports-dashboard-grid, #reports .report-overview-card .panel-body { grid-template-columns: 1fr; } #reports .report-range-controls { grid-template-columns: 1fr; } }

html[data-theme="dark"] #settings .settings-preview {
  background: var(--dark-surface-raised);
}

html[data-theme="dark"] #settings .theme-option[aria-pressed="true"] {
  border-color: #69a9f5;
  background: #17365e;
  color: #ffffff;
}

html[data-theme="dark"] #updates .pill.ok,
html[data-theme="dark"] #updates .update-ok {
  background: var(--dark-success-bg);
  color: var(--dark-green);
}

/* Authentication is outside app-mode and needs its own readable placeholders. */
html[data-theme="dark"] body.auth-mode .auth-form input::placeholder {
  color: var(--dark-placeholder);
  opacity: 1;
}

html[data-theme="dark"] body.auth-mode .auth-status.error {
  color: var(--dark-red);
}

html[data-theme="dark"] body.auth-mode .auth-status.success {
  color: var(--dark-green);
}

/* Fixed expenses header: isolated from global bars and aligned with the app shell. */
body.app-mode #fixed-expenses .fixed-expenses-head {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 1px solid #dce5f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 35, 64, .07);
}

body.app-mode #fixed-expenses .fixed-expenses-head > div {
  min-width: 0;
}

body.app-mode #fixed-expenses .fixed-expenses-head .section-kicker {
  margin: 0 0 8px;
  padding: 5px 9px;
  border: 1px solid #c9dcf5;
  background: #edf5ff;
  color: #0755a9;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .04em;
}

body.app-mode #fixed-expenses .fixed-expenses-head h2 {
  margin: 0;
  color: #10243f;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.16;
}

body.app-mode #fixed-expenses .fixed-expenses-head p {
  max-width: 680px;
  margin: 7px 0 0;
  color: #607087;
  font-size: 13px;
  line-height: 1.45;
}

body.app-mode #fixed-expenses .period-selector {
  width: 210px;
  min-width: 210px;
  gap: 7px;
  color: #42536a;
  font-size: 11px;
  font-weight: 800;
}

body.app-mode #fixed-expenses .period-selector select {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 38px 0 12px;
  border: 1px solid #cbd7e6;
  border-radius: 9px;
  background-color: #f7f9fc;
  color: #172a43;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
}

html[data-theme="dark"] body.app-mode #fixed-expenses .fixed-expenses-head {
  border-color: var(--dark-border);
  background: var(--dark-surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] body.app-mode #fixed-expenses .fixed-expenses-head .section-kicker {
  border-color: #365f91;
  background: #17365e;
  color: #b8d8ff;
}

html[data-theme="dark"] body.app-mode #fixed-expenses .fixed-expenses-head h2 {
  color: var(--dark-text);
}

html[data-theme="dark"] body.app-mode #fixed-expenses .fixed-expenses-head p,
html[data-theme="dark"] body.app-mode #fixed-expenses .period-selector {
  color: var(--dark-text-secondary);
}

html[data-theme="dark"] body.app-mode #fixed-expenses .period-selector select {
  border-color: var(--dark-border);
  background-color: var(--dark-field);
  color: var(--dark-text);
}

@media (max-width: 700px) {
  body.app-mode #fixed-expenses .fixed-expenses-head {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  body.app-mode #fixed-expenses .period-selector {
    width: 100%;
    min-width: 0;
  }
}

/* Desktop POS: independent scrolling for product catalog and complete invoice. */
@media (min-width: 1061px) {
  body.app-mode #pos .pos-catalog {
    overflow: hidden;
  }

  body.app-mode #pos .pos-grid {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  body.app-mode #pos .pos-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
  }

  body.app-mode #pos .pos-cart {
    min-height: 260px;
    flex: 0 0 auto;
    overflow: visible;
  }

  body.app-mode #pos .pos-checkout-area {
    flex: 0 0 auto;
  }

  body.app-mode #pos .pos-grid,
  body.app-mode #pos .pos-side {
    scrollbar-width: thin;
    scrollbar-color: #9eb2ca #edf2f8;
  }

  body.app-mode #pos .pos-grid::-webkit-scrollbar,
  body.app-mode #pos .pos-side::-webkit-scrollbar {
    width: 10px;
  }

  body.app-mode #pos .pos-grid::-webkit-scrollbar-track,
  body.app-mode #pos .pos-side::-webkit-scrollbar-track {
    background: #edf2f8;
  }

  body.app-mode #pos .pos-grid::-webkit-scrollbar-thumb,
  body.app-mode #pos .pos-side::-webkit-scrollbar-thumb {
    border: 2px solid #edf2f8;
    border-radius: 999px;
    background: #9eb2ca;
  }

  html[data-theme="dark"] body.app-mode #pos .pos-grid,
  html[data-theme="dark"] body.app-mode #pos .pos-side {
    scrollbar-color: #60758e #121a23;
  }

  html[data-theme="dark"] body.app-mode #pos .pos-grid::-webkit-scrollbar-track,
  html[data-theme="dark"] body.app-mode #pos .pos-side::-webkit-scrollbar-track {
    background: #121a23;
  }

  html[data-theme="dark"] body.app-mode #pos .pos-grid::-webkit-scrollbar-thumb,
html[data-theme="dark"] body.app-mode #pos .pos-side::-webkit-scrollbar-thumb {
    border-color: #121a23;
    background: #60758e;
  }
}

/* DitaPOS official brand identity */
.platform-brand-image {
  background-color: #fff;
  background-image: url("assets/ditapos-logo-oficial.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent;
}

.auth-brand-block {
  align-items: flex-start;
}

.auth-logo {
  width: 148px;
  height: 148px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .28);
}

.platform-logo-image {
  display: block;
  object-fit: contain;
  background: #fff;
}

.app-sidebar-logo.platform-brand-image,
.logo-mark.platform-brand-image {
  border: 1px solid rgba(58, 143, 255, .28);
  background-size: contain;
}

#inventory .inventory-brand-mark.platform-logo-image,
#sales .sales-brand-mark.platform-logo-image {
  padding: 0;
  overflow: hidden;
  border: 1px solid #c8d7eb;
  border-radius: 8px;
}

html[data-theme="dark"] #inventory .inventory-brand-mark.platform-logo-image,
html[data-theme="dark"] #sales .sales-brand-mark.platform-logo-image {
  border-color: #35506f;
}

@media (max-width: 720px) {
  .auth-logo {
    width: 112px;
    height: 112px;
  }
}

/* Final override: every visible delete button uses the same red treatment. */
body button.delete-action,
body #inventory button.delete-action,
body #sales button.delete-action,
body #accounting button.delete-action,
body #fixed-expenses button.delete-action,
body #users button.delete-action,
body #pos button.delete-action,
html[data-theme="dark"] body button.delete-action {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 15px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  border: 1px solid #ef3340 !important;
  border-radius: 8px !important;
  background: #ef3340 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(239, 51, 64, .2) !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body button.delete-action svg {
  width: 17px !important;
  height: 17px !important;
  color: #ffffff !important;
  stroke: currentColor !important;
}

body button.delete-action.delete-action-icon {
  width: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
}

body button.delete-action:disabled,
html[data-theme="dark"] body button.delete-action:disabled {
  border-color: #8f4b51 !important;
  background: #8f4b51 !important;
  color: #e9c9cc !important;
  box-shadow: none !important;
  opacity: .62;
}

@media (hover: hover) and (pointer: fine) {
  body button.delete-action:not(:disabled):hover,
  html[data-theme="dark"] body button.delete-action:not(:disabled):hover {
    border-color: #d91f2d !important;
    background: #d91f2d !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(217, 31, 45, .28) !important;
  }
}

@media (max-width: 700px) {
  body button.delete-action.delete-action-record {
    min-width: 92px !important;
  }
}

/* POS offline queue: compact, visible and consistent in both themes. */
#pos .pos-catalog-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

#pos .offline-sync-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 7px 5px 11px;
  border: 1px solid var(--border, #d7e0ec);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--muted, #667085);
  box-shadow: 0 6px 18px rgba(15, 45, 84, .07);
}

#pos .connection-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #087a4b;
  font-weight: 800;
}

#pos .connection-state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, .13);
}

#pos .connection-state.offline {
  color: #b54708;
}

#pos .connection-state.offline i {
  background: #f79009;
  box-shadow: 0 0 0 4px rgba(247, 144, 9, .16);
}

#pos #pendingSyncCount,
#pos #lastSyncAt {
  white-space: nowrap;
  font-size: 12px;
}

#pos #syncPendingSales {
  min-height: 30px;
  padding: 0 11px;
}

#pos .offline-warning {
  margin: 0 18px 12px;
  padding: 11px 13px;
  border: 1px solid #f7c66c;
  border-radius: 8px;
  background: #fff8e8;
  color: #8a4b08;
  font-size: 13px;
  font-weight: 700;
}

html[data-theme="dark"] #pos .offline-sync-card {
  border-color: #34465b;
  background: #182432;
  color: #b8c6d9;
}

html[data-theme="dark"] #pos .offline-warning {
  border-color: #765517;
  background: #2f2819;
  color: #ffd88a;
}

body.is-offline .app-sidebar .tab[disabled] {
  cursor: not-allowed;
  opacity: .48;
}

.stock-conflict-badge {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 7px;
  border: 1px solid #f1a94b;
  border-radius: 999px;
  background: #fff3dc;
  color: #8a4b08;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

html[data-theme="dark"] .stock-conflict-badge {
  border-color: #8c621c;
  background: #332a19;
  color: #ffd88a;
}

@media (max-width: 780px) {
  #pos .offline-sync-card {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 9px 10px;
  }

  #pos #lastSyncAt {
    white-space: normal;
  }

  #pos .offline-warning {
    margin-inline: 10px;
  }
}

/* Final visual fixes for the personal Ditaessence build. */
#pos .pos-card-image,
#pos .pos-card-image.has-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #162231 !important;
}

#sales .sales-register-modal > .panel-head,
#sales .customer-modal > .panel-head {
  background: #111923 !important;
  color: #f4f7fb !important;
  border-bottom-color: #2e3c4d !important;
}

#sales .sales-register-modal > .panel-head h2,
#sales .customer-modal > .panel-head h2 {
  color: #f4f7fb !important;
}

/* Shipping labels: editable preview before printing. */
#sales .shipment-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-height: 42px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-color: #62aaff !important;
  background: rgba(10, 102, 214, .14) !important;
  color: #8fc5ff !important;
}

#sales .shipment-action svg {
  width: 17px !important;
  height: 17px !important;
  stroke: currentColor !important;
}

#sales .shipment-modal {
  position: fixed;
  inset: 34px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: auto;
  overflow: hidden;
  border: 1px solid #32465c;
  border-radius: 10px;
  background: #14202d;
  color: #eaf1fb;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

#sales .shipment-modal.hidden {
  display: none;
}

#sales .shipment-modal > .panel-head {
  background: #101923 !important;
  border-bottom: 1px solid #314357 !important;
  color: #f4f7fb !important;
}

#sales .shipment-modal > .panel-head h2 {
  color: #f4f7fb !important;
}

#sales .shipment-modal .panel-body {
  overflow: auto;
  padding: 18px;
}

#sales .shipment-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
}

#sales .shipment-grid .wide {
  grid-column: 1 / -1;
}

#sales .shipment-form-card,
#sales .shipment-preview-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid #304357;
  border-radius: 8px;
  background: #172536;
}

#sales .shipment-form-card h3 {
  margin: 2px 0 4px;
  color: #f4f7fb;
  font-size: 17px;
}

#sales .shipment-form-card label {
  display: grid;
  gap: 7px;
  color: #cbd6e4;
  font-weight: 800;
}

#sales .shipment-form-card input,
#sales .shipment-form-card select,
#sales .shipment-form-card textarea {
  min-height: 42px;
  border: 1px solid #3a5068;
  border-radius: 8px;
  background: #0f1924;
  color: #eef5ff;
}

#sales .shipment-form-card input:focus,
#sales .shipment-form-card select:focus,
#sales .shipment-form-card textarea:focus {
  border-color: #61a8ff;
  box-shadow: 0 0 0 3px rgba(97, 168, 255, .18);
  outline: none;
}

#sales .shipment-form-card input[readonly] {
  color: #b9c7d9;
  background: #101a25;
}

#sales .shipment-preview-card {
  background: #101923;
}

#sales .shipping-label-preview {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  gap: 14px;
  min-height: 360px;
  padding: 22px;
  border: 2px solid #e8edf5;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

#sales .shipping-label-section {
  padding: 14px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
}

#sales .shipping-label-section.recipient {
  grid-row: span 2;
}

#sales .shipping-label-section small {
  display: block;
  margin-bottom: 8px;
  color: #0758b5;
  font-weight: 900;
  letter-spacing: .08em;
}

#sales .shipping-label-section h2 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 30px;
  line-height: 1.08;
  text-transform: uppercase;
}

#sales .shipping-label-section strong,
#sales .shipping-label-section b {
  display: block;
  font-size: 19px;
}

#sales .shipping-label-section p {
  margin: 8px 0;
}

/* Contraste garantizado en la etiqueta: texto legible sobre fondo blanco. */
#sales .shipping-label-preview :is(small, h2, strong, b, p, div, span) {
  color: #111827 !important;
  opacity: 1 !important;
}

#sales .shipping-label-preview .shipping-label-section small {
  color: #0758b5 !important;
}

#sales .shipment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#sales .shipment-actions button {
  min-height: 42px;
}

@media (max-width: 900px) {
  #sales .shipment-modal {
    inset: 10px;
  }

  #sales .shipment-grid,
  #sales .shipping-label-preview {
    grid-template-columns: 1fr;
  }

  #sales .shipping-label-section.recipient {
    grid-row: auto;
  }
}

/* DitaPOS 1.7.9: visible shipping module. */
#shipments.shipments-dashboard {
  min-height: calc(100vh - 24px);
  padding: 30px;
  background: #101923;
  color: #edf4ff;
}

.shipments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.shipments-header h2 {
  margin: 4px 0 6px;
  color: #f5f9ff;
  font-size: 34px;
}

.shipments-header p {
  margin: 0;
  color: #aebcce;
}

.shipments-header button,
.shipments-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  background: #0b66d8;
  color: #ffffff;
  font-weight: 900;
}

.shipments-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.shipments-stats article {
  padding: 18px;
  border: 1px solid #2f4359;
  border-radius: 8px;
  background: #172536;
}

.shipments-stats small {
  display: block;
  margin-bottom: 8px;
  color: #9fb0c6;
  font-weight: 800;
}

.shipments-stats strong {
  color: #7db8ff;
  font-size: 28px;
}

.shipments-toolbar {
  display: flex;
  margin-bottom: 16px;
}

.shipments-toolbar label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(680px, 100%);
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #334a63;
  border-radius: 8px;
  background: #0d1722;
  color: #70b3ff;
}

.shipments-toolbar input {
  width: 100%;
  border: 0;
  background: transparent;
  color: #f2f7ff;
  outline: none;
}

.shipments-table-card {
  overflow: hidden;
  border: 1px solid #2f4359;
  border-radius: 8px;
  background: #162332;
}

.shipments-table {
  width: 100%;
  border-collapse: collapse;
}

.shipments-table th {
  padding: 14px 16px;
  background: #1d2b3b;
  color: #b9c9dc;
  font-size: 12px;
  text-align: left;
  text-transform: uppercase;
}

.shipments-table td {
  padding: 16px;
  border-top: 1px solid #2c3d51;
  vertical-align: middle;
}

.shipments-table small {
  display: block;
  margin-top: 5px;
  color: #9fb0c6;
  line-height: 1.35;
}

#shipments .shipment-action,
#sales .shipment-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-height: 42px !important;
  padding: 0 13px !important;
  border-radius: 8px !important;
  border: 1px solid #62aaff !important;
  background: rgba(10, 102, 214, .18) !important;
  color: #9cccff !important;
  font-size: 14px !important;
  font-weight: 900 !important;
}

.shipment-modal {
  position: fixed;
  inset: 34px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  margin: auto;
  overflow: hidden;
  border: 1px solid #32465c;
  border-radius: 10px;
  background: #14202d;
  color: #eaf1fb;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.shipment-modal.hidden {
  display: none;
}

.shipment-modal > .panel-head {
  background: #101923 !important;
  border-bottom: 1px solid #314357 !important;
  color: #f4f7fb !important;
}

.shipment-modal > .panel-head h2 {
  color: #f4f7fb !important;
}

.shipment-modal .panel-body {
  overflow: auto;
  padding: 18px;
}

.shipment-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
}

.shipment-grid .wide {
  grid-column: 1 / -1;
}

.shipment-form-card,
.shipment-preview-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid #304357;
  border-radius: 8px;
  background: #172536;
}

.shipment-form-card h3 {
  margin: 2px 0 4px;
  color: #f4f7fb;
  font-size: 17px;
}

.shipment-form-card label {
  display: grid;
  gap: 7px;
  color: #cbd6e4;
  font-weight: 800;
}

.shipment-form-card input,
.shipment-form-card select,
.shipment-form-card textarea {
  min-height: 42px;
  border: 1px solid #3a5068;
  border-radius: 8px;
  background: #0f1924;
  color: #eef5ff;
}

.shipment-preview-card {
  background: #101923;
}

.shipping-label-preview {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  gap: 14px;
  min-height: 360px;
  padding: 22px;
  border: 2px solid #e8edf5;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

.shipping-label-section {
  padding: 14px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
}

.shipping-label-section.recipient {
  grid-row: span 2;
}

.shipment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  #shipments.shipments-dashboard {
    padding: 18px;
  }

  .shipments-header,
  .shipments-stats {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .shipments-table thead {
    display: none;
  }

  .shipments-table tr,
  .shipments-table td {
    display: block;
  }

  .shipments-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #83bfff;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .shipment-modal {
    inset: 10px;
  }

  .shipment-grid,
  .shipping-label-preview {
    grid-template-columns: 1fr;
  }
}

/* Theme consistency guard: the navigation shell must always follow the selected theme. */
html[data-theme="dark"] body.app-mode,
html[data-theme="dark"] body.app-mode #appView:not(.hidden),
html[data-theme="dark"] body.app-mode .app-workspace,
html[data-theme="dark"] body.app-mode .tab-content,
html[data-theme="dark"] body.app-mode .tab-content.active {
  background: #0f151d !important;
  color: #edf3fa;
}

html[data-theme="dark"] body.app-mode .app-sidebar,
html[data-theme="dark"] body.app-mode .app-sidebar-footer {
  background: #141d27 !important;
  border-color: #3a495a !important;
}

html[data-theme="dark"] body.app-mode .app-sidebar-brand strong,
html[data-theme="dark"] body.app-mode .app-sidebar-user strong {
  color: #edf3fa !important;
}

html[data-theme="dark"] body.app-mode .app-sidebar-brand span,
html[data-theme="dark"] body.app-mode .app-sidebar-user span,
html[data-theme="dark"] body.app-mode .app-sidebar-nav .tab {
  color: #b7c4d3 !important;
}

html[data-theme="dark"] body.app-mode .app-sidebar-nav .tab:hover {
  background: #213249 !important;
  color: #edf3fa !important;
}

html[data-theme="dark"] body.app-mode .app-sidebar-nav .tab.active {
  background: #17365e !important;
  border-color: #69a9f5 !important;
  color: #ffffff !important;
}

/* Clear theme corrections for modules that were originally built with fixed dark colors. */
html[data-theme="light"] #reports.reports-redesign {
  background: #f4f7fc !important;
  color: #172033 !important;
}

html[data-theme="light"] #reports.reports-redesign :is(.panel, .report-line, tbody tr) {
  background: #ffffff !important;
  border-color: #dce5ef !important;
}

html[data-theme="light"] #reports.reports-redesign :is(strong, th, td) {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}

html[data-theme="light"] #reports.reports-redesign :is(span, small, p, label) {
  color: #52627c !important;
  -webkit-text-fill-color: #52627c !important;
}

html[data-theme="light"] #reports.reports-redesign .report-hero,
html[data-theme="light"] #reports.reports-redesign .report-hero :is(.panel-head, .report-range-controls) {
  background: linear-gradient(125deg, #152d68, #3567d6 58%, #40a3db) !important;
  border-color: transparent !important;
}

html[data-theme="light"] #reports.reports-redesign .report-hero :is(h2, p, span, strong, label),
html[data-theme="light"] #reports.reports-redesign .report-hero .report-range-summary :is(span, strong) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="light"] #reports.reports-redesign :is(input, select, option) {
  background: #ffffff !important;
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
  border-color: #bccbde !important;
}

html[data-theme="light"] #reports.reports-redesign .report-kpis::before {
  background: #f4f7fc !important;
  color: #405570 !important;
}

html[data-theme="light"] #reports.reports-redesign .net-profit-grid article {
  background: #ffffff !important;
  border-color: #dce5ef !important;
  box-shadow: 0 6px 18px rgba(30, 55, 90, .07) !important;
}

html[data-theme="light"] #reports.reports-redesign .net-profit-grid :is(span, strong, small) {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}

html[data-theme="light"] #reports.reports-redesign .net-profit-grid :is(span, small) {
  color: #60728a !important;
  -webkit-text-fill-color: #60728a !important;
}

html[data-theme="light"] #reports.reports-redesign .net-profit-grid .kpi-sales { border-top-color: #2563eb !important; }
html[data-theme="light"] #reports.reports-redesign .net-profit-grid .kpi-profit { border-top-color: #0f9f7b !important; }
html[data-theme="light"] #reports.reports-redesign .net-profit-grid .negative { border-top-color: #e06b37 !important; }
html[data-theme="light"] #reports.reports-redesign .net-profit-grid .net-result { border-top-color: #7c5ac7 !important; }

html[data-theme="light"] #reports.reports-redesign .reports-dashboard-grid .panel,
html[data-theme="light"] #reports.reports-redesign .reports-dashboard-grid .panel-head {
  background: #ffffff !important;
  border-color: #dce5ef !important;
}

html[data-theme="light"] #reports.reports-redesign .reports-dashboard-grid .panel-head h2 {
  color: #172033 !important;
  -webkit-text-fill-color: #172033 !important;
}

html[data-theme="light"] .customers-dashboard.active {
  background: #f4f7fc !important;
  color: #172033 !important;
}

html[data-theme="light"] :is(.customers-header h2, .customer-detail-head h3, .customer-purchases-head h3, .customer-info-grid strong, .customer-purchase-date span) {
  color: #172033 !important;
}

html[data-theme="light"] :is(.customers-header p, .customers-stats small, .customer-info-grid small, .customer-list-item span, .customer-list-item small, .customer-detail-empty, .customer-detail-head p, .customer-purchase-date small, .customer-purchase-item span, .customer-purchase-item small) {
  color: #60728a !important;
}

html[data-theme="light"] :is(.customers-stats article, .customers-list-card, .customer-detail-card) {
  background: #ffffff !important;
  border-color: #dce5ef !important;
}

html[data-theme="light"] :is(.customers-search, .customer-list-item, .customer-info-grid > div, .customer-notes, .customer-purchase-date, .customer-purchase-item) {
  background: #f9fbfe !important;
  border-color: #dce5ef !important;
  color: #172033 !important;
}

html[data-theme="light"] .customers-search input {
  color: #172033 !important;
}

html[data-theme="light"] #shipments.shipments-dashboard {
  background: #f4f7fc !important;
  color: #172033 !important;
}

html[data-theme="light"] :is(.shipments-header h2, .shipments-stats strong) {
  color: #172033 !important;
}

html[data-theme="light"] :is(.shipments-header p, .shipments-stats small, .shipments-table small) {
  color: #60728a !important;
}

html[data-theme="light"] :is(.shipments-stats article, .shipments-table-card) {
  background: #ffffff !important;
  border-color: #dce5ef !important;
}

html[data-theme="light"] .shipments-toolbar label {
  background: #ffffff !important;
  border-color: #c9d9ef !important;
  color: #2563eb !important;
}

html[data-theme="light"] .shipments-toolbar input {
  color: #172033 !important;
}

html[data-theme="light"] .shipments-table th {
  background: #eaf1fa !important;
  color: #203957 !important;
}

html[data-theme="light"] .shipments-table td {
  border-color: #e0e7f0 !important;
  color: #172033 !important;
}

html[data-theme="light"] #sales .shipment-modal {
  background: #ffffff !important;
  border-color: #dce5ef !important;
  color: #172033 !important;
  box-shadow: 0 24px 70px rgba(15, 35, 64, .18) !important;
}

html[data-theme="light"] #sales .shipment-modal > .panel-head {
  background: #f4f7fc !important;
  border-color: #dce5ef !important;
  color: #172033 !important;
}

html[data-theme="light"] #sales .shipment-modal > .panel-head h2,
html[data-theme="light"] #sales .shipment-form-card h3 {
  color: #172033 !important;
}

html[data-theme="light"] :is(#sales .shipment-form-card, #sales .shipment-preview-card) {
  background: #f9fbfe !important;
  border-color: #dce5ef !important;
}

html[data-theme="light"] #sales .shipment-form-card label {
  color: #405570 !important;
}

html[data-theme="light"] #sales .shipment-form-card :is(input, select, textarea) {
  background: #ffffff !important;
  border-color: #c9d9ef !important;
  color: #172033 !important;
}

/* Tipografía única del producto: estable en Windows, nítida en pantallas de
   baja densidad y disponible incluso cuando el POS se usa sin conexión. */
:root {
  --dita-ui-font: "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--dita-ui-font) !important;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Algunos módulos traían fuentes y pesos propios; mantener una sola familia
   evita letras distintas o artificialmente engrosadas en tarjetas y botones. */
body :not(code):not(pre):not(kbd):not(samp) {
  font-family: var(--dita-ui-font) !important;
  font-synthesis: none;
}

/* Correcciones de contraste y jerarquía para los módulos del POS.
   Los encabezados internos no son la barra principal de navegación. */
.customer-detail-head,
.cash-register-header {
  position: static;
  z-index: auto;
  min-width: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.customer-detail-head > div:first-child,
.cash-register-header > div:first-child {
  min-width: 0;
}

html[data-theme="light"] :is(#sales, #shipments) .shipment-action {
  border-color: #1d67d8 !important;
  background: #dcecff !important;
  color: #084cab !important;
  box-shadow: 0 3px 10px rgba(29, 103, 216, .14) !important;
}

html[data-theme="light"] :is(#sales, #shipments) .shipment-action:hover {
  border-color: #084cab !important;
  background: #c7e0ff !important;
  color: #063b87 !important;
}

html[data-theme="light"] .customer-detail-head {
  padding: 0;
}

html[data-theme="light"] .cash-register-header h2 {
  color: #172033;
}

html[data-theme="light"] .cash-register-header p {
  color: #52677f;
}

html[data-theme="dark"] .cash-register-header h2 {
  color: #edf4ff;
}

html[data-theme="dark"] .cash-register-header p {
  color: #aebcce;
}

/* Reportes: el selector de fecha usa un botón propio, no el estilo genérico
   de botones de la aplicación. Así el calendario permanece visible en claro. */
html[data-theme="light"] #reports .report-range-controls .date-picker-icon {
  border: 0 !important;
  background: transparent !important;
  color: #1764c7 !important;
  box-shadow: none !important;
}

html[data-theme="light"] #reports .report-range-controls .date-picker-icon:hover,
html[data-theme="light"] #reports .report-range-controls .date-picker-icon:focus-visible {
  border: 0 !important;
  background: rgba(23, 100, 199, .12) !important;
  color: #084cab !important;
  box-shadow: none !important;
}

html[data-theme="light"] #reports .report-range-controls .date-picker-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  /* Reportes contiene una regla antigua que fuerza todos sus SVG a blanco. */
  stroke: #1764c7 !important;
  fill: none;
  stroke-width: 2.4;
}

html[data-theme="light"] .customers-stats strong {
  color: #1d5fd0 !important;
  -webkit-text-fill-color: #1d5fd0 !important;
  font-weight: 850;
}
