* {
    box-sizing: border-box;
}

.support-grid {
    display: grid;
    gap: 18px;
}

.support-card {
    border: 1px solid #ececec;
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}

.support-card h3 {
    margin: 0 0 10px;
    font-size: 22px;
}

.support-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: #6e6e73;
    font-size: 14px;
}

.support-comment {
    border-top: 1px solid #ececec;
    padding: 16px 0;
}

.support-comment:first-child {
    border-top: 0;
}

.support-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    color: #6e6e73;
}

.support-comment-body {
    line-height: 1.65;
    overflow-x: auto;
}

.support-comment-body table,
.rich-surface table {
    border-collapse: collapse;
    margin: 12px 0;
    max-width: 100%;
    width: auto;
}

.support-comment-body th,
.support-comment-body td,
.rich-surface th,
.rich-surface td {
    border: 1px solid #d2d2d7;
    padding: 6px 10px;
    vertical-align: middle;
}

.support-comment-body th,
.rich-surface th {
    font-weight: 700;
    background: #f5f5f7;
}

.support-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.support-file-pill,
.mention-pill {
    border: 1px solid #e5e5e5;
    border-radius: 999px;
    color: #1d1d1f;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    text-decoration: none;
}

.rich-editor {
    border: 1px solid #d2d2d7;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.rich-toolbar {
    align-items: center;
    background: #f5f5f7;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
}

.rich-toolbar select,
.rich-toolbar input[type='color'],
.rich-toolbar button {
    border: 1px solid #d2d2d7;
    border-radius: 999px;
    background: #fff;
    color: #1d1d1f;
    min-height: 34px;
    padding: 0 12px;
}

.rich-toolbar input[type='color'] {
    padding: 2px 8px;
    width: 52px;
}

.rich-surface {
    min-height: 150px;
    outline: none;
    padding: 14px 16px;
}

.rich-hidden {
    display: none;
}

.case-email-placeholder {
    background: #f5f5f7;
    border: 1px dashed #d2d2d7;
    border-radius: 16px;
    color: #6e6e73;
    padding: 14px 16px;
}

.crm-two-column {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.crm-timeline-item {
    border-bottom: 1px solid #ececec;
    padding: 12px 0;
}

.crm-timeline-item:last-child {
    border-bottom: 0;
}

@media (max-width: 900px) {
    .crm-two-column {
        grid-template-columns: 1fr;
    }
}

:root {
    color-scheme: light;
    --page: #f5f5f7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #fff;
    --sidebar: rgba(246, 246, 248, 0.78);
    --line: rgba(0, 0, 0, 0.10);
    --line-strong: rgba(0, 0, 0, 0.16);
    --text: #1d1d1f;
    --muted: #6e6e73;
    --muted-2: #86868b;
    --blue: #0071e3;
    --blue-soft: rgba(0, 113, 227, 0.10);
    --green: #248a3d;
    --red: #d70015;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.08);
    --radius: 18px;
    --sidebar-width: 248px;
    --topbar-height: 63px;
}

html {
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 255, 255, 0.92), transparent 34%),
        linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 48%, #eeeeef 100%);
    -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
p {
    margin-top: 0;
}

.muted-copy {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.5;
}

.muted-inline {
    color: var(--muted);
    font-size: 0.88rem;
}

h1 {
    margin-bottom: 0;
    color: var(--text);
    font-size: clamp(2rem, 3.6vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.05;
}

h2 {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0;
}

.section-kicker,
.admin-title p,
.stat span,
.detail-grid span,
th {
    color: var(--muted);
    text-transform: none;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0;
}

.auth-page {
    display: block;
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    align-items: center;
    gap: clamp(36px, 7vw, 96px);
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 56px 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 650;
}

.brand-link::before,
.admin-brand span,
.admin-nav span,
.admin-account > span {
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f1f1f3);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.brand-link::before {
    content: "JW";
    width: 38px;
    height: 38px;
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-hero p {
    max-width: 590px;
    margin: 18px 0 30px;
    color: var(--muted);
    font-size: clamp(1.08rem, 2vw, 1.38rem);
    line-height: 1.45;
}

.auth-meter {
    width: min(340px, 100%);
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
}

.auth-meter span {
    display: block;
    width: 72%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0071e3, #64d2ff);
}

.auth-panel,
.panel,
.stat,
.detail-grid div {
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.035);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.auth-panel {
    padding: 34px;
}

.auth-panel h2 {
    font-size: 2.2rem;
    line-height: 1.05;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.auth-wide-link {
    width: 100%;
}

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

.social-button {
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.74);
    color: var(--text);
    box-shadow: none;
}

.social-button:disabled {
    opacity: 0.56;
    cursor: not-allowed;
}

.auth-note {
    margin: 14px 0 0;
    font-size: 0.84rem;
}

label {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

.inline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-weight: 500;
}

.stacked-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.test-label-toggle {
    grid-column: span 2;
    min-height: 44px;
    align-self: center;
    border: 1px solid rgba(255, 149, 0, 0.24);
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 149, 0, 0.10);
    color: #7a3f00;
}

.grid-wide,
.form-section-title {
    grid-column: 1 / -1;
}

.form-section-title {
    margin-top: 8px;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

textarea {
    min-height: 92px;
    padding-top: 11px;
}

input[type="checkbox"] {
    width: 22px;
    min-height: 22px;
    accent-color: var(--blue);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 113, 227, 0.62);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

button,
.button-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0 20px;
    background: var(--blue);
    color: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

button:hover,
.button-link:hover {
    background: #0077ed;
    box-shadow: 0 8px 22px rgba(0, 113, 227, 0.20);
}

button:active,
.button-link:active {
    transform: translateY(1px);
}

button.danger {
    background: var(--red);
}

.button-link.subtle {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
}

.button-link.subtle:hover {
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.alert {
    margin-bottom: 18px;
    border: 1px solid rgba(215, 0, 21, 0.12);
    border-left: 4px solid var(--red);
    border-radius: 12px;
    background: rgba(255, 59, 48, 0.08);
    color: #7d000b;
    padding: 12px 14px;
}

.alert.success {
    border-color: rgba(36, 138, 61, 0.14);
    border-left-color: var(--green);
    background: rgba(52, 199, 89, 0.10);
    color: #145523;
}

.mobile-menu-toggle,
.mobile-topbar,
.mobile-menu-backdrop {
    display: none;
}

.admin-sidebar {
    position: fixed;
    inset: 14px auto 14px 14px;
    z-index: 10;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.70);
    border-radius: 22px;
    padding: 12px;
    background: var(--sidebar);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10), inset 0 0 0 1px rgba(0, 0, 0, 0.035);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 6px 12px;
    border-bottom: 1px solid var(--line);
}

.admin-brand span,
.admin-nav span,
.admin-account > span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: 0.78rem;
    font-weight: 750;
}

.admin-brand strong {
    font-size: 0.95rem;
    font-weight: 750;
}

.admin-nav {
    display: grid;
    gap: 4px;
    padding: 14px 0;
}

.admin-nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    padding: 4px 8px;
    color: var(--muted);
    font-weight: 650;
    transition: background 150ms ease, color 150ms ease;
}

.admin-nav a:hover {
    background: rgba(0, 0, 0, 0.055);
    color: var(--text);
}

.admin-account {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.admin-account strong {
    display: block;
    max-width: 150px;
    overflow: hidden;
    color: var(--text);
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-account form {
    margin: 3px 0 0;
}

.admin-account button,
.logout-link {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--blue);
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 650;
}

.admin-shell {
    width: min(1260px, calc(100% - 300px));
    margin-left: 286px;
    padding: 34px 24px 48px 0;
}

.admin-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.admin-title p {
    margin-bottom: 7px;
}

.panel {
    margin-bottom: 20px;
    padding: 22px;
}

.user-form {
    display: grid;
    grid-template-columns: 1fr 1.2fr 160px 1fr auto;
    gap: 12px;
}

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

.grid-form textarea,
.grid-form .check-grid {
    grid-column: span 2;
}

.grid-form button {
    align-self: end;
}

.compact-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.inline-form,
.scan-form,
.actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scan-panel {
    background: linear-gradient(135deg, #fff 0%, rgba(240, 247, 255, 0.86) 100%);
}

.receiving-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.receiving-head p {
    max-width: 660px;
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.5;
}

.receiving-counter {
    min-width: 138px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.72);
}

.receiving-counter span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.receiving-counter strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
}

