/* Workspace layout and shared interaction components. Business components live in app.css. */
:root {
  --page-bg: #f7f8fa;
  --surface-soft: #f8f9fb;
  --ink: #223046;
  --ink-soft: #40516a;
  --muted: #596980;
  --line: #e1e6ed;
  --line-strong: #c7d0dd;
  --blue: #315ed8;
  --blue-dark: #244aaa;
  --surface-blue: #eaf0ff;
  --green: #19705a;
  --red: #b33635;
  --amber: #986714;
  --sidebar-width: 216px;
  --topbar-height: 64px;
  --bs-primary: #315ed8;
  --bs-primary-rgb: 49, 94, 216;
  --bs-body-color: #223046;
  --bs-border-color: #e1e6ed;
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}
body {
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}
:focus-visible {
  outline: 3px solid #8ba7f0;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.ui-icon {
  flex-shrink: 0;
  vertical-align: middle;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 2000;
  transform: translateY(-150%);
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
}
.skip-link:focus {
  transform: none;
  color: #fff;
}
.workspace-sidebar {
  --bs-offcanvas-width: var(--sidebar-width);
  background: #f4f6f9 !important;
  border-right: 1px solid var(--line) !important;
  display: flex;
  flex-direction: column;
}
.workspace-brand {
  min-height: 82px;
  padding: 22px 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-link {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
}
.brand-link strong {
  font-size: 17px;
  display: block;
}
.brand-link small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.brand-mark {
  background: #274975;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px #ffffff18;
  width: 37px;
  height: 37px;
  flex-basis: 37px;
}
.workspace-links {
  padding: 8px 12px 20px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}
.workspace-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  min-height: 38px;
  color: #54627a;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 550;
  margin: 2px 0;
}
.workspace-link .ui-icon {
  width: 18px;
  height: 18px;
  color: #79869b;
}
.workspace-link:hover {
  background: #e9edf4;
  color: var(--ink);
}
.workspace-link.active {
  background: #e4ebfb;
  color: #274da9;
  font-weight: 680;
}
.workspace-link.active .ui-icon {
  color: #315ed8;
}
.nav-section-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #647187;
  margin: 20px 12px 8px;
  font-weight: 600;
}
.sidebar-footer {
  font-size: 11px;
  color: #647187;
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-dot {
  height: 6px;
  width: 6px;
  background: #7b8a9c;
  border-radius: 50%;
}
.workspace-topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1010;
}
.workspace-location {
  display: flex;
  gap: 12px;
  font-size: 12px;
  align-items: center;
  min-width: 0;
  color: #647187;
}
.workspace-location strong {
  color: #566379;
  font-weight: 550;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jump-trigger {
  margin-left: auto;
  border: 1px solid #e5e9f0;
  background: #f9fafc;
  border-radius: 6px;
  color: #647187;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  font-size: 12px;
  min-width: 188px;
}
.jump-trigger .ui-icon {
  width: 16px;
  height: 16px;
}
.jump-trigger kbd {
  margin-left: auto;
  background: #fff;
  color: #647187;
  border: 1px solid #e3e7ee;
  font-size: 10px;
  font-family: inherit;
  padding: 1px 5px;
}
.user-menu {
  margin-left: auto;
}
.jump-trigger + .user-menu {
  margin-left: 0;
}
.user-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: none;
  padding: 4px 0;
  color: #516078;
  font-size: 12px;
}
.user-trigger > .ui-icon {
  width: 14px;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #d9e2f6;
  border-radius: 50%;
  background: #edf2ff;
  color: #36569f;
  font-size: 12px;
}
.account-caption {
  padding: 9px 12px;
  font-size: 11px;
  color: var(--muted);
}
.app-dropdown {
  box-shadow: 0 10px 35px #23354d14;
  min-width: 200px;
}
.app-dropdown .dropdown-item {
  font-size: 13px;
  padding: 9px 12px;
}
.app-shell {
  max-width: 1600px;
  padding: 24px 28px 56px;
}
.app-shell:focus {
  outline: none;
}
.page-head {
  gap: 18px;
  margin-bottom: 24px;
  align-items: center;
}
.page-head .page-title,
.app-shell h1 {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 720;
}
.page-subtitle,
.page-head p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 7px;
  max-width: 800px;
}
.page-kicker {
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.06em;
  color: #647187;
  margin-bottom: 8px;
}
.btn {
  --bs-btn-font-size: 13px;
  --bs-btn-padding-y: 8px;
  --bs-btn-padding-x: 14px;
  font-size: 13px;
  font-weight: 580;
  border-radius: 6px;
  white-space: nowrap;
}
.btn-primary {
  box-shadow: 0 1px 2px #315ed81a;
  --bs-btn-bg: var(--blue);
  --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue-dark);
  --bs-btn-hover-border-color: var(--blue-dark);
}
.btn-outline-secondary {
  color: #53627a;
  border-color: #d6dde7;
  background: #fff;
}
.btn-outline-primary {
  color: #365cc0;
  border-color: #cbd6ef;
  background: #fff;
}
.btn-outline-danger {
  color: var(--red);
  border-color: #e6d8d8;
  background: #fff;
}
.btn-sm {
  --bs-btn-padding-y: 5px;
  --bs-btn-padding-x: 9px;
  font-size: 12px;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #46556c;
  margin-bottom: 7px;
}
.form-control,
.form-select {
  font-size: 14px;
  min-height: 40px;
  border-color: #d8dfea;
  box-shadow: 0 1px 2px #23354d03;
  border-radius: 6px;
}
.form-control:focus,
.form-select:focus {
  border-color: #84a1eb;
  box-shadow: 0 0 0 3px #315ed814;
}
.form-text,
.helper-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.form-control[readonly] {
  background: #f3f5f8;
  color: #63718a;
}
.alert {
  font-size: 13px;
  padding: 13px 16px;
  border-radius: 7px;
  line-height: 1.7;
}
.alert-danger {
  color: #9c3336;
  background: #fff3f2;
  border-color: #f0d4d3;
}
.alert-warning {
  color: #886221;
  background: #fff9ec;
  border-color: #ecdfbd;
}
.alert-success {
  color: #216d56;
  background: #eef8f3;
  border-color: #cfe7da;
}
.alert-info {
  color: #355c9c;
  background: #f0f5ff;
  border-color: #d7e2f8;
}
.alert-dismissible {
  padding-right: 48px;
}
.stat-strip {
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 0 22px;
}
.stat-box {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 17px 20px;
  background: transparent;
}
.stat-box:last-child {
  border-right: 0;
}
.stat-box span {
  font-size: 11px;
}
.stat-box strong {
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 650;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.filter-bar {
  padding: 16px 18px;
  box-shadow: none;
  border-color: var(--line);
  margin-bottom: 16px;
  border-radius: 8px;
}
.filter-drawer {
  margin-bottom: 16px;
}
.filter-drawer > summary {
  list-style: none;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-weight: 600;
  color: #53627a;
}
.filter-drawer > summary::-webkit-details-marker {
  display: none;
}
.filter-drawer > summary::after {
  content: "＋";
  margin-left: auto;
}
.filter-drawer[open] > summary::after {
  content: "−";
}
.filter-drawer .filter-bar {
  margin-bottom: 0;
}
.filter-drawer > summary small {
  font-size: 11px;
  font-weight: 400;
  color: var(--blue);
}
.table {
  --bs-table-color: var(--ink);
  font-size: 13px;
}
.table th {
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
  color: #647187;
  background: #f8f9fb !important;
  padding: 11px 12px;
  white-space: nowrap;
}
.table td {
  padding: 12px;
  line-height: 1.5;
  border-bottom-color: #edf0f5;
}
.table .fw-semibold {
  font-weight: 600 !important;
}
.table code {
  color: #405f89;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
}
.table .small {
  font-size: 11px;
  color: #647187 !important;
}
.table .text-end {
  font-variant-numeric: tabular-nums;
}
.table-hover > tbody > tr:hover > * {
  --bs-table-bg-state: #f6f8fc;
}
.data-table-shell,
.table-responsive {
  box-shadow: none;
  border-radius: 8px;
  scrollbar-width: thin;
  scrollbar-color: #cad3e0 #f5f7fb;
}
.table-scroll-hint {
  font-size: 11px;
  color: #647187;
  display: flex;
  justify-content: flex-end;
  margin: 7px 2px 12px;
}
.table-responsive.is-scrollable table th:first-child,
.table-responsive.is-scrollable table td:first-child {
  position: sticky;
  left: 0;
  background: white;
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}
.table-responsive.is-scrollable table th:first-child {
  z-index: 2;
}
.badge {
  padding: 4px 7px;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 550;
  border-radius: 4px;
}
.text-bg-success {
  background: #eaf5ef !important;
  color: #2c775a !important;
}
.text-bg-danger {
  background: #fbeeed !important;
  color: #a43c3a !important;
}
.text-bg-warning {
  background: #fff4d9 !important;
  color: #85621e !important;
}
.text-bg-secondary {
  background: #eef1f5 !important;
  color: #67758c !important;
}
.text-danger {
  color: var(--red) !important;
}
.text-success {
  color: var(--green) !important;
}
.panel {
  box-shadow: none;
  border-color: var(--line);
  border-radius: 9px;
}
.panel-head {
  padding-bottom: 14px;
}
.panel-head h2,
.order-summary h2 {
  font-size: 15px;
  font-weight: 650;
}
.panel-head p {
  font-size: 11px;
  line-height: 1.6;
}
.panel-head > a {
  font-size: 11px;
  white-space: nowrap;
}
.stack-row {
  padding: 12px 0;
}
.empty-note {
  font-size: 13px;
  color: var(--muted);
  padding: 26px 18px;
  text-align: center;
  background: #fafbfd;
  border-radius: 7px;
}
.form-shell {
  border-color: var(--line);
  box-shadow: none;
  border-radius: 9px;
}
.form-section {
  padding: 22px 24px;
}
.form-section-title h2 {
  font-size: 16px;
}
.form-section-title p {
  font-size: 12px;
}
.form-section-number {
  background: #edf2fb;
  color: #466496;
  box-shadow: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
}
.workflow-layout {
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 22px;
}
.workflow-summary {
  top: 86px;
}
.order-summary {
  border-radius: 9px;
  box-shadow: none;
  border-color: var(--line);
}
.order-summary-head {
  padding: 18px 20px;
  background: #f9fafc;
}
.order-summary-body {
  padding: 10px 20px 20px;
}
.summary-line {
  font-size: 12px;
  padding: 10px 0;
}
.summary-line.total strong {
  font-size: 26px;
}
.sale-line {
  background: #fcfdff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 18px;
  margin-bottom: 12px;
}
#sale-lines {
  border: 0;
}
.sale-line-head {
  margin-bottom: 16px;
}
.sale-line-index {
  font-size: 13px;
}
.sale-line-head .small {
  font-size: 11px;
}
.inventory-strip {
  padding: 9px 12px;
  font-size: 11px;
  background: #f1f5fc;
  border-color: #e4ebf6;
  line-height: 1.7;
}
.edit-item {
  background: #fcfdff;
}
.focused-form {
  max-width: 1040px;
}
.form-band {
  margin: -2px 0 18px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.form-band h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 4px;
}
.form-band p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.form-actions {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 62px;
}
.password-toggle {
  position: absolute;
  right: 8px;
  top: 5px;
  bottom: 5px;
  border: 0;
  background: transparent;
  color: #536a98;
  font-size: 12px;
  padding: 4px 8px;
}
.field-error {
  border-color: #c96b68 !important;
}
.validation-summary {
  margin-bottom: 20px;
}
.validation-summary h2 {
  font-size: 14px;
}
.validation-summary ul {
  margin: 8px 0 0;
  padding-left: 20px;
}
.validation-summary a {
  text-decoration: underline;
  color: inherit;
}
.permission-group {
  background: #fcfdff;
  border-color: var(--line);
  padding: 18px;
  border-radius: 8px;
}
.permission-option strong {
  font-size: 12px;
}
.permission-option small {
  font-size: 11px;
}
.permission-count {
  font-size: 12px;
  color: var(--blue);
  margin-left: auto;
}
.receivable-group {
  box-shadow: none;
  border-radius: 9px;
}
.receivable-group-head {
  background: #f8fafd;
  border-bottom: 1px solid var(--line);
}
.receivable-group-head h2 {
  font-size: 16px;
}
.receivable-customer-row summary {
  padding: 17px 18px;
}
.receivable-customer-row summary strong {
  font-size: 13px;
}
.receivable-customer-row summary span {
  font-size: 11px;
}
.pagination {
  --bs-pagination-font-size: 12px;
  --bs-pagination-color: #5c6b83;
  --bs-pagination-active-bg: #315ed8;
  --bs-pagination-active-border-color: #315ed8;
  gap: 4px;
}
.page-link {
  border-radius: 5px !important;
  padding: 7px 11px;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #748198;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.icon-button:hover {
  background: #edf1f7;
}
.jump-dialog {
  border: 1px solid #dbe2ed;
  border-radius: 12px;
  padding: 0;
  width: min(540px, calc(100vw - 24px));
  max-height: 80dvh;
  box-shadow: 0 24px 100px #192c4e38;
  color: var(--ink);
}
.jump-dialog::backdrop {
  background: #1c2a4566;
}
.jump-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px 16px;
}
.jump-heading h2 {
  font-size: 17px;
  margin: 0 0 5px;
}
.jump-heading p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
#jump-search {
  display: block;
  width: calc(100% - 44px);
  margin: 0 22px 12px;
  border: 1px solid #ccd8ef;
  border-radius: 7px;
  padding: 12px;
  font-size: 14px;
}
#jump-results {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 4px 14px 14px;
  max-height: 48dvh;
  overflow: auto;
}
#jump-results a {
  margin: 2px;
  padding: 11px 10px;
}
.jump-footer {
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  display: flex;
  justify-content: space-between;
  color: #647187;
  font-size: 11px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 26px 36px;
  font-size: 16px;
}
.auth-brand > span:last-child {
  font-size: 12px;
  color: var(--muted);
  margin-left: 4px;
}
.auth-workspace {
  background: #f7f8fa;
}
.auth-workspace .app-shell {
  padding-top: 0;
}
.auth-panel {
  max-width: 430px;
  padding: 34px;
  box-shadow: 0 8px 30px #21385808;
  border-color: #e0e6ef;
  border-radius: 12px;
}
.auth-panel h1 {
  font-size: 25px;
}
.auth-panel .btn {
  min-height: 42px;
}
.auth-form-narrow {
  margin-left: 0;
}
.auth-wrap {
  min-height: calc(100dvh - 190px);
  padding: 12px 0 70px;
}
@media (min-width: 992px) {
  .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100dvh;
    z-index: 1030;
  }
  .workspace .workspace-topbar {
    margin-left: var(--sidebar-width);
  }
  .workspace .app-shell {
    margin-left: var(--sidebar-width);
  }
  .filter-drawer > summary {
    display: none;
  }
}
@media (min-width: 1200px) {
  .dashboard-grid > .span-5 {
    grid-column: span 5;
  }
  .dashboard-grid > .span-7 {
    grid-column: span 7;
  }
  .dashboard-grid > .span-6 {
    grid-column: span 6;
  }
  .dashboard-grid > .span-4 {
    grid-column: span 4;
  }
}
@media (min-width: 992px) and (max-width: 1250px) {
  .workflow-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 16px;
  }
  .app-shell {
    padding: 24px;
  }
  .workspace-topbar {
    padding: 0 24px;
  }
  .sale-line {
    padding: 15px;
  }
}
@media (max-width: 991px) {
  .workspace-sidebar {
    --bs-offcanvas-width: 270px;
  }
  .workspace-topbar {
    padding: 0 20px;
    gap: 12px;
  }
  .app-shell {
    padding: 24px 20px 48px;
  }
  .workflow-layout {
    grid-template-columns: 1fr;
  }
  .workspace-links {
    padding-top: 0;
  }
  .workspace-link {
    min-height: 42px;
  }
  .workspace-brand {
    min-height: 78px;
  }
  .filter-drawer[open] > .filter-bar {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  .jump-trigger {
    min-width: 150px;
  }
}
@media (max-width: 700px) {
  :root {
    --topbar-height: 58px;
  }
  .workspace-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .workspace-location > span {
    display: none;
  }
  .workspace-location strong {
    max-width: 155px;
    font-size: 12px;
  }
  .user-name {
    display: none;
  }
  .user-trigger > .ui-icon {
    display: none;
  }
  .jump-trigger {
    border: 0;
    background: none;
    min-width: 0;
    padding: 6px;
  }
  .jump-trigger span,
  .jump-trigger kbd {
    display: none;
  }
  .jump-trigger .ui-icon {
    width: 19px;
    height: 19px;
  }
  .app-shell {
    padding: 22px 16px 40px;
  }
  .page-head {
    margin-bottom: 20px;
    gap: 12px;
  }
  .app-shell h1 {
    font-size: 23px;
  }
  .page-head p {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 6px;
  }
  .page-kicker {
    font-size: 10px;
    margin-bottom: 5px;
  }
  .quick-actions {
    gap: 7px;
  }
  .btn {
    font-size: 12px;
    padding: 9px 12px;
    min-height: 36px;
  }
  .btn-sm {
    min-height: 32px;
  }
  .stat-strip {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 18px;
  }
  .stat-box {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }
  .stat-box:nth-child(2n) {
    border-right: 0;
  }
  .stat-box:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
  .stat-box span {
    font-size: 10px;
  }
  .stat-box strong {
    font-size: 20px;
    margin-top: 3px;
  }
  .filter-bar {
    padding: 14px;
  }
  .filter-drawer {
    margin-bottom: 14px;
  }
  .filter-drawer > summary {
    font-size: 12px;
  }
  .filter-drawer .form-label {
    font-size: 11px;
  }
  .form-control,
  .form-select {
    font-size: 16px;
  }
  .form-section {
    padding: 18px 16px;
  }
  .form-section-title h2 {
    font-size: 15px;
  }
  .form-section-title p {
    font-size: 11px;
  }
  .form-section-number {
    width: 22px;
    height: 22px;
  }
  .form-section-head {
    gap: 10px;
    margin-bottom: 20px;
  }
  .form-section .col-12:has(#order_date),
  .form-section .col-12:has(#out_type) {
    width: 50%;
  }
  .form-section .col-12:has(#handler) {
    width: 66.666%;
  }
  .form-section .col-12:has(#sales_channel_display) {
    width: 33.333%;
  }
  .sale-line {
    padding: 14px;
  }
  .sale-line-head .small {
    display: none;
  }
  .inventory-strip {
    font-size: 10px;
    gap: 6px;
  }
  .sale-line-index {
    font-size: 12px;
  }
  .sale-line .form-label {
    font-size: 11px;
  }
  .order-summary {
    margin-top: 0;
  }
  .summary-line {
    padding: 8px 0;
  }
  .form-actions {
    flex-wrap: wrap;
  }
  .mobile-records tbody tr {
    padding: 9px 8px;
    border-radius: 8px;
    box-shadow: none;
  }
  .mobile-records tbody td {
    padding: 8px;
    line-height: 1.6;
    font-size: 12px;
  }
  .mobile-records tbody td::before {
    font-size: 10px;
    font-weight: 450;
    color: #647187;
  }
  .mobile-records .mobile-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }
  .mobile-records .mobile-actions::before {
    margin: 0 auto 0 0;
  }
  .table code {
    font-size: 11px;
  }
  .receivable-customer-row summary {
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    padding: 14px;
  }
  .receivable-customer-row summary > div:first-child {
    grid-column: 1/-1;
  }
  .receivable-customer-row summary strong {
    font-size: 12px;
  }
  .auth-brand {
    padding: 22px 20px;
  }
  .auth-brand > span:last-child {
    display: none;
  }
  .auth-panel {
    padding: 28px 22px;
  }
  .auth-wrap {
    padding: 0 0 40px;
  }
  .auth-form-narrow {
    margin: auto;
  }
  .jump-dialog {
    max-height: 84dvh;
  }
  #jump-results {
    grid-template-columns: 1fr 1fr;
  }
  .jump-footer {
    font-size: 10px;
    padding: 12px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media print {
  .workspace-sidebar,
  .workspace-topbar,
  .quick-actions,
  .filter-drawer,
  .jump-dialog,
  .skip-link {
    display: none !important;
  }
  .workspace .app-shell {
    margin: 0;
    padding: 0;
    max-width: none;
  }
  body {
    background: white;
  }
  details {
    break-inside: avoid;
  }
}
/* Dashboard: the first screen is a working overview, with diagnostics on demand. */
.backup-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 20px;
}
.backup-notice > div {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.backup-notice span {
  font-size: 11px;
}
.backup-notice a {
  color: inherit;
  white-space: nowrap;
  font-size: 11px;
}
.today-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.today-metric {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.today-metric:last-child {
  border: 0;
}
.today-metric span {
  font-size: 12px;
  color: var(--muted);
}
.today-metric small {
  font-size: 10px;
  margin-left: 3px;
  color: #647187;
}
.today-metric strong {
  font-size: 31px;
  letter-spacing: -0.045em;
  font-weight: 650;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.today-metric em {
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
}
.month-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin: 14px 2px 26px;
  font-size: 11px;
  color: var(--muted);
}
.month-overview > span:first-child {
  margin-right: 6px;
  color: #647187;
}
.month-overview strong {
  font-weight: 550;
  color: #46566e;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.dashboard-grid {
  align-items: start;
  gap: 20px;
}
.dashboard-grid .panel {
  padding: 20px;
}
.dashboard-grid .panel-head {
  margin-bottom: 2px;
}
.section-tag {
  font-size: 10px;
  color: #77869d;
  background: #f1f4f9;
  border-radius: 4px;
  padding: 4px 8px;
}
.attention-summary {
  display: grid;
  grid-template-columns: 2fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 0 7px;
  padding: 13px 0;
  gap: 16px;
}
.attention-summary a {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.attention-summary strong {
  font-size: 20px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.attention-summary span {
  font-size: 11px;
  color: var(--muted);
}
.attention-summary a:last-child {
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.queue-list {
  gap: 0;
}
.queue-item {
  padding: 12px 0;
}
.queue-item strong {
  font-size: 12px;
}
.queue-item span {
  font-size: 11px;
}
.queue-item .queue-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.queue-item .badge {
  font-size: 9px;
  margin-right: 4px;
}
.queue-footer {
  font-size: 10px;
  color: var(--muted);
  padding-top: 13px;
}
.trend-panel .chart-legend {
  justify-content: flex-end;
  margin: 0 0 10px;
  font-size: 10px;
}
.trend-panel .trend-chart {
  height: 240px;
  padding-top: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  background: repeating-linear-gradient(
    to top,
    transparent,
    transparent 59px,
    #f2f4f8 60px
  );
}
.trend-panel .trend-bars {
  background: transparent;
  border: 0;
  height: 192px;
  gap: 4px;
  padding: 0 4px;
}
.trend-panel .trend-day small {
  font-size: 9px;
}
.trend-panel .bar {
  border-radius: 2px 2px 0 0;
  min-height: 0;
}
.chart-data > summary {
  cursor: pointer;
  color: #617393;
  font-size: 11px;
}
.chart-data .table td {
  padding: 8px 12px;
}
.chart-note {
  font-size: 11px;
  line-height: 1.8;
  color: #647187;
  margin: 16px 0 0;
}
.feed-item {
  padding: 13px 0;
}
.feed-item strong {
  font-size: 12px;
}
.feed-item span {
  font-size: 11px;
}
.bar-row strong {
  font-variant-numeric: tabular-nums;
}
.system-health-panel > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
}
.system-health-panel > summary > span {
  margin-left: 16px;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.system-health-content {
  padding-top: 20px;
}
.system-health-content code {
  overflow-wrap: anywhere;
}
.dashboard-grid a:not([href]) {
  cursor: default;
}
@media (min-width: 992px) {
  .trend-panel {
    min-height: 378px;
  }
}
@media (max-width: 700px) {
  .backup-notice {
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 10px;
  }
  .backup-notice > div {
    gap: 2px;
    flex-direction: column;
    align-items: flex-start;
  }
  .backup-notice span {
    font-size: 10px;
  }
  .today-metric {
    padding: 12px 10px;
    gap: 5px;
  }
  .today-metric span {
    font-size: 10px;
  }
  .today-metric small {
    display: none;
  }
  .today-metric strong {
    font-size: clamp(14px, 4.5vw, 20px);
    overflow-wrap: anywhere;
  }
  .today-metric em {
    display: none;
  }
  .month-overview {
    gap: 8px 15px;
    margin: 12px 0 18px;
    font-size: 10px;
  }
  .month-overview > span:first-child {
    width: 100%;
  }
  .month-overview strong {
    margin-left: 4px;
  }
  .dashboard-grid {
    gap: 16px;
  }
  .dashboard-grid .panel {
    padding: 16px;
  }
  .trend-panel .trend-chart {
    height: 195px;
  }
  .trend-panel .trend-bars {
    height: 150px;
    gap: 2px;
    padding: 0 1px;
  }
  .trend-panel .trend-day small {
    font-size: 8px;
  }
  .trend-panel .panel-head p {
    font-size: 10px;
  }
  .system-health-panel > summary > span {
    display: block;
    margin: 6px 0 0;
  }
}
.table-scope-note {
  font-size: 11px;
  color: var(--muted);
  margin: -8px 0 12px;
}
.record-note {
  max-width: 230px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: var(--muted);
}
.record-details summary {
  cursor: pointer;
  color: #526d9b;
  font-size: 11px;
  white-space: nowrap;
}
.record-details pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-width: 180px;
  max-width: 300px;
  font-size: 11px;
  background: #f5f7fa;
  padding: 12px;
  border-radius: 6px;
  margin-top: 10px;
}
.form-band {
  margin-bottom: 20px;
}
.form-band h2 {
  font-size: 15px;
  font-weight: 650;
  margin: 0 0 6px;
}
.form-band p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.7;
}
.focused-form {
  max-width: 1100px;
}
.form-actions {
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 0 0 9px 9px;
  display: flex;
  gap: 10px;
}
.form-section + .form-section {
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .form-actions {
    padding: 16px;
  }
  .record-note {
    max-width: none;
  }
}

.more-attention > summary {
  font-size: 11px;
  color: #617393;
  cursor: pointer;
  padding: 12px 0 4px;
}
@media (max-width: 700px) {
  .page-head {
    align-items: flex-start !important;
    text-align: left;
  }
  .page-head > .quick-actions {
    justify-content: flex-start;
  }
  .page-head > .btn {
    align-self: flex-start;
  }
  .page-head > div {
    width: 100%;
  }
}

@media (max-width: 991px) {
  .filter-drawer > summary {
    display: flex;
  }
}

/* Focused operational layout: one primary action, legible records, native disclosure. */
.text-secondary {
  color: var(--muted) !important;
}
.nav-management {
  margin-top: 18px;
}
.nav-management > summary {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}
.nav-management > summary:hover {
  background: #e9edf4;
}
.jump-create small {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
}
.page-head {
  margin-bottom: 20px;
}
.page-head .page-title {
  line-height: 1.25;
}
.search-toolbar {
  padding: 14px 16px;
  margin-bottom: 16px;
}
.search-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  gap: 10px;
}
.search-primary > * {
  min-width: 0;
}
.search-secondary {
  position: relative;
  margin-top: 9px;
}
.advanced-filters > summary {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 6px 110px 6px 0;
  cursor: pointer;
}
.advanced-filters .row {
  padding-top: 10px;
}
.clear-filters {
  position: absolute;
  top: 6px;
  right: 0;
  font-size: 12px;
}
.filter-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.filter-search-row > div {
  width: auto;
  padding: 0;
}
.has-primary-search .filter-drawer {
  margin: 10px 0 0;
}
.has-primary-search .filter-drawer > .row {
  padding: 12px 0 0;
}
.has-primary-search .filter-drawer > summary {
  border: 0;
  background: transparent;
  padding: 8px 0;
}
.stat-box {
  padding: 13px 18px;
}
.stat-box span,
.table-scope-note {
  font-size: 12px;
}
.stat-box strong {
  font-size: 22px;
}
.sales-table th:nth-child(2) {
  width: 17%;
}
.sales-table th:nth-child(3) {
  width: 21%;
}
.sales-table .text-end {
  white-space: nowrap;
}
.sales-table td:last-child {
  white-space: nowrap;
}
.empty-title,
.empty-description {
  display: block;
  margin-bottom: 8px;
}
.empty-title {
  color: var(--ink);
  font-size: 15px;
}
.today-metric {
  padding: 18px 22px;
}
.today-metric > span {
  font-size: 13px;
}
.today-metric em,
.month-overview {
  font-size: 12px;
}
.month-overview {
  flex-wrap: wrap;
  row-gap: 6px;
}
.queue-item > span,
.queue-footer,
.panel-head p {
  font-size: 12px;
}
.queue-item-header strong {
  font-size: 14px;
}
.warehouse-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.warehouse-shortcuts a {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
}
.warehouse-shortcuts strong {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.warehouse-shortcuts small {
  color: var(--blue);
}
.warehouse-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.warehouse-finance {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 13px;
}
.warehouse-finance p {
  margin: 14px 0 8px;
}
.trend-disclosure > summary {
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
}
.trend-disclosure[open] > summary {
  margin-bottom: 20px;
}
.entry-dock-total {
  display: none;
}
.form-control,
.form-select {
  min-width: 0;
  max-width: 100%;
}
[data-entry-form] :is(input, select, textarea) {
  scroll-margin-top: 90px;
  scroll-margin-bottom: 120px;
}
.entry-dock .btn:disabled {
  opacity: 0.65;
}
@media (max-width: 700px) {
  .workspace-topbar {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  .app-shell {
    padding: 18px max(14px, env(safe-area-inset-right)) 40px
      max(14px, env(safe-area-inset-left));
  }
  .has-entry-dock .app-shell {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }
  .icon-button,
  .jump-trigger,
  .user-trigger {
    min-width: 44px;
    min-height: 44px;
  }
  .btn,
  .btn-sm,
  .form-control,
  .form-select,
  .page-link {
    min-height: 44px;
  }
  .btn,
  .btn-sm {
    font-size: 13px;
  }
  .page-head {
    gap: 10px;
    margin-bottom: 16px;
  }
  .page-head p {
    font-size: 13px;
    line-height: 1.5;
  }
  .page-kicker {
    font-size: 11px;
  }
  .form-section {
    padding: 16px 14px;
  }
  .form-section-head {
    margin-bottom: 14px;
    gap: 8px;
  }
  .form-section-title p,
  .form-band p {
    font-size: 12px;
  }
  .sale-line:only-child {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .sale-line:only-child .sale-line-head {
    display: none;
  }
  .sale-line .form-label {
    font-size: 12px;
  }
  .form-section
    .col-12:has(
      [name="movement_date"],
      [name="movement_type"],
      [name="payment_date"],
      [name="amount"],
      [name="from_warehouse"],
      [name="to_warehouse"]
    ) {
    width: 50%;
  }
  .form-section .col-12:has([name="customer_id"]) {
    width: 100%;
  }
  .inventory-strip {
    font-size: 12px;
  }
  .entry-dock,
  [data-entry-form] > .form-actions {
    position: fixed;
    z-index: 1020;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    margin: 0;
    padding: 12px max(14px, env(safe-area-inset-right))
      calc(12px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    background: white;
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -3px 12px #22304608;
  }
  .entry-dock > .btn,
  [data-entry-form] > .form-actions > .btn {
    width: auto !important;
    margin: 0 !important;
  }
  .entry-dock > .btn-primary,
  [data-entry-form] > .form-actions > .btn-primary {
    flex: 1;
    order: 2;
  }
  .entry-dock > a,
  [data-entry-form] > .form-actions > a {
    order: 1;
  }
  .entry-dock > a {
    display: none;
  }
  .entry-dock-total {
    display: flex;
    flex-direction: column;
    min-width: 100px;
    gap: 2px;
  }
  .entry-dock-total span {
    font-size: 11px;
    color: var(--muted);
  }
  .entry-dock-total strong {
    font-size: 20px;
    font-variant-numeric: tabular-nums;
  }
  .search-toolbar {
    padding: 12px;
  }
  .search-primary {
    grid-template-columns: minmax(0, 1fr) 104px auto;
    gap: 7px;
  }
  .search-primary .form-select {
    padding-left: 8px;
    padding-right: 25px;
    font-size: 13px;
  }
  .search-primary .btn {
    padding-left: 11px;
    padding-right: 11px;
  }
  .clear-filters,
  .advanced-filters > summary {
    min-height: 36px;
    line-height: 24px;
  }
  .stat-box {
    padding: 10px 12px;
  }
  .stat-box span {
    font-size: 11px;
  }
  .stat-box strong {
    font-size: 20px;
  }
  .table-scope-note {
    font-size: 11px;
    line-height: 1.5;
  }
  .mobile-records tbody td {
    font-size: 13px;
  }
  .mobile-records tbody td::before {
    font-size: 11px;
  }
  .sales-table tbody tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 10px 8px;
  }
  .sales-table tbody td:nth-child(1) {
    grid-column: 1/3;
  }
  .sales-table tbody td:nth-child(2) {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .sales-table tbody td:nth-child(2) > .small {
    display: inline;
    margin-left: 8px;
  }
  .sales-table tbody td:nth-child(2) > .fw-semibold {
    display: inline;
    font-size: 15px;
  }
  .sales-table tbody td:nth-child(2)::before {
    display: none;
  }
  .sales-table tbody td:nth-child(3) {
    grid-column: 1/-1;
    grid-row: 3;
  }
  .sales-table tbody td:nth-child(4) {
    grid-column: 1/-1;
    grid-row: 4;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  .sales-table tbody td:nth-child(4)::before {
    margin-bottom: 0;
  }
  .sales-table tbody td:nth-child(8) {
    grid-column: 3;
    grid-row: 1;
    text-align: right;
  }
  .sales-table tbody td:nth-child(8)::before {
    display: none;
  }
  .sales-table tbody td:nth-child(5),
  .sales-table tbody td:nth-child(6),
  .sales-table tbody td:nth-child(7) {
    grid-row: 5;
    text-align: left !important;
  }
  .sales-table .payment-breakdown {
    display: none;
  }
  .sales-table .mobile-actions {
    grid-column: 1/-1;
    grid-row: 6;
    padding-top: 10px;
  }
  .sales-table tbody td {
    padding: 6px;
  }
  .today-metric {
    padding: 14px 11px;
  }
  .today-metric > span {
    font-size: 11px;
  }
  .today-metric > strong {
    font-size: clamp(18px, 5vw, 24px);
  }
  .month-overview {
    font-size: 11px;
    gap: 8px 12px;
  }
  .queue-item > span {
    font-size: 12px;
    line-height: 1.5;
  }
  .priority-panel {
    padding: 16px;
  }
  .queue-item {
    padding: 11px 0;
  }
  .trend-day small {
    font-size: 9px;
  }
}
@media print {
  .entry-dock,
  [data-entry-form] > .form-actions {
    display: none !important;
  }
}

.section-tag {
  color: #53647d;
}
.text-bg-secondary {
  color: #53647d !important;
}
.text-warning {
  color: #916016 !important;
}
.product-preview > summary {
  cursor: pointer;
  color: var(--ink);
}
.product-preview > summary span {
  display: block;
  font-size: 11px;
  color: var(--blue);
  margin-top: 4px;
}
.product-preview > div {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 8px;
}
.queue-context {
  font-size: 12px;
  white-space: nowrap;
}
@media (max-width: 700px) {
  [data-page="sales_orders"] .page-head {
    flex-direction: row;
    align-items: center;
  }
  [data-page="sales_orders"] .page-head > div:first-child {
    width: auto;
    flex: 1;
  }
  [data-page="sales_orders"] .page-head > .quick-actions {
    width: auto;
  }
  [data-page="sales_orders"] .page-head .page-subtitle {
    display: none;
  }
  [data-page="sales_orders"] .quick-actions .btn {
    padding-left: 10px;
    padding-right: 10px;
  }
  #sales-form .form-section-title p {
    display: none;
  }
  #sales-form .form-section-head {
    margin-bottom: 12px;
  }
  [data-entry-form] .form-section .col-12:has([name="payment_method"]),
  [data-entry-form] .form-section .col-12:has([name="handler"]:not(select)) {
    width: 50%;
  }
}
