:root {
  --red-700: #a51d27;
  --red-600: #bd2732;
  --red-100: #fce8e9;
  --ink: #17202a;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --green: #147a55;
  --green-soft: #e7f5ee;
  --amber: #a45e08;
  --amber-soft: #fff2d8;
  --blue: #2463a8;
  --blue-soft: #e8f1fb;
  --shadow: 0 18px 50px rgba(23, 32, 42, 0.14);
  --sidebar-width: 248px;
  --role-accent: #b4232c;
  --role-accent-dark: #8f1d25;
  --role-accent-soft: #fce8e9;
}

/* Professional software polish layer - 28 Jul 2026 */
:root {
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 18px 46px rgba(15, 23, 42, 0.14);
  --motion-fast: 140ms cubic-bezier(0.2, 0, 0, 1);
  --motion-smooth: 240ms cubic-bezier(0.2, 0, 0, 1);
}

body.app-body {
  background:
    radial-gradient(circle at top left, rgba(36, 99, 168, 0.08), transparent 28rem),
    linear-gradient(180deg, #f7f9fc 0%, var(--canvas) 42%, #eef2f6 100%);
}

.content {
  animation: aya-page-in var(--motion-smooth) both;
}

@keyframes aya-page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar {
  box-shadow: 12px 0 32px rgba(15, 23, 42, 0.04);
}

.brand-block {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.94));
}

.brand-logo-icon {
  display: block;
  object-fit: cover;
  padding: 0;
  overflow: hidden;
}

.brand-mark,
.avatar,
.stat-icon,
.welcome-mark {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 20px rgba(15, 23, 42, 0.12);
}

.nav-item {
  position: relative;
  overflow: hidden;
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast),
    background-color var(--motion-fast),
    color var(--motion-fast);
}

.nav-item::before {
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--role-accent);
  content: "";
  opacity: 0;
  transform: scaleY(0.5);
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.topbar {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.primary-button,
.secondary-button,
.danger-button,
.small-button,
.icon-button,
.theme-option,
.theme-toggle {
  position: relative;
  overflow: hidden;
  transition:
    transform var(--motion-fast),
    box-shadow var(--motion-fast),
    background-color var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast);
}

.primary-button {
  background: linear-gradient(135deg, var(--role-accent), var(--role-accent-dark));
  border-color: var(--role-accent-dark);
  box-shadow: 0 12px 24px rgba(23, 32, 42, 0.12);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--role-accent-dark), var(--role-accent));
  box-shadow: var(--shadow-lift);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.small-button:active,
.icon-button:active,
.theme-option:active,
.theme-toggle:active,
.is-pressing {
  transform: translateY(1px) scale(0.98);
}

/* Settlement shortage treatment and expense reporting */
.shortage-treatment-link {
  display: block;
  width: max-content;
  margin-top: 5px;
  color: var(--role-accent-dark);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.3;
}

.success-text {
  color: var(--green);
  font-weight: 750;
}

.expense-filter-panel {
  padding: 16px;
}

.expense-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.expense-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.expense-one-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.summary-list {
  max-height: 320px;
  overflow: auto;
  padding: 6px 18px 12px;
}

.summary-list > div {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list > div:last-child {
  border-bottom: 0;
}

.summary-list span,
.summary-list small {
  display: block;
}

.summary-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 750;
}

.summary-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.summary-list strong {
  white-space: nowrap;
}

.expense-total-row td {
  border-top: 2px solid var(--line);
  background: var(--canvas);
}

.shortage-treatment-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e8c477;
  border-radius: 6px;
  color: #704006;
  background: #fff7e5;
  font-size: 12px;
  line-height: 1.5;
}

.shortage-treatment-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

html[data-theme="dark"] .shortage-treatment-note {
  border-color: #805d1d;
  color: #fde68a;
  background: #2b2112;
}

.shortage-allocation-surface {
  width: min(960px, 100%);
}

.shortage-common-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 14px;
}

.allocation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 6px;
}

.allocation-heading h3,
.allocation-heading p {
  margin: 0;
}

.allocation-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.allocation-row {
  display: grid;
  grid-template-columns: 38px minmax(220px, 1fr) minmax(130px, 180px) 42px;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.allocation-number {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  align-self: center;
  border-radius: 7px;
  color: #fff;
  background: var(--role-accent-dark);
  font-weight: 850;
}

.allocation-row .field {
  margin: 0;
}

.allocation-remove {
  display: grid;
  align-self: end;
  place-items: center;
}

.allocation-delete-field {
  display: none;
}

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

.allocation-totals > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--canvas);
}

.allocation-totals span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.allocation-totals strong {
  white-space: nowrap;
}

.allocation-totals .allocation-balanced {
  border-color: #69b99e;
  color: var(--green);
  background: #ecf8f3;
}

.allocation-totals .allocation-over {
  border-color: #e29aa0;
  color: var(--red);
  background: #fff0f1;
}

.form-error-banner {
  padding: 11px 13px;
  border: 1px solid #e29aa0;
  border-radius: 7px;
  color: #9f1f2b;
  background: #fff0f1;
  font-size: 12px;
  font-weight: 750;
}

html[data-theme="dark"] .allocation-totals .allocation-balanced {
  color: #86efc5;
  background: #102c25;
}

html[data-theme="dark"] .allocation-totals .allocation-over,
html[data-theme="dark"] .form-error-banner {
  color: #fecaca;
  background: #38191d;
}

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

@media (max-width: 700px) {
  .expense-filter-grid,
  .expense-one-view {
    grid-template-columns: minmax(0, 1fr);
  }

  .expense-filter-actions,
  .expense-filter-actions > * {
    width: 100%;
  }

  .shortage-common-fields,
  .allocation-totals {
    grid-template-columns: minmax(0, 1fr);
  }

  .allocation-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .allocation-heading .secondary-button {
    width: 100%;
  }

  .allocation-row {
    grid-template-columns: 34px minmax(0, 1fr) 42px;
  }

  .allocation-row .field {
    grid-column: 1 / -1;
  }

  .allocation-row .allocation-number {
    grid-column: 1;
    grid-row: 1;
  }

  .allocation-row .allocation-remove {
    grid-column: 3;
    grid-row: 1;
  }
}

/* Automatic workflow and operator action-center release - 15 Aug 2026 */
:root {
  --sidebar-collapsed-width: 82px;
  --control-radius: 7px;
}

.sidebar,
.app-shell,
.brand-block,
.sidebar-footer,
.nav-item {
  transition:
    width var(--motion-smooth),
    margin-left var(--motion-smooth),
    padding var(--motion-smooth),
    gap var(--motion-smooth),
    background-color var(--motion-fast),
    color var(--motion-fast),
    transform var(--motion-fast);
}

.desktop-sidebar-toggle {
  display: grid;
  border-color: #dce2e9;
  background: #f8fafc;
}

.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .app-shell {
  margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .brand-block {
  justify-content: center;
  padding-inline: 12px;
}

.sidebar-collapsed .brand-block > div,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-item > span,
.sidebar-collapsed .sidebar-footer .user-copy,
.sidebar-collapsed .sidebar-footer form {
  display: none;
}

.sidebar-collapsed .nav-list {
  padding-inline: 12px;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  min-height: 46px;
  padding-inline: 10px;
}

.sidebar-collapsed .nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  padding-inline: 10px;
}

.sidebar-collapsed .user-chip {
  justify-content: center;
}

.operator-reminder-center {
  position: relative;
}

.reminder-trigger {
  border-color: #f0d9a5;
  color: #8a5208;
  background: #fff9eb;
}

.reminder-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  background: #b4232c;
  font-size: 9px;
  font-weight: 850;
}

.operator-reminder-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 12px);
  right: 0;
  width: min(460px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top right;
  transition: opacity var(--motion-fast), transform var(--motion-fast);
}

.operator-reminder-panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.operator-reminder-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #e8edf2;
  background: #f8fafc;
}

.operator-reminder-panel h2 {
  margin: 3px 0 0;
  font-size: 18px;
  line-height: 1.25;
}

.operator-reminder-list {
  display: grid;
  gap: 1px;
  background: #e8edf2;
}

.operator-reminder-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--ink);
  background: #ffffff;
  transition: background-color var(--motion-fast), transform var(--motion-fast);
}

.operator-reminder-item:hover {
  color: var(--ink);
  background: #f8fafc;
}

.reminder-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 7px;
  color: #8a5208;
  background: #fff2d8;
}

.operator-reminder-item.loading .reminder-icon {
  color: #2463a8;
  background: #e8f1fb;
}

.operator-reminder-item.payment .reminder-icon {
  color: #b4232c;
  background: #fce8e9;
}