.scan-form input {
    min-height: 72px;
    font-size: 2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.scan-form input[name="location"] {
    max-width: 220px;
    font-size: 1rem;
    letter-spacing: 0;
    text-transform: none;
}

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

.stat,
.detail-grid div {
    padding: 18px;
}

.stat span,
.detail-grid span {
    display: block;
    margin-bottom: 6px;
}

.pallet-detail-panel {
    max-width: 980px;
    margin-inline: auto;
}

.pallet-detail-panel h1 {
    margin: 0;
    color: var(--text);
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: 0;
}

.pallet-detail-panel h2 {
    margin: 0 0 18px;
}

.pallet-detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 0;
}

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

.pallet-detail-notes {
    margin: 18px 0 0;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.45;
}

.pallet-detail-actions {
    width: min(980px, 100%);
    margin: 6px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.pallet-detail-actions-left,
.pallet-detail-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.overview-page {
    width: min(920px, 100%);
    margin: 0 auto;
    padding-top: 34px;
}

.overview-page h1 {
    margin: 0 0 54px;
    color: #000;
    font-size: clamp(2.6rem, 5vw, 4.45rem);
    font-weight: 500;
    line-height: 1.05;
    text-align: center;
    letter-spacing: 0;
}

.overview-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 16px;
}

.overview-card {
    container-type: inline-size;
    position: relative;
    min-height: 121px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.035);
    border-radius: 12px;
    padding: 16px 20px 15px;
    background: #fff;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.075),
        0 1px 1px rgba(0, 0, 0, 0.035);
}

.overview-card.selected {
    border-color: #3478ff;
    box-shadow:
        0 10px 26px rgba(0, 0, 0, 0.075),
        inset 0 0 0 1px #3478ff;
}

.overview-plus {
    position: absolute;
    top: 11px;
    right: 14px;
    color: #9b9b9f;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
}

.overview-card strong {
    display: block;
    margin: 0 28px 8px 0;
    color: #000;
    font-size: clamp(1.75rem, 14cqw, 3.05rem);
    font-weight: 500;
    line-height: 0.92;
    letter-spacing: 0;
    white-space: nowrap;
}

.overview-card h2 {
    margin: 0 0 6px;
    color: #000;
    font-size: 1.82rem;
    font-weight: 650;
    line-height: 1.05;
    letter-spacing: 0;
}

.overview-card h2.danger {
    color: #ff0000;
}

.overview-card h2.blue {
    color: #0000ff;
}

.overview-card p {
    margin: 0;
    color: #66666b;
    font-size: 0.76rem;
    line-height: 1.35;
    font-weight: 450;
}

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

.stat strong {
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
}

.stat strong.small-stat {
    font-size: 0.96rem;
    line-height: 1.25;
}

.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.inbound-hero-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 0 0 24px;
}

.inbound-card {
    aspect-ratio: 1.886 / 1;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 18px;
    padding: 24px 24px 26px;
    background: #fff;
    box-shadow:
        0 24px 54px rgba(0, 0, 0, 0.07),
        0 4px 14px rgba(0, 0, 0, 0.028);
}

.inbound-card h2 {
    margin: 0;
    color: #0b0b0d;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 2.05rem;
    font-weight: 750;
    line-height: 1.05;
    letter-spacing: 0;
}

.inbound-record-panel h2 {
    margin: 0;
    color: #111;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0;
}

.inbound-card p {
    width: 88%;
    max-width: 520px;
    margin: 16px 0 0;
    color: #6f6f74;
    font-size: 0.98rem;
    line-height: 1.45;
    font-weight: 450;
}

.inbound-card .actions {
    margin-top: auto;
    align-items: center;
    gap: 12px;
}

.inbound-card .button-link {
    min-height: 42px;
    padding: 0 21px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
}

.inbound-card .button-link.subtle {
    border-color: #111;
    background: #fff;
    color: #111;
}

.inventory-page {
    width: min(1420px, 100%);
    margin: 0 auto;
}

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

.inventory-hero-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    margin-bottom: 26px;
}

.inventory-hero-card {
    aspect-ratio: 1.89 / 1;
}

.inventory-hero-card h2 {
    font-size: 2.35rem;
}

.inventory-hero-card p {
    width: 82%;
    margin-top: 18px;
}

.inventory-realtime-card {
    min-height: 250px;
    aspect-ratio: auto;
}

.inventory-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
    margin-bottom: 28px;
}

.inventory-stat-card {
    min-height: 180px;
    padding: 28px 38px 24px;
}

.inventory-stat-card strong {
    margin-bottom: 14px;
    font-size: clamp(2.3rem, 11cqw, 4.15rem);
}

.inventory-stat-card h2 {
    font-size: clamp(1.75rem, 5.5cqw, 3rem);
    line-height: 1.06;
}

.inventory-product-panel {
    margin-top: 28px;
}

.realtime-inventory-panel {
    padding: 26px 30px 32px;
}

.inventory-list-heading {
    margin-bottom: 20px;
}

.inventory-list-heading h2 {
    margin: 0;
    font-size: 2rem;
}

.inventory-search-form input {
    min-width: 280px;
}

.inventory-search-form button {
    min-width: 128px;
    white-space: nowrap;
}

.inventory-detail-button {
    min-height: 34px;
    padding: 0 18px;
    white-space: nowrap;
}

.inventory-detail-button:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.product-editor-shell {
    width: min(960px, 100%);
    margin: 0 auto;
}

.product-editor-panel {
    padding: 22px 24px 28px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.10);
}

.product-editor-panel h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.1;
}

.product-editor-divider {
    height: 1px;
    margin: 24px 0;
    background: var(--line);
}

.product-client-row {
    margin-bottom: 14px;
}

.product-client-row select {
    width: min(420px, 100%);
}

.product-type-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.product-type-card {
    min-height: 72px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.product-type-card input {
    display: none;
}

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

.product-type-card strong {
    font-size: 1rem;
    line-height: 1.25;
}

.product-type-card span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.25;
}

.product-type-card.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.product-type-card.active span {
    color: rgba(255, 255, 255, 0.86);
}

.product-editor-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
}

.product-photo-column {
    min-width: 0;
}

.product-photo-uploader {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    font: inherit;
}

.product-photo-uploader img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-photo-cropper {
    margin-top: 14px;
    display: grid;
    gap: 18px;
}

.product-photo-crop-preview {
    width: min(360px, 76vw);
    height: min(360px, 76vw);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin: 0 auto;
    background: #fff;
}

.product-photo-crop-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.product-photo-cropper label {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 14px;
    align-items: center;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
}

.product-photo-modal[hidden] {
    display: none;
}

.product-photo-modal {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.product-photo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(245, 245, 247, 0.74);
    backdrop-filter: blur(12px);
}

.product-photo-modal-card {
    position: relative;
    width: min(520px, 92vw);
    max-height: min(760px, 92vh);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 22px;
    background: #fff;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.product-photo-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.product-photo-modal-head h2 {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
}

.product-photo-modal-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f5f5f7;
    color: #1d1d1f;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.product-photo-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.product-photo-modal-toolbar .button-link {
    min-width: 112px;
}

.product-fields-column,
.product-type-extra {
    display: grid;
    gap: 12px;
}

.product-type-extra.is-hidden,
.product-type-extra[hidden] {
    display: none !important;
}

.product-field-two,
.product-field-three {
    display: grid;
    gap: 12px;
}

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

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

.product-unit-row {
    align-items: center;
}

.product-inline-check {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
}

.product-inline-check input {
    width: 18px;
    height: 18px;
}

.product-inner-divider {
    margin: 12px 0;
}

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

