:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --text: #181b20;
    --text-soft: #68707d;
    --line: #e2e6ea;
    --line-dark: #cdd3da;
    --ink: #15181c;
    --green: #16794b;
    --green-soft: #e8f5ee;
    --blue: #2667b3;
    --blue-soft: #e9f1fb;
    --amber: #9b650e;
    --amber-soft: #fbf2df;
    --red: #b4232a;
    --red-soft: #fbeaec;
    --sidebar-width: 236px;
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
}

.sandbox-environment-banner {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    border-bottom: 1px solid #e4c46a;
    background: #fff4cc;
    color: #b4232a;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
}

body.sandbox-mode .sidebar,
body.sandbox-mode .topbar {
    top: 36px;
}

body.sandbox-mode .login-page,
body.sandbox-mode .app-layout,
body.sandbox-mode .workspace {
    min-height: calc(100vh - 36px);
    min-height: calc(100dvh - 36px);
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(38, 103, 179, 0.25);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.brand-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.1;
}

.brand-copy strong {
    font-size: 16px;
    font-weight: 750;
}

.brand-copy small {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 10px;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0 18px;
    cursor: pointer;
    font-weight: 650;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.button-primary {
    background: var(--ink);
    color: #fff;
}

.button-primary:hover {
    background: #30343a;
}

.button-secondary {
    border-color: var(--line-dark);
    background: var(--surface);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--surface-muted);
    border-color: #aeb6bf;
}

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

.button-danger:hover {
    border-color: #941b22;
    background: #941b22;
}

.button-danger-soft {
    border-color: #efb8bc;
    background: #fdebed;
    color: #9f1f27;
}

.button-danger-soft:hover {
    border-color: #df969c;
    background: #f9dadd;
    color: #851820;
}

.button-compact {
    min-height: 36px;
    padding-inline: 13px;
    font-size: 11px;
}

.button:disabled,
.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.button.is-loading,
.icon-button.is-loading {
    cursor: wait;
}

.icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button:hover {
    border-color: var(--line-dark);
    background: var(--surface-muted);
}

.icon-button.subtle {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-color: transparent;
    background: transparent;
    color: var(--text-soft);
}

.is-loading i {
    animation: spin 700ms linear infinite;
}

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 32px 18px;
    background: #eef1f3;
}

.login-panel {
    width: min(100%, 410px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 34px;
    box-shadow: 0 18px 46px rgba(24, 27, 32, 0.09);
}

.brand-login {
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.login-heading {
    margin: 30px 0 25px;
}

.login-heading h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 750;
}

.login-heading p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 18px;
}

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

.field label {
    color: #343941;
    font-size: 12px;
    font-weight: 650;
}

.input-wrap {
    position: relative;
}

.input-wrap i {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #858d98;
    font-size: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    padding: 0 14px 0 42px;
    color: var(--text);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap input:focus {
    border-color: #606975;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.08);
}

.has-error .input-wrap input {
    border-color: var(--red);
}

.form-error {
    margin: -3px 0 0;
    border-radius: 5px;
    background: var(--red-soft);
    padding: 10px 12px;
    color: var(--red);
    font-size: 12px;
    line-height: 1.5;
}

.login-button {
    width: 100%;
    margin-top: 4px;
}

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

.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.sidebar-brand {
    height: 74px;
    flex: 0 0 74px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
}

.sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    padding: 20px 12px;
}

.nav-item {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    border-radius: 6px;
    padding: 0 13px;
    color: #4f5763;
    text-decoration: none;
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    font-size: 17px;
    text-align: center;
}

.nav-item:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.nav-item.active {
    background: var(--ink);
    color: #fff;
}

.nav-notification-badge {
    display: inline-grid;
    min-width: 19px;
    height: 19px;
    margin-left: auto;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 99px;
    background: #d62f35;
    padding: 0 4px;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.nav-notification-badge[hidden] {
    display: none;
}

.nav-notification-badge.new-packing-count {
    background: #e65f2f;
}

.nav-notification-badge.marketing-running-count {
    background: #2b8a57;
}

.sidebar-account {
    display: flex;
    min-height: 76px;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 12px 14px;
}

.user-avatar,
.customer-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e8ebee;
    color: #343941;
    font-weight: 750;
}

.user-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.user-meta {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.user-meta strong,
.user-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.user-meta span {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 10px;
}

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

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    height: 74px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 0 30px;
}

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

.topbar-mobile-title {
    display: none;
    align-items: center;
    gap: 8px;
}

.mobile-menu {
    display: none;
}

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

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-heading h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 750;
}

.page-heading p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

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

.stat-card {
    display: flex;
    min-width: 0;
    min-height: 106px;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    padding: 20px;
}

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

.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }

