/* Presentation shared by the warehouse workspace, sign-in and both scanner shells. */
@media screen {
  :root {
    --glass-font: "Segoe UI", system-ui, sans-serif;
    --glass-ink: #17263e;
    --glass-muted: #4e617b;
    --glass-blue: #2548bd;
    --glass-teal: #086d78;
    --glass-line: #cbd7ea;
    --glass-paper: rgba(255, 255, 255, .84);
    --glass-tint: #edf3fc;
    --glass-shadow: 0 16px 36px -26px #203f7166, inset 0 1px #fff;
    --glass-canvas: radial-gradient(ellipse at 12% 0%, #c9e1ff 0%, transparent 47%),
      radial-gradient(ellipse at 92% 10%, #e0dafa 0%, transparent 48%),
      linear-gradient(150deg, #eef5fe, #edf1f9 56%, #dceff1);
    --glass-action: linear-gradient(125deg, #304ac2, #1c459d);
    --glass-action-hover: linear-gradient(125deg, #263da9, #193984);
  }

  body.app-page.original-ui {
    --ops-ink: var(--glass-ink);
    --ops-muted: var(--glass-muted);
    --ops-blue: var(--glass-blue);
    --ops-teal: var(--glass-teal);
    --ops-line: var(--glass-line);
    --sidebar-width: 242px;
    --workspace-inset: clamp(14px, 2.1vw, 32px);
    background: var(--glass-canvas) fixed;
    color: var(--glass-ink);
    font-family: var(--glass-font);
  }

  body.app-page.original-ui .sidebar {
    width: var(--sidebar-width);
    padding: 16px 12px;
    background: radial-gradient(ellipse at 0 0, #2c456d, transparent 65%),
      linear-gradient(164deg, #182744 0%, #121d36 70%, #122d44);
    box-shadow: inset -1px 0 #d7e5ff24, 10px 0 26px -21px #081332;
  }

  body.app-page.original-ui .sidebar .hys-logo-box {
    max-width: none;
    padding: 12px 11px;
    margin-bottom: 12px;
    background: #d6e6ff0e;
    border: 1px solid #d7e5ff29;
    border-radius: 15px;
  }

  body.app-page.original-ui .sidebar .nav {
    gap: 2px;
  }

  body.app-page.original-ui .sidebar .nav-section-title {
    color: #b4c5e2;
    margin: 15px 10px 6px;
    border: 0;
    padding-block: 0;
    font-size: 10px;
    letter-spacing: .09em;
  }

  body.app-page.original-ui .sidebar .nav-link {
    min-height: 38px;
    margin: 0;
    color: #dae6f9;
    font-size: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
  }

  body.app-page.original-ui .sidebar .nav-link:hover {
    background: #c6dbff18;
  }

  body.app-page.original-ui .sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(110deg, #375d9a, #293c68);
    border-color: #8bb4ff66;
    box-shadow: inset 3px 0 #92d9ff;
  }

  body.app-page.original-ui .sidebar .nav-link:focus-visible {
    outline-color: #a6deff;
    outline-offset: -2px;
  }

  body.app-page.original-ui .top-header {
    margin: var(--workspace-inset) var(--workspace-inset) 0;
    min-height: 74px;
    padding: 13px 17px;
    gap: 12px;
    align-items: center;
    background: rgba(252, 253, 255, .72);
    backdrop-filter: blur(20px) saturate(135%);
    border: 1px solid #fff;
    border-radius: 18px;
    box-shadow: var(--glass-shadow);
    z-index: 30;
  }

  body.app-page.original-ui .top-header #menu-toggle,
  body.app-page.original-ui .wms-account-menu > .wms-account-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid #cbd8f0;
    border-radius: 12px;
    background: #f2f6ff;
    color: var(--glass-blue);
  }

  body.app-page.original-ui .page-emblem {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    border: 1px solid #d1d9fa;
    border-radius: 13px;
    background: linear-gradient(155deg, #e9edff, #dbe7fc);
    color: var(--glass-blue);
  }

  body.app-page.original-ui .page-title {
    margin: 0;
    color: var(--glass-ink);
    font-size: clamp(18px, 1.85vw, 27px);
    line-height: 1.16;
    letter-spacing: -.035em;
    font-weight: 750;
    overflow-wrap: anywhere;
  }

  body.app-page.original-ui .page-subtitle {
    color: var(--glass-muted);
    font-size: 11px;
    margin-top: 5px;
  }

  body.app-page.original-ui .wms-account-panel {
    border-color: var(--glass-line);
    border-radius: 15px;
    box-shadow: 0 14px 40px #263f742e;
  }

  body.app-page.original-ui .content {
    width: 100%;
    max-width: 1760px;
    min-width: 0;
    margin-inline: auto;
    padding: var(--workspace-inset);
  }

  body.app-page.original-ui .page-footer {
    padding: 14px 0 4px;
    border-top: 1px solid var(--glass-line);
    color: var(--glass-muted);
    line-height: 1.6;
  }

  body.app-page.original-ui :is(.card, .panel, .editor, .workspace-administration, .workspace-choice, .picker-empty) {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 17px;
    background: var(--glass-paper);
    box-shadow: var(--glass-shadow), 0 0 0 1px #657eaa20;
  }

  body.app-page.original-ui :is(.card-head, .panel-head) {
    gap: 12px;
    flex-wrap: wrap;
    border-bottom-color: #dbe4f2;
  }

  body.app-page.original-ui :is(.card-head, .panel-head) h2 {
    color: var(--glass-ink);
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: -.015em;
  }

  body.app-page.original-ui :is(.card-head, .panel-head) > *,
  body.app-page.original-ui :is(.field, .form-grid, .filters, .tools, .account-primary, .account-secondary) {
    min-width: 0;
  }

  body.app-page.original-ui .account-settings .account-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
  }

  body.app-page.original-ui .account-settings .card {
    margin-bottom: 0;
  }

  body.app-page.original-ui .account-settings :is(.account-workspace, .account-access-notice) {
    margin-bottom: 16px;
  }

  body.app-page.original-ui .account-workspace,
  body.app-page.original-ui .account-workspace-identity,
  body.app-page.original-ui .account-shortcuts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  body.app-page.original-ui .account-workspace {
    justify-content: space-between;
    padding: 14px 18px;
  }

  body.app-page.original-ui .account-workspace-identity {
    min-width: 0;
  }

  body.app-page.original-ui .account-workspace-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    color: var(--glass-blue);
    background: #e9f0fc;
  }

  body.app-page.original-ui .account-workspace h2,
  body.app-page.original-ui .account-access-notice h2 {
    margin: 0;
    color: var(--glass-ink);
    font-size: 16px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body.app-page.original-ui .account-workspace-identity p {
    margin: 0 0 2px;
    color: var(--glass-muted);
    font-size: 11px;
  }

  body.app-page.original-ui .account-access-notice p {
    margin: 5px 0 0;
  }

  body.app-page.original-ui .account-access-notice .account-shortcuts {
    margin-top: 8px;
  }

  body.app-page.original-ui .account-shortcuts .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 6px 11px;
    border: 1px solid var(--glass-line);
    border-radius: 8px;
    background: #f3f7ff;
    text-decoration: none;
  }

  body.app-page.original-ui .account-shortcuts .text-link:hover {
    background: #e9f0fc;
  }

  body.app-page.original-ui .account-settings .card > .action-form {
    margin-top: 16px;
  }

  body.app-page.original-ui .account-settings .action-form > .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(174px, 100%), 1fr));
    gap: 12px 14px;
  }

  body.app-page.original-ui .account-settings .account-security .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.app-page.original-ui .account-settings .field {
    margin: 0;
  }

  body.app-page.original-ui .account-settings .field input[readonly] {
    background: #edf2fa;
    color: var(--glass-muted);
  }

  body.app-page.original-ui .account-settings .form-actions {
    margin-top: 16px;
  }

  body.app-page.original-ui .account-settings .help {
    margin: 10px 0 0;
    color: var(--glass-muted);
    line-height: 1.55;
  }

  body.app-page.original-ui .account-settings .form-result:empty {
    margin: 0;
  }

  body.app-page.original-ui .editor > summary {
    background: transparent;
    color: var(--glass-ink);
    border-radius: inherit;
  }

  body.app-page.original-ui .editor[open] > summary {
    border-bottom: 1px solid #dbe4f2;
  }

  body.app-page.original-ui :is(.filters, .workspace-admin-body) {
    background: rgba(234, 241, 252, .58);
  }

  body.app-page.original-ui .filters .field {
    min-width: min(170px, 100%);
  }

  body.app-page.original-ui .form-grid:not([data-checklist-form] > .form-grid) {
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
  }

  body.app-page.original-ui .field > :is(input, select, textarea) {
    max-width: 100%;
  }

  body.app-page.original-ui :is(button.primary, a.button.primary, .filters > button:not(.subtle):not(.danger)) {
    background: var(--glass-action);
    border-color: #2948ab;
    color: #fff;
  }

  body.app-page.original-ui :is(button.primary, a.button.primary, .filters > button:not(.subtle):not(.danger)):hover:not(:disabled) {
    background: var(--glass-action-hover);
    border-color: #223c97;
  }

  body.app-page.original-ui :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--glass-teal);
    outline-offset: 3px;
  }

  body.app-page.original-ui .sidebar-overlay[hidden] {
    display: none !important;
  }

  /* Keep ledgers horizontally scrollable without widening the workspace. */
  body.app-page.original-ui .table-wrap {
    min-width: 0;
    max-width: 100%;
    border-color: #d7e1f0;
    border-radius: 11px;
    scrollbar-color: #9bafd0 #eef3fa;
  }

  body.app-page.original-ui :is(.table-wrap, .incoming-scan-wrap, .po-table-wrap) {
    overscroll-behavior-inline: contain;
  }

  /* Keep row actions intact while descriptive cells can still wrap. */
  body.app-page.original-ui :where(table:not(.editable-rows, .goshi-grid, .print-grid, .print-sheet table)) td
    :is(button, .button):not(.incoming-part-button) {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    flex-shrink: 0;
  }

  body.app-page.original-ui :where(td) :is(.button, button) > :is(.wms-icon, svg) {
    flex-shrink: 0;
  }

  body.app-page.original-ui td .badge {
    overflow-wrap: normal;
    word-break: normal;
  }

  body.app-page.original-ui table:not(.preparation-workspace table, .editable-rows, .print-grid, .print-sheet table) th {
    background: #e9f0fc;
    color: #2e4262;
  }

  body.app-page.original-ui table:not(.preparation-workspace table, .editable-rows, .print-grid, .print-sheet table) tbody tr:hover {
    background: #edf4ff;
  }

  body.app-page.original-ui .reference-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(155px, 100%), 1fr));
    gap: 13px;
  }

  body.app-page.original-ui .reference-stats > div {
    border: 1px solid #fff;
    border-radius: 14px;
    padding: 16px;
    background: var(--glass-paper);
    box-shadow: var(--glass-shadow), 0 0 0 1px #657eaa22;
  }

  body.app-page.original-ui .reference-stats > div > span {
    color: var(--glass-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
  }

  body.app-page.original-ui .reference-stats > div > strong {
    color: var(--glass-ink);
    font-size: clamp(19px, 2vw, 29px);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
  }

  body[data-page="fg_dashboard.php"] .dashboard-metrics > .reference-stats > div {
    border-top: 3px solid #506aaa;
  }

  body[data-page="fg_dashboard.php"] .dashboard-metrics > .reference-stats > div:nth-child(2) {
    border-top-color: #16816b;
  }

  body[data-page="fg_dashboard.php"] .dashboard-metrics > .reference-stats > div:nth-child(3) {
    border-top-color: #bd5c31;
  }

  body[data-page="fg_dashboard.php"] .dashboard-metrics > .reference-stats > div:nth-child(4) {
    border-top-color: #7755a9;
  }

  body[data-page="fg_dashboard.php"] .dashboard-metrics > .reference-stats > div:nth-child(5) {
    border-top-color: #2461b9;
    background: linear-gradient(150deg, #fbfdff, #e5edff);
  }

  body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
    margin-bottom: 20px;
  }

  body.app-page.original-ui .dashboard-charts > .panel {
    margin-bottom: 0;
  }

  .dashboard-charts .chart .monthly-bars {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  body.app-page.original-ui .dashboard-charts .legend,
  body.app-page.original-ui .dashboard-charts .pie-item {
    font-size: 12px;
  }

  .dashboard-charts :is(.chart-in, .legend-in) { fill: #0b7d71; background-color: #0b7d71; }
  .dashboard-charts .chart-in-side { fill: #07584f; }
  .dashboard-charts .chart-in-top { fill: #18a899; }
  .dashboard-charts :is(.chart-out, .legend-out) { fill: #4a58d1; background-color: #4a58d1; }
  .dashboard-charts .chart-out-side { fill: #323d9e; }
  .dashboard-charts .chart-out-top { fill: #707df0; }
  .dashboard-charts .customer-pie-3d { width: 165px; height: auto; flex-shrink: 0; }
  .dashboard-charts .pie-item .pie-dot-0 { background: #15803d; }
  .dashboard-charts .pie-item .pie-dot-1 { background: #1d63dc; }
  .dashboard-charts .pie-item .pie-dot-2 { background: #ea580c; }
  .dashboard-charts .pie-item .pie-dot-3 { background: #7c3aed; }

  .dashboard-charts .pie-legend {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .dashboard-charts .stock-movement-list {
    gap: 14px;
  }

  /* Dedicated screen controls surround the worksheet and saved sheets. */
  body.app-page.original-ui .preparation-workspace :is(.cw-workspace-head, .cw-workflow-step, .cw-saved-section) {
    border-radius: 14px;
    border-color: var(--glass-line);
    background: var(--glass-paper);
  }

  body.app-page.original-ui .preparation-workspace .cw-preview-scroll {
    max-width: 100%;
    border-color: #bccbe1;
    background: #e8effa;
  }

  body.app-page.original-ui .preparation-workspace .cw-nav-tab {
    border-radius: 12px;
  }

  body.app-page.original-ui :is(#pending-live .ps-tabs, .locator-tabs, .odr-tabs) {
    max-width: 100%;
    background: var(--glass-paper);
    border-radius: 13px;
    scrollbar-color: #9bafd0 #eef3fa;
  }

  body.app-page.original-ui :is(#pending-live .pi-panel, #pending-live .po-entry, #pending-live .po-queue) {
    border-radius: 15px;
  }

  body.app-page.original-ui :is(#pending-live .pi-filter, #pending-live .po-list-filter, #pending-live .ps-dr-filters) {
    background: var(--glass-tint);
  }

  body.app-page.original-ui :is(.incoming-details-dialog, .outgoing-detail-dialog, .wms-help-dialog, .wms-dialog) {
    border-radius: 18px;
    border-color: var(--glass-line);
    max-width: calc(100vw - 24px);
  }

  body.app-page.original-ui dialog::backdrop,
  .scanner-standalone dialog::backdrop {
    background: #0c183c91;
    backdrop-filter: blur(5px);
  }


}

@media screen and (min-width: 851px) {
  body.app-page.original-ui main#main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  body.app-page.original-ui.nav-collapsed .sidebar {
    width: 72px;
  }

  body.app-page.original-ui.nav-collapsed .sidebar .nav-link {
    width: 100%;
    padding-inline: 0;
    font-size: 0;
  }

  body.app-page.original-ui.nav-collapsed .sidebar .nav-section-title {
    font-size: 0;
    margin-block: 9px;
  }
}

@media screen and (max-width: 1090px) {
  body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-charts {
    grid-template-columns: minmax(0, 1fr);
  }

  body.app-page.original-ui .dashboard-charts .chart {
    min-height: 0;
  }
}

@media screen and (max-width: 850px) {
  body.app-page.original-ui .sidebar {
    width: min(280px, 85vw);
  }

  body.app-page.original-ui .top-header .header-report {
    order: 4;
    justify-content: flex-start;
    padding-top: 9px;
    border-top: 1px solid var(--glass-line);
  }

  body.app-page.original-ui .top-header .page-emblem {
    display: none;
  }

  body.app-page.original-ui .top-header .wms-help-trigger {
    order: 3;
  }

  body.app-page.original-ui .account-settings .account-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media screen and (max-width: 560px) {
  body.app-page.original-ui {
    --workspace-inset: 11px;
  }

  body.app-page.original-ui .top-header {
    padding: 10px;
    gap: 8px;
  }

  body.app-page.original-ui .top-header .wms-help-trigger {
    order: 5;
  }

  body.app-page.original-ui .page-subtitle {
    overflow-wrap: anywhere;
  }

  body.app-page.original-ui .reference-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  body.app-page.original-ui .reference-stats > div {
    padding: 12px;
  }

  body.app-page.original-ui :is(.card-head, .panel-head, .filters) {
    padding-inline: 14px;
  }

  body.app-page.original-ui .filters .field {
    flex: 1 1 100%;
  }

  body.app-page.original-ui .pagination {
    flex-wrap: wrap;
  }

  body.app-page.original-ui .pie-area {
    flex-direction: column;
  }
}

@media screen {
  /* Authentication */
  body.login-page.original-ui:has(.modern-auth),
  body.login-page.original-ui:has(main.login-card) {
    min-height: 100svh;
    height: auto;
    background: var(--glass-canvas) fixed;
    color: var(--glass-ink);
    font-family: var(--glass-font);
    padding: clamp(12px, 4vw, 48px);
  }

  body.login-page.original-ui:has(main.login-card) {
    display: grid;
    place-items: center;
  }

  body.login-page.original-ui main.login-card,
  body.app-page.original-ui main.login-card {
    display: block;
    width: min(100%, 520px);
    min-height: 0;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(18px, 4vw, 32px);
    border: 1px solid white;
    border-radius: 19px;
    background: var(--glass-paper);
    color: var(--glass-ink);
    box-shadow: var(--glass-shadow);
  }

  .login-page.original-ui .modern-auth {
    max-width: 1020px;
    min-height: 610px;
    background: rgba(251, 253, 255, .7);
    border-color: #fff;
    backdrop-filter: blur(22px);
    box-shadow: 0 32px 78px -33px #2f4c8b7a, inset 0 1px #fff;
  }

  .login-page.original-ui .auth-brand {
    justify-content: space-between;
    background: radial-gradient(ellipse at 106% 94%, #4d66ad, transparent 60%),
      radial-gradient(ellipse at -12% 8%, #25566e, transparent 62%),
      linear-gradient(155deg, #182847, #1a244b 78%);
  }

  .login-page.original-ui .auth-brand h2 {
    font-size: clamp(29px, 4vw, 53px);
    line-height: 1.06;
    letter-spacing: -.045em;
    max-width: 9em;
    margin-block: 0 16px;
  }

  .login-page.original-ui .auth-capabilities > span {
    font-size: 13px;
    color: #e2edff;
  }

  .login-page.original-ui .auth-panel {
    justify-content: space-between;
    background: transparent;
  }

  .login-page.original-ui .auth-heading h1 {
    font-size: clamp(27px, 3.5vw, 39px);
  }

  .login-page.original-ui :is(.auth-heading p, .auth-next p, .auth-recovery > summary, .auth-footer) {
    color: var(--glass-muted);
    font-size: 12px;
  }

  .login-page.original-ui .auth-form label {
    font-size: 13px;
  }

  .login-page.original-ui .auth-input {
    background: rgba(255, 255, 255, .79);
    border-color: #bbcbe5;
    border-radius: 11px;
  }

  .login-page.original-ui .auth-input input {
    font-size: 16px !important;
  }

  .login-page.original-ui .auth-input input::placeholder {
    color: #62748e;
  }

  .login-page.original-ui .auth-submit {
    background: var(--glass-action);
    border-radius: 11px;
    font-size: 14px;
  }

  .login-page.original-ui .auth-submit:hover {
    background: var(--glass-action-hover);
  }

  /* Capture screens retain the existing scanner theme switch. */
  body.scanner-standalone {
    --bg: #101c31;
    --shell: rgba(22, 36, 61, .9);
    --card: #eef4ff0b;
    --field: #162844;
    --border: #94b1db4d;
    --text: #f0f5ff;
    --muted: #bccae3;
    --accent: #a1c8ff;
    --green: #63eac7;
    --scan-action: linear-gradient(130deg, #334da5, #26558d);
    background: radial-gradient(ellipse at 14% 0, #2e4778, transparent 58%),
      radial-gradient(ellipse at 94% 84%, #184651, transparent 57%), var(--bg);
    background-attachment: fixed;
    font-family: var(--glass-font);
  }

  body.scanner-standalone.sc-light {
    --shell: rgba(249, 252, 255, .76);
    --card: #ffffffb8;
    --field: #edf4ff;
    --border: #bacce7;
    --text: var(--glass-ink);
    --muted: var(--glass-muted);
    --accent: var(--glass-blue);
    --green: #006954;
    --scan-action: var(--glass-action);
    background: var(--glass-canvas) fixed;
  }

  .scanner-standalone .sc-app {
    max-width: 560px;
    padding: clamp(12px, 3.4vw, 22px);
    border-color: var(--border);
    border-radius: 24px;
    box-shadow: 0 27px 76px -30px #02081890, inset 0 1px #ffffff1a;
    backdrop-filter: blur(18px);
  }

  .scanner-standalone.sc-history-module .sc-app {
    max-width: 650px;
  }

  .scanner-standalone .sc-header {
    background: var(--card);
    border: 1px solid var(--border);
    flex-wrap: wrap;
    padding: 12px;
  }

  .scanner-standalone .sc-header h1 {
    color: var(--text);
    font-size: clamp(15px, 3vw, 20px);
  }

  .scanner-standalone .sc-header p {
    line-height: 1.35;
  }

  .scanner-standalone .sc-brand-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    background: var(--scan-action);
  }

  .scanner-standalone .sc-directions button {
    min-height: 42px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
  }

  .scanner-standalone .sc-directions button[data-direction="incoming"].active {
    background: #00604e;
    border-color: #299783;
    color: #fff;
  }

  .scanner-standalone .sc-directions button[data-direction="outgoing"].active {
    background: #a04226;
    border-color: #ca7152;
    color: #fff;
  }

  .scanner-standalone :is(.sc-queue, .sc-scan-box, .sc-paste, .ps-history-item) {
    border-radius: 14px;
  }

  .scanner-standalone :is(.sc-queue-head, .sc-scan-heading, .sc-paste, .ic-counters > div) {
    padding: 11px;
  }

  .scanner-standalone :is(.sc-queue-head, .sc-scan-heading > span, .field > span, .sc-empty) {
    font-size: 12px;
  }

  .scanner-standalone .sc-scan-box .sc-scan-heading {
    padding: 0 0 4px;
  }

  .scanner-standalone .sc-scan-box input {
    min-height: 50px;
    font-size: 16px;
  }

  .scanner-standalone .sc-scan-box .sc-guide-trigger {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .scanner-standalone .form-actions button.primary {
    min-height: 46px;
    background: var(--scan-action);
    color: #fff;
    border-color: transparent;
    border-radius: 11px;
    font-size: 13px;
  }

  .scanner-standalone .ic-counters span {
    font-size: 11px;
  }

  .scanner-standalone .ic-counters strong {
    font-size: clamp(13px, 3.5vw, 19px);
  }

  .scanner-standalone :is(.sc-guide-dialog, #ic-location-results) {
    background: var(--bg);
  }

  .scanner-standalone.sc-light :is(.sc-guide-dialog, #ic-location-results) {
    background: #f7faff;
  }

  .scanner-standalone.sc-light .ic-feedback.error {
    color: #9f243c;
  }
}

@media screen and (max-width: 650px) {
  .login-page.original-ui .modern-auth {
    min-height: 0;
  }

  .login-page.original-ui .auth-brand {
    gap: 17px;
  }

  .login-page.original-ui .auth-brand h2 {
    max-width: 14em;
    margin-bottom: 0;
  }

  .login-page.original-ui .auth-form-wrap {
    padding-top: 6px;
  }
}

@media screen and (max-width: 400px) {
  .scanner-standalone .sc-header {
    gap: 7px;
  }

  .scanner-standalone .sc-header .sc-history-toggle {
    padding-inline: 6px;
  }
}

@media screen and (forced-colors: active) {
  :root {
    --glass-line: CanvasText;
  }

  body.app-page.original-ui .sidebar .nav-link.active,
  .scanner-standalone .sc-directions button.active {
    border-color: Highlight;
    color: Highlight;
  }

  body.app-page.original-ui .table-wrap {
    scrollbar-color: auto;
  }
}

@media screen {
  /* GOSHI document styling follows the WMS Workflows checklist palette. */
  #checklist-workspace[data-workspace-kind="goshi"] {
    --goshi-navy: #153960;
    --goshi-line: #cbd9e8;
  }

  body.app-page.original-ui #checklist-workspace[data-workspace-kind="goshi"] .cw-workspace-head {
    background: linear-gradient(115deg, #153960, #235a7d);
    border-radius: 16px 16px 0 0;
    padding: clamp(15px, 2vw, 23px);
  }

  #checklist-workspace .goshi-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    background: var(--glass-paper);
    padding: 12px 15px;
    border: 1px solid #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: var(--glass-shadow);
  }

  #checklist-workspace .goshi-action-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
  }

  #checklist-workspace .goshi-action-group :is(button, .button) {
    min-height: 37px;
    height: auto;
    border-radius: 8px;
    padding: 8px 11px;
    line-height: 1.25;
  }

  #checklist-workspace .goshi-action-group .goshi-print-action {
    background: #087354;
    border-color: #087354;
    color: #fff;
  }

  #checklist-workspace .goshi-action-group .cw-clear-all {
    background: #fff1f1;
    border-color: #e4bbc2;
    color: #8d2e3b;
  }

  #checklist-workspace .goshi-action-group :is(button, .button):hover:not(:disabled) {
    box-shadow: inset 0 0 0 1px currentColor;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--goshi-line);
    border-radius: 14px;
    background: #fff;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet > .sheet-tab {
    margin: 0;
    border: 0;
    border-radius: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    background: #f8faff;
  }

  #checklist-workspace .goshi-sheet .goshi-selection-total {
    margin-inline-start: auto;
    padding: 5px 9px;
    color: #23466a;
    background: #e1edfc;
    border: 1px solid #c7daf4;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet > .sheet-tab > button {
    min-height: 34px;
    height: auto;
  }

  #checklist-workspace .goshi-document-heading {
    padding: 12px 15px;
    background: var(--goshi-navy);
    color: #f5f9ff;
  }

  #checklist-workspace .goshi-document-heading > p {
    color: #d5e7f8;
    margin: 0 0 4px;
    font-size: 11px;
  }

  #checklist-workspace .goshi-sheet .goshi-title {
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
    font-size: 15px;
    letter-spacing: .035em;
  }

  #checklist-workspace .goshi-sheet .goshi-meta {
    gap: 10px;
    padding: 12px 15px;
    grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
    background: #f3f7fd;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-meta-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    grid-column: auto;
    min-width: 0;
    border: none;
  }

  #checklist-workspace .goshi-sheet .goshi-meta-field > span {
    padding: 0 0 4px;
    color: #36516d;
  }

  body.app-page.original-ui #checklist-workspace .goshi-meta-field > input {
    min-height: 35px;
    height: 35px;
    border: 1px solid var(--goshi-line);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    padding: 5px 8px;
  }

  body.app-page.original-ui #checklist-workspace .goshi-meta-field > input[readonly] {
    background: #e7eef8;
    color: #25415f;
    font-weight: 700;
  }

  #checklist-workspace .goshi-sheet .goshi-section-title {
    margin: 0;
    background: #dcecff;
    color: #163e6f;
    font-size: 15px;
    letter-spacing: .07em;
  }

  #checklist-workspace .goshi-sheet .spreadsheet-editor {
    margin: 0;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .table-wrap {
    border: 0;
    border-radius: 0;
  }

  #checklist-workspace :is(.goshi-grid, .goshi-form-preview) :is(td, th) {
    --column-head: #2e4e70;
    --column-bg: #fff;
    --column-alt: #f3f7fc;
  }

  #checklist-workspace :is(.goshi-grid [data-column="quantity"], .goshi-form-preview tbody td:nth-child(3), .goshi-form-preview thead tr:last-child th:nth-child(3)) {
    --column-head: #865019;
    --column-bg: #fff4d8;
    --column-alt: #fcecc5;
  }

  #checklist-workspace :is(.goshi-grid [data-column="spq"], .goshi-form-preview .goshi-spq, .goshi-form-preview thead tr:last-child th:nth-child(4)) {
    --column-head: #414f62;
    --column-bg: #edf1f7;
    --column-alt: #e0e7f1;
  }

  #checklist-workspace :is(.goshi-grid [data-column="quantity_prepared"], .goshi-form-preview tbody td:nth-child(6), .goshi-form-preview thead tr:last-child th:nth-child(6)) {
    --column-head: #543695;
    --column-bg: #f0e9fc;
    --column-alt: #e8ddfa;
  }

  #checklist-workspace :is(.goshi-grid [data-column="boxes"], .goshi-form-preview tbody td:nth-child(7), .goshi-form-preview thead tr:last-child th:nth-child(7)) {
    --column-head: #93411f;
    --column-bg: #ffe9dc;
    --column-alt: #ffdfcd;
  }

  #checklist-workspace :is(.goshi-grid [data-column="location_0"], .goshi-form-preview tbody td:nth-child(n+8):nth-child(-n+13), .goshi-form-preview thead tr:last-child th:nth-child(8)) {
    --column-head: #12695e;
    --column-bg: #e7f7f1;
    --column-alt: #d9f2eb;
  }

  #checklist-workspace :is(.goshi-grid [data-column="captured_fg"], .goshi-form-preview tbody td:nth-child(14), .goshi-form-preview thead tr:last-child th:nth-child(9)) {
    --column-head: #1e5898;
    --column-bg: #e6f1ff;
    --column-alt: #d9eaff;
  }

  #checklist-workspace .goshi-grid [data-column="variance"] {
    --column-head: #953c4f;
    --column-bg: #fff0f2;
    --column-alt: #fce3e8;
  }

  body.app-page.original-ui #checklist-workspace :is(.goshi-sheet table.goshi-grid, .goshi-form-preview) thead tr:last-child th {
    background: var(--column-head);
    color: #fff;
    text-align: center;
    border-color: #cbd9e8;
  }

  body.app-page.original-ui #checklist-workspace :is(.goshi-sheet table.goshi-grid, .goshi-form-preview) tbody td {
    border-color: #d1dceb;
    background: var(--row-color, var(--column-bg));
  }

  #checklist-workspace :is(.goshi-grid, .goshi-form-preview) :where(tbody tr:nth-child(even)) > td {
    --row-color: var(--column-alt);
  }

  #checklist-workspace .goshi-grid td[data-location-zone="staging"] {
    --row-color: repeating-linear-gradient(135deg, #f6daa0 0 5px, #fff4d8 5px 10px);
  }

  #checklist-workspace .goshi-grid td[data-location-zone="c"] {
    --row-color: #b8e6d7;
  }

  #checklist-workspace .goshi-grid td[data-location-zone="d"] {
    --row-color: repeating-linear-gradient(90deg, #ede5fc 0 5px, #cdb9f0 5px 7px);
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-grid td input {
    color: #1e314a;
    font-variant-numeric: tabular-nums;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-grid td input[readonly] {
    background: transparent !important;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-grid :is([data-column="part_number"], [data-column="location_0"]) input {
    text-align: left;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-grid [data-column="variance"] input {
    color: #8f2432;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet table.goshi-grid .goshi-totals .goshi-total-spacer {
    background: transparent;
    border: 0;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet table.goshi-grid .goshi-totals :is(.goshi-total-label, .goshi-total-value) {
    position: static;
    min-width: 0;
    height: 32px;
    padding: 4px 6px !important;
    border: 1px solid #b4cee9;
    background: #dcecff;
    color: #204e7e;
    font-size: 11px;
    font-weight: 700;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-total-label {
    text-align: left;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet .goshi-total-value {
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  body.app-page.original-ui #checklist-workspace .goshi-sheet table.goshi-grid .goshi-total-value input {
    width: 4em;
    max-width: 54%;
    height: 24px;
    min-height: 24px;
    margin-inline-end: 3px;
    padding: 2px 4px;
    border: 1px solid #9db9df;
    border-radius: 5px;
    background: #fff;
    font-size: 11px;
  }

  #checklist-workspace .goshi-sheet .goshi-total-value > span {
    font-size: 9px;
  }

  #checklist-workspace .goshi-source-note {
    font-size: 11px;
    color: var(--glass-muted);
  }

  body.app-page.original-ui #checklist-workspace .goshi-form-preview thead tr:first-child th {
    color: #fff;
    background: #153960;
  }

  body.app-page.original-ui #checklist-workspace .goshi-form-preview .goshi-total {
    color: #204e7e;
    background: #dcecff;
  }
}

@media screen and (max-width: 560px) {
  #checklist-workspace .goshi-sheet .goshi-selection-total {
    margin-inline-start: 0;
  }
}

@media screen {
  body.app-page.original-ui .inventory-balance-card .inventory-balance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-block: 14px;
  }

  body.app-page.original-ui .inventory-balance-header p {
    margin: 4px 0 0;
    color: var(--glass-muted);
  }

  body.app-page.original-ui .inventory-export-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  body.app-page.original-ui .inventory-export-tools a {
    white-space: nowrap;
  }

  body.app-page.original-ui .inventory-export-tools .button {
    min-height: 38px;
    padding: 6px 12px;
  }
}