.product-editor-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.product-editor-actions button,
.product-editor-actions .button-link {
    min-width: 132px;
    white-space: nowrap;
}

.product-editor-actions .danger {
    color: #d70015;
    border-color: rgba(215, 0, 21, 0.45);
}

.product-editor-actions .danger:hover {
    color: #fff;
    background: #d70015;
    border-color: #d70015;
}

.product-detail-inventory {
    margin-top: 24px;
}

.outbound-page {
    width: min(1420px, 100%);
    margin: 0 auto;
}

.outbound-hero-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    margin-bottom: 26px;
}

.outbound-hero-card {
    aspect-ratio: 1.89 / 1;
}

.outbound-hero-card h2 {
    font-size: 2.35rem;
}

.outbound-hero-card p {
    width: 82%;
    margin-top: 18px;
}

.outbound-hero-card button:disabled {
    opacity: 1;
}

.outbound-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px 18px;
}

.outbound-stat-card {
    min-height: 180px;
    padding: 28px 38px 24px;
}

.outbound-stat-card strong {
    margin-bottom: 14px;
    font-size: clamp(2.3rem, 11cqw, 4.15rem);
}

.outbound-stat-card h2 {
    font-size: clamp(1.75rem, 5.5cqw, 3rem);
    line-height: 1.06;
}

.outbound-single-page {
    width: min(1140px, 100%);
}

.outbound-single-panel,
.outbound-list-panel {
    border: 1px solid rgba(0, 0, 0, 0.035);
    border-radius: 14px;
    background: #fff;
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.075),
        0 1px 2px rgba(0, 0, 0, 0.035);
}

.outbound-single-panel {
    padding: 28px 24px 36px;
}

.outbound-single-panel h1 {
    margin: 0;
    color: #111;
    font-size: 2.04rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.outbound-case-line {
    margin: 10px 0 0;
    color: #6e6e73;
    font-size: 0.9rem;
    font-weight: 600;
}

.outbound-section-line {
    height: 1px;
    margin: 30px 0 26px;
    background: #d9d9d9;
}

.outbound-staff-client-row {
    margin: -4px 0 22px;
}

.outbound-two-column {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 82px;
    padding-bottom: 28px;
    border-bottom: 1px solid #dcdcdc;
}

.outbound-two-column::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #e1e1e1;
    transform: translateX(-50%);
}

.outbound-form-column {
    display: grid;
    gap: 12px;
    align-content: start;
}

.outbound-form-column h2,
.outbound-form-section h2,
.outbound-list-panel h2 {
    margin: 0;
    color: #111;
    font-size: 1.52rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.outbound-form-column h2 {
    margin-bottom: 10px;
}

.outbound-form-column textarea {
    min-height: 98px;
    resize: vertical;
    border: 1px solid #1d1d1f;
    border-radius: 16px;
    padding: 13px 22px;
    background: #fff;
    color: #1d1d1f;
    font-size: 1rem;
    font-weight: 700;
}

.outbound-form-column input,
.outbound-staff-client-row select,
.outbound-item-row input,
.outbound-package-row input,
.outbound-wide-input,
.outbound-list-heading input {
    height: 42px;
    min-height: 42px;
    border: 1px solid #1d1d1f;
    border-radius: 999px;
    padding: 0 22px;
    background: #fff;
    color: #1d1d1f;
    font-size: 1rem;
    font-weight: 700;
    line-height: 42px;
    box-shadow: none;
}

.outbound-form-column input::placeholder,
.outbound-form-column textarea::placeholder,
.outbound-item-row input::placeholder,
.outbound-package-row input::placeholder,
.outbound-wide-input::placeholder,
.outbound-list-heading input::placeholder {
    color: #9a9aa0;
    font-weight: 700;
}

.outbound-item-row input[readonly] {
    color: #6e6e73;
    background: #fff;
}

.outbound-form-section {
    padding: 28px 0 32px;
    border-bottom: 1px solid #dcdcdc;
}

.outbound-item-rows,
.outbound-package-rows {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.outbound-item-row,
.outbound-package-row {
    display: grid;
    align-items: center;
    gap: 16px;
}

.outbound-item-row {
    grid-template-columns: 200px minmax(320px, 1fr) 150px 150px 42px;
}

.outbound-package-row {
    grid-template-columns: repeat(4, minmax(180px, 1fr)) 42px;
}

.outbound-product-search-wrap {
    position: relative;
}

.outbound-product-suggestions {
    position: absolute;
    z-index: 25;
    top: calc(100% + 6px);
    left: 0;
    width: min(420px, 88vw);
    overflow: hidden;
    border: 1px solid #d6d6d9;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
}

.outbound-product-suggestions[hidden] {
    display: none;
}

.outbound-product-suggestions button,
.outbound-product-suggestions p {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(90px, auto) 1fr auto;
    gap: 12px;
    align-items: center;
    border: 0;
    padding: 11px 14px;
    background: #fff;
    color: #1d1d1f;
    text-align: left;
    font: inherit;
}

.outbound-product-suggestions button:hover {
    background: #f5f5f7;
}

.outbound-product-suggestions strong {
    font-size: 0.9rem;
}

.outbound-product-suggestions span,
.outbound-product-suggestions em,
.outbound-product-suggestions p {
    color: #6e6e73;
    font-size: 0.82rem;
    font-style: normal;
}

.outbound-wide-input {
    width: 100%;
    margin-top: 18px;
}

.outbound-import-actions,
.outbound-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.outbound-import-actions {
    margin-top: 16px;
}

.outbound-form-actions {
    padding-top: 28px;
}

.outbound-import-actions .button-link,
.outbound-form-actions .button-link {
    min-height: 42px;
    min-width: 136px;
    border-color: #1d1d1f;
    font-size: 1rem;
    font-weight: 800;
}

.outbound-form-actions .button-link:first-child {
    border-color: #0071e3;
}

.outbound-list-panel {
    margin-top: 28px;
    padding: 26px 24px 28px;
}

.outbound-list-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}

.outbound-search-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.outbound-search-form input {
    min-width: 260px;
}

.outbound-selected-action {
    min-width: 112px;
    padding: 0 30px;
    white-space: nowrap;
}

.outbound-selected-action[hidden] {
    display: none !important;
}

.outbound-table-wrap {
    overflow-x: auto;
}

.outbound-table {
    min-width: 980px;
    border-collapse: collapse;
}

.outbound-table th,
.outbound-table td {
    border-bottom: 1px solid #e5e5e7;
    padding: 11px 12px;
    color: #1d1d1f;
    font-size: 0.86rem;
    text-align: left;
    vertical-align: middle;
}

.outbound-table th {
    font-weight: 800;
}

.outbound-table tbody tr:hover td {
    background: #f5f5f7;
}

.outbound-table .table-action {
    min-height: 34px;
    padding: 0 22px;
    border-color: #1d1d1f;
    color: #111;
    font-size: 0.9rem;
    font-weight: 800;
}

.outbound-more-row {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

@media (max-width: 980px) {
    .outbound-single-page {
        width: 100%;
    }

    .outbound-single-panel,
    .outbound-list-panel {
        padding: 22px 16px 28px;
    }

    .outbound-two-column {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .outbound-two-column::before {
        display: none;
    }

    .outbound-form-column + .outbound-form-column {
        border-top: 1px solid #dcdcdc;
        padding-top: 24px;
    }

    .outbound-item-row,
    .outbound-package-row,
    .outbound-list-heading {
        grid-template-columns: 1fr;
    }

    .outbound-item-row,
    .outbound-package-row {
        position: relative;
        padding-right: 50px;
    }

    .outbound-item-row .circle-control,
    .outbound-package-row .circle-control {
        position: absolute;
        top: 0;
        right: 0;
    }

    .outbound-search-form {
        justify-content: flex-start;
    }

    .outbound-search-form input {
        min-width: 0;
        width: 100%;
    }
}

.inbound-record-panel {
    min-height: 480px;
    margin: 0 auto;
    border-radius: 28px;
    padding: 34px 42px 42px;
}

.inbound-record-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 28px;
}

.inbound-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 220px) minmax(172px, auto);
    gap: 16px;
    align-items: center;
}