.stat-card > div:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.stat-card span {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card strong {
    margin-top: 8px;
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

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

.panel-header {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 14px 19px;
}

.panel-header h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 750;
}

.table-scroll {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    min-width: 1052px;
    border-collapse: collapse;
    table-layout: fixed;
}

.orders-table th,
.orders-table td {
    border-bottom: 1px solid var(--line);
    padding: 13px 16px;
    text-align: left;
    vertical-align: middle;
}

.orders-table th {
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.orders-table th:first-child { width: 150px; }
.orders-table th:nth-child(2) { width: 72px; }
.orders-table th:nth-child(3) { width: 120px; }
.orders-table th:nth-child(4) { width: 260px; }
.orders-table th:nth-child(5) { width: 105px; }
.orders-table th:nth-child(6) { width: 180px; }
.orders-table th:nth-child(7) { width: 95px; }
.orders-table th:last-child { width: 70px; }

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

.customer-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.customer-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    background: #edf0f2;
    font-size: 10px;
}

.customer-identity > span:last-child,
.contact-lines {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.customer-identity strong,
.customer-identity small,
.contact-lines span,
.contact-lines small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-identity strong,
.contact-lines span {
    font-size: 11px;
    font-weight: 650;
}

.customer-identity small,
.contact-lines small {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 9px;
}

.date-cell {
    color: var(--text-soft);
    font-size: 10px;
    white-space: nowrap;
}

.badge,
.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 400;
    white-space: nowrap;
}

.badge.active,
.order-status.complete {
    background: var(--green-soft);
    color: var(--green);
}

.badge.inactive,
.order-status.unpaid,
.order-status.failed {
    background: var(--red-soft);
    color: var(--red);
}

.order-status.processing {
    background: var(--blue-soft);
    color: var(--blue);
}

.order-status.pending {
    background: var(--amber-soft);
    color: var(--amber);
}

.order-status.neutral {
    background: #edf0f2;
    color: #59616c;
}

.table-loading {
    display: block;
    width: 18px;
    height: 18px;
    margin: 26px auto;
    border: 2px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.empty-cell,
.empty-list {
    padding: 32px 16px;
    color: var(--text-soft);
    font-size: 11px;
    text-align: center;
}

.toast-region {
    position: fixed;
    z-index: 12000;
    top: max(18px, calc(env(safe-area-inset-top) + 8px));
    left: 50%;
    display: grid;
    width: min(360px, calc(100vw - 36px));
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: var(--surface);
    padding: 13px 15px;
    box-shadow: 0 10px 28px rgba(24, 27, 32, 0.14);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success i { color: var(--green); }
.toast.error i { color: var(--red); }
.toast.new-order i { color: #d62f35; }

.toast span {
    font-size: 12px;
    line-height: 1.45;
}

.mobile-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    background: rgba(17, 20, 24, 0.42);
}

.order-table-panel {
    scroll-margin-top: 90px;
}

.order-panel-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 20px;
}

.order-actions {
    display: flex;
    align-items: center;
    justify-self: start;
    gap: 8px;
}

.order-search-toolbar {
    min-width: 0;
    align-self: center;
    justify-self: end;
}

.selected-order-label {
    margin-right: 4px;
    color: var(--text-soft);
    font-size: 10px;
    white-space: nowrap;
}

.pagination-bar {
    display: flex;
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 8px 16px;
}

.pagination-summary {
    color: var(--text-soft);
    font-size: 10px;
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-search-tools {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.order-filter-field {
    display: block;
    white-space: nowrap;
}

.order-filter-field select,
.order-search-form input {
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 5px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.order-filter-field select {
    width: 178px;
    padding: 0 28px 0 9px;
    font-size: 11px;
}

.order-filter-field select:focus,
.order-search-form input:focus {
    border-color: #6c9dc8;
    box-shadow: 0 0 0 2px rgba(108, 157, 200, 0.16);
}

.order-search-form {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.order-search-form input {
    width: 300px;
    border-color: #737b86;
    padding: 0 10px;
    font-size: 11px;
}

.order-search-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--ink);
    border-radius: 5px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
}

.order-search-button:hover {
    background: #303640;
}

.pagination-button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    color: #4f5763;
    cursor: pointer;
    font-size: 10px;
}

.pagination-button:hover:not(:disabled):not(.active) {
    border-color: var(--line-dark);
    background: var(--surface-muted);
    color: var(--text);
}

.pagination-button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    font-weight: 700;
}

.pagination-button:disabled {
    cursor: default;
    opacity: 0.35;
}

.pagination-ellipsis {
    display: inline-grid;
    width: 22px;
    place-items: center;
    color: var(--text-soft);
}

.order-table-scroll {
    position: relative;
    max-height: calc(100vh - 280px);
    min-height: 420px;
}

.orders-table thead {
    position: sticky;
    z-index: 4;
    top: 0;
}

.orders-table th:first-child,
.orders-table td:first-child {
    position: sticky;
    z-index: 2;
    left: 0;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
}

.orders-table th:first-child {
    z-index: 6;
    background: var(--surface-muted);
}

.orders-table tbody tr {
    transition: background-color 140ms ease;
}

.orders-table tbody tr:hover td,
.orders-table tbody tr:hover td:first-child {
    background: #fffdf2;
}

.orders-table tbody tr.selected td,
.orders-table tbody tr.selected td:first-child {
    background: #eef5fb;
}

.orders-table tbody tr.copied-order td,
.orders-table tbody tr.copied-order td:first-child {
    background: #fffdf2;
}

.orders-table tbody tr.copied-order:hover td,
.orders-table tbody tr.copied-order:hover td:first-child {
    background: #fff9df;
}

.orders-table tbody tr.opened-order td,
.orders-table tbody tr.opened-order td:first-child {
    background: #fffdf2;
}

.orders-table tbody tr.opened-order:hover td,
.orders-table tbody tr.opened-order:hover td:first-child {
    background: #fff9df;
}

.orders-table tbody tr.unread-order .order-number,
.orders-table tbody tr.unread-order .contact-email,
.orders-table tbody tr.unread-order .order-status,
.orders-table tbody tr.unread-order .order-amount {
    font-weight: 700;
}

.order-customer,
.order-contact,
.payment-status {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.order-customer-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.order-customer-main input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin: 0;
    accent-color: var(--ink);
    cursor: pointer;
}

.order-customer .order-number,
.order-contact .contact-email,
.payment-status .payment-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-customer .order-number {
    font-size: 16px;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.order-contact .contact-email {
    font-size: 14px;
}

.order-customer small,
.phone-line {
    margin-top: 6px;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.3;
}

.order-customer small {
    padding-left: 26px;
    font-weight: 400;
}

.order-customer .customer-name {
    font-size: 12px;
}

.payment-status {
    align-items: flex-start;
    gap: 7px;
}

.payment-name.complete { color: var(--green); }
.payment-name.processing { color: var(--blue); }
.payment-name.pending { color: var(--amber); }
.payment-name.unpaid,
.payment-name.failed { color: var(--red); }

.phone-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.phone-number {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-nickname {
    overflow: hidden;
    margin-top: 6px;
    color: var(--red);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-action {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border-radius: 50%;
    text-decoration: none;
    font-size: 14px;
}

.whatsapp-link {
    color: #25d366;
}

.whatsapp-link:hover {
    background: #e8f8ee;
    color: #128c4a;
}

.phone-warning {
    color: var(--amber);
}

.order-date,
.order-country,
.order-amount {
    font-size: 12px;
    white-space: nowrap;
}

.order-date {
    color: #4f5763;
}

.orders-table th:nth-child(2),
.order-store-cell {
    text-align: center;
}

.order-list-store-link {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 5px;
    color: #4f5763;
    text-decoration: none;
    font-size: 20px;
}

a.order-list-store-link:hover {
    background: #f1f3f5;
    color: var(--ink);
}

.order-list-store-icon {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    object-fit: contain;
}

.order-amount {
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.view-cell {
    text-align: center !important;
}

.view-cell .icon-button {
    width: 42px;
    height: 42px;
    margin: 0 auto;
    font-size: 17px;
}

.order-window-layer {
    position: fixed;
    z-index: 80;
    inset: 0;
    pointer-events: none;
}

.order-window-taskbar {
    position: absolute;
    z-index: 10000;
    right: 8px;
    bottom: 8px;
    left: 8px;
    display: flex;
    max-height: calc(100dvh - 16px);
    align-items: center;
    flex-wrap: wrap-reverse;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px;
    pointer-events: none;
    scrollbar-width: thin;
}

.order-taskbar-item {
    position: relative;
    display: flex;
    min-width: 0;
    max-width: none;
    height: 46px;
    flex: 0 0 calc((100% - 64px) / 9);
    align-items: center;
    gap: 3px;
    overflow: hidden;
    border: 1px solid #aeb9c3;
    border-radius: 6px;
    background: #edf1f4;
    padding: 0 4px;
    color: #303842;
    box-shadow: 0 2px 5px rgba(28, 36, 45, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    pointer-events: auto;
    text-align: left;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.order-taskbar-item:hover {
    border-color: #8fa4b7;
    background: #e5ebf0;
}

.order-taskbar-item.is-active {
    border-color: #6f91af;
    background: #d5e3ef;
    box-shadow: inset 0 2px 6px rgba(42, 67, 89, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.7);
    transform: translateY(1px);
}

.order-taskbar-item.is-active::after {
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #2477b9;
    content: '';
}

.order-taskbar-item.is-minimized {
    background: #f3f5f7;
    color: #69727d;
    box-shadow: inset 0 1px 3px rgba(35, 44, 53, 0.12);
}

.order-taskbar-label {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-taskbar-status {
    flex: 0 0 auto;
}

.close-order-taskbar-item {
    display: inline-grid;
    width: 22px;
    height: 28px;
    flex: 0 0 22px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 0;
    color: #596674;
    cursor: pointer;
}

.close-order-taskbar-item:hover,
.close-order-taskbar-item:focus-visible {
    background: rgba(180, 35, 35, 0.12);
    color: #b4232f;
    outline: none;
}

@media (min-width: 621px) and (max-width: 900px) {
    .order-taskbar-item {
        flex-basis: calc((100% - 32px) / 5);
    }
}

.order-detail-window {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    width: min(1120px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 32px));
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #9cb4c7;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(18, 21, 25, 0.2);
    pointer-events: auto;
    transform: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.order-detail-window.active-window {
    border-color: #6f9fc4;
    box-shadow: 0 24px 70px rgba(18, 21, 25, 0.31);
}

.order-detail-window.dragging,
.order-detail-window.resizing {
    user-select: none;
}

.order-detail-window.minimized {
    display: none !important;
}

.order-detail-window.maximized {
    border-radius: 6px;
}

.order-window-bar {
    display: flex;
    height: 52px;
    flex: 0 0 52px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #a9c1d4;
    background: #dceaf5;
    padding: 0 10px 0 18px;
    color: #294256;
    cursor: move;
    touch-action: none;
    transition: background-color 150ms ease;
}

.order-detail-window.active-window:not(.minimized) .order-window-bar {
    background: #c7e0f2;
}

.order-detail-window .window-tool {
    color: #294256;
}

.order-detail-window .window-tool:hover {
    background: rgba(55, 100, 135, 0.13);
}

.window-resize-handle {
    position: absolute;
    z-index: 3;
    touch-action: none;
}

.window-resize-handle::after {
    position: absolute;
    width: 7px;
    height: 7px;
    border-color: #8d96a1;
    content: '';
    opacity: 0.72;
}

.resize-n { top: -2px; right: 14px; left: 14px; height: 9px; cursor: ns-resize; }
.resize-s { right: 14px; bottom: -2px; left: 14px; height: 9px; cursor: ns-resize; }
.resize-e { top: 14px; right: -2px; bottom: 14px; width: 9px; cursor: ew-resize; }
.resize-w { top: 14px; bottom: 14px; left: -2px; width: 9px; cursor: ew-resize; }
.resize-nw { top: -2px; left: -2px; width: 18px; height: 18px; cursor: nwse-resize; }
.resize-ne { top: -2px; right: -2px; width: 18px; height: 18px; cursor: nesw-resize; }
.resize-se { right: -2px; bottom: -2px; width: 18px; height: 18px; cursor: nwse-resize; }
.resize-sw { bottom: -2px; left: -2px; width: 18px; height: 18px; cursor: nesw-resize; }
.resize-nw::after { top: 3px; left: 3px; border-top: 2px solid; border-left: 2px solid; }
.resize-ne::after { top: 3px; right: 3px; border-top: 2px solid; border-right: 2px solid; }
.resize-se::after { right: 3px; bottom: 3px; border-right: 2px solid; border-bottom: 2px solid; }
.resize-sw::after { bottom: 3px; left: 3px; border-bottom: 2px solid; border-left: 2px solid; }

.order-detail-window.minimized .window-resize-handle,
.order-detail-window.maximized .window-resize-handle {
    display: none;
}

.order-window-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.order-window-title > strong {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.order-window-tools {
    display: flex;
    gap: 4px;
}

.window-tool {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.window-tool:hover {
    background: rgba(255, 255, 255, 0.14);
}

.order-window-body {
    position: relative;
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    container-name: order-detail-body;
    container-type: inline-size;
}

.window-loading {
    display: block;
    width: 24px;
    height: 24px;
    margin: 90px auto;
    border: 2px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.detail-section {
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    padding: 0 22px 24px;
}

.detail-section:last-child {
    border-bottom: 0;
}

.detail-section > header {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 10px;
}

.collapsible-detail-section > header {
    justify-content: space-between;
}

.order-summary-section > header {
    justify-content: flex-start;
}

.order-summary-section .order-detail-refresh {
    margin-left: auto;
}

.collapsible-detail-section.is-collapsed {
    padding-bottom: 0;
}

.detail-section-body[hidden] {
    display: none;
}

.detail-section h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 750;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.detail-grid.order-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-item {
    min-width: 0;
    min-height: 68px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
}

.detail-item > span {
    display: block;
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 650;
}

.detail-item > strong {
    display: block;
    overflow: hidden;
    margin-top: 8px;
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-item > .detail-value {
    margin-top: 8px;
    font-size: 11px;
}

.detail-item > .detail-value .phone-line {
    margin-top: 0;
}

.detail-nickname-value {
    color: var(--red);
    font-weight: 400;
}

.detail-payment-status {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.detail-payment-status .payment-name,
.detail-payment-status .order-status {
    font-weight: 700;
}

.detail-payment-status .payment-name {
    font-size: 11px;
}

.detail-item.detail-order-number > strong {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.detail-inline-link {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.detail-inline-link:hover,
.detail-inline-link:focus-visible {
    color: var(--blue);
    text-decoration: underline;
    outline: none;
}

.detail-email-display {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.detail-email-address {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-email-action {
    display: inline-grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 0;
    color: var(--blue);
    cursor: pointer;
}

.detail-email-action:hover,
.detail-email-action:focus-visible {
    background: var(--blue-soft);
    outline: none;
}

.detail-store-link {
    gap: 8px;
}

.detail-store-link > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-store-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 3px;
    object-fit: contain;
}

@media (max-width: 900px) {
    .detail-grid.order-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-summary-grid .detail-item-empty {
        display: none;
    }
}

@media (max-width: 620px) {
    .detail-grid.order-summary-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item.emphasis > strong {
    font-size: 15px;
}

.detail-item.wide {
    grid-column: span 2;
}

.detail-item.preserve > strong {
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.detail-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.detail-table th,
.detail-table td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

.detail-table th {
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 9px;
}

.detail-table td {
    font-size: 11px;
    line-height: 1.45;
}

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

.detail-empty {
    margin: 0;
    padding: 28px 16px;
    background: var(--surface-muted);
    color: var(--text-soft);
    font-size: 11px;
    text-align: center;
}

.order-commerce-section {
    border-bottom: 1px solid var(--line);
}

.order-workspace-header {
    display: flex;
    min-height: 58px;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    border-bottom: 1px solid var(--line);
    padding: 10px 22px;
}

.section-order-number {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.order-workspace-meta {
    color: #414852;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.order-workspace-store {
    display: inline-grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 5px;
    color: var(--text);
    text-decoration: none;
}

.order-workspace-store:hover,
.order-workspace-store:focus-visible {
    background: var(--blue-soft);
    color: var(--blue);
    outline: none;
}

.order-workspace-store-icon {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    object-fit: contain;
}

.order-workspace-payment .detail-payment-status {
    flex-wrap: wrap;
}

.order-payment-notification-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.order-payment-notification-actions .button {
    min-height: 30px;
    border-color: #d3b452;
    background: #fff4bd;
    color: #40340d;
    padding: 0 10px;
    font-size: 10px;
    white-space: nowrap;
}

.order-payment-notification-actions .button:hover,
.order-payment-notification-actions .button:focus-visible {
    border-color: #1c2021;
    background: #ffe989;
}

.order-payment-notification-actions .button:disabled {
    border-color: var(--line);
    background: var(--surface-muted);
    color: var(--text-soft);
}

.order-products-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
	flex-wrap: wrap;
    gap: 7px;
    min-height: 30px;
    margin: 0 0 12px;
}

.order-products-toolbar .order-screenshot-capture {
    margin-right: auto;
}

.order-product-selection-actions {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.order-product-select-all-label {
	display: inline-flex;
	min-height: 30px;
	align-items: center;
	gap: 6px;
	color: #3f4852;
	font-size: 10px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
}

.order-product-select-all-label input {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: #2f3943;
}

.order-product-actions {
	position: relative;
}

.order-product-actions-toggle {
	min-height: 30px;
	gap: 7px;
	border-radius: 5px;
	padding: 0 10px;
	font-size: 10px;
	white-space: nowrap;
}

.order-product-actions-toggle:disabled {
	border-color: #cfd4d9;
	background: #e9ecef;
	color: #949ca5;
	cursor: not-allowed;
}

.order-product-actions-menu {
	position: absolute;
	z-index: 80;
	top: calc(100% + 5px);
	left: 0;
	display: grid;
	width: 178px;
	overflow: hidden;
	border: 1px solid #b9c0c7;
	border-radius: 5px;
	background: #fff;
	padding: 4px;
	box-shadow: 0 10px 28px rgba(24, 27, 32, .18);
}

.order-product-actions-menu[hidden] { display: none; }

.order-product-action-group {
	display: grid;
	border-top: 1px solid #e4e7ea;
}

.order-product-action-item,
.order-product-action-submenu-label {
	display: flex;
	width: 100%;
	min-height: 32px;
	align-items: center;
	gap: 8px;
	border: 0;
	border-radius: 3px;
	background: #fff;
	padding: 5px 8px;
	color: #303840;
	font-size: 10px;
	text-align: left;
}

.order-product-action-item { cursor: pointer; }
.order-product-action-submenu-label {
	color: #59636d;
	font-size: 9px;
	font-weight: 800;
}

.order-product-action-item:hover,
.order-product-action-item:focus-visible {
	background: #edf0f3;
	color: #111;
	outline: none;
}

.order-product-action-submenu {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3px;
	padding: 2px 4px 5px 22px;
}

.order-product-action-submenu .order-product-action-item {
	min-height: 27px;
	justify-content: center;
	border: 1px solid #d8dde2;
	padding: 3px 5px;
	font-size: 9px;
	text-align: center;
}

.order-product-status-marker {
	display: inline-block;
	width: 9px;
	height: 9px;
	flex: 0 0 9px;
	border: 1px solid rgba(17, 17, 17, .18);
	border-radius: 50%;
}
.order-product-bulk-status.is-unordered .order-product-status-marker { background: #aeb5bd; }
.order-product-bulk-status.is-ordered .order-product-status-marker { background: #55a96b; }
.order-product-bulk-status.is-frozen .order-product-status-marker { background: #83c9d7; }
.order-product-bulk-status.is-picked .order-product-status-marker { background: #111; }
.order-product-bulk-status.is-out-of-stock .order-product-status-marker { background: #df9296; }
.order-product-bulk-status.is-shipped .order-product-status-marker { background: #C3C3C3; }

.order-place-status-toggle,
.order-screenshot-capture,
.order-print-history-open,
.order-items-manage-open {
    min-height: 30px;
    border-radius: 5px;
    padding: 0 10px;
    font-size: 10px;
    white-space: nowrap;
}

.order-screenshot-capture i {
    color: #505862;
}

.order-items-manage-open i {
    color: #1769c2;
}

.order-screenshot-stage {
    position: fixed;
    z-index: -1;
    top: 0;
    left: -100000px;
    box-sizing: border-box;
    width: max-content;
    max-width: none;
    overflow: visible;
    background: #fff;
    padding: 16px;
    color: #1c2021;
    pointer-events: none;
}

.order-screenshot-heading {
    margin: 0 0 12px;
    color: #111;
    font-size: 26px;
    font-weight: 750;
    line-height: 1.2;
}

.order-screenshot-stage .order-items-update-form {
    width: max-content;
    min-width: 300px;
    max-width: none;
    margin: 0;
}

.order-screenshot-stage .order-product-grid {
    width: max-content;
    max-width: none;
    grid-template-columns: repeat(var(--order-screenshot-columns, 4), 150px);
    justify-content: start;
}

.order-screenshot-stage .order-product-card {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    border-color: #d9dee5;
    box-shadow: none;
}

.order-screenshot-stage .order-product-image {
    border-color: #d9dee5 !important;
    padding-bottom: 8px;
}

.order-screenshot-stage .order-screenshot-price {
    display: block;
    color: #111;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.order-screenshot-stage .order-products-totals {
    width: var(--order-screenshot-summary-width, 520px);
    min-width: 300px;
    max-width: 800px;
    margin: 18px auto 0 0;
    padding-top: 0;
}

.order-screenshot-stage .order-total-editor {
    width: 100%;
    border-color: #d9dee5;
}

.order-screenshot-stage .order-items-count {
    grid-auto-flow: row;
    align-content: center;
    gap: 10px;
}

.order-screenshot-order-number {
    color: #111;
    font-size: 15px;
    font-weight: 750;
}

.order-screenshot-items-value {
    font-size: 13px;
    font-weight: 650;
}

.order-screenshot-stage .total-editor-value {
    text-align: right;
    white-space: nowrap;
}

.order-screenshot-stage .order-screenshot-discount {
    color: var(--red);
}

.order-item-manager-layer {
    position: absolute;
    z-index: 50;
    inset: 52px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(244, 247, 249, 0.56);
    padding: 14px;
    -webkit-backdrop-filter: blur(4px) saturate(0.72);
    backdrop-filter: blur(4px) saturate(0.72);
}

.order-item-manager-dialog {
    display: flex;
    width: min(1060px, 100%);
    height: min(720px, 100%);
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #96a4b1;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(23, 29, 35, 0.28);
    container-name: order-item-manager;
    container-type: inline-size;
}

.order-item-manager-bar {
    display: flex;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #a9c1d4;
    background: #dceaf5;
    padding: 0 8px 0 16px;
    color: #294256;
}

.order-item-manager-bar > div {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.order-item-manager-bar strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-item-manager-bar .window-tool {
    color: #294256;
}

.order-item-manager-bar .window-tool:hover,
.order-item-manager-bar .window-tool:focus-visible {
    background: rgba(55, 100, 135, 0.13);
    outline: none;
}

.order-item-manager-body {
    display: grid;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr);
}

.order-manager-search-pane,
.order-manager-current-pane {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding: 16px;
}

.order-manager-current-pane {
    border-left: 1px solid var(--line);
    background: #fafbfc;
}

.order-manager-search-pane > header,
.order-manager-current-pane > header {
    display: flex;
    min-height: 30px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-manager-search-pane > header strong,
.order-manager-current-pane > header strong {
    font-size: 12px;
}

.order-manager-current-count {
    color: var(--text-soft);
    font-size: 10px;
}

.order-manager-tabs {
    display: grid;
    height: 34px;
    flex: 0 0 34px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--line-dark);
    margin-bottom: 12px;
}

.order-manager-tab {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.order-manager-tab:hover,
.order-manager-tab:focus-visible {
    color: #111;
    outline: none;
}

.order-manager-tab.is-active {
    border-bottom-color: #171b1e;
    color: #171b1e;
}

.order-manager-panel {
    display: none;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.order-manager-panel.is-active {
    display: flex;
}

.order-manager-panel[hidden] {
    display: none;
}

.order-manager-search-form {
    display: grid;
    height: 44px;
    flex: 0 0 44px;
    grid-template-columns: 34px minmax(0, 1fr) 40px;
    align-items: center;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    margin-bottom: 12px;
}

.order-manager-search-form:focus-within {
    border-color: #65717d;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-manager-search-form > i {
    color: #77818b;
    text-align: center;
}

.order-manager-search-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 0;
    background: transparent;
    padding: 0 6px;
    color: #111;
    font-size: 12px;
    outline: none;
}

.order-manager-search-submit {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    background: #1c2021;
    color: #fff;
}

.order-manager-search-submit:hover,
.order-manager-search-submit:focus-visible {
    background: #343a3d;
    color: #fff;
}

.order-manager-search-results,
.order-manager-current-list {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.order-manager-search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.order-manager-current-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 12px;
    padding-right: 4px;
}

.order-manager-empty,
.order-manager-loading {
    display: flex;
    min-height: 128px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 11px;
    text-align: center;
}

.order-manager-empty > i {
    color: #8d98a3;
    font-size: 17px;
}

.order-manager-empty.is-error {
    color: var(--red);
}

.order-manager-search-card {
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.order-manager-search-card:hover,
.order-manager-search-card.is-adding {
    border-color: #8d98a3;
    box-shadow: 0 4px 13px rgba(24, 27, 32, 0.08);
}

.order-manager-search-summary {
    display: grid;
    min-width: 0;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.order-manager-search-summary > img {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 5px;
    background: var(--surface-muted);
    object-fit: contain;
}

.order-manager-search-info,
.order-manager-search-price,
.order-manager-current-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.order-manager-search-info {
    gap: 3px;
}

.order-manager-search-info strong,
.order-manager-current-info strong {
    overflow: hidden;
    color: #191d21;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-manager-search-info > span,
.order-manager-current-info > span {
    overflow: hidden;
    color: #5b6570;
    font-size: 9px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-manager-stock.is-in-stock {
    color: #23723c;
}

.order-manager-stock.is-out-of-stock {
    color: #b42127;
}

.order-manager-custom-badge {
    align-self: flex-start;
    border-radius: 4px;
    background: #e8eef3;
    padding: 2px 5px;
    color: #344b5d !important;
    font-size: 8px !important;
    font-weight: 700;
}

.order-manager-search-price {
    align-items: flex-end;
    gap: 6px;
}

.order-manager-search-price > strong {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.order-product-add-start {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8f4eb;
    color: #176c34;
}

.order-product-add-start:hover,
.order-product-add-start:focus-visible {
    background: #cfe9d6;
    color: #105828;
}

.order-manager-search-editor[hidden] {
    display: none;
}

.order-manager-search-editor {
    border-top: 1px solid var(--line);
    background: #f7f9fa;
    padding: 10px;
}

.order-product-add-form,
.order-manager-options {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.order-manager-option {
    min-width: 0;
    border: 0;
    margin: 0;
    padding: 0;
}

.order-manager-option legend {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 6px;
    color: #343b43;
    font-size: 10px;
    font-weight: 700;
}

.required-mark {
    color: var(--red);
}

.order-manager-option select,
.order-manager-add-controls input {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 9px;
    color: #111;
    font-size: 11px;
    outline: none;
}

.order-manager-option select:focus,
.order-manager-add-controls input:focus {
    border-color: #65717d;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-manager-radio-options {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 7px;
}

.order-manager-radio-choice {
    position: relative;
    display: inline-flex;
    min-width: 74px;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 5px 8px;
    color: #333b43;
    font-size: 10px;
    cursor: pointer;
}

.order-manager-radio-choice:has(input:checked) {
    border-color: #111;
    box-shadow: inset 0 0 0 1px #111;
}

.order-manager-radio-choice input {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    accent-color: #111;
}

.order-manager-radio-choice img {
    width: 34px;
    height: 34px;
    border-radius: 4px;
    object-fit: contain;
}

.order-manager-option-unsupported {
    margin: 0;
    color: var(--red);
    font-size: 10px;
}

.order-manager-add-controls {
    display: grid;
    min-width: 0;
    grid-template-columns: 90px minmax(120px, 1fr) auto;
    align-items: end;
    gap: 9px;
}

.order-manager-add-controls > label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.order-manager-add-controls > label > span:first-child {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 650;
}

.order-manager-money-input {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding-left: 8px;
}

.order-manager-money-input:focus-within {
    border-color: #65717d;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-manager-money-input > span {
    color: #59636d;
    font-size: 11px;
}

.order-manager-money-input .order-manager-price-input {
    border: 0;
    box-shadow: none;
}

.order-manager-add-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-manager-add-actions .icon-button {
    width: 36px;
    height: 36px;
}

.order-custom-product-form {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
}

.order-manager-custom-panel {
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.order-custom-product-image-field {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.order-custom-product-image-preview {
    display: grid;
    width: 128px;
    height: 128px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    color: #87919a;
    font-size: 22px;
    outline: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.order-custom-product-image-preview:focus-visible,
.order-custom-product-image-preview.is-awaiting-paste {
    border-color: #65717d;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-custom-product-image-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.order-custom-product-image-preview img[hidden] {
    display: none;
}

.order-custom-product-image-actions {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.order-custom-product-image-actions .button {
    min-width: 104px;
    justify-content: center;
}

.order-custom-product-image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.order-custom-product-fields,
.order-custom-product-order-fields {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.order-custom-product-order-fields {
    grid-template-columns: 88px minmax(108px, 1fr) 54px 78px;
    gap: 8px;
}

.order-custom-product-fields > label,
.order-custom-product-order-fields > label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.order-custom-product-fields > label > span:first-child,
.order-custom-product-order-fields > label > span:first-child {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 650;
}

.order-custom-product-fields input,
.order-custom-product-order-fields input,
.order-custom-product-order-fields select {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 9px;
    color: #111;
    font-size: 11px;
    outline: none;
}

.order-custom-product-order-fields select:disabled {
    background: #eef1f3;
    color: #4e5963;
}

.order-custom-product-fields input:focus,
.order-custom-product-order-fields input:focus,
.order-custom-product-order-fields select:focus {
    border-color: #65717d;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-custom-product-order-fields .order-manager-money-input {
    height: 38px;
}

.order-custom-product-order-fields .order-manager-money-input input {
    border: 0;
    box-shadow: none;
}

.order-custom-product-quantity input,
.order-custom-product-price input {
    padding-right: 5px;
    padding-left: 5px;
}

.order-custom-product-actions {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.order-custom-product-reuse-summary {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.order-custom-product-reuse-summary > img {
    width: 58px;
    height: 58px;
    border-radius: 5px;
    background: var(--surface-muted);
    object-fit: contain;
}

.order-custom-product-reuse-summary > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.order-custom-product-reuse-summary strong,
.order-custom-product-reuse-summary span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-custom-product-reuse-summary strong {
    font-size: 11px;
}

.order-custom-product-reuse-summary span {
    color: var(--text-soft);
    font-size: 9px;
}

.order-manager-current-item {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.order-manager-current-image {
    position: relative;
    display: grid;
    min-height: 130px;
    place-items: center;
    background: var(--surface-muted);
    padding: 8px;
}

.order-manager-current-image > img {
    display: block;
    width: min(100%, 130px);
    height: auto;
    object-fit: contain;
}

.order-manager-current-info {
    gap: 5px;
    padding: 10px;
}

.order-manager-current-options {
    color: #111 !important;
}

.order-manager-current-meta {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 6px;
}

.order-manager-current-quantity {
    flex: 0 0 auto;
    color: var(--red);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.order-manager-current-total {
    overflow: hidden;
    color: #5b6570;
    font-size: 9px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-product-delete {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 34px;
    height: 34px;
    border: 1px solid #e5b7ba;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #b42127;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.12);
}

.order-product-delete:hover,
.order-product-delete:focus-visible {
    background: #f9e5e6;
    color: #95181e;
}

@container order-item-manager (max-width: 740px) {
    .order-item-manager-body {
        overflow-y: auto;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(360px, auto) minmax(250px, auto);
    }

    .order-manager-search-pane,
    .order-manager-current-pane {
        min-height: 360px;
    }

    .order-manager-current-pane {
        min-height: 250px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .order-manager-search-results,
    .order-manager-current-list {
        overflow: visible;
    }

    .order-manager-current-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .order-item-manager-layer {
        padding: 4px;
    }

    .order-item-manager-dialog {
        border-radius: 5px;
    }

    .order-manager-search-pane,
    .order-manager-current-pane {
        padding: 12px;
    }

    .order-manager-search-summary {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .order-manager-search-summary > img {
        width: 58px;
        height: 58px;
    }

    .order-manager-current-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .order-custom-product-order-fields {
        grid-template-columns: 72px minmax(74px, 1fr) 48px 68px;
        gap: 6px;
    }

    .order-custom-product-image-field {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 10px;
    }

    .order-custom-product-image-preview {
        width: 112px;
        height: 112px;
    }

    .order-custom-product-image-actions {
        align-content: center;
    }

    .order-custom-product-image-actions .button {
        min-width: 98px;
    }

    .order-manager-add-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

.order-workspace-columns {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
}

.order-address-column,
.order-products-column {
    min-width: 0;
    padding: 18px 22px 24px;
}

.order-products-column {
    border-left: 1px solid var(--line);
}

.order-products-totals {
    margin-top: 20px;
    padding-top: 8px;
}

.order-products-totals .totals-list {
    width: 100%;
    margin-left: 0;
}

.order-total-editor {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(72px, 1fr) minmax(0, 4fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.order-items-count {
    display: grid;
    min-width: 0;
    place-items: center;
    padding: 14px 8px;
    color: #303943;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
}

.totals-editor-rows {
    min-width: 0;
}

.total-editor-row {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 7fr) minmax(92px, 3fr);
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    font-size: 11px;
}

.total-editor-label {
    min-width: 0;
    text-align: right;
}

.total-editor-value {
    min-width: 0;
    color: #111;
    font-variant-numeric: tabular-nums;
    text-align: left;
    overflow-wrap: anywhere;
}

.total-money-input {
    width: 100%;
}

.total-discount-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    white-space: nowrap;
}

.discount-inline-prefix {
    color: var(--red);
    font-weight: 650;
}

.total-editor-row.total-final {
    font-size: 13px;
}

.total-update-row {
    border-bottom: 0;
}

.total-update-row .button {
    width: 100%;
    justify-content: center;
}

.order-payment-status-form {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 34px 0 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    padding: 20px 16px;
}

.order-payment-status-heading {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.order-payment-status-label {
    flex: 0 0 auto;
    color: #303943;
    font-size: 13px;
}

.order-payment-status-icon {
    font-size: 24px;
    line-height: 1;
}

.order-payment-status-icon.is-success {
    color: #16803a;
}

.order-payment-status-icon.is-paid {
    color: #1769c2;
}

.order-payment-status-icon.is-danger {
    color: #b42127;
}

.order-payment-status-form select {
    width: min(100%, 210px);
    height: 44px;
    flex: 0 1 210px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    padding: 0 34px 0 10px;
    color: #111;
    font-size: 12px;
}

.order-payment-status-form .button {
    min-width: 92px;
    height: 44px;
    justify-content: center;
}

.order-remark-form {
    margin-top: 18px;
    padding-top: 14px;
}

.order-remark-input {
    display: block;
    width: 100%;
    min-height: 220px;
    resize: vertical;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    padding: 10px 12px;
    color: var(--red);
    font: inherit;
    font-size: 15px;
    line-height: 1.55;
    white-space: pre-wrap;
}

.order-remark-input:focus {
    border-color: #656e79;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-remark-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.order-remark-form.is-readonly > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 10px;
}

.order-remark-form.is-readonly .order-remark-input {
    min-height: 120px;
    margin: 0;
    overflow: auto;
    resize: none;
}

.order-detail-window.is-readonly-order .address-form input[readonly] {
    background: #f7f8f9;
    color: #252b31;
    cursor: text;
}

.history-comment {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.history-comment a {
    color: var(--blue);
    text-decoration: underline;
}

.history-comment table {
    max-width: 100%;
    border-collapse: collapse;
    white-space: normal;
}

.history-comment th,
.history-comment td {
    border: 1px solid var(--line);
    padding: 4px 6px;
}

.order-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
}

.order-product-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.order-product-card.is-selected {
	box-shadow: 0 0 0 2px rgba(47, 57, 67, .28);
}

.order-product-card-select {
	position: absolute;
	z-index: 4;
	top: 9px;
	left: 9px;
	display: grid;
	width: 25px;
	height: 25px;
	place-items: center;
	cursor: pointer;
}

.order-product-card-select input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.order-product-card-select span {
	display: grid;
	width: 19px;
	height: 19px;
	place-items: center;
	border: 1px solid #6e7781;
	border-radius: 4px;
	background: rgba(255, 255, 255, .96);
	color: transparent;
	font-size: 9px;
	box-shadow: 0 3px 10px rgba(24, 27, 32, .12);
}

.order-product-card-select input:checked + span {
	border-color: #20262c;
	background: #20262c;
	color: #fff;
}

.order-product-card-select input:focus-visible + span {
	outline: 2px solid rgba(32, 38, 44, .35);
	outline-offset: 2px;
}

.order-product-card.is-place-editing {
    z-index: 21;
    max-height: min(var(--place-editor-max-height, 680px), calc(100dvh - 80px));
    grid-column: span 2;
    overflow-x: hidden;
    overflow-y: scroll;
    border-color: #8b949e;
    box-shadow: 0 8px 24px rgba(24, 27, 32, 0.1);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.order-product-card.is-place-editing > .order-product-card-select {
	display: none;
}

.order-product-image {
    position: relative;
    display: grid;
    min-height: 130px;
    place-items: center;
    border: 2px solid var(--line);
    border-radius: 5px;
    background: var(--surface-muted);
    padding: 8px 8px 36px;
}

.order-product-image img {
    display: block;
    width: min(100%, 130px);
    height: auto;
    object-fit: contain;
}

.order-product-zoom {
    position: absolute;
    z-index: 2;
	bottom: 76px;
    left: 8px;
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #68737e;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    padding: 0;
    color: #303840;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.12);
    transition: opacity 140ms ease, transform 140ms ease;
}

.order-product-zoom:hover,
.order-product-zoom:focus-visible {
    border-color: #111;
    background: #fff;
    color: #111;
    outline: none;
}

.order-product-photo {
    position: absolute;
    z-index: 2;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    min-width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid #68737e;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    padding: 0 7px;
    color: #303840;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.12);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.order-product-photo.active {
    border-color: #4f83ba;
    background: #e9f1fb;
    color: #245f9e;
}

.order-product-photo-gallery {
    position: absolute;
    z-index: 2;
    bottom: 42px;
    left: 8px;
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #8a6700;
    border-radius: 4px;
    background: #b8860b;
    padding: 0;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.16);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.order-product-photo-gallery:hover,
.order-product-photo-gallery:focus-visible {
    border-color: #604800;
    background: #8f6805;
    color: #fff;
    outline: none;
}

.order-product-photo:hover,
.order-product-photo:focus-visible {
    border-color: #111;
    background: #fff;
    color: #111;
    outline: none;
}

.order-product-photo.is-readonly,
.order-product-place-badge.is-readonly {
    cursor: default;
}

.order-product-lock-badge {
    position: absolute;
    z-index: 2;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    min-height: 25px;
    max-width: calc(50% - 12px);
    align-items: center;
    gap: 5px;
    overflow: hidden;
    border-radius: 4px;
    background: #c62828;
    padding: 0 7px;
    color: #fff;
    font-size: 8px;
    font-style: normal;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.12);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.order-product-lock-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-product-lock-badge.is-label-lock {
    background: #111;
}

.order-product-id {
    position: absolute;
    z-index: 2;
    bottom: 8px;
    left: 50%;
    translate: -50% 0;
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    border: 1px solid #7e8791;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.94);
    padding: 3px 6px;
    color: #303840;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.1);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.order-product-place-badge {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: inline-flex;
    overflow: hidden;
    max-width: calc(100% - 16px);
    min-height: 26px;
    align-items: center;
    gap: 5px;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.1);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}

.order-product-place-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-product-place-badge .order-product-place-icon {
    position: relative;
    display: inline-grid;
    width: 15px;
    height: 12px;
    overflow: visible;
    flex: 0 0 15px;
    place-items: center;
}

.order-product-place-icon-check {
    position: absolute;
    top: -5px;
    right: -2px;
    display: grid;
    width: 10px;
    height: 10px;
    place-items: center;
    border-radius: 50%;
    background: #196c35;
    color: #fff;
    font-size: 6px;
}

.order-product-place-close {
    position: absolute;
    z-index: 3;
    top: 8px;
    right: 8px;
    display: none;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid #8d959e;
    border-radius: 50%;
    background: #fff;
    padding: 0;
    color: #111;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(24, 27, 32, 0.12);
}

.order-product-place-close:hover,
.order-product-place-close:focus-visible {
    border-color: #111;
    background: #f0f2f4;
    outline: none;
}

.order-product-card.is-place-editing .order-product-place-close {
    display: grid;
}

.order-product-card.is-place-editing .order-product-place-badge {
    right: 52px;
    max-width: calc(100% - 60px);
}

.order-product-card.is-place-editing .order-product-price-control {
    display: none;
}

.order-product-place-badge.is-unordered,
.order-product-place-status-select.is-unordered {
    border-color: #aeb5bd;
    background: #f1f3f5;
    color: #505862;
}

.order-product-image.is-unordered {
    border-color: transparent;
}

.order-product-place-badge.is-ordered,
.order-product-place-status-select.is-ordered {
    border-color: #55a96b;
    background: #e7f5eb;
    color: #196c35;
}

.order-product-image.is-ordered {
    border-color: #55a96b;
}

.order-product-place-badge.is-frozen,
.order-product-place-status-select.is-frozen {
    border-color: #83c9d7;
    background: #e4f7fb;
    color: #08758e;
}

.order-product-image.is-frozen {
    border-color: #83c9d7;
}

.order-product-place-badge.is-picked,
.order-product-place-status-select.is-picked {
    border-color: #111;
    background: #1f2328;
    color: #fff;
}

.order-product-image.is-picked {
    border-color: #111;
}

.order-product-place-badge.is-out-of-stock,
.order-product-place-status-select.is-out-of-stock {
    border-color: #df9296;
    background: #fde7e8;
    color: #a81e24;
}

.order-product-image.is-out-of-stock {
    border-color: #df9296;
}

.order-product-place-badge.is-shipped,
.order-product-place-status-select.is-shipped {
    border-color: #C3C3C3;
    background: #f1f1d6;
    color: #C3C3C3;
}

.order-product-image.is-shipped {
    border-color: #C3C3C3;
}

.order-product-place-badge.is-unknown,
.order-product-place-status-select.is-unknown {
    border-color: #e0b66c;
    background: #fff1d8;
    color: #8a4d00;
}

.order-product-image.is-unknown {
    border-color: #e0b66c;
}

.order-product-card-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    font-size: 10px;
    line-height: 1.4;
}

.order-product-model,
.order-product-options,
.order-product-price {
    overflow-wrap: anywhere;
}

.order-product-model {
    font-size: 11px;
    font-weight: 400;
}

.order-product-place {
    min-width: 0;
    padding-top: 7px;
}

.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-place-badge,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-id,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-zoom,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-photo,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-photo-gallery {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
}

.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:hover .order-product-place-badge,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:hover .order-product-id,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:hover .order-product-zoom,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:hover .order-product-photo,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:hover .order-product-photo-gallery,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:focus-within .order-product-place-badge,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:focus-within .order-product-id,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:focus-within .order-product-zoom,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:focus-within .order-product-photo,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-editing) .order-product-image:focus-within .order-product-photo-gallery {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-note-revealed) .order-product-place-notes,
.order-commerce-section:not(.is-place-status-visible) .order-product-card:not(.is-place-note-revealed) .order-product-place-summary.has-notes:not(.has-tracking) {
    display: none;
}

.order-window-body.is-place-editor-open {
    overflow: hidden;
}

.order-product-place-backdrop {
    position: absolute;
    z-index: 20;
    top: var(--place-backdrop-top, 0);
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(244, 247, 249, 0.5);
    padding: 0;
    cursor: default;
    -webkit-backdrop-filter: blur(3px) saturate(0.75);
    backdrop-filter: blur(3px) saturate(0.75);
}

.order-product-place-backdrop:focus {
    outline: none;
}

.order-product-place-summary {
    display: grid;
    min-width: 0;
    min-height: 28px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 6px;
}

.order-product-place-summary[hidden],
.order-product-place-editor[hidden],
.order-product-place-tracking-warning[hidden] {
    display: none;
}

.order-product-place-summary-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.order-product-place-notes {
    display: grid;
    min-width: 0;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    border-left: 3px solid #e5b84b;
    border-radius: 4px;
    background: #fff6cf;
    padding: 6px 7px;
    color: #9b2c2c;
    font-size: 10px;
    line-height: 1.45;
}

.order-product-place-notes i {
    margin-top: 2px;
    color: #b47a00;
}

.order-product-place-notes span {
    display: -webkit-box;
    overflow: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.order-product-tracking {
    display: grid;
    min-width: 0;
    grid-template-columns: 14px auto minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    color: #34404c;
    font-size: 9px;
    line-height: 1.45;
}

.order-product-tracking > i {
    margin-top: 2px;
    color: #16803a;
}

.order-product-tracking.is-new-tracking > i {
    color: #1769c2;
}

.order-product-tracking-label {
    color: var(--text-soft);
    font-weight: 650;
}

.order-product-tracking-links {
    min-width: 0;
    overflow-wrap: anywhere;
}

.order-product-tracking-links a {
    color: #1769c2;
    text-decoration: none;
}

.order-product-tracking-links a:hover,
.order-product-tracking-links a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.order-product-place-tools {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.order-product-place-tool {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 0;
    border-radius: 4px;
    background: #f0f2f4;
    padding: 0;
    color: #4c5661;
    cursor: pointer;
}

.order-product-place-tool:hover,
.order-product-place-tool:focus-visible {
    background: #e1e5e9;
    color: #111;
    outline: none;
}

.order-product-place-duplicate {
    display: inline-grid;
    width: 24px;
    height: 28px;
    place-items: center;
    color: var(--red);
}

.order-product-place-editor {
    min-width: 0;
    border-radius: 5px;
    background: #f5f7f8;
    padding: 9px;
}

.order-product-place-fields {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.order-product-place-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.order-product-place-field.field-status,
.order-product-place-field.field-print-lock,
.order-product-place-field.field-notes {
    grid-column: 1 / -1;
}

.order-product-place-field > span {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 650;
}

.order-product-place-field input,
.order-product-place-field select,
.order-product-place-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 8px;
    color: #111;
    font-size: 11px;
    outline: none;
}

.order-product-place-field input,
.order-product-place-field select {
    height: 38px;
}

.order-product-place-field select {
    padding-right: 28px;
    font-weight: 700;
}

.order-product-place-field textarea {
    min-height: 86px;
    padding-block: 8px;
    line-height: 1.5;
    resize: vertical;
}

.order-product-place-field .order-product-place-notes-input {
    color: #b42127;
    font-size: 14px;
    line-height: 1.55;
}

.order-product-place-field input:focus,
.order-product-place-field select:focus,
.order-product-place-field textarea:focus {
    border-color: #656e79;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.order-product-place-tracking-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--red);
    font-size: 10px;
}

.order-product-place-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 10px;
}

.order-product-place-editor-actions .button {
    min-height: 36px;
}

.order-product-options {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    color: var(--text-soft);
    font-size: 11px;
}

.order-product-option,
.order-product-quantity {
    overflow-wrap: anywhere;
}

.order-product-quantity {
    color: var(--red);
    font-weight: 650;
}

.order-product-select-option {
    min-width: 0;
    color: #111;
    font-size: 13px;
}

.order-select-option-display,
.order-select-option-editor {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

.order-select-option-display[hidden],
.order-select-option-editor[hidden] {
    display: none;
}

.order-select-option-current {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.order-select-option-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    flex: 1 1 auto;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 25px 0 7px;
    color: #111;
    font-size: 13px;
}

.order-option-tool {
    display: inline-grid;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: #eef2f5;
    color: #303943;
    cursor: pointer;
}

.order-option-tool:hover,
.order-option-tool:focus-visible {
    background: #dfe7ed;
    color: #111;
    outline: none;
}

.order-option-tool:disabled {
    cursor: default;
    opacity: 0.45;
}

.save-order-select-option {
    color: #167647;
}

.cancel-order-select-option {
    color: var(--red);
}

.order-product-price-control,
.total-money-input {
    display: flex;
    min-width: 0;
    align-items: center;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
}

.order-product-price-control {
    overflow: hidden;
}

.total-money-input {
    overflow: hidden;
}

.order-product-price-control {
    width: 100%;
    margin-top: 2px;
}

.money-input-prefix {
    display: inline-flex;
    min-width: 27px;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
    padding: 0 6px;
    color: #4b5560;
    font-size: 11px;
    font-weight: 650;
}

.order-item-price-input,
.order-discount-input {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 0;
    background: transparent;
    padding: 0 7px;
    color: #111;
    font-size: 12px;
    font-weight: 500;
    outline: none;
}

.order-product-price-control:focus-within,
.total-money-input:focus-within {
    border-color: #656e79;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.address-section {
    overflow: visible;
}

.address-stack {
    border: 1px solid var(--line);
}

.address-form {
    min-width: 0;
}

.address-form + .address-form {
    border-top: 1px solid var(--line);
}

.address-form-header {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 14px;
    background: var(--surface-muted);
}

.address-form h4 {
    margin: 0;
    font-size: 12px;
}

.address-collapse-toggle,
.detail-section-toggle,
.order-detail-refresh,
.order-access-block {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.address-collapse-toggle:hover,
.address-collapse-toggle:focus-visible,
.detail-section-toggle:hover,
.detail-section-toggle:focus-visible,
.order-detail-refresh:hover,
.order-detail-refresh:focus-visible,
.order-access-block:hover,
.order-access-block:focus-visible {
    background: #e7ebef;
    color: var(--text);
    outline: none;
}

.address-collapse-toggle i,
.detail-section-toggle i {
    transition: transform 160ms ease;
}

.address-collapse-toggle[aria-expanded="true"] i,
.detail-section-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.order-detail-refresh.is-loading i {
    animation: spin 700ms linear infinite;
}

.order-access-block {
	color: #b42318;
}

.order-access-block.is-cancel {
	color: #475467;
}

.access-block-danger {
	display: inline-grid;
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	place-items: center;
	color: #d92d20;
	font-size: 15px;
}

.order-summary-section > header .access-block-danger {
	width: 32px;
	height: 32px;
	flex-basis: 32px;
	font-size: 16px;
}

.access-block-toolbar,
.access-block-toolbar form,
.access-block-record > header,
.access-block-record > footer,
.access-block-pagination {
	display: flex;
	align-items: center;
}

.access-block-toolbar {
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 12px;
}

.access-block-toolbar form {
	min-width: 0;
	flex: 1;
	gap: 8px;
}

.access-block-toolbar input,
.access-block-toolbar select,
.access-block-field input,
.access-block-field textarea {
	border: 1px solid #aeb7c2;
	border-radius: 5px;
	background: #fff;
	color: var(--text);
	font: inherit;
}

.access-block-toolbar input {
	width: min(480px, 55vw);
	height: 36px;
	padding: 0 10px;
}

.access-block-toolbar select {
	height: 36px;
	padding: 0 30px 0 10px;
}

.access-block-summary {
	min-height: 24px;
	margin-bottom: 8px;
	color: var(--text-soft);
	font-size: 12px;
}

.access-block-list {
	display: grid;
	gap: 14px;
}

.access-block-record {
	border: 1px solid var(--line-strong);
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

.access-block-record > header,
.access-block-record > footer {
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	background: var(--surface-muted);
}

.access-block-record-title,
.access-block-record > footer > div,
.access-block-status-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
}

.access-block-record-title > i {
	color: #b42318;
}

.access-block-order-link {
	border: 0;
	background: transparent;
	color: #175cd3;
	font-weight: 700;
	cursor: pointer;
}

.access-block-status-toggle {
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
}

.access-block-status-toggle input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: #b42318;
}

.access-block-fields {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	padding: 12px;
}

.access-block-field {
	display: grid;
	min-width: 0;
	gap: 5px;
}

.access-block-field.is-full {
	grid-column: 1 / -1;
}

.access-block-field > span {
	color: var(--text-soft);
	font-size: 11px;
	font-weight: 700;
}

.access-block-field input,
.access-block-field textarea {
	width: 100%;
	padding: 8px 9px;
	line-height: 1.4;
	resize: vertical;
}

.access-block-review {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 12px 12px;
	padding: 9px 10px;
	border-left: 3px solid #f79009;
	background: #fffaeb;
	color: #7a2e0e;
	font-size: 12px;
}

.access-block-record-meta {
	color: var(--text-soft);
	font-size: 11px;
}

.access-block-pagination {
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
	font-size: 12px;
}

@media (max-width: 900px) {
	.access-block-fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.access-block-toolbar,
	.access-block-toolbar form {
		align-items: stretch;
		flex-direction: column;
	}

	.access-block-toolbar input {
		width: 100%;
	}

	.access-block-fields {
		grid-template-columns: 1fr;
	}

	.access-block-field.is-full {
		grid-column: auto;
	}
}

.mobile-address-collapse-toggle {
    display: none;
}

.address-form-body {
    padding: 14px;
}

.address-form-body[hidden] {
    display: none;
}

.address-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 11px 10px;
}

.address-field {
    display: block;
    min-width: 0;
}

.address-field.field-full {
    grid-column: 1 / -1;
}

.address-field.field-half {
    grid-column: span 3;
}

.address-field.field-third {
    grid-column: span 2;
}

.address-field-control {
    position: relative;
}

.address-field input {
    width: 100%;
    height: 50px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 17px 10px 3px;
    color: #111111;
    font-size: 14px;
    font-weight: 400;
}

.address-field input[name="fax"] {
    color: var(--red);
}

.address-field-control.has-action input {
    padding-right: 44px;
}

.address-floating-label {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 10px;
    left: 10px;
    overflow: hidden;
    color: #858d98;
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateY(-50%);
    transform-origin: left top;
    transition: top 160ms ease, font-size 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.address-field-control.has-action .address-floating-label {
    right: 44px;
}

.address-field input:focus + .address-floating-label,
.address-field input:not(:placeholder-shown) + .address-floating-label {
    top: 7px;
    font-size: 9px;
    transform: none;
}

.address-field input:focus {
    border-color: #656e79;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07);
}

.address-field-action {
    position: absolute;
    top: 9px;
    right: 4px;
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    text-decoration: none;
}

.address-field-action:hover,
.address-field-action:focus-visible {
    background: var(--blue-soft);
    outline: none;
}

.address-whatsapp-action {
    color: #1e9e58;
}

.address-whatsapp-action:hover,
.address-whatsapp-action:focus-visible {
    background: #e8f8ee;
    color: #128c4a;
}

.address-field-action.is-disabled {
    color: #a4abb4;
    cursor: default;
}

.address-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.address-actions .copy-shipping-address,
.address-actions .copy-payment-to-shipping {
    margin-right: auto;
}

@media (min-width: 621px) {
    .address-form.is-mobile-collapsible > .address-form-body[hidden] {
        display: block;
    }
}

@container order-detail-body (max-width: 1000px) {
    .order-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@container order-detail-body (max-width: 900px) {
    .detail-grid.order-summary-grid,
    .detail-grid.metadata-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-summary-grid .detail-item-empty {
        display: none;
    }

    .address-field.field-third {
        grid-column: span 3;
    }
}

@container order-detail-body (max-width: 760px) {
    .order-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container order-detail-body (max-width: 650px) {
    .order-workspace-columns {
        grid-template-columns: 1fr;
    }

    .order-products-column {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .address-field.field-half,
    .address-field.field-third {
        grid-column: 1 / -1;
    }
}

@container order-detail-body (max-width: 480px) {
    .detail-grid.order-summary-grid,
    .detail-grid.metadata-grid {
        grid-template-columns: 1fr;
    }

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

    .order-product-place-fields {
        grid-template-columns: 1fr;
    }

    .order-product-place-field.field-status,
    .order-product-place-field.field-print-lock,
    .order-product-place-field.field-notes {
        grid-column: auto;
    }
}

.totals-section {
    overflow: visible;
}

.totals-list {
    width: min(100%, 420px);
    margin-left: auto;
}

.total-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    padding: 10px 4px;
    font-size: 11px;
}

.total-final {
    border-bottom: 0;
    font-size: 14px;
    font-weight: 750;
}

.confirm-layer {
    position: fixed;
    z-index: 11000;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(17, 20, 24, 0.48);
    padding: 18px;
}

.order-product-image-preview-layer {
    position: fixed;
    z-index: 3200;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(10, 13, 16, 0.84);
    padding: 28px;
}

body:has(.order-product-image-preview-layer:not([hidden])) {
    overflow: hidden;
}

.order-product-image-preview-image {
    display: block;
    width: auto;
    max-width: min(1400px, calc(100vw - 56px));
    height: auto;
    max-height: calc(100dvh - 56px);
    object-fit: contain;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.38);
}

.close-order-product-image-preview {
    position: fixed;
    z-index: 1;
    top: 16px;
    right: 16px;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(20, 24, 28, 0.82);
    padding: 0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.close-order-product-image-preview:hover,
.close-order-product-image-preview:focus-visible {
    border-color: #fff;
    background: #fff;
    color: #111;
    outline: none;
}

.confirm-dialog {
    width: min(100%, 390px);
    border: 1px solid var(--line-dark);
    border-radius: 8px;
    background: #fff;
    padding: 26px;
    box-shadow: 0 22px 60px rgba(17, 20, 24, 0.24);
    text-align: center;
}

.confirm-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 50%;
    background: var(--red-soft);
    color: var(--red);
    font-size: 18px;
}

.confirm-dialog h2 {
    margin: 0;
    font-size: 17px;
}

.confirm-dialog p {
    margin: 12px 0 22px;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.7;
}

.confirm-reason-field {
    display: flex;
    margin: -8px 0 20px;
    flex-direction: column;
    gap: 7px;
    text-align: left;
}

.confirm-reason-field[hidden] { display: none; }
.confirm-reason-field span { color: #5f6872; font-size: 10px; font-weight: 700; }
.confirm-reason-field textarea { width: 100%; min-height: 72px; resize: vertical; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; padding: 8px 9px; color: var(--text); font: inherit; font-size: 11px; line-height: 1.45; }
.confirm-reason-field textarea:focus { border-color: #54606c; outline: 2px solid rgba(84,96,108,.12); outline-offset: 0; }

.confirm-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}

.mail-panel {
    height: calc(100vh - 82px);
    min-height: 620px;
}

.mail-toolbar {
    display: grid;
    min-height: 62px;
    align-items: center;
    grid-template-columns: minmax(280px, 1fr) minmax(220px, 420px) minmax(180px, 1fr);
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 9px 14px;
}

.mail-account-control,
.mail-toolbar-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.mail-account-control > label {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

.mail-account-control select {
    width: min(100%, 310px);
    height: 38px;
    min-width: 0;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    padding: 0 32px 0 11px;
    color: var(--text);
    font-size: 11px;
}

.mail-connection-state {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: var(--text-soft);
    font-size: 9px;
    white-space: nowrap;
}

.mail-connection-state > i,
.mail-account-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #a8afb8;
}

.mail-connection-state.connected > i,
.mail-connection-state.ready > i,
.mail-account-status-dot.connected,
.mail-account-status-dot.ready { background: var(--green); }
.mail-connection-state.error > i,
.mail-account-status-dot.error { background: var(--red); }
.mail-connection-state.testing > i,
.mail-connection-state.pending > i,
.mail-account-status-dot.testing,
.mail-account-status-dot.pending { background: #e0a11a; }

.mail-search {
    position: relative;
    min-width: 0;
}

.mail-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #858d98;
    font-size: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.mail-search input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: var(--surface-muted);
    padding: 0 38px 0 36px;
    color: var(--text);
    font-size: 11px;
}

.mail-search input:focus {
    border-color: #7d858f;
    background: #fff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.06);
}

.mail-search button {
    position: absolute;
    top: 50%;
    right: 5px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transform: translateY(-50%);
}

.mail-toolbar-actions {
    justify-content: flex-end;
}

.mail-toolbar-actions .icon-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 15px;
}

.mail-layout {
    display: grid;
    height: calc(100% - 62px);
    min-height: 0;
    grid-template-columns: 205px 360px minmax(0, 1fr);
}

.mail-folder-pane,
.mail-thread-pane,
.mail-reader-pane {
    min-width: 0;
    min-height: 0;
}

.mail-folder-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
}

.mail-folder-pane > header,
.mail-list-header {
    display: flex;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 14px;
}

.mail-folder-pane > header strong,
.mail-list-header strong {
    font-size: 12px;
}

#mail-folder-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 10px;
}

.mail-folder-item {
    display: grid;
    width: 100%;
    min-height: 42px;
    align-items: center;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 0 10px;
    color: #4e5661;
    cursor: pointer;
    text-align: left;
}

.mail-folder-item:hover {
    background: #eceff2;
    color: var(--text);
}

.mail-folder-item.active {
    background: var(--ink);
    color: #fff;
}

.mail-folder-item > i {
    text-align: center;
}

.mail-folder-item > span {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-folder-item > small {
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 99px;
    color: inherit;
    font-size: 9px;
}

.mail-folder-item:not(.active) > small:not(:empty) {
    background: #dde2e7;
}

.mail-worker-state {
    border-top: 1px solid var(--line);
    padding: 12px 14px;
    color: var(--text-soft);
    font-size: 9px;
    line-height: 1.5;
}

.mail-worker-state.error { color: var(--red); }
.mail-folders-empty { padding: 20px 8px; color: var(--text-soft); font-size: 10px; line-height: 1.6; }

.mail-thread-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #fff;
}

.mail-list-header > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.mail-list-header span {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 9px;
}

.mail-thread-list {
    flex: 1 1 auto;
    overflow-y: auto;
}

.mail-thread-item {
    display: grid;
    width: 100%;
    min-height: 92px;
    align-items: start;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    padding: 13px 14px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.mail-thread-item:hover { background: #fafbfc; }
.mail-thread-item.active { background: #edf3f8; }
.mail-thread-item.unread { background: #f4f8fc; }
.mail-thread-item.unread strong,
.mail-thread-item.unread .mail-thread-subject > span { font-weight: 750; }

.mail-thread-avatar,
.mail-message-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e8ecef;
    color: #4c545f;
    font-size: 11px;
    font-weight: 750;
}

.mail-thread-item.unread .mail-thread-avatar {
    background: #d8e8f6;
    color: var(--blue);
}

.mail-thread-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.mail-thread-top,
.mail-thread-subject {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.mail-thread-top strong,
.mail-thread-subject > span,
.mail-thread-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-thread-top strong {
    flex: 1 1 auto;
    font-size: 11px;
    font-weight: 600;
}

.mail-thread-top time {
    flex: 0 0 auto;
    color: var(--text-soft);
    font-size: 9px;
}

.mail-thread-subject {
    margin-top: 7px;
}

.mail-thread-subject > span {
    font-size: 11px;
}

.mail-thread-subject small {
    display: grid;
    min-width: 17px;
    height: 17px;
    place-items: center;
    border-radius: 50%;
    background: #e9ecef;
    color: #5c6470;
    font-size: 8px;
}

.mail-thread-subject > i {
    color: var(--text-soft);
    font-size: 9px;
}

.mail-thread-preview {
    margin-top: 7px;
    color: var(--text-soft);
    font-size: 9px;
}

.mail-pagination {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-top: 1px solid var(--line);
}

.mail-pagination:empty { display: none; }

.mail-pagination button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.mail-pagination button:disabled { cursor: default; opacity: 0.35; }
.mail-pagination span { color: var(--text-soft); font-size: 9px; }

.mail-reader-pane {
    overflow-y: auto;
    background: #fff;
}

.mail-reader-empty {
    display: flex;
    height: 100%;
    min-height: 350px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-soft);
    text-align: center;
}

.mail-reader-empty > i { margin-bottom: 18px; color: #c2c8cf; font-size: 42px; }
.mail-reader-empty strong { color: #4d5560; font-size: 13px; }
.mail-reader-empty span { margin-top: 7px; font-size: 10px; }

.mail-reader-header {
    position: sticky;
    z-index: 3;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    padding: 10px 18px;
}

.mail-reader-header > div {
    min-width: 0;
    flex: 1 1 auto;
}

.mail-reader-header h2 {
    overflow: hidden;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-reader-header span {
    display: block;
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 9px;
}

.mail-message-list { padding: 0 18px 24px; }

.mail-message {
    border-bottom: 1px solid var(--line);
    padding: 20px 0;
}

.mail-message:last-child { border-bottom: 0; }

.mail-message-header {
    display: grid;
    align-items: center;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
}

.mail-message-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.mail-message-meta strong,
.mail-message-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-message-meta strong { font-size: 13px; }
.mail-message-meta span { margin-top: 4px; color: var(--text-soft); font-size: 11px; }
.mail-message-header time { color: var(--text-soft); font-size: 11px; white-space: nowrap; }

.mail-message-body { margin: 18px 0 0; }

.mail-text-body {
    margin: 18px 0 0 48px;
    border: 0;
    background: transparent;
    color: #24282e;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mail-html-frame {
    display: block;
    width: 100%;
    min-height: 120px;
    overflow: hidden;
    border: 0;
    background: #fff;
    color-scheme: light;
}

.mail-load-images { margin-bottom: 12px; }

.mail-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0 48px;
}

.mail-attachment {
    display: flex;
    min-width: 180px;
    max-width: 320px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    padding: 9px 11px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.mail-attachment:hover { border-color: var(--line-dark); background: #fff; }
.mail-attachment.loading > i:first-child { animation: pulse 900ms infinite; }
.mail-attachment > span { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.mail-attachment strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mail-attachment small { margin-top: 3px; color: var(--text-soft); font-size: 8px; }

.modal-layer {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(17, 20, 24, 0.46);
    padding: 18px;
}

.order-product-photo-layer {
    z-index: 3000;
    background: rgba(241, 244, 247, 0.74);
    -webkit-backdrop-filter: blur(5px) saturate(0.8);
    backdrop-filter: blur(5px) saturate(0.8);
}

.order-product-photo-dialog {
    display: flex;
    width: min(920px, calc(100vw - 36px));
    height: min(760px, calc(100dvh - 36px));
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #9da7b1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 24px 74px rgba(18, 21, 25, 0.28);
}

.order-product-photo-dialog .modal-bar > div > span {
    color: #dce3e9;
    font-size: 10px;
    font-weight: 700;
}

.order-product-photo-toolbar {
    display: flex;
    min-height: 55px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    padding: 9px 14px;
}

.order-product-photo-product-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.order-product-photo-product-summary img {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    object-fit: contain;
    overflow: hidden;
    border: 1px solid #aeb6bf;
    border-radius: 6px;
    background: #f4f6f8;
    padding: 2px;
}

.order-product-photo-product-summary img[hidden] { display: none; }

.order-product-photo-product-summary > strong {
    min-width: 0;
    overflow: hidden;
    color: #303840;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-product-photo-toolbar label { cursor: pointer; }
.order-product-photo-layer.is-uploading .order-product-photo-toolbar label { opacity: .55; pointer-events: none; }
.order-product-photo-layer.is-dragging .order-product-photo-dialog { border-color: #b8860b; box-shadow: 0 0 0 4px rgba(184, 134, 11, .15), 0 24px 74px rgba(18, 21, 25, .28); }

.order-product-photo-list {
    display: grid;
    min-height: 0;
    flex: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    gap: 14px;
    overflow-y: auto;
    padding: 14px;
}

.order-product-photo-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #c9d0d7;
    border-radius: 6px;
    background: #fff;
}

.order-product-photo-thumb {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid #d7dce1;
    background: #f4f6f8;
    padding: 7px;
    cursor: zoom-in;
}

.order-product-photo-thumb:hover,
.order-product-photo-thumb:focus-visible { background: #e9edf1; outline: 2px solid #7d8791; outline-offset: -2px; }
.order-product-photo-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.order-product-photo-item-actions { display: flex; min-width: 0; min-height: 39px; align-items: center; gap: 5px; padding: 5px 6px 5px 8px; }
.order-product-photo-item-meta { min-width: 0; flex: 1; overflow: hidden; color: #66717b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.order-product-photo-item-actions .icon-button { width: 28px; height: 28px; flex: 0 0 28px; color: #b1262e; }
.order-product-photo-empty { display: grid; min-height: 260px; grid-column: 1 / -1; place-items: center; align-content: center; gap: 10px; color: #7a848e; }
.order-product-photo-empty i { font-size: 30px; }
.order-product-photo-empty strong { font-size: 12px; }

@media (max-width: 720px) {
    .order-product-photo-layer { padding: 0; }
    .order-product-photo-dialog { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
    .order-product-photo-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
    .order-product-photo-toolbar { padding-inline: 10px; }
}

body:has(.modal-layer:not([hidden])) {
    overflow: hidden;
}

.mail-compose-dialog,
.mail-settings-dialog {
    display: flex;
    overflow: hidden;
    width: min(100%, 760px);
    max-height: calc(100vh - 36px);
    flex-direction: column;
    border: 1px solid #40464f;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(18, 21, 25, 0.28);
}

.mail-settings-dialog { width: min(100%, 1120px); }

.modal-bar {
    display: flex;
    min-height: 52px;
    flex: 0 0 52px;
    align-items: center;
    justify-content: space-between;
    background: var(--ink);
    padding: 0 10px 0 18px;
    color: #fff;
}

.modal-bar > div { display: flex; align-items: center; gap: 10px; }
.modal-bar strong { font-size: 13px; }

.mail-compose-form {
    display: grid;
    overflow-y: auto;
    grid-template-columns: 1fr;
}

.mail-compose-form > label,
.mail-account-form-grid > label {
    display: grid;
    min-width: 0;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.mail-compose-form label > span,
.mail-account-form-grid label > span {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 650;
}

.mail-compose-form > label > span { padding-left: 18px; }

.mail-compose-form input,
.mail-compose-form select,
.mail-compose-form textarea {
    width: 100%;
    border: 0;
    background: #fff;
    padding: 0 14px;
    color: var(--text);
    outline: 0;
    font-size: 12px;
}

.mail-compose-form input,
.mail-compose-form select { height: 47px; }
.mail-compose-form textarea { min-height: 280px; padding-block: 14px; line-height: 1.6; resize: vertical; }
.mail-body-field { align-items: start !important; }
.mail-body-field > span { padding-top: 17px; }

.mail-compose-footer {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.mail-file-button {
    display: inline-flex;
    height: 40px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    padding: 0 13px;
    cursor: pointer;
    font-size: 10px;
}

.mail-file-button input { display: none; }
.mail-file-summary { flex: 1 1 auto; color: var(--text-soft); font-size: 9px; }

.mail-settings-layout {
    display: grid;
    min-height: 570px;
    grid-template-columns: 270px minmax(0, 1fr);
}

.mail-account-list-wrap {
    display: flex;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
    padding: 14px;
}

.mail-account-list-wrap > .button { width: 100%; margin-bottom: 12px; }
.mail-account-list { overflow-y: auto; }

.mail-account-list-item {
    display: grid;
    width: 100%;
    min-height: 58px;
    align-items: center;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    gap: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 8px 10px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.mail-account-list-item:hover { background: #eceff2; }
.mail-account-list-item.active { background: #dfe5ea; }
.mail-account-list-item > i { color: var(--text-soft); }

.mail-account-list-copy { display: flex; min-width: 0; flex-direction: column; }
.mail-account-list-copy strong,
.mail-account-list-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-account-list-copy strong { font-size: 11px; }
.mail-account-list-copy small { margin-top: 4px; color: var(--text-soft); font-size: 9px; }

.mail-account-form {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow-y: auto;
    padding: 22px;
}

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

.mail-account-form-grid > label {
    align-items: start;
    grid-template-columns: 1fr;
    border: 0;
    gap: 7px;
}

.mail-account-form-grid input,
.mail-account-form-grid select {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    padding: 0 11px;
    color: var(--text);
    font-size: 11px;
}

.mail-account-form-grid input:focus,
.mail-account-form-grid select:focus {
    border-color: #707985;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.06);
}

.mail-account-switches {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    border-top: 1px solid var(--line);
    margin-top: 22px;
    padding-top: 18px;
}

.mail-account-switches label { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.mail-account-switches input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }

.mail-account-form-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding-top: 24px;
}

#mail-account-form-status {
    flex: 1 1 auto;
    color: var(--text-soft);
    font-size: 9px;
    line-height: 1.5;
}

#mail-account-form-status.error { color: var(--red); }
#mail-account-form-status.connected,
#mail-account-form-status.ready { color: var(--green); }

.mail-mobile-only,
.mail-mobile-close { display: none; }

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

@keyframes pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@keyframes new-order-highlight {
    0%, 35% { background: #dcecf8; }
    100% { background: transparent; }
}

@media (min-width: 901px) {
    .sidebar-brand,
    .topbar {
        height: 58px;
    }

    .sidebar-brand {
        flex-basis: 58px;
    }

    .content {
        padding: 12px 30px;
    }

    .order-table-panel {
        display: flex;
        height: calc(100vh - 82px);
        flex-direction: column;
    }

    .order-panel-header {
        min-height: 54px;
        padding: 7px 16px;
    }

    .order-table-scroll {
        max-height: none;
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
    }

}

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

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

    .mail-layout {
        grid-template-columns: 175px 310px minmax(0, 1fr);
    }

    .mail-connection-state span {
        display: none;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: min(286px, calc(100vw - 52px));
        box-shadow: 10px 0 30px rgba(20, 24, 28, 0.14);
        transform: translateX(-105%);
        transition: transform 220ms ease;
    }

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

    .workspace {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid;
    }

    .topbar-mobile-title {
        display: flex;
    }

    .topbar-mobile-title strong {
        font-size: 20px;
    }

    .topbar-notification-badge {
        margin-left: 0;
    }

    .topbar {
        height: 66px;
        padding: 0 18px;
    }

    .content {
        padding: 22px 18px 32px;
    }

    .order-panel-header {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .order-actions {
        grid-row: 2;
        justify-self: stretch;
        width: 100%;
    }

    .order-search-toolbar {
        width: 100%;
        grid-row: 1;
        justify-self: stretch;
    }

    .selected-order-label {
        margin-right: auto;
    }

    .order-table-scroll {
        max-height: none;
    }

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

    .mail-panel {
        height: calc(100vh - 110px);
        height: calc(100dvh - 110px);
        min-height: 560px;
    }

    .mail-toolbar {
        min-height: 116px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 10px;
    }

    .mail-account-control {
        grid-column: 1 / -1;
    }

    .mail-account-control > label {
        display: none;
    }

    .mail-account-control select {
        max-width: none;
        flex: 1 1 auto;
    }

    .mail-search {
        grid-column: 1;
    }

    .mail-toolbar-actions {
        grid-column: 2;
    }

    .mail-toolbar-actions .button span {
        display: none;
    }

    .mail-toolbar-actions .button {
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

    .mail-layout {
        display: grid;
        height: calc(100% - 116px);
        grid-template-columns: minmax(0, 1fr);
    }

    .mail-mobile-pane {
        display: none;
        grid-area: 1 / 1;
        border-right: 0;
    }

    .mail-folder-pane.mobile-active,
    .mail-thread-pane.mobile-active {
        display: flex;
    }

    .mail-reader-pane.mobile-active {
        display: block;
    }

    .mail-mobile-only {
        display: inline-grid;
    }

    .mail-mobile-close {
        display: inline-grid;
    }

    .mail-settings-dialog,
    .mail-compose-dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
    }

    .mail-settings-layout {
        overflow-y: auto;
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .mail-account-list-wrap {
        max-height: 230px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .mail-account-form {
        min-height: 580px;
    }
}

@media (max-width: 620px) {
    .window-resize-handle {
        display: none;
    }

    .maximize-order-window {
        display: none;
    }

    .order-window-taskbar {
        right: 6px;
        bottom: 6px;
        left: 6px;
        max-height: calc(100dvh - 20px);
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .order-window-taskbar .order-taskbar-item {
        width: 100% !important;
        min-width: 0;
        max-width: none;
        flex: 0 0 46px;
    }

    .login-page {
        align-items: stretch;
        padding: 0;
        background: var(--surface);
    }

    .login-panel {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
        box-shadow: none;
    }

    .brand-login {
        padding-bottom: 22px;
    }

    .login-heading {
        margin-top: 48px;
    }

    .content {
        padding-inline: 14px;
    }

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

    .stat-grid {
        gap: 9px;
    }

    .stat-card {
        min-height: 92px;
        gap: 11px;
        padding: 14px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        font-size: 16px;
    }

    .stat-card strong {
        font-size: 19px;
    }

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

    .selected-order-label {
        grid-column: 1 / -1;
    }

    .order-actions .button {
        width: 100%;
    }

    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
        overflow: hidden;
    }

    .pagination-controls {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .order-search-toolbar .order-search-tools {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .order-filter-field select {
        width: 100%;
        min-width: 0;
    }

    .order-search-form {
        grid-column: 1 / -1;
        margin-left: 0;
    }

    .order-search-form input {
        width: auto;
        min-width: 0;
        flex: 1;
    }

    .order-detail-window {
        top: 6px;
        right: 6px;
        left: 6px;
        width: auto;
        height: calc(100vh - 12px);
        height: calc(100dvh - 12px);
        transform: none;
    }

    .detail-section {
        padding-inline: 14px;
    }

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

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

    .address-form-body {
        padding: 12px;
    }

    .mobile-address-collapse-toggle {
        display: inline-grid;
    }

    .address-fields {
        grid-template-columns: 1fr;
    }

    .order-products-column {
        padding-inline: 12px;
    }

    .panel-header {
        min-height: 62px;
        padding-inline: 15px;
    }

    .mail-panel {
        height: calc(100dvh - 94px);
        min-height: 520px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .mail-toolbar {
        min-height: 112px;
    }

    .mail-layout {
        height: calc(100% - 112px);
    }

    .mail-thread-item {
        min-height: 88px;
    }

    .mail-reader-header {
        min-height: 66px;
        padding-inline: 10px;
    }

    .mail-reader-header h2 {
        font-size: 14px;
    }

    .mail-reader-header .reply-mail span {
        display: none;
    }

    .mail-reader-header .reply-mail {
        width: 38px;
        min-height: 38px;
        padding: 0;
    }

    .mail-message-list {
        padding-inline: 12px;
    }

    .mail-message-header {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .mail-message-header time {
        grid-column: 2;
        margin-top: -4px;
    }

    .mail-message-body,
    .mail-text-body,
    .mail-attachments {
        margin-left: 0;
    }

    .modal-layer {
        padding: 0;
    }

    .mail-compose-dialog,
    .mail-settings-dialog {
        height: 100dvh;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .mail-compose-form > label {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .mail-compose-form textarea {
        min-height: 240px;
    }

    .mail-account-form {
        padding: 16px;
    }

    .mail-account-form-grid {
        grid-template-columns: 1fr;
    }

    .mail-account-form-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    #mail-account-form-status {
        width: 100%;
        flex-basis: 100%;
    }
}

@media (min-width: 400px) and (max-width: 620px) {
    .order-payment-status-form {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 12px 8px;
    }

    .order-payment-status-heading {
        gap: 4px;
    }

    .order-payment-status-label {
        font-size: 11px;
    }

    .order-payment-status-icon {
        font-size: 20px;
    }

    .order-payment-status-form select {
        width: auto;
        min-width: 0;
        height: 40px;
        flex: 1 1 82px;
        padding: 0 22px 0 6px;
        font-size: 10px;
    }

    .order-payment-status-form .button {
        min-width: 58px;
        height: 40px;
        padding-inline: 8px;
        font-size: 10px;
    }
}

/* Structured CRM email templates */
.mail-template-panel {
    display: flex;
    height: calc(100vh - 82px);
    min-height: 640px;
    flex-direction: column;
    overflow: hidden;
}

.mail-template-toolbar {
    display: grid;
    min-height: 62px;
    flex: 0 0 auto;
    align-items: center;
    grid-template-columns: minmax(170px, 1fr) 190px minmax(190px, 310px) auto;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 9px 14px;
}

.mail-template-title,
.mail-template-list-copy,
.mail-template-editor-header > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.mail-template-title strong { font-size: 13px; }
.mail-template-title span,
.mail-template-editor-header span { margin-top: 4px; color: var(--text-soft); font-size: 9px; }

.mail-template-filter,
.mail-template-search {
    display: flex;
    min-width: 0;
    align-items: center;
}

.mail-template-filter { gap: 8px; }
.mail-template-filter > span { color: var(--text-soft); font-size: 9px; font-weight: 700; white-space: nowrap; }
.mail-template-filter select,
.mail-template-search input {
    width: 100%;
    height: 38px;
    min-width: 0;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 10px;
}

.mail-template-filter select { padding: 0 30px 0 10px; }
.mail-template-search { position: relative; }
.mail-template-search i { position: absolute; left: 12px; color: var(--text-soft); font-size: 11px; pointer-events: none; }
.mail-template-search input { padding: 0 10px 0 34px; }
.mail-template-toolbar-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mail-template-mobile-tabs { display: none; }

.mail-template-layout {
    display: grid;
    min-height: 0;
    flex: 1 1 auto;
    grid-template-columns: 240px minmax(410px, 0.92fr) minmax(400px, 1.08fr);
}

.mail-template-list-pane,
.mail-template-editor-pane,
.mail-template-preview-pane {
    min-width: 0;
    min-height: 0;
}

.mail-template-list-pane {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--surface-muted);
}

.mail-template-list-pane > header,
.mail-template-editor-header,
.mail-template-preview-header {
    display: flex;
    min-height: 54px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 0 13px;
}

.mail-template-list-pane > header strong,
.mail-template-editor-header strong { font-size: 12px; }
.mail-template-list-pane > header span {
    display: grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 99px;
    background: #e1e5e9;
    color: #555d67;
    font-size: 9px;
}

.mail-template-list { flex: 1 1 auto; overflow-y: auto; padding: 8px; }
.mail-template-list-item {
    display: grid;
    width: 100%;
    min-height: 82px;
    align-items: center;
    grid-template-columns: 5px minmax(0, 1fr) 15px;
    gap: 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 9px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.mail-template-list-item:hover { background: #e9edf0; }
.mail-template-list-item.active { background: #dfe7ee; }
.mail-template-list-item.disabled { opacity: 0.58; }
.mail-template-list-item > i { color: #5f866f; font-size: 10px; }
.mail-template-list-item.disabled > i { color: #969da6; }
.mail-template-list-tone { width: 5px; height: 44px; border-radius: 3px; background: #9299a2; }
.mail-template-list-tone.amber { background: #c58c13; }
.mail-template-list-tone.green { background: #268552; }
.mail-template-list-tone.blue { background: #3679b6; }
.mail-template-list-tone.red { background: #bb443e; }
.mail-template-list-copy strong,
.mail-template-list-copy span,
.mail-template-list-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-template-list-copy strong { font-size: 11px; }
.mail-template-list-copy span { margin-top: 6px; color: #59616c; font-size: 9px; }
.mail-template-list-copy small { margin-top: 5px; color: #8a919a; font-size: 8px; }

.mail-template-editor-pane {
    border-right: 1px solid var(--line);
    background: #fff;
}

.mail-template-form { display: flex; height: 100%; min-height: 0; flex-direction: column; }
.mail-template-editor-scroll { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.mail-template-fields { display: grid; grid-template-columns: 1fr; gap: 11px; margin-bottom: 12px; }
.mail-template-fields.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mail-template-fields.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mail-template-fields label,
.mail-profile-fields label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}
.mail-template-fields label > span,
.mail-profile-fields label > span { color: #626a74; font-size: 9px; font-weight: 700; }
.mail-template-fields input,
.mail-template-fields select,
.mail-template-fields textarea,
.mail-template-variable-bar select,
.mail-profile-form select,
.mail-profile-fields input,
.mail-profile-fields textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 11px;
    outline: 0;
}
.mail-template-fields input,
.mail-template-fields select,
.mail-template-variable-bar select,
.mail-profile-form select,
.mail-profile-fields input { height: 39px; padding: 0 10px; }
.mail-template-fields textarea,
.mail-profile-fields textarea { padding: 10px; line-height: 1.55; resize: vertical; }
.mail-template-body-mode-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.mail-template-body-mode-wrap[hidden],
.mail-template-body-panel[hidden] { display: none; }
.mail-template-body-mode-wrap > span { color: #626a74; font-size: 9px; font-weight: 700; }
.mail-template-body-mode {
    display: grid;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(126px, 1fr));
    border: 1px solid var(--line-dark);
    border-radius: 6px;
}
.mail-template-body-mode button {
    min-height: 34px;
    border: 0;
    border-right: 1px solid var(--line-dark);
    background: #fff;
    padding: 0 12px;
    color: #626a74;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}
.mail-template-body-mode button:last-child { border-right: 0; }
.mail-template-body-mode button.active { background: #dfe7ee; color: #1c2021; box-shadow: inset 0 1px 2px rgba(28, 32, 33, 0.18); }
.mail-template-fields input:focus,
.mail-template-fields select:focus,
.mail-template-fields textarea:focus,
.mail-profile-fields input:focus,
.mail-profile-fields textarea:focus { border-color: #747d88; box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.06); }
.mail-template-fields input[readonly] { background: #f0f2f4; color: #747b84; }
.mail-template-variable-bar { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; }
.mail-template-variable-bar select { flex: 1 1 auto; }
.mail-template-switches { display: flex; flex-wrap: wrap; gap: 15px; border-top: 1px solid var(--line); padding-top: 14px; }
.mail-template-switches label { display: flex; align-items: center; gap: 7px; color: #4f5761; font-size: 9px; }
.mail-template-switches input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.mail-template-editor-footer {
    display: flex;
    min-height: 62px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding: 10px 14px;
}
#mail-template-form-status { margin-right: auto; color: var(--text-soft); font-size: 9px; }

.mail-template-preview-pane { display: flex; min-height: 0; flex-direction: column; background: #e9ebee; }
.mail-template-preview-header { background: #fff; }
.mail-template-preview-header label { display: flex; align-items: center; gap: 8px; }
.mail-template-preview-header label span { color: var(--text-soft); font-size: 9px; font-weight: 700; }
.mail-template-preview-header input { width: 130px; height: 34px; border: 1px solid var(--line-dark); border-radius: 6px; padding: 0 9px; font-size: 10px; }
.mail-template-preview-modes { display: flex; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; }
.mail-template-preview-modes button {
    display: grid;
    width: 34px;
    height: 32px;
    place-items: center;
    border: 0;
    border-right: 1px solid var(--line-dark);
    background: #fff;
    color: #69717b;
    cursor: pointer;
}
.mail-template-preview-modes button:last-child { border-right: 0; }
.mail-template-preview-modes button.active { background: var(--ink); color: #fff; }
.mail-template-preview-warning,
.mail-compose-template-warning { border-bottom: 1px solid #e8c97b; background: #fff5d8; padding: 9px 12px; color: #765100; font-size: 9px; line-height: 1.5; }
.mail-template-preview-stage { display: flex; min-height: 0; flex: 1 1 auto; justify-content: center; overflow: auto; padding: 18px; }
.mail-template-preview-stage iframe {
    width: 100%;
    max-width: 760px;
    height: 100%;
    min-height: 520px;
    border: 1px solid #cfd3d8;
    border-radius: 6px;
    background: #fff;
    transition: width 180ms ease;
}
.mail-template-preview-stage.mobile iframe { width: 390px; }
.mail-template-preview-stage iframe.loading { opacity: 0.5; }

.mail-compose-template-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px auto;
    align-items: end;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: #f7f8f9;
    padding: 10px 14px;
}
.mail-compose-template-tools > label { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.mail-compose-template-tools > label > span { color: var(--text-soft); font-size: 9px; font-weight: 700; }
.mail-compose-template-tools select,
.mail-compose-template-tools input { width: 100%; height: 38px; min-width: 0; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; padding: 0 10px; font-size: 10px; }
.mail-compose-template-preview { border-bottom: 1px solid var(--line); background: #e9ebee; padding: 12px; }
.mail-compose-template-preview iframe { display: block; width: 100%; height: 360px; border: 1px solid #ccd1d6; border-radius: 6px; background: #fff; }
.mail-compose-template-preview .mail-compose-template-warning { margin-top: 8px; border: 1px solid #e8c97b; border-radius: 6px; }
.mail-compose-form input[readonly],
.mail-compose-form textarea[readonly] { background: #f4f5f6; color: #4e5660; }

.mail-profile-dialog {
    display: flex;
    overflow: hidden;
    width: min(100%, 820px);
    max-height: calc(100vh - 36px);
    flex-direction: column;
    border: 1px solid #40464f;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(18, 21, 25, 0.28);
}
.mail-profile-form { display: flex; min-height: 0; flex-direction: column; overflow-y: auto; padding: 18px; }
.mail-profile-form > label { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; margin-bottom: 16px; }
.mail-profile-form > label > span { color: var(--text-soft); font-size: 10px; font-weight: 700; }
.mail-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mail-profile-fields .wide { grid-column: 1 / -1; }
.mail-profile-fields input[type="color"] { width: 74px; padding: 4px; }
.mail-profile-form footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
#mail-profile-source { margin-right: auto; color: var(--text-soft); font-size: 9px; }

@media (max-width: 1380px) {
    .mail-template-layout { grid-template-columns: 210px minmax(390px, 0.95fr) minmax(340px, 1.05fr); }
    .mail-template-toolbar { grid-template-columns: minmax(130px, 1fr) 170px minmax(160px, 250px) auto; }
    .mail-template-toolbar-actions .button span { display: none; }
}

@media (max-width: 900px) {
    .mail-template-panel { height: calc(100dvh - 110px); min-height: 560px; }
    .mail-template-toolbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 164px; gap: 8px; }
    .mail-template-title { grid-column: 1; }
    .mail-template-mobile-tabs { display: flex; grid-column: 2; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; }
    .mail-template-mobile-tabs button { display: flex; height: 36px; align-items: center; gap: 5px; border: 0; border-right: 1px solid var(--line-dark); background: #fff; padding: 0 9px; color: #5e6670; font-size: 9px; }
    .mail-template-mobile-tabs button:last-child { border-right: 0; }
    .mail-template-mobile-tabs button.active { background: var(--ink); color: #fff; }
    .mail-template-filter { grid-column: 1; }
    .mail-template-search { grid-column: 2; }
    .mail-template-toolbar-actions { grid-column: 1 / -1; }
    .mail-template-toolbar-actions .button { flex: 1 1 50%; }
    .mail-template-toolbar-actions .button span { display: inline; }
    .mail-template-layout { display: grid; grid-template-columns: 1fr; flex: 1 1 auto; }
    .mail-template-list-pane,
    .mail-template-editor-pane,
    .mail-template-preview-pane { display: none; grid-area: 1 / 1; border-right: 0; }
    #mail-templates-view:not([data-mobile-pane]) .mail-template-list-pane,
    #mail-templates-view[data-mobile-pane="list"] .mail-template-list-pane { display: flex; }
    #mail-templates-view[data-mobile-pane="editor"] .mail-template-editor-pane { display: block; }
    #mail-templates-view[data-mobile-pane="preview"] .mail-template-preview-pane { display: flex; }
    .mail-template-editor-pane { min-height: 0; }
    .mail-template-preview-stage { padding: 10px; }
    .mail-template-preview-stage iframe { min-height: 460px; }
    .mail-compose-template-tools { grid-template-columns: minmax(0, 1fr) 140px; }
    .mail-compose-template-tools .button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
    .mail-template-panel { height: calc(100dvh - 94px); min-height: 520px; border-radius: 0; }
    .mail-template-toolbar { min-height: 190px; grid-template-columns: 1fr; }
    .mail-template-title,
    .mail-template-mobile-tabs,
    .mail-template-filter,
    .mail-template-search,
    .mail-template-toolbar-actions { grid-column: 1; }
    .mail-template-mobile-tabs { width: 100%; }
    .mail-template-mobile-tabs button { flex: 1 1 33.33%; justify-content: center; }
    .mail-template-fields.two-columns,
    .mail-template-fields.three-columns,
    .mail-profile-fields { grid-template-columns: 1fr; }
    .mail-profile-fields .wide { grid-column: auto; }
    .mail-template-editor-scroll { padding: 12px; }
    .mail-template-preview-header { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; padding-block: 8px; }
    .mail-template-preview-header label { width: 100%; justify-content: space-between; }
    .mail-template-preview-header input { width: 170px; }
    .mail-compose-template-tools { grid-template-columns: 1fr; }
    .mail-compose-template-tools .button { grid-column: auto; width: 100%; }
    .mail-compose-template-preview iframe { height: 300px; }
    .mail-profile-dialog { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
    .mail-profile-form { padding: 14px; }
    .mail-profile-form > label { grid-template-columns: 1fr; gap: 6px; }
}

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

/* Expandable CRM settings workspace. */
.nav-group { display: grid; }
.nav-group-toggle { width: 100%; border: 0; background: transparent; text-align: left; }
.nav-group-arrow { margin-left: auto; font-size: 10px !important; transition: transform 160ms ease; }
.nav-group.open .nav-group-arrow { transform: rotate(180deg); }
.nav-submenu { display: grid; gap: 3px; padding: 4px 0 2px 34px; }
.nav-subitem {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 9px;
    border-radius: 6px;
    padding: 0 10px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}
.nav-subitem i { width: 15px; text-align: center; }
.nav-subitem:hover,
.nav-subitem.active { background: #edf0f3; color: var(--text); }

.settings-panel { min-height: calc(100vh - 82px); }
.settings-header {
    display: flex;
    min-height: 80px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 17px 22px;
}
.settings-header h1,
.settings-section-header h2 { margin: 0; letter-spacing: 0; }
.settings-header h1 { font-size: 20px; }
.settings-header p,
.settings-section-header p { margin: 6px 0 0; color: var(--text-soft); font-size: 11px; line-height: 1.5; }
.settings-layout { display: block; min-height: calc(100vh - 163px); }
.settings-content { min-width: 0; padding: 22px; }
.settings-mail-templates-section,
.settings-mail-templates-host { min-width: 0; }
.settings-mail-templates-host .mail-template-panel {
    height: calc(100dvh - 178px);
    min-height: 560px;
    border: 1px solid var(--line);
}
.settings-section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; }
.settings-section-header h2 { font-size: 17px; }
.settings-security-note { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: var(--green); font-size: 9px; font-weight: 700; }
.settings-impact-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-left: 3px solid var(--blue);
    background: #f4f7fa;
    padding: 11px 13px;
    color: #4f5965;
    font-size: 10px;
    line-height: 1.6;
}
.settings-impact-note i { margin-top: 2px; color: var(--blue); }
.system-mail-store-list { margin-top: 18px; border-top: 1px solid var(--line); }
.system-mail-store { padding: 18px 2px; border-bottom: 1px solid var(--line); }
.system-mail-store > header,
.system-mail-store > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.system-mail-store-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.system-mail-store-identity img,
.system-mail-store-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
}
.system-mail-store-identity > div { display: flex; min-width: 0; flex-direction: column; }
.system-mail-store-identity strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.system-mail-store-identity a { overflow: hidden; margin-top: 4px; color: var(--text-soft); font-size: 9px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.system-mail-store-identity a:hover { color: var(--blue); text-decoration: underline; }
.settings-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; cursor: pointer; }
.settings-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-toggle-track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #cbd1d7; transition: background-color 160ms ease; }
.settings-toggle-track span { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 160ms ease; }
.settings-toggle input:checked + .settings-toggle-track { background: var(--green); }
.settings-toggle input:checked + .settings-toggle-track span { transform: translateX(16px); }
.settings-toggle input:focus-visible + .settings-toggle-track { outline: 3px solid rgba(38, 103, 179, 0.25); outline-offset: 2px; }
.settings-toggle input:disabled ~ * { cursor: not-allowed; opacity: 0.6; }
.settings-toggle strong { font-size: 10px; }
.system-mail-fields { display: grid; grid-template-columns: minmax(250px, 1.1fr) minmax(120px, 0.45fr) minmax(280px, 1.2fr); gap: 14px; margin: 16px 0; }
.system-mail-fields label,
.system-mail-field-status,
.system-mail-addresses { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.system-mail-fields label > span,
.system-mail-field-status > span,
.system-mail-addresses > span { color: var(--text-soft); font-size: 8px; font-weight: 700; }
.system-mail-fields select,
.system-mail-actions input { width: 100%; height: 36px; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; padding: 0 10px; color: var(--text); font-size: 10px; }
.system-mail-fields select:focus,
.system-mail-actions input:focus { border-color: #68717b; outline: 0; box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07); }
.system-mail-connection { display: inline-flex; width: fit-content; min-height: 26px; align-items: center; gap: 6px; color: var(--text-soft); font-size: 9px; font-weight: 700; }
.system-mail-connection i { width: 7px; height: 7px; border-radius: 50%; background: #a7aeb6; }
.system-mail-connection.connected,
.system-mail-connection.ready { color: var(--green); }
.system-mail-connection.connected i,
.system-mail-connection.ready i { background: var(--green); }
.system-mail-connection.testing { color: var(--blue); }
.system-mail-connection.testing i { background: var(--blue); animation: pulse 900ms ease infinite; }
.system-mail-connection.error { color: var(--red); }
.system-mail-connection.error i { background: var(--red); }
.system-mail-addresses { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; column-gap: 10px; }
.system-mail-addresses strong { overflow: hidden; color: #3d444d; font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.system-mail-store > footer { min-height: 38px; }
.system-mail-form-status { color: var(--text-soft); font-size: 9px; }
.system-mail-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.system-mail-actions input { width: 190px; }
.settings-empty { padding: 40px 12px; color: var(--text-soft); text-align: center; }
.settings-empty-state { display: grid; min-height: 260px; place-content: center; gap: 12px; color: #9aa1aa; text-align: center; }
.settings-empty-state i { font-size: 22px; }
.settings-empty-state span { font-size: 11px; font-weight: 700; }

.payment-account-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--line-dark);
    border-radius: 6px;
    background: #eef1f4;
    padding: 3px;
}
.payment-account-tabs button {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    padding: 0 14px;
    color: #59616b;
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
}
.payment-account-tabs button:hover { color: var(--text); }
.payment-account-tabs button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(24, 27, 32, 0.14); }
.payment-account-panel { margin-top: 22px; }
.payment-account-panel > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.payment-account-panel > header > div { display: flex; flex-direction: column; gap: 4px; }
.payment-account-panel > header strong { font-size: 13px; }
.payment-account-panel > header span { color: var(--text-soft); font-size: 9px; }
.payment-account-list { display: grid; }
.payment-account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 16px 2px;
}
.payment-account-row.is-new { border-left: 3px solid var(--green); background: #f5faf7; padding-inline: 12px; }
.payment-account-fields { display: grid; min-width: 0; align-items: end; gap: 11px; }
.payment-account-paypal-fields { grid-template-columns: minmax(160px, 0.8fr) minmax(240px, 1.3fr) 120px; }
.payment-account-zelle-fields { grid-template-columns: minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(220px, 1.2fr) minmax(145px, 0.8fr) 130px; }
.payment-account-wu-fields { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.payment-account-fields > label { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.payment-account-fields > label > span:first-child { color: var(--text-soft); font-size: 8px; font-weight: 700; }
.payment-account-fields input:not([type="radio"]),
.payment-account-fields select {
    width: 100%;
    height: 36px;
    min-width: 0;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 9px;
    color: var(--text);
    font-size: 10px;
}
.payment-account-fields input:focus,
.payment-account-fields select:focus { border-color: #68717b; outline: 0; box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.07); }
.payment-account-radio-control { display: inline-flex; height: 36px; align-items: center; gap: 7px; color: #454c55; font-size: 9px; font-weight: 700; }
.payment-account-radio-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.payment-account-actions { display: flex; min-height: 40px; align-items: center; justify-content: flex-end; gap: 7px; }
.payment-account-current { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; font-weight: 750; white-space: nowrap; }
.payment-account-actions .icon-button { width: 36px; height: 36px; flex-basis: 36px; }

.tracking-transfer-form { display: grid; gap: 9px; max-width: 1080px; }
.tracking-transfer-form > label { color: var(--text-soft); font-size: 9px; font-weight: 750; }
.tracking-transfer-form textarea {
    width: 100%;
    min-height: 280px;
    resize: vertical;
    border: 1px solid #9299a2;
    border-radius: 6px;
    background: #fff;
    padding: 14px;
    color: var(--text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.75;
    letter-spacing: 0;
}
.tracking-transfer-form textarea:focus { border-color: #515a65; outline: 0; box-shadow: 0 0 0 3px rgba(24, 27, 32, 0.08); }
.tracking-transfer-form > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.tracking-transfer-form > footer > span { color: var(--text-soft); font-size: 9px; }
.tracking-transfer-result { display: grid; gap: 12px; max-width: 1080px; margin-top: 24px; }
.tracking-transfer-summary { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); border-block: 1px solid var(--line); }
.tracking-transfer-summary > div { display: flex; min-height: 68px; flex-direction: column; justify-content: center; gap: 4px; padding: 10px 16px; }
.tracking-transfer-summary > div + div { border-left: 1px solid var(--line); }
.tracking-transfer-summary strong { font-size: 19px; }
.tracking-transfer-summary span { color: var(--text-soft); font-size: 9px; font-weight: 700; }
.tracking-transfer-result-group { border-left: 3px solid var(--line-dark); background: #f7f8f9; padding: 11px 14px; }
.tracking-transfer-result-group.is-success { border-left-color: var(--green); background: #f3f8f5; }
.tracking-transfer-result-group.is-warning { border-left-color: #b78116; background: #fff9ec; }
.tracking-transfer-result-group.is-error { border-left-color: var(--red); background: #fff4f3; }
.tracking-transfer-result-group > header { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.tracking-transfer-result-group ul { display: grid; gap: 5px; margin: 9px 0 0; padding-left: 18px; color: #4f5761; font-size: 10px; line-height: 1.55; }

@media (max-width: 900px) {
    .settings-panel { min-height: calc(100dvh - 110px); }
    .settings-layout { min-height: 0; }
    .system-mail-fields { grid-template-columns: minmax(0, 1fr) minmax(120px, 0.45fr); }
    .system-mail-addresses { grid-column: 1 / -1; }
    .system-mail-store > footer { align-items: stretch; flex-direction: column; }
    .system-mail-actions { justify-content: stretch; }
    .payment-account-row { grid-template-columns: 1fr; }
    .payment-account-paypal-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 100px; }
    .payment-account-zelle-fields,
    .payment-account-wu-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .payment-account-actions { justify-content: flex-end; }
}

@media (max-width: 620px) {
    .settings-panel { border-radius: 0; }
    .settings-header,
    .settings-content { padding: 15px 13px; }
    .settings-section-header { align-items: flex-start; flex-direction: column; gap: 8px; }
    .settings-impact-note { font-size: 9px; }
    .system-mail-store { padding: 17px 0; }
    .system-mail-store > header { align-items: flex-start; flex-direction: column; gap: 12px; }
    .system-mail-fields { grid-template-columns: 1fr; }
    .system-mail-addresses { grid-column: auto; }
    .system-mail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .system-mail-actions input { width: 100%; grid-column: 1 / -1; }
    .payment-account-tabs { display: grid; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .payment-account-tabs button { justify-content: center; padding-inline: 6px; }
    .payment-account-panel > header { align-items: flex-start; }
    .payment-account-paypal-fields,
    .payment-account-zelle-fields,
    .payment-account-wu-fields { grid-template-columns: 1fr; }
    .payment-account-actions { flex-wrap: wrap; }
	.tracking-transfer-form textarea { min-height: 230px; }
	.tracking-transfer-form > footer { align-items: stretch; flex-direction: column; }
	.tracking-transfer-form > footer .button { width: 100%; justify-content: center; }
	.tracking-transfer-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tracking-transfer-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
	.tracking-transfer-summary > div:nth-child(4) { border-top: 1px solid var(--line); }
}

/* Printing workspace and print settings. */
.order-print-open,
.order-print-history-open,
.order-place-status-toggle,
.order-screenshot-capture,
.order-items-manage-open {
    min-height: 30px;
    border-radius: 5px;
    padding: 0 10px;
    font-size: 10px;
    white-space: nowrap;
}

.order-print-open i { color: #28704a; }
.order-print-history-open i { color: #496f8c; }

.order-print-layer {
    z-index: 510;
    align-items: center;
    justify-content: center;
    background: rgba(241, 244, 247, 0.72);
    padding: 18px;
    -webkit-backdrop-filter: blur(5px) saturate(0.8);
    backdrop-filter: blur(5px) saturate(0.8);
}

.order-print-dialog {
    display: flex;
    width: min(1180px, calc(100vw - 36px));
    min-width: min(760px, calc(100vw - 36px));
    height: min(820px, calc(100dvh - 36px));
    min-height: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #9da7b1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(20, 27, 34, 0.24);
}

.order-print-dialog .modal-bar > div { display: flex; align-items: center; gap: 9px; }
.order-print-dialog .modal-bar > div > span { color: #496174; font-size: 11px; font-weight: 750; }
.order-print-layer:not(.history-only) #order-print-number { color: #fff; font-size: 17px; font-weight: 850; line-height: 1; }
.order-print-panel { min-height: 0; flex: 1; overflow: auto; }
.order-print-panel[data-print-panel="create"] { display: flex; flex-direction: column; }
.order-print-config {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    align-items: flex-end;
    gap: 8px;
    margin-right: auto;
}
.order-print-config label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.order-print-config label > span { color: var(--text-soft); font-size: 8px; font-weight: 700; }
.order-print-config select {
    width: 160px;
    height: 34px;
    border: 1px solid var(--line-dark);
    border-radius: 5px;
    background: #fff;
    padding: 0 9px;
    color: var(--text);
    font-size: 10px;
}
.order-print-selection-header { display: flex; min-height: 42px; flex: 0 0 auto; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 16px; }
.order-print-selection-header label { display: inline-flex; align-items: center; gap: 8px; color: #343b43; font-size: 10px; font-weight: 700; cursor: pointer; }
.order-print-selection-header input { width: 19px; height: 19px; margin: 0; accent-color: #23704a; cursor: pointer; }
.order-print-selection-header > span { color: var(--text-soft); font-size: 9px; font-weight: 700; }
.order-print-selection-summary { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 12px; margin-left: auto; }
#order-print-selected-count { color: var(--text-soft); font-size: 9px; font-weight: 700; white-space: nowrap; }
.order-print-merge-controls { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.order-print-merge-controls[hidden] { display: none; }
.order-print-selection-notices { display: flex; min-width: 0; flex: 1; align-items: center; flex-direction: column; justify-content: center; gap: 2px; padding: 0 10px; text-align: center; }
#order-print-merge-hint { color: #8a5b00; font-size: 9px; font-weight: 700; }
#order-print-quantity-warning { color: #c1252d; font-size: 10px; font-weight: 800; line-height: 1.25; }
#order-print-quantity-warning[hidden] { display: none; }
.order-print-merge-badge { position: absolute; z-index: 3; top: 7px; right: 7px; display: inline-flex; min-height: 21px; align-items: center; gap: 4px; border-radius: 4px; background: #8a5b00; padding: 0 6px; color: #fff; font-size: 8px; font-style: normal; font-weight: 800; box-shadow: 0 3px 10px rgba(24,27,32,.14); }
.order-print-item.has-merge-requirement { border-color: #b17a18; }
.order-print-items {
    display: grid;
    min-height: 180px;
    flex: 1;
    grid-template-columns: repeat(auto-fill, minmax(150px, 180px));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    justify-content: start;
    gap: 16px;
    overflow: auto;
    padding: 14px 16px;
}
.order-print-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    align-self: start;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border: 1px solid #ccd2d8;
    border-radius: 6px;
    background: #fff;
    padding: 0;
    cursor: pointer;
    transition: border-color 130ms ease, background-color 130ms ease;
}
.order-print-item:hover { background: #fbfcfd; box-shadow: 0 4px 12px rgba(24, 27, 32, 0.08); }
.order-print-item.has-active-shipment { cursor: default; }
.order-print-item.has-active-shipment .order-print-item-check { opacity: .38; }
.order-print-item:has(> input:checked) { border-color: #30363d; box-shadow: inset 0 0 0 1px rgba(48, 54, 61, 0.18); }
.order-print-item > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.order-print-item-check { position: absolute; z-index: 2; top: 7px; left: 7px; display: grid; width: 21px; height: 21px; place-items: center; border: 1px solid #8e98a2; border-radius: 4px; background: #fff; color: transparent; font-size: 9px; }
.order-print-item > input:checked + .order-print-item-check { border-color: #23704a; background: #23704a; color: #fff; }
.order-print-item-image { position: relative; display: grid; width: 100%; aspect-ratio: 1 / 1; place-items: center; overflow: hidden; border: 2px solid transparent; border-radius: 5px; background: #f5f6f7; }
.order-print-item.is-unordered .order-print-item-image { border-color: transparent; }
.order-print-item.is-ordered .order-print-item-image { border-color: #55a96b; }
.order-print-item.is-frozen .order-print-item-image { border-color: #83c9d7; }
.order-print-item.is-picked .order-print-item-image { border-color: #111; }
.order-print-item.is-out-of-stock .order-print-item-image { border-color: #df9296; }
.order-print-item.is-shipped .order-print-item-image { border-color: #C3C3C3; }
.order-print-item.is-unknown .order-print-item-image { border-color: #e0b66c; }
.order-print-item:has(> input:checked) .order-print-item-image { border-color: transparent; }
.order-print-item-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.order-print-item-copy { display: flex; min-width: 0; flex-direction: column; gap: 4px; padding: 7px 8px 8px; }
.order-print-item-copy > span { color: #4f5862; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.order-print-item-copy .order-print-item-model { color: #343b43; font-size: 10px; font-weight: 400; }
.order-print-item-copy .order-print-item-option { color: #111; font-size: 11px; }
.order-print-item-copy .has-quantity { color: var(--red); font-size: 13px; font-weight: 800; }
.order-print-item-copy .order-print-item-price { color: #22282e; font-size: 11px; }
.order-print-item-copy .order-print-item-notes { border-top: 1px solid #ead0d2; margin-top: 2px; padding-top: 5px; color: #c1252d; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.order-print-lock-state { position: absolute; z-index: 3; right: 7px; bottom: 7px; display: inline-flex; min-height: 23px; max-width: calc(100% - 44px); width: fit-content; align-items: center; gap: 5px; overflow: hidden; border-radius: 4px; background: #c62828; padding: 0 7px; color: #fff; font-size: 8px; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 3px 10px rgba(24,27,32,.12); }
.order-print-lock-state.is-label-lock { background: #111; }
.order-print-actions { display: flex; flex: 0 0 auto; align-items: flex-end; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); background: #fafbfc; padding: 10px 16px; }
.order-print-buttons { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.print-history-toolbar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(248,249,250,.98); padding: 10px 18px; }
#order-print-history-back { margin-right: auto; }
.print-history-store { width: 190px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; padding: 0 30px 0 10px; color: var(--text); font-size: 11px; }
.print-history-search-field { width: min(520px, 100%); }
#print-history-search::-webkit-search-cancel-button { display: none; -webkit-appearance: none; appearance: none; }
.order-print-history { display: grid; gap: 0; padding: 4px 18px 20px; }
.order-print-history-empty { display: flex; min-height: 260px; align-items: center; flex-direction: column; justify-content: center; gap: 10px; color: #7b848e; font-size: 12px; }
.order-print-history-empty i { font-size: 23px; }
.order-print-history-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.65fr) auto; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); padding: 15px 2px; }
.order-print-history-main { min-width: 0; }
.order-print-history-main > div { display: flex; align-items: center; gap: 8px; }
.order-print-history-main strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.print-history-type-icon { width: 14px; flex: 0 0 14px; text-align: center; }
.print-history-type-title.type-label .print-history-type-icon { color: #315f82; }
.print-history-type-title.type-image .print-history-type-icon { color: #23704a; }
.print-history-type-title.type-legacy .print-history-type-icon { color: #697682; }
.print-history-type-title.type-invoice .print-history-type-icon { color: #6c4d81; }
.print-history-order-link { border: 0; border-radius: 4px; background: #e8f0f7; padding: 3px 6px; color: #24577e; font-size: 10px; font-weight: 800; cursor: pointer; }
.print-history-order-link:hover { background: #d8e7f3; color: #143f60; }
.print-history-status { border-radius: 4px; background: #eef1f3; padding: 3px 6px; color: #59626c; font-size: 9px; font-weight: 700; }
.print-history-status.completed { background: #e4f4e9; color: #176a35; }
.print-history-status.legacy { background: #e8eef3; color: #3f5669; }
.print-history-status.replacement { background: #e9edf1; color: #263b4c; }
.print-history-status.voided,
.print-history-status.cancelled { background: #fce8e8; color: #a32727; }
.print-history-status.prepared { background: #fff1d8; color: #85510b; }
.order-print-history-main p { margin: 7px 0 0; color: #5e6771; font-size: 11px; line-height: 1.45; }
.order-print-history-main code { display: block; overflow: hidden; margin-top: 7px; color: #2f4e69; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.order-print-history-meta { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #6c7580; font-size: 10px; line-height: 1.35; }
.order-print-history-meta .void-reason { color: var(--red); }
.order-print-history-meta .replacement-progress { color: #8a570c; font-weight: 800; }
.order-print-history-meta .replacement-completed { color: #176a35; font-weight: 800; }
.order-print-history-meta .replacement-cancelled,
.order-print-history-meta .replacement-reason { color: #9d2929; }
.order-print-history-actions { display: flex; max-width: 520px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.order-print-history-actions .button { font-size: 10px; }
.order-print-history-row.is-legacy { background: #fbfcfd; }
.order-print-history-row.is-legacy .order-print-history-main strong { color: #344b5d; }
.order-print-history-main .legacy-record-note { color: #697682; }

.print-settings-group { margin-top: 22px; }
.print-settings-group + .print-settings-group { margin-top: 34px; }
.print-settings-group > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.print-settings-group > header > div { display: flex; flex-direction: column; gap: 4px; }
.print-settings-group > header strong { font-size: 13px; }
.print-settings-group > header span { color: var(--text-soft); font-size: 9px; }
.print-settings-list { display: grid; }
.print-setting-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) minmax(90px, 0.55fr) minmax(70px, 0.35fr) auto auto;
    align-items: end;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 12px 2px;
}
.print-format-form { grid-template-columns: minmax(145px, 1.3fr) minmax(90px, 0.6fr) 82px 82px 68px auto auto auto; }
.print-setting-row.is-new { background: #f7faf8; }
.print-format-form input[type="radio"] { width: 17px; height: 17px; accent-color: #23704a; }
.print-setting-row label:not(.print-setting-check) { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.print-setting-row label > span { color: var(--text-soft); font-size: 8px; font-weight: 700; }
.print-setting-row input[type="text"],
.print-setting-row input[type="number"] { width: 100%; height: 34px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; padding: 0 8px; color: var(--text); font-size: 10px; }
.print-setting-check { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; color: #48515a; font-size: 9px; font-weight: 700; white-space: nowrap; }
.print-setting-actions { display: flex; min-height: 34px; align-items: center; gap: 4px; }

@media (max-width: 1000px) {
    .order-print-config select { width: 145px; }
    .print-setting-row,
    .print-format-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .print-setting-name { grid-column: span 2; }
}

@media (max-width: 720px) {
    .order-print-layer { padding: 0; }
    .order-print-dialog { width: 100%; min-width: 0; height: 100dvh; border: 0; border-radius: 0; }
	.order-print-selection-header { flex-wrap: wrap; gap: 7px; padding-block: 7px; }
	.order-print-selection-summary { gap: 8px; }
	.order-print-merge-controls { order: 3; width: 100%; margin-left: 0; }
	#order-print-merge-hint { display: none; }
	.order-print-selection-notices { order: 4; width: 100%; flex: 0 0 100%; padding: 0; }
    .order-print-items { padding: 10px; }
    .order-print-item { min-height: 0; padding: 0; }
    .order-print-item.is-locked { padding-bottom: 0; }
    .order-print-item-image { width: 100%; height: auto; }
    .order-print-actions { align-items: stretch; flex-direction: column; padding: 10px; }
    .order-print-config { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
    .order-print-config select { width: 100%; }
    .order-print-buttons { width: 100%; justify-content: stretch; }
    .order-print-buttons .button { flex: 1 1 calc(50% - 8px); justify-content: center; }
	.print-history-toolbar { align-items: stretch; flex-direction: column; padding: 10px; }
	#order-print-history-back { margin-right: 0; }
    .print-history-store,.print-history-search-field { width: 100%; }
    .order-print-history { padding-inline: 10px; }
    .order-print-history-row { grid-template-columns: 1fr auto; gap: 10px; }
    .order-print-history-meta { grid-column: 1; }
    .order-print-history-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; }
    .print-setting-row,
    .print-format-form { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 0; }
    .print-setting-name { grid-column: 1 / -1; }
}

@media (max-width: 440px) {
    .order-print-config { grid-template-columns: 1fr; }
}
