:root {
  color-scheme: dark;
  --background: #040b19;
  --surface: #091a2f;
  --surface-2: #0d233c;
  --line: #213e5c;
  --ink: #f3f8fc;
  --muted: #9db2c8;
  --accent: #49c9ed;
  --font: "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }
::selection { color: var(--background); background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.checking { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font-size: 14px; }

.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { display: block; width: 220px; height: auto; max-width: 100%; }
.login-brand .brand img { width: 300px; }
.eyebrow, .section-index { margin: 0; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: space-between; gap: 26px; padding: 10px 18px; border: 1px solid var(--accent); border-radius: 7px; font-size: 13px; font-weight: 750; }
.button span { font-size: 18px; line-height: 1; }
.button.primary { background: var(--accent); color: #061b29; }
.button.outline { background: transparent; color: var(--ink); }
.button:hover:not(:disabled), .text-button:hover, .back-link:hover { filter: brightness(1.12); }
.form-message { margin: 14px 0 0; font-size: 12px; line-height: 1.5; }
.form-message.error { color: #ffb1aa; }
input, textarea, select { width: 100%; min-height: 46px; border: 1px solid #31516e; border-radius: 6px; background: #06162a; color: var(--ink); outline: none; }
input, select { padding: 9px 13px; }
textarea { padding: 12px 13px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #6d8aa6; }
label { display: block; color: #d9e7f1; font-size: 12px; font-weight: 700; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(390px, 1fr); }
.login-brand { position: relative; min-width: 0; display: flex; flex-direction: column; padding: clamp(30px, 5vw, 76px); border-right: 1px solid var(--line); background: #07162b; }
.login-brand-copy { margin: auto 0; max-width: 680px; }
.login-brand h1 { margin: 19px 0 23px; font-size: clamp(48px, 5.2vw, 78px); line-height: 1.11; letter-spacing: -.06em; }
.login-brand-copy > p:last-child { max-width: 450px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.brand-rule { width: 88px; height: 2px; background: var(--accent); }
.login-panel-wrap { min-width: 0; display: grid; place-items: center; padding: 40px; }
.login-panel { width: min(100%, 400px); min-width: 0; }
.login-panel h2 { margin: 18px 0 10px; font-size: 32px; line-height: 1.15; letter-spacing: -.04em; }
.form-intro { margin: 0 0 33px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.login-panel label { margin: 19px 0 9px; }
.login-panel .button { width: 100%; margin-top: 25px; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; color: var(--muted); font-size: 12px; }

.dashboard-container { width: min(100% - 72px, 1440px); margin-inline: auto; }
.admin-header { border-bottom: 1px solid var(--line); background: #061326; }
.header-inner { min-height: 82px; display: flex; align-items: center; gap: 22px; }
.admin-badge { margin-left: auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.admin-chat-shortcut { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; color: #dce9f5; font-size: 12px; font-weight: 750; }
.admin-chat-shortcut:hover, .admin-chat-shortcut.has-open-chats { border-color: var(--accent); color: var(--accent); }
.admin-chat-shortcut strong { min-width: 24px; padding: 3px 6px; border-radius: 999px; background: #173451; color: var(--ink); font-size: 11px; line-height: 1.4; text-align: center; }
.admin-chat-shortcut.has-open-chats strong { background: var(--accent); color: #061b29; }
.admin-security-shortcut { min-height: 44px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: #dce9f5; font-size: 12px; font-weight: 750; }
.admin-security-shortcut:hover { border-color: var(--accent); color: var(--accent); }
.text-button { min-height: 44px; border: 0; background: transparent; color: #dce9f5; font-size: 12px; font-weight: 700; }
.text-button span { margin-left: 6px; color: var(--accent); font-size: 17px; }
.dashboard-main { padding-top: 58px; padding-bottom: 90px; }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.dashboard-heading h1 { margin: 14px 0 10px; font-size: clamp(48px, 5vw, 70px); line-height: 1.1; letter-spacing: -.055em; }
.dashboard-heading p:last-child { max-width: 650px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.dashboard-heading .button { flex: none; }
.dashboard-heading-actions { display: flex; flex: none; gap: 10px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin: 48px 0 64px; border-block: 1px solid var(--line); }
.metric { min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px 26px 20px; border-right: 1px solid var(--line); }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric span { color: #87a6c1; font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.metric strong { font-size: 38px; line-height: 1; letter-spacing: -.05em; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 345px); align-items: start; gap: clamp(30px, 4vw, 60px); }
.orders-column, .orders-section, .admin-side-column, .inventory-section, .report-section { min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.section-heading h2 { margin: 11px 0 0; font-size: 28px; line-height: 1.15; letter-spacing: -.04em; }
.section-count { color: var(--muted); font-size: 12px; }
.table-tools { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; margin-bottom: 42px; }
.table-tools label { font-size: 11px; white-space: nowrap; }
.table-tools input, .table-tools select { min-width: 0; }
.order-action-message { margin: -27px 0 27px; color: #8ee4cb; }
.order-tabs { display: flex; gap: 26px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.order-tab { min-height: 48px; display: inline-flex; align-items: center; gap: 10px; padding: 0 1px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 14px; font-weight: 750; }
.order-tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); }
.order-tab span { min-width: 29px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font-size: 11px; text-align: center; }
.order-tab[aria-selected="true"] span { border-color: #388cb0; color: var(--accent); }
.order-tab-panel { min-width: 0; }
.closed-section { margin-top: 58px; }
.order-list { display: grid; gap: 11px; }
.order-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #07172b; }
.historical-order-card { background: #071528; }
.order-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 19px 20px 17px; }
.order-identity { min-width: 0; }
.order-identity h3 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.order-identity p { margin: 6px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 1.5; }
.order-badges { display: flex; flex: none; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.status { display: inline-block; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; color: #b9d5e7; white-space: nowrap; }
.status.fulfilled { border-color: #3d7b7e; color: #8ee4cb; }
.status.attention { border-color: #927747; color: #f0d398; }
.status.pending { border-color: #3e6586; color: #9dc5e2; }
.sample-badge { display: inline-block; padding: 5px 8px; border: 1px solid #52627a; border-radius: 3px; color: #a8b4c5; font-size: 11px; white-space: nowrap; }
.order-details { display: grid; grid-template-columns: minmax(85px, .7fr) minmax(150px, 1.8fr) minmax(85px, .75fr) minmax(75px, .7fr) minmax(125px, 1.2fr); border-top: 1px solid var(--line); }
.historical-order-details { grid-template-columns: minmax(120px, .8fr) minmax(100px, .7fr) minmax(180px, 1.2fr); }
.order-detail { min-width: 0; padding: 15px 18px 17px; border-right: 1px solid var(--line); }
.order-detail:last-child { border-right: 0; }
.order-detail span { display: block; margin-bottom: 7px; color: #81a4bd; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.order-detail strong { display: block; overflow-wrap: anywhere; color: #e6f0f8; font-size: 12px; font-weight: 650; line-height: 1.4; }
.order-detail:first-child strong { color: var(--accent); font-size: 15px; letter-spacing: .06em; }
.order-card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; padding: 9px 18px; border-top: 1px solid var(--line); }
.order-card-foot span { margin-right: auto; color: var(--muted); font-size: 11px; }
.action-button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 4px; background: transparent; color: var(--accent); font-size: 11px; font-weight: 750; white-space: nowrap; }
.action-button.secondary { border-color: var(--line); color: #c6dce9; }
.action-button.confirm { background: var(--accent); color: #061b29; }
.action-button:disabled { opacity: .5; }
.empty-state { margin: 0; padding: 30px 20px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.more-button { width: 100%; min-height: 46px; margin-top: 13px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: #c9e1f0; font-size: 12px; font-weight: 700; }
.more-button:hover { border-color: var(--accent); color: var(--accent); }
.admin-side-column { display: grid; gap: 18px; }
.inventory-section, .report-section { padding: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.inventory-section .section-heading { margin-bottom: 12px; }
.report-section .section-heading { margin-bottom: 12px; }
.report-controls { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(90px, .8fr); gap: 9px; }
.report-controls label { display: grid; gap: 8px; }
.report-section .button { width: 100%; margin-top: 15px; }
.report-data-note { margin: 14px 0 0; padding: 11px 12px; border: 1px solid #6f5d39; border-radius: 4px; color: #f0d398; font-size: 11px; line-height: 1.55; }
.inventory-intro { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.inventory-counts { display: grid; grid-template-columns: repeat(3, 1fr); padding: 15px 0; border-block: 1px solid var(--line); }
.inventory-counts div { padding-left: 11px; border-left: 1px solid var(--line); }
.inventory-counts div:first-child { padding-left: 0; border-left: 0; }
.inventory-counts span { display: block; color: var(--muted); font-size: 10px; }
.inventory-counts strong { display: block; margin-top: 7px; font-size: 21px; }
.capacity-breakdown { display: grid; gap: 7px; margin-top: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 4px; }
.capacity-breakdown > span { margin-bottom: 3px; color: #81a6c0; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.capacity-breakdown > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #a9c3d5; font-size: 11px; }
.capacity-breakdown strong { color: var(--ink); font-size: 12px; }
.inventory-section form { margin-top: 26px; }
.field-help { margin: 7px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.field-help code { color: #d4eaf4; font-size: 11px; }
.inventory-section textarea { width: 100%; min-height: 155px; }
.inventory-section .button { width: 100%; margin-top: 15px; }
.inventory-note { margin: 22px 0 0; padding-top: 17px; border-top: 1px solid var(--line); color: #7f9bb3; font-size: 11px; line-height: 1.6; }
.support-admin-section { margin: 0 0 64px; padding: 0 0 64px; border-bottom: 1px solid var(--line); scroll-margin-top: 24px; }
.support-admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.support-admin-heading h2 { margin: 11px 0 7px; font-size: 34px; letter-spacing: -.04em; }
.support-admin-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.support-admin-heading-actions { display: flex; align-items: center; gap: 16px; }
.support-admin-heading-actions .button { min-height: 44px; }
.admin-chat-grid { min-height: 510px; display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--surface); }
.admin-chat-list-wrap { min-width: 0; border-right: 1px solid var(--line); background: #061326; }
.admin-chat-list { display: grid; max-height: 610px; overflow-y: auto; }
.admin-chat-list-item { width: 100%; display: grid; gap: 6px; padding: 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
.admin-chat-list-item:hover, .admin-chat-list-item.selected { background: #0c2239; }
.admin-chat-list-item.selected { box-shadow: inset 3px 0 var(--accent); }
.admin-chat-list-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-chat-list-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
.admin-chat-list-title span { flex: none; color: #8ee4cb; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.admin-chat-list-title span.closed { color: var(--muted); }
.admin-chat-list-item > span { overflow: hidden; color: #91abc0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-chat-list-item > .admin-chat-identity, .admin-chat-identity { color: #f1bd76; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.admin-chat-list-item > .admin-chat-identity.verified, .admin-chat-identity.verified { color: #8ee4cb; }
.admin-chat-list-item > small { overflow: hidden; color: #bcd0dd; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-chat-list-wrap .empty-state { border: 0; }
.admin-chat-detail { min-width: 0; padding: 24px; }
.admin-chat-placeholder { display: grid; min-height: 455px; place-items: center; margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
.admin-chat-thread-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-chat-thread-head strong, .admin-chat-thread-head span { display: block; }
.admin-chat-thread-head strong { font-size: 18px; }
.admin-chat-thread-head div span { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.admin-chat-thread-head div .admin-chat-identity { margin-top: 7px; color: #f1bd76; font-size: 9px; }
.admin-chat-thread-head div .admin-chat-identity.verified { color: #8ee4cb; }
.admin-chat-messages { display: grid; gap: 10px; max-height: 370px; overflow-y: auto; padding: 20px 3px; }
.admin-chat-message { width: min(84%, 540px); padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: #07162b; }
.admin-chat-message.admin { justify-self: end; border-color: #347f9e; background: #092338; }
.admin-chat-message strong { display: block; margin-bottom: 5px; color: var(--accent); font-size: 10px; }
.admin-chat-message p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #e7f2f8; font-size: 13px; line-height: 1.5; }
.admin-chat-message time { display: block; margin-top: 7px; color: #7895aa; font-size: 9px; }
.admin-chat-reply-form { padding-top: 18px; border-top: 1px solid var(--line); }
.admin-chat-reply-form label { display: grid; gap: 8px; }
.admin-chat-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.admin-chat-actions .button { min-height: 44px; }
.credentials-dialog { width: min(600px, calc(100% - 30px)); max-height: min(85vh, 800px); padding: 28px; border: 1px solid #3a6584; border-radius: 8px; background: var(--surface); color: var(--ink); }
.credentials-dialog::backdrop { background: rgba(0, 4, 11, .78); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin: 10px 0 0; font-size: 28px; line-height: 1.15; letter-spacing: -.04em; }
.dialog-close { width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--ink); font-size: 24px; line-height: 1; }
.dialog-reference { margin: 6px 0 20px; color: var(--muted); font-size: 12px; }
.credentials-list { display: grid; gap: 9px; }
.credential-row { padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: #07162b; }
.credential-row label { margin-bottom: 5px; color: #84abc6; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.credential-row strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.credential-details { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; margin-top: 13px; }
.credential-actions { display: flex; gap: 6px; }
.credential-actions button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: #c8e5f4; font-size: 11px; }
.credential-actions button:hover { border-color: var(--accent); }
.customer-info-list { display: grid; gap: 9px; margin: 0; }
.customer-info-list > div { padding: 14px 15px; border: 1px solid var(--line); border-radius: 5px; background: #07162b; }
.customer-info-list dt { margin: 0 0 6px; color: #84abc6; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.customer-info-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.customer-link-recovery { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 5px; background: #07162b; }
.customer-link-recovery h3 { margin: 0; font-size: 16px; }
.customer-link-recovery > p { margin: 7px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.customer-link-recovery .form-message { margin-bottom: 0; }
#customer-link-result { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
#customer-link-result label { display: block; margin-bottom: 7px; color: #84abc6; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
#customer-link-result > p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.customer-link-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.customer-link-code-row input { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 4px; background: #04101f; color: var(--ink); font: 600 13px/1.4 monospace; }
.manual-order-dialog { width: min(760px, calc(100% - 30px)); overflow-y: auto; }
.manual-order-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.manual-order-fields label { display: grid; align-content: start; gap: 8px; }
.manual-order-fields label > span { color: var(--muted); font-size: 10px; font-weight: 500; }
.manual-order-fields .manual-order-wide { grid-column: 1 / -1; }
.manual-order-fields textarea { min-height: 92px; }
.manual-order-fields small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.4; }
.manual-order-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.manual-order-actions .button { min-width: 170px; }
.manual-order-security { margin: 16px 0 0; color: #7f9bb3; font-size: 10px; line-height: 1.5; }
.security-dialog { overflow-y: auto; }
.security-copy { margin: 16px 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.security-status-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 15px 0; border-block: 1px solid var(--line); }
.security-status-row strong { font-size: 14px; }
.security-status-row span { color: var(--muted); font-size: 12px; }
.security-form label { margin: 18px 0 8px; }
.security-form > .button { margin-top: 20px; }
.security-qr-wrap { display: grid; place-items: center; margin: 22px 0; }
.security-qr-wrap img { width: min(224px, 100%); height: auto; padding: 10px; border-radius: 6px; background: #fff; }
.security-secret { font-family: monospace; font-size: 13px; letter-spacing: .04em; }
.security-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.security-actions .button { flex: 1; justify-content: center; gap: 8px; }
.security-disable { border-color: #b97770 !important; color: #ffb1aa !important; }
.security-backups h3 { margin: 22px 0 0; font-size: 20px; }
.security-backup-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 20px 0; padding: 0; list-style: none; }
.security-backup-list li { min-width: 0; padding: 12px 8px; border: 1px solid var(--line); border-radius: 4px; background: #06162a; overflow-wrap: anywhere; color: var(--ink); font-family: monospace; font-size: 14px; text-align: center; user-select: all; }
.security-saved-check { display: flex; align-items: start; gap: 11px; margin: 22px 0; font-size: 13px; line-height: 1.6; }
.security-saved-check input { width: 20px; min-height: 20px; height: 20px; flex: none; margin: 1px 0 0; accent-color: var(--accent); }
.security-backups > .button { width: 100%; justify-content: center; }

@media (max-width: 1050px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-side-column { max-width: 600px; }
  .admin-chat-grid { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
}
@media (max-width: 1350px) {
  .order-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .historical-order-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-detail:nth-child(3) { border-right: 0; }
  .order-detail:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .login-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-brand { min-height: 0; padding: 18px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-brand-copy, .brand-rule { display: none; }
  .login-panel-wrap { padding: 34px 24px 70px; place-items: start center; }
  .dashboard-container { width: min(100% - 32px, 1440px); }
  .header-inner { min-height: 70px; }
  .admin-badge { display: none; }
  .admin-chat-shortcut { margin-left: auto; }
  .text-button { margin-left: 0; }
  .dashboard-main { padding-top: 42px; }
  .dashboard-heading { display: block; }
  .dashboard-heading-actions { flex-wrap: wrap; margin-top: 24px; }
  .metrics { grid-template-columns: repeat(2, 1fr); margin: 36px 0 46px; }
  .metric { min-height: 112px; padding: 20px 16px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(n+3) { border-bottom: 0; }
  .metric:nth-child(3) { padding-left: 0; }
  .table-tools { grid-template-columns: auto minmax(0, 1fr); }
  .support-admin-heading { align-items: start; flex-direction: column; }
  .admin-chat-grid { grid-template-columns: 1fr; }
  .admin-chat-list-wrap { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-chat-list { max-height: 260px; }
}
@media (max-width: 520px) {
  .header-inner .brand img { width: 170px; }
  .header-inner { gap: 8px; }
  .admin-chat-shortcut span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .admin-chat-shortcut { min-width: 44px; justify-content: center; padding-inline: 8px; }
  .header-inner { flex-wrap: wrap; padding-block: 10px; }
  .admin-security-shortcut { padding-inline: 9px; }
  .security-actions { flex-direction: column; }
  .security-actions .button { width: 100%; }
}
@media (max-width: 420px) {
  .header-inner .brand img { width: 150px; }
  .inventory-section { padding: 20px; }
  .table-tools { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-bottom: 36px; }
  .table-tools label, .table-tools input { width: 100%; grid-column: 1; }
  .order-tabs { gap: 16px; }
  .order-tab { flex: 1; justify-content: center; }
  .order-card-head { display: block; padding: 17px; }
  .order-badges { justify-content: flex-start; margin-top: 14px; }
  .order-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .historical-order-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-detail { padding: 13px 15px; }
  .order-detail:nth-child(2n) { border-right: 0; }
  .order-detail:nth-child(n+3) { border-top: 1px solid var(--line); }
  .order-detail:nth-child(3) { border-right: 1px solid var(--line); }
  .order-detail:last-child { grid-column: 1 / -1; }
  .historical-order-details .order-detail:last-child { grid-column: 1 / -1; border-right: 0; }
  .credentials-dialog { padding: 20px; }
  .manual-order-fields { grid-template-columns: 1fr; }
  .manual-order-fields .manual-order-wide { grid-column: auto; }
  .manual-order-actions { align-items: stretch; flex-direction: column-reverse; }
  .manual-order-actions .button { width: 100%; }
  .credential-details { grid-template-columns: 1fr; }
  .order-card-foot { flex-wrap: wrap; }
  .order-card-foot span { width: 100%; }
  .admin-chat-detail { padding: 17px; }
  .admin-chat-actions { align-items: stretch; flex-direction: column; }
  .admin-chat-actions .button { width: 100%; }
}