.inbound-export-actions {
    display: flex;
    justify-content: flex-end;
}

.inbound-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.inbound-status-filters .button-link,
.date-range-menu summary {
    min-height: 48px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    box-shadow: none;
    font-size: 0.98rem;
    font-weight: 650;
}

.date-range-menu {
    position: relative;
}

.date-range-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 172px;
    border-radius: 999px;
    padding: 0 22px;
    cursor: pointer;
    list-style: none;
}

.date-range-menu summary::-webkit-details-marker {
    display: none;
}

.date-range-menu[open] summary,
.date-range-menu summary:hover {
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.date-range-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: 320px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.date-range-popover label {
    margin-bottom: 12px;
}

.date-range-popover .actions {
    justify-content: flex-end;
    gap: 10px;
}

.button-link.active-filter {
    border-color: #1d1d1f;
    background: #fff;
    color: #1d1d1f;
    font-weight: 750;
}

.inbound-record-table th a {
    color: var(--text);
    font-weight: 750;
    white-space: nowrap;
}

.inbound-record-table .select-column {
    width: 42px;
    text-align: center;
}

.inbound-record-table .select-column input {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.inbound-record-table td {
    white-space: nowrap;
}

.inbound-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 300px;
}

.inbound-row-actions form {
    margin: 0;
}

.inbound-row-actions .button-link,
.inbound-row-actions button {
    min-height: 42px;
}

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

.detail-grid p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eef3fb;
    color: #2f5f91;
    font-size: 0.82rem;
    font-weight: 600;
}

.code-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    background: var(--blue-soft);
    color: var(--blue);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    background: #eef3fb;
    color: #315f8e;
    font-size: 0.78rem;
    font-weight: 750;
    white-space: nowrap;
}

.status-pill.success {
    background: rgba(52, 199, 89, 0.12);
    color: #176b2c;
}

.status-pill.warning {
    background: rgba(255, 149, 0, 0.14);
    color: #7a3f00;
}

.status-pill.danger {
    background: rgba(255, 59, 48, 0.12);
    color: #9a0010;
}

.location-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.location-chip {
    min-width: 180px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, 0.72);
    transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.location-chip:hover {
    background: #fff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

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

.location-chip strong {
    margin-bottom: 4px;
}

.location-chip span {
    color: var(--muted);
    font-size: 0.82rem;
}

.log-message {
    max-width: 720px;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-word;
}

.test-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-left: 6px;
    border-radius: 999px;
    padding: 0 8px;
    background: rgba(255, 149, 0, 0.14);
    color: #7a3f00;
    font-size: 0.75rem;
    font-weight: 750;
    white-space: nowrap;
}

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

.check-grid.compact {
    grid-template-columns: 1fr;
    min-width: 220px;
}

.narrow-panel {
    max-width: 520px;
}

.profile-panel {
    max-width: 960px;
    margin-inline: auto;
}

.profile-page-title {
    max-width: 960px;
    margin-inline: auto;
    width: 100%;
    margin-bottom: 24px;
}

.profile-page-title p {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.profile-header h2 {
    margin: 0 0 4px;
    font-size: 1.9rem;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 108px;
}

.profile-avatar-menu {
    position: relative;
    flex: 0 0 auto;
}

.profile-avatar-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
}

.profile-avatar-menu summary::-webkit-details-marker {
    display: none;
}

.profile-avatar-menu[open] summary::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 25;
}

.avatar-token {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-grid;
    place-items: center;
    background: #f5f5f7;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.avatar-token img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-token:not(.avatar-initial):not(:has(img)) > span {
    width: 100%;
    height: 100%;
}

.avatar-art {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 50%;
}

.avatar-art i {
    position: absolute;
    display: block;
}

.avatar-preset-1 .avatar-art i:nth-child(1) {
    width: 76%;
    height: 76%;
    left: 12%;
    top: 12%;
    border: 2px solid rgba(255, 255, 255, 0.84);
    border-radius: 50%;
}

.avatar-preset-1 .avatar-art i:nth-child(2) {
    width: 8%;
    height: 8%;
    right: 25%;
    top: 20%;
    background: #fff;
    border-radius: 50%;
}

.avatar-preset-1 .avatar-art i:nth-child(3) {
    width: 60%;
    height: 2px;
    left: 20%;
    top: 58%;
    background: rgba(255, 255, 255, 0.72);
    transform: rotate(-24deg);
}

.avatar-preset-2 .avatar-art i {
    width: 86%;
    height: 32%;
    left: 7%;
    border: 2px solid rgba(255, 255, 255, 0.78);
    border-color: rgba(255, 255, 255, 0.78) transparent transparent transparent;
    border-radius: 50%;
}

.avatar-preset-2 .avatar-art i:nth-child(1) { top: 34%; }
.avatar-preset-2 .avatar-art i:nth-child(2) { top: 45%; opacity: 0.7; }
.avatar-preset-2 .avatar-art i:nth-child(3) { top: 56%; opacity: 0.45; }

.avatar-preset-3 .avatar-art i:nth-child(1) {
    left: 15%;
    bottom: 20%;
    width: 36%;
    height: 34%;
    background: rgba(255, 255, 255, 0.82);
    clip-path: polygon(0 100%, 100% 100%, 52% 0);
}

.avatar-preset-3 .avatar-art i:nth-child(2) {
    right: 13%;
    bottom: 20%;
    width: 48%;
    height: 48%;
    background: rgba(255, 255, 255, 0.55);
    clip-path: polygon(0 100%, 100% 100%, 44% 0);
}

.avatar-preset-3 .avatar-art i:nth-child(3) {
    left: 16%;
    bottom: 18%;
    width: 68%;
    height: 3px;
    background: rgba(255, 255, 255, 0.58);
}

.avatar-preset-4 .avatar-art i:nth-child(1) {
    width: 54%;
    height: 54%;
    left: 21%;
    top: 20%;
    border: 5px solid rgba(255, 255, 255, 0.86);
    border-right-color: transparent;
    border-radius: 50%;
    transform: rotate(28deg);
}

.avatar-preset-4 .avatar-art i:nth-child(2),
.avatar-preset-4 .avatar-art i:nth-child(3) {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
}

.avatar-preset-4 .avatar-art i:nth-child(2) { right: 24%; top: 26%; }
.avatar-preset-4 .avatar-art i:nth-child(3) { left: 25%; bottom: 28%; }

.avatar-preset-5 .avatar-art i {
    width: 8px;
    height: 74%;
    top: 13%;
    background: rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    transform: rotate(28deg);
}

.avatar-preset-5 .avatar-art i:nth-child(1) { left: 28%; }
.avatar-preset-5 .avatar-art i:nth-child(2) { left: 47%; opacity: .68; }
.avatar-preset-5 .avatar-art i:nth-child(3) { left: 66%; opacity: .42; }

.avatar-preset-6 .avatar-art i:nth-child(1) {
    width: 54%;
    height: 54%;
    left: 23%;
    bottom: 18%;
    background: rgba(255, 255, 255, 0.86);
    border-radius: 50% 50% 8% 8%;
}

.avatar-preset-6 .avatar-art i:nth-child(2) {
    left: 18%;
    bottom: 17%;
    width: 64%;
    height: 3px;
    background: rgba(255, 255, 255, 0.72);
}

.avatar-preset-6 .avatar-art i:nth-child(3) {
    left: 12%;
    bottom: 28%;
    width: 76%;
    height: 3px;
    background: rgba(255, 255, 255, 0.42);
}

.avatar-preset-7 .avatar-art i:nth-child(1) {
    width: 58%;
    height: 58%;
    left: 21%;
    top: 21%;
    border: 6px solid rgba(255, 255, 255, 0.88);
    border-radius: 50%;
}

.avatar-preset-7 .avatar-art i:nth-child(2) {
    width: 28%;
    height: 28%;
    left: 36%;
    top: 36%;
    background: rgba(0, 0, 0, 0.14);
    border-radius: 50%;
}