.reminder-copy,
.reminder-metric {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.reminder-copy strong {
  font-size: 12px;
}

.reminder-copy small,
.reminder-metric small,
.operator-reminder-panel footer {
  color: var(--muted);
  font-size: 10px;
}

.reminder-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-metric {
  text-align: right;
}

.reminder-metric strong {
  font-size: 16px;
}

.operator-reminder-panel footer {
  padding: 11px 16px;
  border-top: 1px solid #e8edf2;
  background: #f8fafc;
}

.filter-bar,
.form-surface,
.section-block,
.detail-group,
.stat-card,
.analytics-panel,
.executive-stat {
  border-radius: 8px;
}

input,
select,
textarea,
.primary-button,
.secondary-button,
.danger-button,
.small-button {
  border-radius: var(--control-radius);
}

thead th {
  color: #475467;
  background: #f5f7fa;
  letter-spacing: 0;
}

tbody tr {
  transition: background-color var(--motion-fast);
}

tbody tr:hover {
  background: #f8fafc;
}

html[data-theme="dark"] .desktop-sidebar-toggle,
html[data-theme="dark"] .operator-reminder-panel,
html[data-theme="dark"] .operator-reminder-item {
  border-color: #334155;
  color: #e5e7eb;
  background: #111827;
}

html[data-theme="dark"] .operator-reminder-panel header,
html[data-theme="dark"] .operator-reminder-panel footer,
html[data-theme="dark"] thead th {
  border-color: #334155;
  color: #cbd5e1;
  background: #172033;
}

html[data-theme="dark"] .operator-reminder-list {
  background: #334155;
}

html[data-theme="dark"] .operator-reminder-item:hover,
html[data-theme="dark"] tbody tr:hover {
  background: #172033;
}

@media (max-width: 800px) {
  .desktop-sidebar-toggle {
    display: none;
  }

  .sidebar-collapsed .sidebar {
    width: var(--sidebar-width);
  }

  .sidebar-collapsed .app-shell {
    margin-left: 0;
  }

  .operator-reminder-panel {
    position: fixed;
    top: 68px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }
}

@media (max-width: 520px) {
  .operator-reminder-item {
    grid-template-columns: 36px minmax(0, 1fr) 16px;
  }

  .reminder-metric {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    gap: 8px;
    text-align: left;
  }
}

.advanced-report-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.advanced-report-filter .report-type-field {
  grid-column: span 2;
}

.report-run-button {
  min-height: 44px;
  justify-content: center;
}

.report-stat-grid {
  margin-top: 18px;
}

.report-result-section {
  overflow: hidden;
}

.report-record-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #dce2e9;
  border-radius: 6px;
  color: #475467;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 800;
}

.advanced-report-table table {
  min-width: 900px;
}

.advanced-report-table td {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.report-limit-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid #e8edf2;
  color: #667085;
  background: #f8fafc;
  font-size: 10px;
}

html[data-theme="dark"] .report-record-chip,
html[data-theme="dark"] .report-limit-note {
  border-color: #334155;
  color: #cbd5e1;
  background: #172033;
}

@media (max-width: 1180px) {
  .advanced-report-filter {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 800px) {
  .advanced-report-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advanced-report-filter .report-type-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .advanced-report-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .advanced-report-filter .report-type-field {
    grid-column: auto;
  }

  .report-heading .heading-actions,
  .report-heading .heading-actions > * {
    width: 100%;
  }
}

.primary-button.is-submitting,
.danger-button.is-submitting,
.secondary-button.is-submitting {
  pointer-events: none;
  opacity: 0.82;
}

.primary-button.is-submitting::after,
.danger-button.is-submitting::after,
.secondary-button.is-submitting::after {
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  content: "";
  animation: aya-spin 700ms linear infinite;
}

@keyframes aya-spin {
  to {
    transform: rotate(360deg);
  }
}

.section-block,
.quick-panel,
.form-surface,
.detail-group,
.stat-card,
.analytics-panel,
.executive-stat {
  border-color: rgba(207, 213, 221, 0.88);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--motion-smooth),
    box-shadow var(--motion-smooth),
    border-color var(--motion-smooth);
}

.section-block:hover,
.form-surface:hover,
.detail-group:hover,
.analytics-panel:hover,
.executive-stat:hover {
  border-color: rgba(36, 99, 168, 0.18);
  box-shadow: var(--shadow-lift);
}

.stat-card:hover,
.metric-matrix > a:hover,
.metric-matrix-three > a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.field input:not([type="checkbox"]),
.field select,
.field textarea,
.search-box,
.filter-bar > select {
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    background-color var(--motion-fast),
    transform var(--motion-fast);
}

.field input:not([type="checkbox"]):focus,
.field select:focus,
.field textarea:focus,
.search-box:focus-within,
.filter-bar > select:focus {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(36, 99, 168, 0.12), 0 10px 22px rgba(15, 23, 42, 0.08);
}

.table-wrap {
  border-radius: 8px;
}

.table-wrap tbody tr {
  transition: background-color var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast);
}

.table-wrap tbody tr:hover {
  background: #f7fbff;
  box-shadow: inset 3px 0 0 var(--role-accent);
}

.message {
  animation: aya-message-in 220ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes aya-message-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-panel,
.password-panel,
.welcome-panel {
  animation: aya-panel-in 300ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes aya-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

html[data-theme="dark"] body.app-body {
  background:
    radial-gradient(circle at top left, rgba(47, 123, 214, 0.16), transparent 28rem),
    linear-gradient(180deg, #0b1220 0%, #101928 52%, #0b1220 100%);
}

html[data-theme="dark"] .brand-block {
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.96), rgba(15, 23, 42, 0.96));
}

html[data-theme="dark"] .table-wrap tbody tr:hover {
  background: rgba(47, 123, 214, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body,
button,
input,
select,
textarea {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
}

.welcome-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(7px);
  transition: opacity 0.2s ease;
}

.welcome-overlay[hidden] {
  display: none !important;
}

.welcome-overlay.show {
  opacity: 1;
  pointer-events: none;
}

.welcome-panel {
  position: relative;
  width: min(720px, 100%);
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
  pointer-events: none;
}

.welcome-close {
  position: absolute;
  top: 14px;
  right: 14px;
  pointer-events: auto;
}

.welcome-mark {
  display: inline-grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.welcome-copy {
  margin-top: 18px;
  max-width: 620px;
}

.welcome-copy h2 {
  margin: 7px 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.welcome-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.welcome-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}

.welcome-flow span {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #243044;
  font-size: 12px;
  font-weight: 800;
}

.welcome-flow span:nth-child(2) {
  background: var(--blue-soft);
}

.welcome-flow span:nth-child(3) {
  background: var(--green-soft);
}

.welcome-flow span:nth-child(4) {
  background: var(--amber-soft);
}

.welcome-progress {
  overflow: hidden;
  height: 5px;
  margin-top: 20px;
  border-radius: 999px;
  background: #edf0f4;
}

.welcome-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--red-600);
  transform-origin: left;
  animation: welcome-countdown 10s linear forwards;
}

@keyframes welcome-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 20px;
  font-weight: 800;
}

img.brand-mark.brand-logo-icon,
img.welcome-mark.brand-logo-icon {
  padding: 0;
  border: 0;
  object-fit: cover;
  background: #022b55;
}

.login-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.34)),
    url("../img/login-warehouse.e40e0de3aa7b.png") center / cover no-repeat fixed;
}

.login-shade {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 33, 0.24);
}

.login-brand {
  position: fixed;
  z-index: 2;
  top: 30px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.login-theme-control {
  position: fixed;
  z-index: 3;
  top: 30px;
  right: 36px;
}

.login-brand-mark {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
  font-size: 24px;
}

.login-brand-name {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 900;
}

.login-brand-company {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
}

.login-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 88px 20px 40px;
}

.login-panel {
  width: min(100%, 440px);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-product-line {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.secure-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid #b7ddcd;
  border-radius: 999px;
  color: #116844;
  background: #f0faf5;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.secure-chip svg {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.login-panel-head {
  margin-bottom: 26px;
}

.login-kicker,
.eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--red-700);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-panel-head h1,
.page-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.login-panel-head p,
.page-heading p,
.section-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-form,
.standard-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea,
.search-box,
.filter-bar > select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:not([type="checkbox"]),
.field select,
.field textarea,
.filter-bar > select {
  max-width: 100%;
  padding: 10px 12px;
}

.field select {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.field textarea {
  min-height: 94px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-box:focus-within,
.filter-bar > select:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(189, 39, 50, 0.12);
}

.input-with-icon {
  position: relative;
}

.input-with-icon > svg {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 13px;
  color: #7b8493;
}

.input-with-icon input {
  padding-left: 42px !important;
}

.password-field input {
  padding-right: 44px !important;
}

.password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #667085;
  background: transparent;
}

.password-toggle:hover {
  background: #f0f2f5;
}

.primary-button,
.secondary-button,
.text-button,
.danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-weight: 750;
  white-space: nowrap;
}

.primary-button {
  padding: 10px 16px;
  border: 1px solid var(--red-600);
  color: #ffffff;
  background: var(--red-600);
}

.primary-button:hover {
  border-color: var(--red-700);
  background: var(--red-700);
}