/* Table width alignment & filter row polish */
body.app-page.original-ui .table-wrap > table:not(.editable-rows, .goshi-grid) {
  width: 100%;
}

body.app-page.original-ui .filters {
  align-items: end;
}

body.app-page.original-ui .filters .field {
  min-width: min(140px, 100%);
}

body.app-page.original-ui .filters .field:has(input[type="date"], input[type="month"], select) {
  flex: 0 1 155px;
}

.su-advanced-options {
  margin: 12px 0;
  border: 1px solid #d5e1f3;
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 12px;
}

.su-advanced-options > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #2e4262;
}

.su-advanced-body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

/* Dashboard operational queue, quick actions, chart labels & bottom grid */
/* Dashboard KPI Strip */
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-metrics {
  margin-bottom: 14px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-top: 3px solid #506aaa;
  background: var(--glass-paper);
  box-shadow: var(--glass-shadow), 0 0 0 1px #657eaa1e;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #4b5d79;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #edf2fb;
  color: #3f5a96;
  flex-shrink: 0;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-icon .wms-icon {
  width: 16px;
  height: 16px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-num {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-num strong {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #16243d;
  font-variant-numeric: tabular-nums;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-num strong.dk-text-val {
  font-size: 16px;
  line-height: 1.3;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-unit {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card .dk-meta {
  font-size: 11.5px;
  color: #64748b;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-teal {
  border-top-color: #0b7d71;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-teal .dk-icon {
  background: #e6f6f3;
  color: #0b7d71;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-amber {
  border-top-color: #c25e28;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-amber .dk-icon {
  background: #fdf0e8;
  color: #c25e28;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-violet {
  border-top-color: #7755a9;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-violet .dk-icon {
  background: #f2ecfa;
  color: #7755a9;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-rose {
  border-top-color: #b43b4e;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-rose .dk-icon {
  background: #fcecef;
  color: #b43b4e;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-hero {
  border-top-color: #1f4f9e;
  background: linear-gradient(155deg, #ffffff 0%, #eaf1ff 100%);
  box-shadow: 0 10px 24px rgba(31, 79, 158, 0.12), 0 0 0 1px rgba(31, 79, 158, 0.14);
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-hero .dk-label {
  color: #1f4f9e;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-hero .dk-icon {
  background: #1f4f9e;
  color: #ffffff;
}
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-kpi-card.tone-hero .dk-num strong {
  color: #102a56;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-ops {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-top: 3px solid #94a3b8;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(24, 42, 74, 0.06), 0 0 0 1px #657eaa1a;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(24, 42, 74, 0.1), 0 0 0 1px rgba(53, 88, 184, 0.25);
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card .dq-label {
  font-size: 12px;
  font-weight: 700;
  color: #4b5d79;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card .dq-value {
  font-size: 20px;
  line-height: 1.2;
  color: #16243d;
  font-variant-numeric: tabular-nums;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card .dq-meta {
  font-size: 11.5px;
  color: #64748b;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card.tone-warn {
  border-top-color: #d97706;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card.tone-info {
  border-top-color: #3558b8;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-queue-card.tone-good {
  border-top-color: #15803d;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-quick-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid > .card {
  margin-bottom: 0;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid th,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td {
  padding: 9px 10px;
  font-size: 12.5px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid th:first-child,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:first-child {
  padding-left: 24px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid th:last-child,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:last-child {
  padding-right: 24px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(1),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(3),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(4),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(5),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(6) {
  white-space: nowrap;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid td:nth-child(2) {
  min-width: 130px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid > .card:first-child th:nth-child(3),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid > .card:first-child td:nth-child(3),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid > .card:last-child th:last-child,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid > .card:last-child td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-period-meta {
  margin: 0 24px 14px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-subhead {
  margin: 16px 24px 8px;
  color: #23334d;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table th,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table td {
  padding: 8px 14px;
  font-size: 13px;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table th:first-child,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table td:first-child {
  padding-left: 24px;
  text-align: left;
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table th:last-child,
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table td:last-child {
  padding-right: 24px;
}

/* Click-to-copy highlighted text for Warrant & Location in Pending Incoming panel */
@keyframes piCopyPop {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(0.92); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(0.96); }
}

body.app-page.original-ui .pi-copy-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  text-decoration: none;
  transition: color 0.14s ease, transform 0.12s ease;
}

body.app-page.original-ui .pi-copy-chip::before {
  content: none !important;
  display: none !important;
}

body.app-page.original-ui .pi-copy-chip:hover {
  color: #1e40af;
}

body.app-page.original-ui .pi-copy-chip:active {
  transform: scale(0.96);
}

body.app-page.original-ui .pi-copy-chip.pi-copy-badge {
  text-decoration: none;
  padding: 0;
}

body.app-page.original-ui .pi-copy-chip .badge {
  white-space: nowrap;
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
  transition: background-color 0.14s ease, color 0.14s ease;
}

body.app-page.original-ui .pi-copy-chip:hover .badge {
  background: #bfdbfe;
  color: #1e3a8a;
}

body.app-page.original-ui .pi-copy-chip[data-copied="1"]::after {
  content: "Copied!";
  position: absolute;
  left: 50%;
  bottom: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: #15803d;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(21, 128, 61, 0.25);
  animation: piCopyPop 1.15s ease forwards;
  z-index: 20;
}

body.app-page.original-ui[data-page="movement_history.php"] .table-wrap th,
body.app-page.original-ui[data-page="movement_history.php"] .table-wrap td {
  padding: 9px 8px;
  font-size: 12.5px;
}

body.app-page.original-ui[data-page="inventory_monthly.php"] .editor {
  margin: 0 24px 16px;
}

.cutoff-picker {
  margin-bottom: 12px;
}
.cutoff-picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.cutoff-chip {
  padding: 6px 12px;
  font-size: 12px;
}

.po-list-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ps-dr-panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body.app-page.original-ui .ps-dr-number-copy {
  margin-top: 4px;
}
body.app-page.original-ui .ps-dr-number-copy .badge {
  font-size: 20px;
  font-weight: 800;
  padding: 6px 14px;
  letter-spacing: 0.01em;
}
body.app-page.original-ui .ps-dr-copy-row .pi-copy-badge .badge {
  font-size: 18px;
  font-weight: 800;
  padding: 5px 12px;
}
dialog.ps-dr-edit-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 20px 22px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
}
dialog.ps-dr-edit-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.ps-dr-edit-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ps-dr-edit-dialog-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.ps-dr-edit-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.ps-dr-copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
dialog.ps-dr-edit-dialog .ps-dr-edit-form {
  display: block;
}
dialog.ps-dr-edit-dialog .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  dialog.ps-dr-edit-dialog .ps-dr-edit-form {
  display: block;
}
dialog.ps-dr-edit-dialog .form-grid {
    grid-template-columns: 1fr;
  }
}

body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table th:nth-child(n+2),
body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-breakdown-table td:nth-child(n+2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.app-page.original-ui .dashboard-charts .chart-axis-label {
  font-size: 10px;
  fill: #64748b;
  font-weight: 600;
}

body.app-page.original-ui .dashboard-charts .chart-val-label {
  font-size: 8.5px;
  fill: #23334d;
  font-weight: 700;
}

body.app-page.original-ui .dashboard-charts .pie-pct {
  font-weight: 500;
  color: #64748b;
}

@media screen and (max-width: 1090px) {
  body.app-page.original-ui[data-page="fg_dashboard.php"] .dashboard-bottom-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Unified compact HYS WMS button system across all app modules */
body.app-page.original-ui :is(main, header, dialog) :is(button, .button):not(.mobile-menu-button):not(.wms-account-trigger):not(.wms-account-action):not(.wms-help-close):not(.pi-copy-chip):not(.cw-batch-main):not(.cw-cell-btn):not(.ps-dr-edit-close):not(.sc-guide-trigger):not(.sc-guide-close) {
  min-height: 34px;
  height: auto;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 9px;
  gap: 6px;
  transition: transform 0.12s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

body.app-page.original-ui :is(main, header, dialog) :is(button, .button):not(.primary):not(.subtle):not(.danger):not(.danger-button):not(.cw-red):not(.cw-danger-outline):not(.di-row-action):not(.mobile-menu-button):not(.wms-account-trigger):not(.wms-account-action):not(.wms-help-close):not(.pi-copy-chip):not(.cw-batch-main):not(.ps-dr-edit-close) {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

body.app-page.original-ui :is(main, header, dialog) :is(button, .button):not(.primary):not(.subtle):not(.danger):not(.danger-button):not(.cw-red):not(.cw-danger-outline):not(.di-row-action):not(.mobile-menu-button):not(.wms-account-trigger):not(.wms-account-action):not(.wms-help-close):not(.pi-copy-chip):not(.cw-batch-main):not(.ps-dr-edit-close):hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

body.app-page.original-ui :is(main, header, dialog) :is(button.primary, .button.primary) {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: 1px solid #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.24);
}

body.app-page.original-ui :is(main, header, dialog) :is(button.primary, .button.primary):hover:not(:disabled) {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
  border-color: #1e40af;
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.28);
}

body.app-page.original-ui :is(main, header, dialog) :is(button.subtle, .button.subtle) {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  box-shadow: none;
}

body.app-page.original-ui :is(main, header, dialog) :is(button.subtle, .button.subtle):hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.app-page.original-ui :is(main, header, dialog) .di-row-action {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 7px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  box-shadow: none;
}

body.app-page.original-ui :is(main, header, dialog) .di-row-action:hover:not(:disabled) {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

body.app-page.original-ui[data-page="preparation_checklist.php"] :is(.cw-toolbar, .cw-card-actions, .cw-history-controls) :is(button, .button):not(.cw-batch-main) {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

body.app-page.original-ui[data-page="pending_tasks.php"] #pending-live :is(.pi-tabs, .pi-nav, .filters) :is(button, .button) {
  min-height: 34px;
  height: auto;
  padding: 6px 14px;
  font-size: 12.5px;
  border-radius: 9px;
}

body.app-page.original-ui .wms-help-trigger {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

body.app-page.original-ui .ps-dr-filtered-qty {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 10px;
}