.avatar-preset-7 .avatar-art i:nth-child(3) {
    inset: 0;
    background: linear-gradient(120deg, transparent 45%, rgba(255,255,255,.45) 46% 52%, transparent 53%);
}

.avatar-preset-8 .avatar-art i:nth-child(1) {
    inset: 18%;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    transform: rotate(45deg);
}

.avatar-preset-8 .avatar-art i:nth-child(2) {
    inset: 31%;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    transform: rotate(45deg);
}

.avatar-preset-8 .avatar-art i:nth-child(3) {
    inset: 42%;
    border-radius: 50%;
    background: rgba(255,255,255,.62);
}

.avatar-preset-9 .avatar-art i:nth-child(1),
.avatar-preset-9 .avatar-art i:nth-child(2),
.avatar-preset-9 .avatar-art i:nth-child(3) {
    width: 36%;
    height: 36%;
    border: 3px solid rgba(255,255,255,.82);
    border-radius: 50%;
}

.avatar-preset-9 .avatar-art i:nth-child(1) { left: 16%; top: 18%; }
.avatar-preset-9 .avatar-art i:nth-child(2) { right: 16%; top: 28%; opacity: .7; }
.avatar-preset-9 .avatar-art i:nth-child(3) { left: 31%; bottom: 15%; opacity: .55; }

.avatar-preset-10 .avatar-art i:nth-child(1) {
    width: 56%;
    height: 56%;
    left: 22%;
    top: 22%;
    background: rgba(255,255,255,.88);
    border-radius: 50%;
}

.avatar-preset-10 .avatar-art i:nth-child(2) {
    width: 28%;
    height: 28%;
    left: 36%;
    top: 36%;
    background: rgba(255,59,48,.92);
    border-radius: 50%;
}

.avatar-preset-10 .avatar-art i:nth-child(3) {
    width: 78%;
    height: 78%;
    left: 11%;
    top: 11%;
    border: 2px solid rgba(255,255,255,.34);
    border-radius: 50%;
}

.avatar-token-small {
    width: 37px;
    height: 37px;
    font-size: 1rem;
    box-shadow: none;
}

.avatar-token-choice {
    width: 42px;
    height: 42px;
    font-size: 1rem;
    box-shadow: none;
    cursor: pointer;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(5, 42px);
    gap: 12px;
    align-items: center;
    justify-content: start;
}

.avatar-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 12px);
    z-index: 30;
    width: 288px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(18px);
}

.avatar-popover p {
    margin: 0 0 12px;
    font-weight: 700;
}

.avatar-choice {
    position: relative;
    display: inline-flex;
}

.avatar-choice input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.avatar-choice input:checked + .avatar-token,
.avatar-choice:focus-within .avatar-token {
    outline: 3px solid rgba(0, 113, 227, 0.28);
    border-color: #0071e3;
}

.avatar-choice-upload input {
    cursor: pointer;
}

.avatar-upload-symbol {
    background: #fff;
    color: #111;
    font-size: 1.8rem;
}

.avatar-upload-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 18px auto 0;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.avatar-upload-line input {
    display: none;
}

.avatar-cropper {
    margin-top: 18px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.avatar-crop-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #f5f5f7;
}

.avatar-cropper canvas {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: block;
}

.avatar-cropper label {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 0.84rem;
    color: var(--muted);
}

.avatar-cropper input[type="range"] {
    width: 100%;
}

.avatar-menu-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.avatar-menu-actions button,
.avatar-menu-actions .button-link {
    min-height: 38px;
    padding: 0 20px;
    font-size: 0.92rem;
}

.avatar-initial {
    background: #f5f5f7;
    color: #1d1d1f;
}