.secondary-button {
  padding: 9px 14px;
  border: 1px solid #cfd5dd;
  color: #344054;
  background: #ffffff;
}

.secondary-button:hover {
  background: #f7f8fa;
}

.danger-button {
  padding: 10px 16px;
  border: 1px solid #db9ba0;
  color: #a51d27;
  background: #fff2f3;
}

.danger-button:hover {
  border-color: var(--red-600);
  background: var(--red-100);
}

.text-button {
  min-height: 32px;
  color: var(--red-700);
  font-size: 13px;
}

.login-button {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
}

.forgot-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--red-700);
  font-size: 12px;
  font-weight: 750;
}

.forgot-link:hover {
  text-decoration: underline;
}

.forgot-link svg {
  width: 15px;
  height: 15px;
}

.recovery-success {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #acd7c5;
  border-radius: 7px;
  color: #126845;
  background: #edf9f3;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.small-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #cfd5dd;
  border-radius: 5px;
  color: #344054;
  background: #ffffff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.small-button:hover {
  color: var(--red-700);
  background: #fff7f7;
}

.small-button.danger-outline {
  color: var(--red-700);
  border-color: #e2b3b7;
}

.small-button svg {
  width: 14px;
  height: 14px;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(207, 213, 221, 0.8);
  color: #667085;
  font-size: 11px;
  font-weight: 650;
}

.form-alert,
.message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #f0b7bb;
  border-radius: 6px;
  color: #8e1d26;
  background: #fff1f2;
  font-size: 13px;
  line-height: 1.5;
}

.form-alert {
  margin-bottom: 18px;
  padding: 11px 12px;
}

.field-error,
.field-help {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.45;
}

.field-error {
  color: #b4232c;
}

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

.caps-lock-warning {
  display: none;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #9a5b08;
  font-size: 10px;
  font-weight: 800;
}

.caps-lock-warning.show {
  display: flex;
}

.caps-lock-warning svg {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.password-page {
  min-height: 100vh;
  background: #eef1f4;
}

.password-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}

.password-panel {
  width: min(100%, 470px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 40px rgba(23, 32, 42, 0.1);
}

.password-panel > .brand-mark {
  margin-bottom: 22px;
}

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

.app-body[data-role="superadmin"] {
  --role-accent: #b4232c;
  --role-accent-dark: #8f1d25;
  --role-accent-soft: #fce8e9;
}

.app-body[data-role="admin"] {
  --role-accent: #2463a8;
  --role-accent-dark: #1d4f88;
  --role-accent-soft: #e8f1fb;
}

.app-body[data-role="operator"] {
  --role-accent: #087f8c;
  --role-accent-dark: #08626b;
  --role-accent-soft: #e4f5f6;
}

.app-body[data-role="salesman"] {
  --role-accent: #147a55;
  --role-accent-dark: #0f6143;
  --role-accent-soft: #e7f5ee;
}

.app-body[data-role="supplier"] {
  --role-accent: #a45e08;
  --role-accent-dark: #7d4706;
  --role-accent-soft: #fff2d8;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid #dfe3e8;
  border-top: 3px solid var(--role-accent);
  background: #ffffff;
}

.app-body .brand-mark {
  background: var(--role-accent);
}

.brand-block {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 11px;
  padding: 16px 19px;
  border-bottom: 1px solid #edf0f2;
}

.brand-name {
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
}

.brand-company {
  overflow: hidden;
  max-width: 155px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 18px 12px;
}

.nav-section-label {
  display: block;
  margin: 14px 11px 3px;
  color: #98a2b3;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.nav-count {
  display: grid;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 9px;
  font-weight: 850;
}

.nav-item {
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: #4c5563;
  font-size: 13px;
  font-weight: 700;
}

.nav-item:hover {
  color: var(--ink);
  background: #f4f6f8;
}

.nav-item.active {
  color: var(--role-accent-dark);
  background: var(--role-accent-soft);
}

.sidebar-footer {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid #edf0f2;
}

.user-chip {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #344054;
  font-size: 13px;
  font-weight: 800;
}

.user-copy {
  min-width: 0;
}

.user-copy strong,
.user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: 12px;
}

.user-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #667085;
  background: transparent;
}

.icon-button:hover {
  border-color: #d9dde3;
  color: var(--ink);
  background: #f7f8fa;
}

.app-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.impersonation-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 7px 16px;
  color: #5f3605;
  background: #fff1cf;
  font-size: 10px;
  font-weight: 850;
}

.impersonation-bar span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.impersonation-bar button {
  padding: 4px 8px;
  border: 1px solid #d99b3f;
  border-radius: 5px;
  color: #714207;
  background: transparent;
  font-size: 9px;
  font-weight: 850;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 64px;
  align-items: center;
  gap: 13px;
  padding: 0 28px;
  border-bottom: 1px solid #dfe3e8;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.topbar-company {
  font-size: 13px;
  font-weight: 800;
}

.topbar-role {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.theme-switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid #cfd5dd;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(23, 32, 42, 0.1);
}

.theme-option,
.theme-toggle {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  color: #344054;
  background: transparent;
  font-size: 10px;
  font-weight: 850;
}

.theme-option.active {
  color: #ffffff;
  background: #17202a;
}

.theme-option:not(.active):hover,
.theme-toggle:hover {
  color: var(--ink);
  background: #f7f8fa;
}

.theme-option svg,
.theme-toggle svg {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.day-chip {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
}

.live-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #b7ddcd;
  border-radius: 999px;
  color: #116844;
  background: #f0faf5;
  font-size: 10px;
  font-weight: 800;
}

.live-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1e9d6a;
}

.mobile-menu {
  display: none;
}

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

.messages {
  margin-bottom: 18px;
}

.message {
  padding: 11px 13px;
  border-color: #acd7c5;
  color: #126845;
  background: #edf9f3;
}