.avatar-preset-1 { background: radial-gradient(circle at 28% 30%, #fff 0 7%, transparent 8%), linear-gradient(135deg, #061a3a, #0071e3); }
.avatar-preset-2 { background: radial-gradient(circle at 70% 32%, rgba(255,255,255,.9) 0 12%, transparent 13%), linear-gradient(135deg, #00c7be, #007aff); }
.avatar-preset-3 { background: linear-gradient(140deg, transparent 45%, rgba(255,255,255,.88) 46% 62%, transparent 63%), linear-gradient(135deg, #0b3b2e, #34c759); }
.avatar-preset-4 { background: radial-gradient(circle at 64% 35%, transparent 0 18%, rgba(255,255,255,.88) 19% 29%, transparent 30%), linear-gradient(135deg, #2c1a5c, #af52de); }
.avatar-preset-5 { background: linear-gradient(90deg, transparent 0 30%, rgba(255,255,255,.85) 31% 42%, transparent 43%), linear-gradient(135deg, #5f0f40, #ff2d55); }
.avatar-preset-6 { background: radial-gradient(circle at 50% 72%, rgba(255,255,255,.9) 0 23%, transparent 24%), linear-gradient(135deg, #7a2e00, #ff9500); }
.avatar-preset-7 { background: radial-gradient(circle at 50% 50%, transparent 0 26%, rgba(255,255,255,.92) 27% 39%, transparent 40%), linear-gradient(135deg, #6b4e00, #ffd60a); }
.avatar-preset-8 { background: linear-gradient(135deg, rgba(255,255,255,.12) 0 35%, rgba(255,255,255,.85) 36% 48%, rgba(255,255,255,.08) 49%), linear-gradient(135deg, #1d1d1f, #8e8e93); }
.avatar-preset-9 { background: radial-gradient(circle at 35% 65%, rgba(255,255,255,.9) 0 16%, transparent 17%), linear-gradient(135deg, #004a55, #64d2ff); }
.avatar-preset-10 { background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.9) 0 18%, transparent 19%), linear-gradient(135deg, #5c0011, #ff3b30); }

.profile-avatar-main {
    flex: 0 0 auto;
}

.profile-grid {
    align-items: end;
}

.top-avatar {
    flex: 0 0 auto;
}

.top-avatar svg {
    width: 25px;
    height: 25px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

tr:hover td {
    background: #f5f5f7;
}

tbody td:hover {
    background: #e5e5ea;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 28px;
        padding: 32px 0;
    }

    .auth-panel {
        padding: 24px;
    }

    body {
        background: #f5f5f7;
    }

    .mobile-topbar {
        position: fixed;
        inset: 0 0 auto;
        z-index: 30;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: env(safe-area-inset-top) 18px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        background: rgba(251, 251, 253, 0.82);
        backdrop-filter: saturate(180%) blur(20px);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
    }

    .mobile-logo {
        min-height: 50px;
        display: inline-flex;
        align-items: center;
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 700;
        letter-spacing: 0;
    }

    .mobile-menu-button {
        width: 44px;
        height: 50px;
        display: grid;
        place-items: center;
        margin: 0;
        cursor: pointer;
    }

    .mobile-menu-button span {
        position: absolute;
        width: 17px;
        height: 1.6px;
        border-radius: 999px;
        background: #1d1d1f;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .mobile-menu-button span:first-child {
        transform: rotate(90deg);
    }

    .mobile-menu-toggle:checked ~ .mobile-topbar .mobile-menu-button span:first-child {
        transform: rotate(45deg);
    }

    .mobile-menu-toggle:checked ~ .mobile-topbar .mobile-menu-button span:last-child {
        transform: rotate(-45deg);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 50px 0 0;
        z-index: 20;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(245, 245, 247, 0.48);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: opacity 180ms ease;
    }

    .admin-sidebar {
        inset: 50px 0 auto;
        z-index: 25;
        width: auto;
        max-height: calc(100vh - 50px);
        overflow-y: auto;
        border: 0;
        border-radius: 0 0 24px 24px;
        padding: 18px;
        background: rgba(251, 251, 253, 0.94);
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 220ms ease, opacity 180ms ease;
    }

    .mobile-menu-toggle:checked ~ .mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-toggle:checked ~ .admin-sidebar {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .admin-brand {
        padding: 0 0 16px;
    }

    .admin-nav span,
    .admin-brand span,
    .admin-account > span {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .admin-nav {
        gap: 2px;
    }

    .admin-nav a {
        min-height: 48px;
        border-radius: 14px;
        padding: 7px 8px;
        color: var(--text);
        font-size: 1.05rem;
    }

    .admin-account {
        margin-top: 8px;
        padding-top: 16px;
    }

    .admin-shell {
        width: auto;
        margin-left: 0;
        padding: calc(72px + env(safe-area-inset-top)) 14px 34px;
    }

    .admin-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-form,
    .grid-form,
    .compact-form,
    .inbound-record-toolbar,
    .inbound-filter-form,
    .stats-grid,
    .detail-grid,
    .detail-grid.two-column,
    .check-grid {
        grid-template-columns: 1fr;
    }

    .inbound-hero-grid {
        width: auto;
        grid-template-columns: 1fr;
        transform: none;
        margin: 0 0 24px;
    }

    .inventory-hero-grid,
    .inventory-stat-grid,
    .outbound-hero-grid,
    .outbound-stat-grid,
    .product-type-grid,
    .product-editor-grid,
    .product-field-two,
    .product-field-three,
    .product-carton-row {
        grid-template-columns: 1fr;
    }

    .inventory-hero-card,
    .outbound-hero-card {
        aspect-ratio: auto;
    }

    .inventory-stat-card,
    .outbound-stat-card {
        min-height: 132px;
    }

    .product-editor-shell {
        width: 100%;
    }

    .product-editor-panel {
        padding: 20px 16px 24px;
    }

    .product-photo-uploader {
        max-width: 340px;
    }

    .inbound-card {
        aspect-ratio: auto;
        min-height: 220px;
        padding: 22px;
    }

    .overview-page {
        padding-top: 18px;
    }

    .overview-page h1 {
        margin-bottom: 28px;
        font-size: 2.65rem;
        text-align: left;
    }

    .overview-card-grid {
        grid-template-columns: 1fr;
    }

    .overview-card {
        min-height: 114px;
    }

    .inbound-card h2 {
        font-size: 1.8rem;
    }

    .inbound-card p {
        width: 100%;
        font-size: 16px;
    }

    .grid-form textarea,
    .grid-form .check-grid,
    .test-label-toggle {
        grid-column: auto;
    }

    .inline-form,
    .scan-form,
    .actions,
    .receiving-head,
    .section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .scan-form input[name="location"] {
        max-width: none;
    }

    .panel {
        padding: 16px;
    }

    .scan-form input {
        font-size: 1.45rem;
    }
}

@media (max-width: 520px) {
    .auth-shell {
        width: min(100% - 28px, 480px);
    }

    .auth-hero h1 {
        font-size: 2.4rem;
    }

    .auth-panel h2 {
        font-size: 2rem;
    }

    .admin-shell {
        margin-left: 0;
        padding-right: 12px;
        padding-left: 12px;
    }

    h1 {
        font-size: 1.9rem;
    }
}

/* Top navigation shell, based on the approved PDF direction. */
.admin-topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--topbar-height);
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(420px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.admin-topbar .mobile-menu-button {
    display: none;
}

.top-logo {
    display: inline-flex;
    align-items: center;
    width: 223px;
    min-width: 223px;
    height: 100%;
}

.top-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    height: 100%;
}

.top-nav-item {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    height: 30px;
    border-radius: 999px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #1d1d1f;
    box-shadow: none;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    font-family: inherit;
}

.top-nav-item:hover,
.mega-group:hover .top-nav-item {
    background: #f1f1f3;
    color: #000;
    box-shadow: none;
    font-weight: 750;
}

.mega-group {
    height: 100%;
    display: flex;
    align-items: center;
}

.mega-menu {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    z-index: 45;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 220ms ease;
}

.mega-group:hover .mega-menu,
.mega-group:focus-within .mega-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mega-inner {
    width: min(920px, calc(100% - 48px));
    min-height: 140px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0 auto;
    padding: 30px 0 34px;
}

.mega-inner a,
.mega-disabled {
    display: block;
    border-radius: 16px;
    padding: 14px;
    color: #1d1d1f;
}

.mega-inner a:hover {
    background: #f5f5f7;
}

.mega-inner strong,
.mega-inner span {
    display: block;
}

.mega-inner strong {
    margin-bottom: 7px;
    font-size: 1rem;
}

.mega-inner span,
.mega-disabled {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.balance-pill {
    color: #2b6ecb;
    font-size: 0.78rem;
    white-space: nowrap;
}

.balance-pill.warning {
    color: #d07000;
}

.balance-pill.danger {
    color: var(--red);
    font-weight: 750;
}

.top-icon-group {
    position: relative;
}

.top-account-button {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    padding: 0 2px 0 10px;
    background: transparent;
    color: #1d1d1f;
    box-shadow: none;
    font-size: 0.82rem;
    font-weight: 650;
    white-space: nowrap;
}

.top-account-button > span:first-child {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-account-button:hover,
.top-icon-group:hover .top-account-button {
    background: #f1f1f3;
    box-shadow: none;
}

.top-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    min-height: 28px;
    height: 28px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: #111;
    box-shadow: none;
}

.top-icon:hover,
.top-icon-group:hover .top-icon {
    background: #f1f1f3;
    box-shadow: none;
}

.top-account-button:hover .top-icon,
.top-icon-group:hover .top-account-button .top-icon {
    background: transparent;
}

.top-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-top-icon {
    position: relative;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0071e3;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.global-search-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    z-index: 48;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.10);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 170ms ease, transform 190ms ease;
}

.global-search-open .global-search-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.global-search-form {
    width: min(470px, calc(100% - 32px));
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    margin: 0 0 0 auto;
}

.global-search-form input {
    min-height: 48px;
    border-color: transparent;
    border-radius: 999px;
    background: #f5f5f7;
    font-size: 1.05rem;
}

.global-search-form input:focus {
    border-color: rgba(0, 113, 227, 0.3);
    background: #fff;
}

.icon-menu {
    position: absolute;
    top: 30px;
    right: 0;
    min-width: 180px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 8px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.top-icon-group:hover .icon-menu,
.top-icon-group:focus-within .icon-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.icon-menu a {
    display: block;
    border-radius: 10px;
    padding: 9px 10px;
    color: #1d1d1f;
    font-size: 0.9rem;
}

.icon-menu-user {
    border-bottom: 1px solid var(--line);
    margin: 0 2px;
    padding: 8px 8px;
}

.icon-menu-client {
    margin: 0 2px 6px;
    padding: 8px 8px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.35;
    word-break: break-word;
}

.icon-menu-user + .icon-menu-client {
    border-top: 0;
}

.search-page-card {
    width: min(1120px, 100%);
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    padding: 28px;
    background: rgba(255, 255, 255, 0.90);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.10);
}

.global-search-page-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
}

.global-search-page-form input {
    min-height: 52px;
    border-radius: 999px;
    font-size: 1.06rem;
}

.search-summary,
.empty-state {
    color: var(--muted);
    font-size: 0.96rem;
}

.empty-state {
    padding: 34px 0 12px;
}

.search-result-groups {
    display: grid;
    gap: 24px;
}

.search-result-group h2 {
    margin: 0 0 10px;
    font-size: 1.15rem;
}

.search-result-list {
    border-top: 1px solid var(--line);
}

.search-result-row {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.search-result-row:hover {
    background: #f5f5f7;
}

.search-result-label {
    display: inline-flex;
    width: fit-content;
    max-width: 148px;
    border-radius: 999px;
    padding: 5px 10px;
    background: #e8f1ff;
    color: #0071e3;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-main {
    min-width: 0;
}

.search-result-main strong,
.search-result-main em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-main strong {
    font-size: 1rem;
}

.search-result-main em {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
    font-style: normal;
}

.search-result-open {
    color: var(--blue);
    font-size: 0.9rem;
    font-weight: 650;
}

.icon-menu-user:has(+ .icon-menu-client) {
    margin-bottom: 0;
    padding-bottom: 8px;
}

.icon-menu-user strong,
.icon-menu-user span {
    display: block;
}

.icon-menu-user strong {
    color: var(--text);
    font-size: 0.94rem;
}

.icon-menu-user span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    word-break: break-word;
}

.icon-menu a:hover {
    background: #f5f5f7;
}

.admin-shell {
    width: min(1260px, calc(100% - 48px));
    margin: 0 auto;
    padding: 95px 0 48px;
}

.permission-profile-list,
.case-type-list,
.notification-list {
    display: grid;
    gap: 18px;
}

.permission-profile-card,
.case-type-row,
.notification-row {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: #fff;
}

.permission-profile-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
}

.permission-profile-head input,
.permission-profile-head textarea,
.case-type-row input,
.case-type-row select,
.case-type-row textarea {
    width: 100%;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    font: inherit;
}

.permission-profile-head input {
    font-size: 1.15rem;
    font-weight: 750;
}

.permission-matrix {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.permission-group {
    border: 1px solid #ececf0;
    border-radius: 14px;
    padding: 14px;
    background: #fafafa;
}

.permission-group h3 {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.permission-checks {
    display: grid;
    gap: 8px;
}

.permission-checks label,
.compact-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.86rem;
    line-height: 1.35;
}

.permission-checks input,
.compact-check input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.case-type-row {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr 1.2fr 0.5fr auto;
    gap: 12px;
    align-items: center;
}

.case-type-row textarea {
    grid-column: 1 / -2;
}

.notification-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.notification-row.is-unread {
    border-color: rgba(0, 113, 227, 0.35);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.08);
}

.notification-row strong,
.notification-row span,
.notification-row small {
    display: block;
}

.notification-row span {
    margin-top: 5px;
    color: #424245;
}

.notification-row small {
    margin-top: 6px;
    color: var(--muted);
}

.notification-row.is-read {
    opacity: 0.72;
}

.line-items {
    display: grid;
    gap: 10px;
}

.line-item-row {
    display: grid;
    grid-template-columns: 1fr 120px 1.2fr auto;
    gap: 10px;
    align-items: center;
}

.manual-label-panel,
.manual-quote-panel {
    width: min(960px, 100%);
    margin: 0 auto 24px;
}

.manual-label-panel {
    min-height: 1260px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    padding: 26px 22px 42px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}

.manual-label-panel.single-inbound-panel {
    width: min(1130px, 100%);
    min-height: 0;
    padding: 26px 22px;
}

.manual-label-panel h1 {
    margin: 0 0 26px;
    color: #111;
    font-size: 1.95rem;
    line-height: 1.12;
    letter-spacing: 0;
}

.manual-label-form {
    display: block;
}

.manual-staff-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin-bottom: 20px;
}

.manual-staff-controls select {
    max-width: 520px;
}

.single-inbound-staff-controls {
    margin-bottom: 18px;
}

.manual-divider,
.manual-form-section {
    border-top: 1px solid #d8d8d8;
}

.manual-form-section {
    padding: 22px 0 28px;
}

.manual-form-section h2 {
    display: flex;
    align-items: center;
    min-height: 44px;
    margin: 0;
    color: #111;
    font-size: 1.38rem;
    line-height: 1;
    letter-spacing: 0;
}

.manual-section-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 8px;
}

.manual-checkbox {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    gap: 10px;
    color: #8b8b8f;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.manual-checkbox span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
}

.manual-checkbox input {
    flex: 0 0 auto;
    width: 18px;
    min-height: 18px;
    margin: 0;
    border-radius: 2px;
}

.manual-field-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px 12px;
}

.manual-field-grid .span-4 {
    grid-column: span 4;
}

.manual-field-grid .span-6 {
    grid-column: span 6;
}

.single-inbound-transport-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 16px;
}

.manual-label-panel input,
.manual-label-panel select {
    min-height: 40px;
    border: 1px solid #9d9d9f;
    border-radius: 999px;
    padding: 0 16px;
    background: #fff;
    color: #1d1d1f;
    font-size: 0.92rem;
    box-shadow: none;
}

.manual-label-panel input::placeholder {
    color: #8f8f94;
}

.manual-label-panel input[readonly] {
    background: #fbfbfd;
    color: #6e6e73;
}

.manual-line-items {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.manual-package-rows {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.manual-line-row,
.manual-package-row {
    display: grid;
    align-items: center;
    gap: 12px;
}

.manual-line-row {
    grid-template-columns: minmax(180px, 1.05fr) 140px minmax(280px, 1.4fr) 112px 40px;
}

.single-inbound-panel .manual-line-row {
    grid-template-columns: minmax(240px, 1.05fr) minmax(280px, 1.35fr) 130px 112px 40px;
}

.pallet-inbound-panel .manual-form-section {
    padding: 20px 0 26px;
}

.pallet-transport-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 36px;
    row-gap: 14px;
    margin-top: 28px;
}

.pallet-transport-grid .pallet-transport-wide {
    grid-column: span 6;
}

.pallet-transport-grid .pallet-transport-small {
    grid-column: span 3;
}

.pallet-line-items,
.pallet-package-rows {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.pallet-line-row,
.pallet-package-row {
    display: grid;
    align-items: center;
    gap: 12px;
}

.pallet-line-row {
    grid-template-columns: minmax(170px, 1fr) minmax(240px, 1.35fr) 140px 140px 112px 40px;
}

.line-battery-checkbox {
    display: inline-grid;
    grid-template-columns: auto 20px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    align-self: center;
    height: 40px;
    min-height: 40px;
    border: 1px solid #9d9d9f;
    border-radius: 999px;
    padding: 0 12px;
    color: #8b8b8f;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.line-battery-checkbox span {
    display: block;
    line-height: 20px;
}

.manual-label-panel .line-battery-checkbox input {
    width: 20px;
    height: 20px;
    min-height: 20px;
    flex: 0 0 20px;
    margin: 0;
    padding: 0;
    appearance: auto;
    min-width: 20px;
    border: 1px solid #7c7c80;
    border-radius: 2px;
    box-shadow: none;
}

.pallet-package-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(120px, 0.75fr) minmax(110px, 0.65fr) 40px;
}

.pallet-import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.manual-package-row {
    grid-template-columns: repeat(4, minmax(0, 1fr)) 40px;
}

.circle-control {
    position: relative;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid #7c7c80;
    border-radius: 999px;
    padding: 0;
    background: #fff;
    color: #1d1d1f;
    font-size: 0;
    font-weight: 400;
    box-shadow: none;
}

.circle-control::before,
.circle-control::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 17px;
    height: 1.8px;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.circle-control.icon-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.circle-control.icon-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.circle-control.icon-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.circle-control:hover {
    background: #f5f5f7;
    box-shadow: none;
}

.add-control {
    margin-top: 12px;
    line-height: 1;
}

.manual-add-row {
    display: flex;
    margin-top: 12px;
}

.muted-control {
    color: #1d1d1f;
}

.manual-notes {
    width: 100%;
    margin-top: 12px;
}

.manual-submit {
    min-width: 114px;
    margin-top: 22px;
}

.purchase-label-panel {
    width: min(1380px, calc(100vw - 56px));
    min-height: auto;
    border-radius: 14px;
    padding: 40px 34px 70px;
}

.purchase-label-panel h1 {
    margin: 0 0 42px;
    font-size: 2.04rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.purchase-label-panel .manual-divider {
    height: 1px;
    margin: 0 0 28px;
    background: #d9d9d9;
}

.purchase-label-panel .manual-form-section {
    border-top: 1px solid #dcdcdc;
    padding: 30px 0 34px;
}

.purchase-label-panel .purchase-address-section {
    border-top: 0;
    padding-top: 0;
}

.purchase-address-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 100px;
}

.purchase-address-grid::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #e1e1e1;
    transform: translateX(-50%);
}

.purchase-address-column + .purchase-address-column {
    border-left: 0;
    padding-left: 0;
}

.purchase-label-panel .manual-section-heading {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: 18px;
    min-height: 26px;
    margin-bottom: 22px;
}

.purchase-label-panel .manual-form-section h2 {
    display: flex;
    align-items: center;
    min-height: 26px;
    margin: 0;
    font-size: 1.52rem;
    font-weight: 800;
    line-height: 1;
}

.purchase-label-panel .manual-checkbox,
.purchase-label-panel .line-battery-checkbox {
    position: relative;
    display: inline-grid;
    align-items: center;
    justify-content: center;
    column-gap: 6px;
    box-sizing: border-box;
    margin: 0;
    color: #85858b;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.purchase-label-panel .manual-checkbox {
    grid-template-columns: 16px auto;
    min-height: 26px;
    font-size: 0.86rem;
}

.purchase-label-panel .line-battery-checkbox {
    grid-template-columns: auto 16px;
    width: 90px;
    height: 42px;
    min-height: 42px;
    border: 1px solid #1d1d1f;
    border-radius: 999px;
    padding: 0 9px;
    font-size: 0.9rem;
}

.purchase-label-panel .manual-checkbox .checkbox-text,
.purchase-label-panel .line-battery-checkbox .battery-text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1em;
    padding: 0;
    line-height: 1;
    white-space: nowrap;
}

.purchase-label-panel .manual-checkbox .checkbox-mark,
.purchase-label-panel .line-battery-checkbox .checkbox-mark {
    display: block;
    position: relative;
    align-self: center;
    justify-self: center;
    box-sizing: border-box;
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    border: 1.5px solid #1d1d1f;
    border-radius: 2px;
    background: #fff;
}

.purchase-label-panel .manual-checkbox .checkbox-mark::after,
.purchase-label-panel .line-battery-checkbox .checkbox-mark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg);
}

.purchase-label-panel .manual-checkbox input,
.purchase-label-panel .line-battery-checkbox input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    margin: 0;
    padding: 0;
    opacity: 0;
}

.purchase-label-panel .manual-checkbox span::before,
.purchase-label-panel .manual-checkbox span::after,
.purchase-label-panel .line-battery-checkbox span::before,
.purchase-label-panel .line-battery-checkbox span::after {
    content: none;
}

.purchase-label-panel .manual-checkbox input:checked ~ .checkbox-mark,
.purchase-label-panel .line-battery-checkbox input:checked ~ .checkbox-mark {
    border-color: #0071e3;
    background: #0071e3;
}

.purchase-label-panel .manual-checkbox input:checked ~ .checkbox-mark::after,
.purchase-label-panel .line-battery-checkbox input:checked ~ .checkbox-mark::after {
    opacity: 1;
}

.purchase-label-panel .manual-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.purchase-label-panel .manual-field-grid input,
.purchase-label-panel .manual-field-grid select {
    grid-column: auto;
    width: 100%;
}

.purchase-label-panel input,
.purchase-label-panel select {
    height: 42px;
    min-height: 42px;
    border: 1px solid #1d1d1f;
    border-radius: 999px;
    padding: 0 24px;
    background: #fff;
    color: #1d1d1f;
    font-size: 1rem;
    font-weight: 700;
    line-height: 42px;
    box-shadow: none;
}

.purchase-label-panel input::placeholder {
    color: #9a9aa0;
    font-weight: 700;
}

.purchase-label-panel input[readonly] {
    background: #fbfbfd;
    color: #6e6e73;
}

.purchase-label-panel .manual-line-items,
.purchase-label-panel .manual-package-rows {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.purchase-label-panel .manual-line-row,
.purchase-label-panel .manual-package-row {
    display: grid;
    align-items: center;
    gap: 18px;
}

.purchase-label-panel .manual-line-row {
    grid-template-columns: 200px minmax(360px, 1fr) 150px 90px 42px;
}

.purchase-label-panel .manual-package-row {
    grid-template-columns: repeat(4, minmax(190px, 1fr)) 42px;
}

.purchase-label-panel .circle-control {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    border: 1px solid #1d1d1f;
    background: #fff;
}

.purchase-label-panel .circle-control::before,
.purchase-label-panel .circle-control::after {
    width: 21px;
    height: 3px;
    background: #000;
}

.purchase-label-panel .manual-add-row {
    margin-top: 14px;
}

.purchase-label-panel .add-control {
    margin-top: 0;
}

.purchase-label-panel .manual-notes {
    width: 100%;
    margin-top: 18px;
}

.purchase-import-actions {
    display: flex;
    gap: 18px;
    margin-top: 16px;
}

.purchase-import-actions .button-link {
    min-height: 42px;
    min-width: 136px;
    border-color: #1d1d1f;
    padding: 0 28px;
    font-size: 1rem;
    font-weight: 800;
}

.purchase-label-panel .manual-submit {
    min-width: 136px;
    min-height: 46px;
    margin-top: 30px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 800;
}

.manual-quote-panel {
    width: min(1380px, calc(100vw - 56px));
    padding: 40px 34px;
}

.manual-quote-panel .table-wrap {
    width: 100%;
}

.quote-select-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

.quote-select-box {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    margin: 0;
    border: 1.5px solid #8a8a8a;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
}

.quote-select-box:checked {
    border-color: #0071e3;
    background:
        linear-gradient(45deg, transparent 58%, #fff 58%, #fff 72%, transparent 72%) 6px 7px / 11px 11px no-repeat,
        linear-gradient(-45deg, transparent 52%, #fff 52%, #fff 68%, transparent 68%) 2px 9px / 9px 9px no-repeat,
        #0071e3;
}

.quote-select-box:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.22);
    outline-offset: 3px;
}

@media (max-width: 980px) {
    .admin-topbar {
        height: auto;
        min-height: 78px;
        grid-template-columns: 1fr auto;
        padding: 0 16px;
    }

    .top-logo {
        width: 208px;
        min-width: 208px;
    }

    .admin-topbar .mobile-menu-button {
        position: relative;
        display: grid;
    }

    .top-nav,
    .top-actions {
        grid-column: 1 / -1;
        display: none;
        justify-content: flex-start;
        flex-wrap: wrap;
        height: auto;
        padding: 8px 0 14px;
    }

    .mobile-menu-toggle:checked ~ .admin-topbar .top-nav,
    .mobile-menu-toggle:checked ~ .admin-topbar .top-actions {
        display: flex;
    }

    .mega-menu {
        position: static;
        width: 100%;
        display: none;
        border: 0;
        background: transparent;
        opacity: 1;
        transform: none;
    }

    .mega-group {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
    }

    .mega-group:hover .mega-menu,
    .mega-group:focus-within .mega-menu {
        display: block;
    }

    .mega-inner {
        width: auto;
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 6px 0;
    }

    .line-item-row {
        grid-template-columns: 1fr;
    }

    .manual-label-panel {
        min-height: auto;
        padding: 22px 18px 34px;
    }

    .purchase-label-panel {
        min-height: auto;
        padding: 22px 18px 42px;
    }

    .purchase-address-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .purchase-address-grid::before {
        display: none;
    }

    .purchase-address-column + .purchase-address-column {
        border-left: 0;
        border-top: 1px solid #e5e5e5;
        padding-left: 0;
        padding-top: 22px;
    }

    .manual-staff-controls,
    .manual-field-grid,
    .single-inbound-transport-row,
    .manual-line-row,
    .manual-package-row,
    .pallet-transport-grid,
    .pallet-line-row,
    .pallet-package-row {
        grid-template-columns: 1fr;
    }

    .manual-field-grid .span-4,
    .manual-field-grid .span-6 {
        grid-column: auto;
    }

    .manual-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .manual-checkbox {
        white-space: normal;
    }

    .purchase-label-panel .manual-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .manual-line-row,
    .manual-package-row,
    .pallet-line-row,
    .pallet-package-row {
        position: relative;
        padding-right: 48px;
    }

    .manual-line-row .circle-control,
    .manual-package-row .circle-control,
    .pallet-line-row .circle-control,
    .pallet-package-row .circle-control {
        position: absolute;
        top: 0;
        right: 0;
    }

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

    .pallet-detail-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-shell {
        width: auto;
        margin-left: 0;
        padding: 98px 14px 34px;
    }
}