.page-heading {
  display: flex;
  min-height: 62px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.page-heading.compact {
  margin-bottom: 18px;
}

.page-heading .primary-button {
  flex: 0 0 auto;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #3f4855;
  background: #edf0f3;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.active,
.status-badge.open,
.status-badge.completed {
  color: #126845;
  background: var(--green-soft);
}

.status-badge.pending,
.status-badge.on_hold {
  color: #8a5209;
  background: var(--amber-soft);
}

.status-badge.inactive,
.status-badge.closed,
.status-badge.rejected {
  color: #7a2630;
  background: var(--red-100);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  display: flex;
  min-height: 104px;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 7px;
}

.stat-card.red .stat-icon {
  color: var(--red-700);
  background: var(--red-100);
}

.stat-card.green .stat-icon {
  color: var(--green);
  background: var(--green-soft);
}

.stat-card.amber .stat-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.stat-card.blue .stat-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.stat-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.stat-card strong {
  margin-top: 5px;
  font-size: 24px;
  line-height: 1.1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
}

.section-block,
.quick-panel,
.form-surface,
.detail-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.section-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f2;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #596273;
  background: #fafbfc;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

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

tbody tr:hover td {
  background: #fcfcfd;
}

.table-link {
  color: var(--red-700);
  font-weight: 800;
}

.empty-cell {
  height: 100px;
  color: var(--muted);
  text-align: center;
}

.quick-panel {
  align-self: start;
  overflow: hidden;
}

.quick-panel > a {
  display: grid;
  min-height: 53px;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid #edf0f2;
  color: #3b4554;
  font-size: 12px;
  font-weight: 750;
}

.quick-panel > a:last-child {
  border-bottom: 0;
}

.quick-panel > a:hover {
  color: var(--red-700);
  background: #fff8f8;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  color: #7d8694;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 9px 12px 9px 40px;
  border: 0;
  outline: 0;
  background: transparent;
}

.form-surface {
  padding: 22px;
}

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

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

.form-grid .form-alert {
  margin-bottom: 0;
}

.checkbox-field {
  display: flex;
  align-items: flex-end;
}

.checkbox-label {
  display: inline-flex !important;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  margin: 0 !important;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--red-600);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid #edf0f2;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 8px 18px 18px;
}

.detail-list > div {
  min-width: 0;
  padding: 14px 10px 14px 0;
  border-bottom: 1px solid #edf0f2;
}

.detail-list .wide {
  grid-column: 1 / -1;
}

.detail-list dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-list dd {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.heading-actions,
.document-actions,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.document-actions {
  justify-content: flex-end;
  margin: -8px 0 18px;
}

.document-actions form,
.table-actions form {
  margin: 0;
}

.inline-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-filter-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.inline-filter-form input {
  min-height: 38px;
}

.table-subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.stat-card .small-stat {
  overflow: hidden;
  max-width: 150px;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-gap {
  margin-top: 20px;
}

.chart-frame {
  position: relative;
  height: 330px;
  padding: 18px;
}

.filter-bar.compact-filter {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.filter-bar.date-filter {
  grid-template-columns: 220px 220px auto;
  align-items: end;
}

.filter-bar.report-filter {
  grid-template-columns: repeat(4, minmax(145px, 1fr)) auto;
  align-items: end;
}

.filter-bar .field label {
  margin-bottom: 5px;
}

.form-surface .inset-head {
  min-height: 58px;
  margin: -22px -22px 20px;
}

.narrow-surface {
  width: min(100%, 680px);
}

.onboarding-layout {
  display: grid;
  gap: 18px;
}

.onboarding-layout > .form-actions {
  grid-column: 1 / -1;
}

.location-control {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px dashed #b7bec8;
  border-radius: 6px;
  background: #fafbfc;
}

.location-control strong,
.location-control span {
  display: block;
}

.location-control strong {
  font-size: 12px;
}

.location-control span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.overdue-banner {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid #e9b06b;
  border-radius: 7px;
  color: #714207;
  background: #fff7e8;
}

.overdue-banner[hidden] {
  display: none;
}

.overdue-banner strong,
.overdue-banner span {
  display: block;
}

.overdue-banner strong {
  font-size: 12px;
}

.overdue-banner span {
  margin-top: 3px;
  font-size: 11px;
}

.overdue-banner a {
  color: #8b4f08;
  font-size: 11px;
  font-weight: 850;
}

.order-lines input[type="number"] {
  width: 112px;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid #cfd5dd;
  border-radius: 5px;
}

.order-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.order-page-heading h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.order-page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.order-heading-status {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.order-heading-status > span {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-right: 1px solid var(--line);
  color: #596273;
  font-size: 10px;
  white-space: nowrap;
}

.order-heading-status > span:last-child {
  border-right: 0;
}

.order-heading-status strong {
  color: var(--ink);
  font-size: 14px;
}

.salesman-order-form {
  gap: 14px;
}

.order-customer-section,
.order-article-section,
.order-notes-section {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.order-customer-section,
.order-article-section {
  padding: 16px;
}

.order-notes-section {
  padding: 14px 16px;
}

.order-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.order-section-title h2,
.order-section-title p {
  margin: 0;
}

.order-section-title h2 {
  font-size: 14px;
}

.order-section-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.order-step {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 12px;
  font-weight: 850;
}

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

.select-search-helper-field {
  display: none;
}

.searchable-native-select {
  cursor: pointer;
}

.select-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.select-picker-panel {
  width: min(620px, 100%);
  max-height: min(82vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.select-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.select-picker-head strong {
  color: var(--text);
  font-size: 16px;
}

.select-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px;
  padding: 0 12px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  background: var(--surface);
}

.select-picker-search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.select-picker-search input {
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.select-picker-list {
  overflow-y: auto;
  padding: 0 12px 12px;
}

.select-picker-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 8px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
}

.select-picker-option span {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.select-picker-option svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.select-picker-option[aria-selected="true"] svg {
  color: var(--teal-600);
}

.select-picker-empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.mobile-order-select-trigger {
  display: none;
}

.mobile-order-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
  background: rgba(15, 23, 42, 0.58);
}

.mobile-order-picker-panel {
  width: min(520px, calc(100vw - 86px));
  max-height: min(72vh, 640px);
  overflow: hidden;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.26);
}

.mobile-order-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 6px;
  padding: 0 10px;
  border: 1px solid #d8dde5;
  background: #ffffff;
}

.mobile-order-picker-search svg {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  fill: none;
  stroke: #64748b;
  stroke-width: 2;
}

.mobile-order-picker-search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 18px;
}

.mobile-order-picker-list {
  max-height: calc(min(72vh, 640px) - 62px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-order-picker-option {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border: 0;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  text-align: left;
  font: inherit;
}

.mobile-order-picker-option span {
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.mobile-order-picker-option i {
  width: 29px;
  height: 29px;
  justify-self: end;
  border: 3px solid #6b7280;
  border-radius: 999px;
}

.mobile-order-picker-option[aria-selected="true"] i {
  border-color: #0f9f8f;
  box-shadow: inset 0 0 0 6px #ffffff;
  background: #0f9f8f;
}

.mobile-order-picker-empty {
  padding: 28px 18px;
  color: #64748b;
  text-align: center;
}

.ai-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9000;
  display: none;
}

.ai-assistant.is-positioned {
  right: auto;
  bottom: auto;
}

.ai-assistant-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 128px;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: #fff;
  font-weight: 800;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 18px 26px rgba(40, 83, 190, 0.28));
  animation: robot-float 3.4s ease-in-out infinite, robot-hop 7s ease-in-out infinite;
}

.ai-assistant-toggle:hover {
  animation-duration: 1.8s;
}

.mini-robot {
  position: relative;
  display: block;
  width: 104px;
  height: 116px;
}

.mini-robot::before {
  position: absolute;
  left: 12px;
  top: 2px;
  width: 80px;
  height: 64px;
  content: "";
  border-radius: 38px 38px 26px 26px;
  border: 3px solid #0b1c4c;
  background:
    radial-gradient(circle at 33% 16%, #7fa8ff 0 23%, transparent 24%),
    radial-gradient(circle at 56% 12%, #82acff 0 26%, transparent 27%),
    radial-gradient(circle at 77% 33%, #5d88f8 0 22%, transparent 23%),
    linear-gradient(145deg, #6c92ff 0%, #426ee8 62%, #315dd7 100%);
  box-shadow:
    -6px 2px 0 -3px #0b1c4c,
    6px 2px 0 -3px #0b1c4c,
    inset 0 8px 12px rgba(255, 255, 255, 0.22),
    inset 0 -13px 20px rgba(19, 42, 126, 0.38);
  animation: robot-pulse 2.8s ease-in-out infinite;
}

.mini-robot-head {
  position: absolute;
  left: 25px;
  top: 30px;
  z-index: 2;
  width: 54px;
  height: 38px;
  border-radius: 13px;
  background: #102b62;
  border: 3px solid #0b1c4c;
  overflow: hidden;
  box-shadow:
    inset 0 0 16px rgba(64, 225, 255, 0.12),
    inset 0 -4px 8px rgba(0, 0, 0, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.08);
}

.mini-robot-head::after {
  position: absolute;
  inset: 4px 6px auto auto;
  width: 14px;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: rgba(151, 247, 255, 0.42);
}

.mini-robot-math {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  color: rgba(143, 247, 255, 0.34);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
  animation: robot-math-scroll 3.8s linear infinite;
}

.mini-robot-eye {
  position: absolute;
  top: 16px;
  width: 13px;
  height: 8px;
  border-radius: 0 0 12px 12px;
  border-bottom: 4px solid #8ff7ff;
  animation: robot-blink 4.2s ease-in-out infinite, robot-happy-eyes 5.5s ease-in-out infinite;
}

.mini-robot-eye.left {
  left: 12px;
}

.mini-robot-eye.right {
  right: 12px;
}

.mini-robot-smile {
  position: absolute;
  left: 22px;
  bottom: 6px;
  width: 10px;
  height: 4px;
  border-bottom: 2px solid rgba(143, 247, 255, 0.78);
  border-radius: 0 0 10px 10px;
  opacity: 0;
  animation: robot-smile 5.5s ease-in-out infinite;
}

.mini-robot-body {
  position: absolute;
  left: 31px;
  top: 75px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 31px;
  border-radius: 11px;
  border: 3px solid #0b1c4c;
  background: linear-gradient(145deg, #5c88ff, #335fd8);
  box-shadow:
    inset 0 5px 8px rgba(255, 255, 255, 0.24),
    inset 0 -6px 8px rgba(26, 52, 146, 0.4);
}

.mini-robot-mark {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  color: #f8fbff;
  text-shadow: 0 0 10px rgba(144, 247, 255, 0.86);
  animation: robot-body-code 2.6s ease-in-out infinite;
}

.mini-robot-arm,
.mini-robot-leg {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  border: 3px solid #0b1c4c;
  background: linear-gradient(145deg, #5d88ff, #2f58cd);
}

.mini-robot-arm {
  top: 79px;
  width: 14px;
  height: 34px;
  transform-origin: top center;
  animation: robot-arm-swing 1.8s ease-in-out infinite;
}

.mini-robot-arm.left {
  left: 17px;
  transform: rotate(20deg);
}

.mini-robot-arm.right {
  right: 15px;
  transform: rotate(-20deg);
  animation-delay: 0.55s;
}

.mini-robot-leg {
  bottom: 0;
  width: 17px;
  height: 21px;
  animation: robot-leg-bounce 1.7s ease-in-out infinite;
}

.mini-robot-leg.left {
  left: 34px;
}

.mini-robot-leg.right {
  right: 31px;
  animation-delay: 0.28s;
}

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

.ai-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 118px;
  width: 420px;
  max-height: min(720px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.ai-assistant-panel[hidden] {
  display: none !important;
}

.ai-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.ai-assistant.is-dragging,
.ai-assistant.is-dragging .ai-assistant-toggle,
.ai-assistant.is-dragging .ai-assistant-head {
  cursor: grabbing;
}

.ai-assistant-head strong,
.ai-empty strong,
.ai-result strong,
.ai-card strong {
  color: var(--text);
}

.ai-assistant-head span,
.ai-empty span,
.ai-result small,
.ai-card small,
.ai-summary {
  color: var(--muted);
}

.ai-assistant-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 12px;
  padding: 8px 8px 8px 12px;
  border: 1px solid #cfd5dd;
  border-radius: 7px;
}

.ai-assistant-search input {
  min-height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.ai-assistant-search button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: #1f66ad;
  color: #fff;
  font-weight: 800;
}

.ai-assistant-body {
  overflow-y: auto;
  padding: 0 12px 12px;
}

.ai-empty,
.ai-loading {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 28px 12px;
  text-align: center;
}

.ai-loading span {
  width: 28px;
  height: 28px;
  border: 3px solid #d7dde6;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.ai-card,
.ai-result {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.72);
  text-decoration: none;
}

.ai-card span,
.ai-result span {
  color: #8b1e28;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes robot-float {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-9px) rotate(1deg);
  }
}

@keyframes robot-hop {
  0%,
  64%,
  100% {
    margin-left: 0;
  }
  72% {
    margin-left: -8px;
  }
  80% {
    margin-left: 8px;
  }
  88% {
    margin-left: 0;
  }
}

@keyframes robot-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes robot-blink {
  0%,
  86%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
  90%,
  94% {
    transform: scaleY(0.12);
    opacity: 0.65;
  }
}

@keyframes robot-happy-eyes {
  0%,
  62%,
  100% {
    border-radius: 0 0 12px 12px;
  }
  68%,
  78% {
    border-radius: 12px;
    height: 7px;
    transform: translateY(1px);
  }
}

@keyframes robot-smile {
  0%,
  58%,
  100% {
    opacity: 0;
    transform: scaleX(0.8);
  }
  66%,
  82% {
    opacity: 1;
    transform: scaleX(1.35);
  }
}

@keyframes robot-math-scroll {
  0% {
    transform: translateX(42px);
  }
  100% {
    transform: translateX(-58px);
  }
}

@keyframes robot-body-code {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

@keyframes robot-arm-swing {
  0%,
  100% {
    translate: 0 0;
    rotate: 0deg;
  }
  50% {
    translate: 0 4px;
    rotate: 7deg;
  }
}

@keyframes robot-leg-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@media (min-width: 900px) {
  .ai-assistant {
    display: block;
  }
}

.visit-location-panel {
  display: grid;
  min-height: 72px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid #cfd5dd;
  border-radius: 6px;
  background: #fafbfc;
}

.location-state-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  color: #5e6877;
  background: #edf0f3;
}

.location-state-copy strong,
.location-state-copy span,
.location-state-copy small {
  display: block;
}

.location-state-copy strong {
  font-size: 11px;
}

.location-state-copy span {
  margin-top: 3px;
  color: #596273;
  font-size: 10px;
  font-weight: 750;
}

.location-state-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.visit-location-panel.is-loading {
  border-color: #8ab5dc;
  background: #f1f7fc;
}

.visit-location-panel.is-loading .location-state-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.visit-location-panel.is-success {
  border-color: #9fd2bc;
  background: #f0faf5;
}

.visit-location-panel.is-success .location-state-icon {
  color: var(--green);
  background: var(--green-soft);
}

.visit-location-panel.is-error {
  border-color: #dfa5aa;
  background: #fff5f5;
}

.visit-location-panel.is-error .location-state-icon {
  color: var(--red-700);
  background: var(--red-100);
}

.quick-article-entry {
  display: grid;
  grid-template-columns:
    minmax(170px, 0.9fr)
    minmax(250px, 1.4fr)
    82px
    90px
    110px
    125px
    auto;
  align-items: end;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #f8f9fb;
}

.quick-article-entry .field label {
  margin-bottom: 5px;
  font-size: 10px;
}

.quick-article-entry input,
.quick-article-entry select {
  min-height: 40px !important;
  font-size: 12px;
}

.quick-article-entry .search-box {
  min-height: 40px;
  background: #ffffff;
}

.quick-article-entry .search-box input {
  min-height: 38px !important;
}

.quick-add-button {
  min-height: 40px;
  padding: 9px 12px;
}

.selected-item-strip {
  display: flex;
  min-height: 36px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 12px;
  border-right: 1px solid #dce7f2;
  border-bottom: 1px solid #dce7f2;
  border-left: 1px solid #dce7f2;
  border-radius: 0 0 6px 6px;
  color: #4d5969;
  background: #f3f8fc;
  font-size: 9px;
}

.selected-item-strip[hidden] {
  display: none;
}

.selected-item-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.selected-item-strip strong {
  color: #20364f;
}

.quick-entry-error {
  display: block;
  margin-top: 8px;
}

.quick-entry-error[hidden] {
  display: none;
}

.order-cart-empty {
  display: flex;
  min-height: 154px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  border: 1px dashed #cbd1d8;
  border-radius: 7px;
  color: #778191;
  background: #fbfcfd;
  text-align: center;
}

.order-cart-empty[hidden] {
  display: none;
}

.order-cart-empty svg {
  width: 27px;
  height: 27px;
}

.order-cart-empty strong {
  color: #4d5766;
  font-size: 12px;
}

.order-cart-empty span {
  font-size: 9px;
}

.order-cart-wrap {
  margin-top: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 7px;
}

.has-no-lines .order-cart-wrap {
  display: none;
}

.order-form-ready [data-order-line]:not(.is-active) {
  display: none;
}

.expiry-form-ready [data-expiry-line]:not(.is-active) {
  display: none;
}

.order-cart-table th,
.order-cart-table td {
  padding: 10px;
}

.order-line-number {
  width: 42px;
  color: #7c8593;
  text-align: center;
  font-size: 10px;
  font-weight: 850;
}

.order-item-cell {
  min-width: 260px;
}

.order-line-meta {
  display: block;
  max-width: 420px;
  overflow-wrap: anywhere;
  color: #344054;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.4;
}

.order-line-amount {
  min-width: 105px;
  color: #243d5a;
  font-weight: 850;
}

.order-line-remove {
  width: 45px;
}

.order-delete-field {
  display: none;
}

.order-line-remove .icon-button {
  color: var(--red-700);
  background: var(--red-100);
}

.order-total-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.7fr)) minmax(180px, 1.4fr);
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.order-total-bar > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.order-total-bar > div:last-child {
  border-right: 0;
}

.order-total-bar span,
.order-total-bar strong {
  display: block;
}

.order-total-bar span {
  color: var(--muted);
  font-size: 9px;
}

.order-total-bar strong {
  overflow: hidden;
  margin-top: 4px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-total-bar .order-grand-total {
  color: #ffffff;
  background: #263b52;
  text-align: right;
}

.order-total-bar .order-grand-total span {
  color: #c6d1dc;
}

.order-total-bar .order-grand-total strong {
  font-size: 18px;
}

.order-submit-bar {
  position: sticky;
  z-index: 8;
  bottom: 10px;
  display: grid;
  min-height: 62px;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid #d7dce2;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 28px rgba(28, 38, 50, 0.13);
  backdrop-filter: blur(8px);
}

.submit-total {
  text-align: right;
}

.submit-total span,
.submit-total strong {
  display: block;
}

.submit-total span {
  color: var(--muted);
  font-size: 9px;
}

.submit-total strong {
  margin-top: 3px;
  font-size: 17px;
}

.center-cell {
  text-align: center;
}

.center-cell input {
  width: 17px;
  height: 17px;
  accent-color: var(--red-600);
}

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

.delivery-stop {
  display: grid;
  min-height: 104px;
  grid-template-columns: 44px 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.stop-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 15px;
  font-weight: 850;
}

.delivery-shop-photo {
  display: grid;
  width: 58px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--muted);
}

.delivery-shop-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pickup-note {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8a4b0f !important;
  background: #fff4d6;
  font-weight: 800;
}

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

.delivery-main h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 15px;
}

.delivery-main p,
.delivery-main small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.delivery-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 9px;
  border: 1px dashed #c8ced6;
  border-radius: 8px;
  color: var(--muted);
  background: #ffffff;
  text-align: center;
}

.empty-state svg {
  width: 32px;
  height: 32px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state h2 {
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  font-size: 12px;
}

.review-actions {
  padding: 20px;
}

.review-actions form {
  display: grid;
  gap: 10px;
}

.day-banner {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border: 1px solid #b7ddcd;
  border-radius: 8px;
  background: #edf9f3;
}

.day-banner.pending_start {
  border-color: #e9b06b;
  background: #fff7e8;
}

.day-banner span,
.day-banner strong,
.day-banner small {
  display: block;
}

.day-banner span,
.day-banner small {
  color: var(--muted);
  font-size: 10px;
}

.day-banner strong {
  margin: 4px 0;
  font-size: 20px;
}

.warning-text {
  color: #a45e08;
  font-weight: 850;
}

.section-action {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.compliance-alert {
  display: grid;
  min-height: 66px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #e8bd70;
  border-radius: 7px;
  color: #74450b;
  background: #fff8e9;
}

.compliance-alert strong,
.compliance-alert span {
  display: block;
}

.compliance-alert strong {
  font-size: 12px;
}

.compliance-alert span {
  margin-top: 3px;
  font-size: 10px;
}

.compliance-alert a {
  padding: 7px 9px;
  border: 1px solid #d8a450;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

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

.gst-table-scroll {
  max-height: 390px;
  overflow: auto;
}

.gst-table-scroll thead {
  position: sticky;
  z-index: 1;
  top: 0;
}

.sidebar-scrim {
  display: none;
}

.day-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.day-lock-panel {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.day-lock-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 22px 22px 0;
  border-radius: 14px;
  color: var(--red-600);
  background: rgba(180, 35, 44, 0.1);
}

.day-lock-icon svg {
  width: 28px;
  height: 28px;
}

.day-lock-copy {
  padding: 18px 22px 8px;
}

.day-lock-copy h2 {
  margin: 8px 0 8px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.day-lock-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.day-lock-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.day-lock-summary div {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
}

.day-lock-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.day-lock-summary strong {
  color: var(--ink);
  font-size: 17px;
}

.day-lock-note {
  padding: 12px;
  border: 1px solid rgba(183, 121, 31, 0.26);
  border-radius: 8px;
  background: rgba(255, 251, 235, 0.9);
  color: #8a4b11 !important;
  font-weight: 700;
}

.day-lock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px 22px;
}

.day-lock-logout-form {
  margin: 0;
}

.day-lock-logout-form .secondary-button {
  width: 100%;
}

.cash-flow-day-detail {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.cash-flow-day-detail:first-of-type {
  border-top: 0;
}

.cash-flow-day-detail h3,
.cash-flow-day-detail h4 {
  margin: 0;
}

.cash-flow-day-detail h3 {
  font-size: 17px;
}

.cash-flow-day-detail h4 {
  color: #475467;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-detail-table table {
  font-size: 12px;
}

html[data-theme="dark"] .day-lock-panel {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .day-lock-summary div {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .day-lock-note {
  background: rgba(120, 53, 15, 0.28);
  border-color: rgba(251, 191, 36, 0.24);
  color: #fde68a !important;
}

@media (max-width: 640px) {
  .day-lock-overlay {
    align-items: end;
    padding: 12px;
  }

  .day-lock-panel {
    border-radius: 16px;
  }

  .day-lock-summary {
    grid-template-columns: 1fr;
  }

  .day-lock-actions {
    flex-direction: column;
  }

  .day-lock-actions .primary-button,
  .day-lock-actions .secondary-button,
  .day-lock-logout-form {
    width: 100%;
    justify-content: center;
  }
}

.dashboard-heading {
  display: flex;
  min-height: 68px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.dashboard-heading h1 {
  max-width: 760px;
  overflow-wrap: anywhere;
  margin: 3px 0 5px;
  font-size: 25px;
  line-height: 1.15;
}

.dashboard-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-control {
  display: grid;
  min-width: 220px;
  height: 42px;
  grid-template-columns: 20px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  padding: 0 5px 0 12px;
  border: 1px solid #d6dbe1;
  border-radius: 7px;
  background: #ffffff;
}

.month-control > svg {
  color: var(--red-700);
}

.month-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #303946;
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.month-control button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #ffffff;
  background: var(--red-600);
}

.month-control button svg {
  width: 15px;
  height: 15px;
}

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

.executive-stat {
  position: relative;
  display: grid;
  min-height: 82px;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  overflow: hidden;
  gap: 12px;
  padding: 15px 16px 15px 19px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.executive-stat > svg {
  width: 21px;
  height: 21px;
  color: #778191;
}

.metric-accent {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
}

.metric-accent.red {
  background: var(--red-600);
}

.metric-accent.blue {
  background: #2c7fb8;
}

.metric-accent.green {
  background: #299568;
}

.metric-accent.amber {
  background: #d49a20;
}

.executive-stat span,
.executive-stat strong {
  display: block;
}

.executive-stat div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.executive-stat strong {
  overflow: hidden;
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-command-bar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.dashboard-command-bar strong,
.dashboard-command-bar span {
  display: block;
}

.dashboard-command-bar strong {
  font-size: 12px;
}

.dashboard-command-bar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-command-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.dashboard-command-actions a {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 5px;
  color: #4c5665;
  font-size: 10px;
  font-weight: 800;
}

.dashboard-command-actions a:hover {
  color: var(--red-700);
  background: var(--red-100);
}

.dashboard-command-actions svg {
  width: 15px;
  height: 15px;
}

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

.analytics-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.analytics-title {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f2;
}

.analytics-title h2 {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}

.analytics-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.analytics-title > svg {
  width: 19px;
  height: 19px;
  color: #87909e;
}

.dashboard-chart {
  position: relative;
  height: 268px;
  padding: 14px 12px 10px;
}

.empty-chart {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  color: #8a94a3;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    #f0f2f4 44px
  );
  font-size: 10px;
  font-weight: 700;
}

.empty-chart svg {
  width: 25px;
  height: 25px;
  color: #a9b1bc;
}

.business-summary-panel {
  color: #ffffff;
  border-color: #263b52;
  background: #263b52;
}

.business-summary-panel .analytics-title {
  border-color: rgba(255, 255, 255, 0.12);
}

.business-summary-panel .analytics-title p,
.business-summary-panel .analytics-title > svg {
  color: #c5d0dc;
}

.donut-chart-wrap {
  position: relative;
  height: 224px;
  padding: 13px 20px 7px;
}

.donut-center {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 108px;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.donut-center span,
.donut-center strong {
  display: block;
}

.donut-center span {
  color: #bdc9d5;
  font-size: 9px;
}

.donut-center strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.summary-strip > div {
  min-width: 0;
  padding: 11px 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
  text-align: center;
}

.summary-strip > div:last-child {
  border-right: 0;
}

.summary-strip span,
.summary-strip strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-strip span {
  color: #bdc9d5;
  font-size: 8px;
}

.summary-strip strong {
  margin-top: 4px;
  font-size: 11px;
}

.retailer-chart {
  height: 300px;
}

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

.metric-matrix > a {
  display: flex;
  min-height: 92px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 12px;
  border-right: 1px solid #edf0f2;
  border-bottom: 1px solid #edf0f2;
  text-align: center;
}

.metric-matrix > a:nth-child(2n) {
  border-right: 0;
}

.metric-matrix > a:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.metric-matrix > a:hover {
  background: #fafbfc;
}

.metric-matrix span,
.metric-matrix strong {
  display: block;
  max-width: 100%;
}

.metric-matrix span {
  color: #5f6978;
  font-size: 9px;
  line-height: 1.35;
}

.metric-matrix strong {
  overflow: hidden;
  margin-top: 7px;
  color: #253e60;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.metric-matrix-three > a,
.metric-matrix-three > a:nth-child(2n) {
  border-right: 1px solid #edf0f2;
  border-bottom: 0;
}

.metric-matrix-three > a:last-child {
  border-right: 0;
}

@media (max-width: 1050px) {
  .gst-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

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

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

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

  .quick-panel .section-head {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    background: rgba(23, 32, 42, 0.42);
  }

  .sidebar-scrim.show {
    display: block;
  }

  .app-shell {
    margin-left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .content {
    padding: 20px 16px;
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr) 180px auto;
  }
}

@media (max-width: 620px) {
  .compliance-alert {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .compliance-alert a {
    grid-column: 1 / -1;
    text-align: center;
  }

  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .dashboard-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .month-control {
    width: 100%;
  }

  .executive-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-command-bar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .dashboard-command-actions a {
    justify-content: center;
    border: 1px solid var(--line);
  }

  .dashboard-chart {
    height: 248px;
  }

  .donut-chart-wrap {
    height: 215px;
  }

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

  .metric-matrix-three > a,
  .metric-matrix-three > a:nth-child(2n) {
    min-height: 76px;
    border-right: 0;
    border-bottom: 1px solid #edf0f2;
  }

  .metric-matrix-three > a:last-child {
    border-bottom: 0;
  }

  .login-brand {
    top: 18px;
    left: 18px;
  }

  .login-theme-control {
    top: 72px;
    right: auto;
    left: 18px;
  }

  .login-brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    font-size: 21px;
  }

  .login-brand-name {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .login-brand-company {
    font-size: 9px;
  }

  .login-wrap {
    align-items: end;
    padding: 84px 12px 12px;
  }

  .login-panel {
    padding: 26px 20px;
  }

  .login-product-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .page-heading .primary-button {
    width: 100%;
  }

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

  .stat-card {
    min-height: 88px;
  }

  .quick-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-panel .section-head {
    grid-column: auto;
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid,
  .detail-layout,
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-surface {
    padding: 16px;
  }

  .detail-list .wide {
    grid-column: auto;
  }

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

  .password-panel {
    padding: 26px 20px;
  }
}

@media (max-width: 1050px) {
  .filter-bar.report-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .filter-bar.compact-filter,
  .filter-bar.date-filter,
  .filter-bar.report-filter {
    grid-template-columns: minmax(0, 1fr);
  }

  .heading-actions,
  .document-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .heading-actions > *,
  .document-actions > *,
  .document-actions form button {
    width: 100%;
  }

  .inline-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .location-control,
  .day-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-stop {
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
  }

  .delivery-shop-photo {
    justify-self: start;
  }

  .delivery-main {
    grid-column: 1 / -1;
  }

  .stop-number {
    width: 36px;
    height: 36px;
  }

  .delivery-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .day-chip {
    display: none;
  }

  .impersonation-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .form-surface .inset-head {
    margin: -16px -16px 16px;
  }
}

@media (max-width: 1180px) {
  .quick-article-entry {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .article-search-field,
  .article-picker-field {
    grid-column: span 3;
  }

  .compact-number-field {
    grid-column: span 2;
  }

  .quick-add-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .order-page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .order-page-heading h1 {
    font-size: 23px;
  }

  .order-heading-status {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-heading-status > span {
    justify-content: center;
  }

  .order-customer-section,
  .order-article-section {
    padding: 13px;
  }

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

  .order-customer-grid .field,
  .order-customer-grid select,
  .order-customer-grid input {
    min-width: 0;
    max-width: 100%;
  }

  .order-customer-grid select.mobile-order-native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }

  .mobile-order-select-trigger {
    width: 100%;
    min-height: 46px;
    display: block;
    padding: 10px 40px 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background:
      linear-gradient(45deg, transparent 50%, #64748b 50%) calc(100% - 17px) 50% / 7px 7px no-repeat,
      linear-gradient(135deg, #64748b 50%, transparent 50%) calc(100% - 12px) 50% / 7px 7px no-repeat,
      var(--surface);
    color: var(--text);
    text-align: left;
    font-size: 16px;
    line-height: 1.35;
  }

  .mobile-order-select-trigger.is-placeholder {
    color: var(--muted);
  }

  .order-customer-grid select,
  .order-customer-grid input,
  .quick-article-entry select,
  .quick-article-entry input {
    font-size: 16px;
  }

  .visit-location-panel {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .location-capture-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .quick-article-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .article-search-field,
  .article-picker-field,
  .quick-add-button {
    grid-column: 1 / -1;
  }

  .compact-number-field {
    grid-column: span 1;
  }

  .compact-number-field:nth-of-type(6) {
    grid-column: 1 / -1;
  }

  .selected-item-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .order-cart-wrap {
    overflow: visible;
    border: 0;
  }

  .order-cart-table,
  .order-cart-table tbody {
    display: block;
  }

  .order-cart-table thead {
    display: none;
  }

  .order-cart-table tr.is-active {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) 38px;
    gap: 9px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
  }

  .order-cart-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .order-cart-table td[data-label]::before {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .order-line-number {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid !important;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #677385;
  }

  .order-item-cell {
    grid-column: 1 / -1;
    padding-right: 34px !important;
  }

  .order-line-meta {
    font-size: 11px;
  }

  .order-lines input[type="number"] {
    width: 100%;
    min-width: 0;
  }

  .order-cart-table td[data-label] input,
  .order-cart-table td[data-label] select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .order-cart-table td[data-label="Quantity"] {
    grid-column: 1;
  }

  .order-cart-table td[data-label="Unit"] {
    grid-column: 2;
  }

  .order-cart-table td[data-label="Unit"] select {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .order-cart-table td[data-label="Rate"] {
    grid-column: 1;
  }

  .order-cart-table td[data-label="Discount"] {
    grid-column: 2;
  }

  .order-line-amount {
    grid-column: 1 / 3;
    align-self: end;
    padding-top: 4px !important;
    font-size: 15px;
  }

  .order-line-remove {
    grid-column: 3;
    align-self: end;
  }

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

  .order-total-bar > div:nth-child(2) {
    border-right: 0;
  }

  .order-total-bar .order-grand-total {
    grid-column: 1 / -1;
    text-align: left;
  }

  .order-submit-bar {
    bottom: 6px;
    grid-template-columns: 42px minmax(90px, 1fr) minmax(132px, auto);
    gap: 7px;
  }

  .order-submit-bar .secondary-button {
    width: 42px;
    overflow: hidden;
    padding: 9px;
  }

  .order-submit-bar .secondary-button span {
    display: none;
  }

.order-submit-bar .primary-button {
    min-width: 0;
    padding: 9px 11px;
    font-size: 11px;
  }

  .submit-total strong {
    font-size: 14px;
  }
}

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

.asset-preview {
  min-height: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  justify-content: center;
  color: var(--muted);
}

.asset-preview img {
  display: block;
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

@media (max-width: 620px) {
  .asset-preview-grid {
    grid-template-columns: 1fr;
  }
}

.section-block,
.form-surface,
.detail-group,
.stat-card {
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.stat-card,
.primary-button,
.secondary-button,
.small-button,
.nav-item {
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 var(--border);
}

.table-wrap tbody tr {
  transition: background-color 120ms ease;
}

.table-wrap tbody tr:hover {
  background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(180, 35, 44, 0.28);
  outline-offset: 2px;
}

.warning-text {
  font-weight: 800;
}

.danger-surface {
  border-color: rgba(180, 35, 44, 0.36);
  box-shadow: 0 10px 28px rgba(180, 35, 44, 0.08);
}

.table-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.table-thumb {
  display: block;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
}

.choice-list-panel {
  max-height: 420px;
  overflow: auto;
  padding: 12px 16px;
}

.choice-list-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-list-panel li label {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.choice-list-panel input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--role-accent);
}

.order-line-unit {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
}

.loading-summary-table th,
.loading-summary-table td {
  vertical-align: top;
}

.loading-summary-table td:nth-child(2) {
  min-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.loading-summary-table th:nth-child(n + 3),
.loading-summary-table td:nth-child(n + 3) {
  text-align: right;
  white-space: nowrap;
}

.shop-photo-band {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 420px);
  gap: 24px;
  align-items: center;
}

.shop-photo-band img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 6px;
}

@media (max-width: 700px) {
  .shop-photo-band {
    grid-template-columns: 1fr;
  }
}

.app-body .eyebrow {
  color: var(--role-accent-dark);
}

.app-body .primary-button {
  border-color: var(--role-accent);
  background: var(--role-accent);
}

.app-body .primary-button:hover {
  border-color: var(--role-accent-dark);
  background: var(--role-accent-dark);
}

.app-body .field input:focus,
.app-body .field select:focus,
.app-body .field textarea:focus,
.app-body .search-box:focus-within,
.app-body .filter-bar > select:focus {
  border-color: var(--role-accent);
  box-shadow: 0 0 0 3px var(--role-accent-soft);
}

.app-body button:focus-visible,
.app-body a:focus-visible {
  outline-color: var(--role-accent);
}

.message.warning {
  border-color: #e8c477;
  color: #704006;
  background: #fff7e5;
}

.message.error {
  border-color: #efb0b6;
  color: #8e1d26;
  background: #fff1f2;
}

html[data-theme="dark"] {
  color-scheme: dark;
  background: #080d16;
}

html[data-theme="dark"] .app-body,
html[data-theme="dark"] .login-page,
html[data-theme="dark"] .password-page {
  --ink: #e5e7eb;
  --muted: #a6adbb;
  --line: #273244;
  --surface: #111827;
  --canvas: #080d16;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  color: var(--ink);
  background: radial-gradient(circle at top right, rgba(36, 99, 168, 0.14), transparent 34%),
    #080d16;
}

html[data-theme="dark"] .login-shade {
  background: rgba(8, 13, 22, 0.58);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .section-block,
html[data-theme="dark"] .detail-group,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .standard-form,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .order-customer-section,
html[data-theme="dark"] .order-article-section,
html[data-theme="dark"] .order-notes-section,
html[data-theme="dark"] .quick-article-entry,
html[data-theme="dark"] .selected-item-strip,
html[data-theme="dark"] .order-total-bar,
html[data-theme="dark"] .settlement-fieldset,
html[data-theme="dark"] .day-banner,
html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .password-panel,
html[data-theme="dark"] .welcome-panel {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(17, 24, 39, 0.96);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.94);
}

html[data-theme="dark"] .brand-block,
html[data-theme="dark"] .sidebar-footer,
html[data-theme="dark"] table th,
html[data-theme="dark"] table td {
  border-color: var(--line);
}

html[data-theme="dark"] table thead,
html[data-theme="dark"] .order-cart-table thead {
  color: #dbeafe;
  background: #0f172a;
}

html[data-theme="dark"] tr,
html[data-theme="dark"] .order-cart-empty,
html[data-theme="dark"] .visit-location-panel,
html[data-theme="dark"] .live-badge,
html[data-theme="dark"] .secure-chip {
  border-color: var(--line);
  background: #0f172a;
}

html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .theme-switch,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .small-button {
  border-color: #334155;
  color: #dbeafe;
  background: #111827;
}

html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .secondary-button:hover,
html[data-theme="dark"] .theme-option:not(.active):hover,
html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .small-button:hover {
  color: #ffffff;
  background: #172033;
}

html[data-theme="dark"] .theme-option {
  color: #dbeafe;
}

html[data-theme="dark"] .theme-option.active {
  color: #080d16;
  background: #f8fafc;
}

html[data-theme="dark"] .nav-item.active {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.16);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .search-box {
  border-color: #334155;
  color: var(--ink);
  background: #0b1220;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #748198;
}

html[data-theme="dark"] .message {
  border-color: #14532d;
  color: #bbf7d0;
  background: #052e1a;
}

html[data-theme="dark"] .message.warning {
  border-color: #854d0e;
  color: #fde68a;
  background: #2b1d06;
}

html[data-theme="dark"] .message.error,
html[data-theme="dark"] .form-alert {
  border-color: #7f1d1d;
  color: #fecaca;
  background: #2b0b0f;
}

html[data-theme="dark"] .field-error {
  color: #fca5a5;
}

html[data-theme="dark"] .welcome-flow span,
html[data-theme="dark"] .denomination-total-row {
  border-color: #273244;
  color: #e5e7eb;
  background: #1f2937;
}

html[data-theme="dark"] .welcome-copy p {
  color: #a6adbb;
}

html[data-theme="dark"] .executive-stat,
html[data-theme="dark"] .dashboard-command-bar,
html[data-theme="dark"] .analytics-panel {
  border-color: var(--line);
  color: var(--ink);
  background: #111827;
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .analytics-title,
html[data-theme="dark"] .metric-matrix > a,
html[data-theme="dark"] .metric-matrix-three > a,
html[data-theme="dark"] .metric-matrix-three > a:nth-child(2n),
html[data-theme="dark"] .summary-strip,
html[data-theme="dark"] .summary-strip > div {
  border-color: var(--line);
}

html[data-theme="dark"] .executive-stat strong,
html[data-theme="dark"] .analytics-title h2,
html[data-theme="dark"] .dashboard-command-bar strong,
html[data-theme="dark"] .metric-matrix strong,
html[data-theme="dark"] .topbar-company,
html[data-theme="dark"] .section-head h2 {
  color: #f8fafc;
}

html[data-theme="dark"] .executive-stat div > span,
html[data-theme="dark"] .analytics-title p,
html[data-theme="dark"] .dashboard-command-bar span,
html[data-theme="dark"] .metric-matrix span,
html[data-theme="dark"] .topbar-role,
html[data-theme="dark"] .section-head p,
html[data-theme="dark"] .month-control input {
  color: #a6adbb;
}

html[data-theme="dark"] .executive-stat > svg,
html[data-theme="dark"] .analytics-title > svg,
html[data-theme="dark"] .dashboard-command-actions svg {
  color: #94a3b8;
}

html[data-theme="dark"] .dashboard-command-actions a {
  color: #dbeafe;
  background: #0b1220;
}

html[data-theme="dark"] .dashboard-command-actions a:hover,
html[data-theme="dark"] .metric-matrix > a:hover {
  color: #ffffff;
  background: #172033;
}

html[data-theme="dark"] .metric-matrix > a {
  background: transparent;
}

html[data-theme="dark"] .empty-chart {
  color: #cbd5e1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 43px,
    #1f2937 44px
  );
}

html[data-theme="dark"] .empty-chart svg {
  color: #94a3b8;
}

html[data-theme="dark"] .month-control,
html[data-theme="dark"] .dashboard-controls {
  border-color: var(--line);
  color: var(--ink);
  background: #111827;
}

.settlement-fieldset {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

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

.denomination-entry strong {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: var(--role-accent);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.denomination-total-row {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 900;
}

.return-entry-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.is-full-return .return-entry-table tbody {
  opacity: 0.62;
}

.cash-count-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.cash-count-review div {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8fafc;
  font-size: 12px;
}

.reconciliation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.reconciliation-grid > div {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.reconciliation-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.reconciliation-grid strong {
  font-size: 14px;
}

.day-end-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.content > * {
  animation: workspace-enter 220ms ease-out both;
}

@keyframes workspace-enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 620px) {
  .page-heading > div {
    min-width: 0;
  }

  .page-heading h1 {
    max-width: 100%;
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .denomination-grid,
  .cash-count-review,
  .reconciliation-grid,
  .day-end-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .welcome-panel {
    padding: 20px;
  }

  .welcome-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .choice-list-panel ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .day-end-input-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content > * {
    animation: none;
  }

  .stat-card,
  .primary-button,
  .secondary-button,
  .small-button,
  .nav-item {
    transition: none;
  }
}

.article-ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 1180;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
}

.article-ad-panel {
  width: min(820px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
}

.article-ad-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--border);
}

.article-ad-head h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 4vw, 34px);
}

.article-ad-list {
  display: grid;
  gap: 16px;
  padding: 20px 26px 26px;
}

.article-ad-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(180, 35, 44, 0.08), rgba(8, 133, 145, 0.08));
}

.article-ad-card img,
.article-ad-fallback {
  width: 150px;
  aspect-ratio: 1.2;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
}

.article-ad-fallback {
  display: grid;
  place-items: center;
  color: var(--primary);
}

.article-ad-fallback svg {
  width: 44px;
  height: 44px;
}

.article-ad-copy span {
  display: block;
  color: var(--accent);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.article-ad-copy h3 {
  margin: 4px 0 8px;
  font-size: 22px;
}

.article-ad-copy p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.article-ad-meta {
  display: grid;
  gap: 3px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.68);
}

.article-ad-meta small {
  color: var(--muted);
}

html[data-theme="dark"] .article-ad-panel {
  background: #111827;
  border-color: #334155;
}

html[data-theme="dark"] .article-ad-card {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.12), rgba(45, 212, 191, 0.1));
  border-color: #334155;
}

html[data-theme="dark"] .article-ad-fallback,
html[data-theme="dark"] .article-ad-card img,
html[data-theme="dark"] .article-ad-meta {
  background: rgba(15, 23, 42, 0.84);
  border-color: #334155;
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell,
  .content,
  .topbar,
  .page-heading,
  .dashboard-heading,
  .dashboard-command-bar,
  .section-block,
  .form-surface,
  .stat-card,
  .executive-stat,
  .analytics-panel {
    max-width: 100%;
    min-width: 0;
  }

  .app-shell {
    margin-left: 0;
  }

  .content {
    width: 100%;
    padding: 14px;
  }

  .topbar {
    gap: 8px;
    padding: 8px 10px;
  }

  .topbar-actions {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .dashboard-heading,
  .page-heading,
  .dashboard-command-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .stat-grid,
  .executive-stat-grid,
  .dashboard-grid,
  .analytics-grid,
  .metric-matrix,
  .quick-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .article-ad-overlay {
    align-items: center;
    padding: 10px;
  }

  .article-ad-panel {
    width: min(100%, 430px);
    border-radius: 18px;
    max-height: calc(100vh - 20px);
  }

  .article-ad-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
  }

  .article-ad-head h2 {
    font-size: 24px;
    line-height: 1.12;
  }

  .article-ad-list {
    padding: 12px 14px 16px;
  }

  .article-ad-card {
    display: block;
    padding: 14px;
    overflow: hidden;
  }

  .article-ad-card img,
  .article-ad-fallback {
    display: block;
    width: min(150px, 70%);
    margin: 0 auto 12px;
    aspect-ratio: 1.35;
  }

  .article-ad-copy {
    min-width: 0;
    text-align: left;
  }

  .article-ad-copy h3 {
    font-size: 22px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .article-ad-copy p {
    font-size: 17px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .article-ad-meta {
    padding: 9px 10px;
    overflow-wrap: anywhere;
  }

  .article-ad-meta strong,
  .article-ad-meta small {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .article-ad-card form {
    margin-top: 12px;
  }

  .article-ad-card .primary-button {
    width: 100%;
  }

  .ai-assistant {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* Final visual override so the professional layer wins over legacy rules. */
.primary-button {
  background: linear-gradient(135deg, var(--role-accent), var(--role-accent-dark));
  border-color: var(--role-accent-dark);
  box-shadow: 0 12px 24px rgba(23, 32, 42, 0.12);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--role-accent-dark), var(--role-accent));
  box-shadow: var(--shadow-lift);
}

.section-block,
.quick-panel,
.form-surface,
.detail-group,
.stat-card,
.analytics-panel,
.executive-stat {
  box-shadow: var(--shadow-soft);
}

.section-block:hover,
.form-surface:hover,
.detail-group:hover,
.analytics-panel:hover,
.executive-stat:hover,
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.small-button:active,
.icon-button:active,
.theme-option:active,
.theme-toggle:active,
.is-pressing {
  transform: translateY(1px) scale(0.98);
}
