:root {
    color-scheme: light;
    --navy: #19283f;
    --teal: #13867b;
    --teal-soft: #e4f4f1;
    --gold: #e2a247;
    --red: #c74747;
    --ink: #24354c;
    --muted: #67778d;
    --line: #e1e8ef;
    --ice: #f6f8fb;
    --white: #fff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--ice);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--ice); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.topbar {
    min-height: 68px; display: flex; align-items: center; gap: 28px; padding: 10px 5vw;
    background: var(--navy); color: var(--white); box-shadow: 0 2px 12px #19283f20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font-size: 20px; font-weight: 750; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-accent { color: #9cd9d1; }
.topnav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.topnav a { min-height: 44px; display: inline-flex; align-items: center; color: #e4ebf2; font-size: 14px; }
.account-menu { display: flex; align-items: center; gap: 14px; }
.account-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.account-menu form { margin: 0; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 9px; cursor: pointer; font-weight: 650; }
.button-primary { background: var(--teal); color: var(--white); }
.button-primary:hover { background: #0f7168; color: var(--white); text-decoration: none; }
.button-quiet { padding: 0 12px; background: transparent; color: var(--white); }
.button-quiet:hover { background: #ffffff18; }
.button-wide { width: 100%; margin-top: 22px; }
.page-content { width: min(100% - 32px, 1040px); margin: 34px auto; }
.welcome-card, .content-card, .page-heading { padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); box-shadow: 0 4px 16px #19283f08; }
.welcome-card { padding: 32px; background: linear-gradient(135deg, #fff 0%, #f2faf8 100%); }
.welcome-card h1, .page-heading h1 { margin: 5px 0 8px; color: var(--navy); font-size: clamp(26px, 5vw, 36px); }
.eyebrow { margin: 0; color: var(--teal); font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.6; }
.role-list { display: flex; gap: 8px; margin-top: 20px; }
.role-badge { padding: 6px 10px; border-radius: 999px; background: var(--teal-soft); color: #0f655e; font-size: 12px; font-weight: 700; }
.content-card { margin-top: 18px; }
.content-card h2 { margin-top: 0; color: var(--navy); font-size: 19px; }
.site-footer { padding: 18px; color: var(--muted); text-align: center; font-size: 12px; }

.login-page, .error-page { display: grid; place-items: center; padding: 20px; }
.login-card, .error-card { width: min(100%, 420px); padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: 0 14px 40px #19283f12; }
.brand-login { color: var(--navy); }
.login-card h1 { margin: 28px 0 4px; color: var(--navy); font-size: 28px; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
.login-card label { margin-top: 7px; color: var(--ink); font-size: 14px; font-weight: 650; }
.login-card input { min-height: 46px; width: 100%; padding: 10px 12px; border: 1px solid #bdc9d6; border-radius: 8px; background: var(--white); color: var(--ink); }
.login-footnote { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.alert { padding: 11px 13px; border-radius: 8px; line-height: 1.5; }
.alert-error { border: 1px solid #f0c5c5; background: #fff4f4; color: #8f2929; }
.error-card h1 { margin: 8px 0; color: var(--navy); }
.error-card .button { margin-top: 14px; }

.button-secondary { border: 1px solid #c7d2df; background: #fff; color: var(--navy); }
.button-secondary:hover { background: #eff5f6; text-decoration: none; }
.button-danger { min-height: 44px; border: 0; border-radius: 8px; padding: 0 18px; background: var(--red); color: #fff; font-weight: 700; cursor: pointer; }
.button-remove { min-height: 44px; border: 1px solid #ebcaca; border-radius: 8px; padding: 0 14px; background: #fff8f8; color: #8f2929; cursor: pointer; }
.catalog-page, .product-detail-page, .catalog-form-page { display: grid; gap: 18px; }
.catalog-heading, .product-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.catalog-heading h1, .product-detail-heading h1 { overflow-wrap: anywhere; }
.filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.field { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 650; }
.field > span { display: block; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; border: 1px solid #bdc9d6; border-radius: 8px; padding: 9px 11px; background: #fff; color: var(--ink); font: inherit; font-weight: 400; }
.field textarea { min-height: 104px; resize: vertical; }
.field small, .suggestion-note { color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); gap: 16px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 4px 16px #19283f08; }
.product-card-image { display: grid; place-items: center; aspect-ratio: 1 / 1; min-height: 0; overflow: hidden; background: #eaf0f5; color: var(--teal); }
.product-card-image img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; object-position: center; }
.photo-placeholder { display: grid; place-items: center; width: 76px; height: 76px; border: 2px solid #bfded9; border-radius: 20px; color: var(--teal); font-size: 24px; font-weight: 800; }
.product-card-content { display: grid; gap: 8px; padding: 16px; }
.product-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-code { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.product-card h2 { margin: 0; color: var(--navy); font-size: 18px; line-height: 1.35; }
.product-card h2 a { color: inherit; }
.product-subtitle, .product-price, .product-cost-summary { margin: 0; }
.product-subtitle, .product-cost-summary { color: var(--muted); font-size: 13px; }
.product-price { color: var(--navy); font-size: 20px; font-weight: 750; }
.product-details-link { min-height: 44px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 3px; padding-top: 7px; font-weight: 700; }
.status-pill { border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; }
.status-inactive { background: #f3e6e6; color: #8f2929; }
.empty-state, .photo-empty { display: grid; place-items: center; gap: 8px; padding: 44px 20px; border: 1px dashed #bccbd6; border-radius: 14px; background: #fff; text-align: center; }
.empty-state h2, .photo-empty p { margin: 0; color: var(--navy); }
.photo-empty > span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.alert-success, .alert-warning { border: 1px solid #b7ded4; background: #effaf6; color: #1b675d; padding: 12px 14px; border-radius: 9px; line-height: 1.5; }
.alert-warning { border-color: #efd6a8; background: #fff8e9; color: #765118; }
.alert ul { margin: 8px 0 0; padding-left: 22px; }
.back-link { display: inline-block; min-height: 44px; padding-top: 11px; font-weight: 700; }
.product-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.product-summary-grid article, .profit-reference-grid p { display: grid; gap: 6px; margin: 0; padding: 14px; border-radius: 10px; background: var(--ice); }
.summary-label, .profit-reference-grid span { color: var(--muted); font-size: 13px; }
.product-summary-grid strong, .profit-reference-grid strong { color: var(--navy); font-size: 18px; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; }
.gallery-photo { overflow: hidden; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.gallery-photo img { width: 100%; height: 160px; object-fit: contain; background: #eaf0f5; }
.gallery-photo span { padding: 0 10px 10px; font-size: 12px; }
.gallery-cover { outline: 2px solid var(--teal); outline-offset: 2px; }
.catalog-form-page .page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.product-form { display: grid; gap: 16px; }
.form-section { min-width: 0; display: grid; gap: 14px; margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.product-form .form-section { display: block; }
.product-form .form-section > legend { float: left; width: 100%; margin: 0 0 4px; padding: 0; color: var(--navy); font-size: 17px; font-weight: 750; }
.product-form .form-section > legend + * { clear: both; }
.product-form .form-section > *:not(legend) { margin-top: 14px; }
.product-form .form-section > .muted { margin-top: 10px; }
.form-section > .muted { margin: -4px 0 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.repeatable-list { display: grid; gap: 12px; }
.repeatable-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.repeatable-row .field-wide { grid-column: 1 / -1; }
.paste-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 12px; border-radius: 9px; background: var(--ice); }
.paste-tools > span { flex: 1 1 100%; font-size: 14px; font-weight: 700; }
.paste-status { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.5; }
.new-image-previews:empty { display: none; }
.new-image-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.new-image-preview { position: relative; overflow: hidden; display: grid; grid-template-rows: 112px auto; gap: 0; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--ice); }
.new-image-preview img { width: 100%; height: 112px; object-fit: contain; background: #eaf0f5; }
.new-image-preview figcaption { overflow: hidden; padding: 7px 9px; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.new-image-remove { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 1px solid #fff; border-radius: 50%; background: #8f2929; color: #fff; box-shadow: 0 2px 8px #19283f40; cursor: pointer; font-size: 23px; font-weight: 700; line-height: 1; }
.new-image-remove:hover { background: #6f1f1f; }
.existing-files { display: grid; gap: 10px; }
.existing-files h3 { margin: 0; color: var(--navy); font-size: 16px; }
.existing-files > small { color: var(--muted); line-height: 1.5; }
.existing-file { min-height: 50px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.existing-file > input { width: 20px; height: 20px; }
.existing-file > span:nth-of-type(1) { flex: 1; display: grid; gap: 3px; }
.existing-file small { color: var(--muted); }
.preferred-file { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.preferred-file input { width: 19px; height: 19px; }
.unlink-label { color: #8f2929; font-size: 12px; }
.checkbox-field { min-height: 44px; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.checkbox-field input { width: 22px; height: 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.cost-summary-box { display: grid; gap: 6px; padding: 14px; border-left: 4px solid var(--teal); border-radius: 8px; background: var(--teal-soft); }
.cost-summary-box span { color: #315f5a; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; }
.data-table .table-total td { border-top: 2px solid var(--navy); color: var(--navy); font-weight: 750; }
.profit-reference-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 14px; }
.small-copy { font-size: 12px; }
.technical-file-list { display: grid; gap: 10px; padding-left: 20px; }
.technical-file-list li { padding: 5px 0; }
.technical-file-list span { color: var(--muted); font-size: 12px; }
.archive-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.archive-form button { grid-column: 1 / -1; justify-self: start; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.status-active { background: #e4f4f1; color: #0e655f; }
.order-card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.order-card { min-width: 0; display: grid; gap: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgb(25 40 63 / 4%); }
.order-card-heading, .order-card-footer, .order-audit-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-card h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.order-card h2 a { color: var(--navy); }
.order-card p { margin: 0; font-size: 13px; }
.order-card-footer strong { color: var(--navy); font-size: 19px; }
.order-card-footer span, .order-audit-heading span { color: var(--muted); font-size: 12px; }
.order-card-notes, .pending-order-notes { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.order-card-financials { display: grid; gap: 5px; }
.order-card-financials p { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.order-card-financials p > span { color: var(--muted); font-size: 11px; }
.order-card-financials p > strong { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.order-card-financials .order-card-sale > span { color: var(--ink); font-size: 12px; }
.order-card-financials .order-card-sale > strong { color: var(--navy); font-size: 17px; font-weight: 750; }
.order-card-statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.order-product-preview { display: flex; align-items: center; gap: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.order-product-preview > div:last-child { display: grid; gap: 5px; }
.order-product-preview p { margin: 0; }
.order-product-image { width: 96px; height: 76px; flex: 0 0 96px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--ice); color: var(--teal); font-weight: 800; }
.order-product-image img { width: 100%; height: 100%; object-fit: contain; }
.subsection-title { margin: 8px 0 -7px; color: var(--navy); }
.suggestion-note { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.caption-input { margin-top: 8px; }
.order-calculation { border-color: #b7ded4; }
.order-calculation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.order-calculation-grid p, .order-summary-values p, .order-flag-grid p { display: grid; gap: 5px; margin: 0; padding: 13px; border-radius: 9px; background: var(--ice); }
.order-calculation-grid span, .order-summary-values span, .order-flag-grid span { color: var(--muted); font-size: 12px; }
.order-calculation-grid strong, .order-summary-values strong, .order-flag-grid strong { color: var(--navy); font-size: 18px; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); align-items: start; gap: 14px; }
.order-detail-grid > section, .order-detail-page > .content-card { min-width: 0; margin: 14px 0; }
.order-main-card h2, .order-finance-card h2, .order-detail-page .content-card h2 { margin-top: 0; }
.order-detail-cover { display: block; width: 100%; max-height: 330px; margin-bottom: 12px; border-radius: 11px; object-fit: contain; background: var(--ice); }
.order-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.order-facts > div { min-width: 0; display: grid; gap: 4px; padding: 10px; border-bottom: 1px solid var(--line); }
.order-facts dt { color: var(--muted); font-size: 12px; }
.order-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; font-weight: 650; }
.order-flag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.order-flag-grid small { color: var(--muted); }
.order-summary-values { display: grid; gap: 8px; }
.order-summary-values p { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.order-summary-values strong { text-align: right; }
.negative-value { color: #a42a2a !important; }
.order-detail-actions { display: flex; gap: 8px; }
.order-detail-page > .content-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.order-breakdown h3, .order-files-card h3 { color: var(--navy); }
.order-audit-list { display: grid; gap: 14px; margin: 0; padding-left: 24px; }
.order-audit-list > li { padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.order-audit-list p { margin: 8px 0; color: var(--muted); }
.audit-json { max-height: 360px; overflow: auto; padding: 12px; border-radius: 8px; background: #f3f6f9; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-delete-card { border-color: #e6c3c3 !important; }
.button-danger { min-height: 44px; padding: 0 16px; border: 1px solid #a42a2a; border-radius: 8px; background: #a42a2a; color: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.button-danger:hover { background: #852020; }
.loss-confirmation, .reconciliation-confirmation { padding: 12px; border-radius: 9px; background: #fff8e9; color: #765118; }
.loss-confirmation input, .reconciliation-confirmation input { width: 22px; height: 22px; flex: 0 0 22px; }
.alert-info { border: 1px solid #c7d2df; background: #f3f7fa; color: var(--navy); padding: 12px 14px; border-radius: 9px; line-height: 1.5; }
.pending-card-list { display: grid; gap: 13px; }
.pending-card { min-width: 0; display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgb(25 40 63 / 4%); }
.pending-card-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pending-card-main.has-cover { grid-template-columns: 112px minmax(0, 1fr); }
.pending-cover { width: 112px; height: 112px; border-radius: 10px; object-fit: contain; background: var(--ice); }
.pending-card-copy { min-width: 0; display: grid; gap: 10px; }
.pending-card-copy h2 { margin: 0; font-size: 18px; line-height: 1.35; }
.pending-card-copy h2 a { color: var(--navy); }
.pending-card-copy > p { margin: 0; font-size: 13px; }
.pending-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 0; }
.pending-facts > div { min-width: 0; display: grid; gap: 4px; padding: 9px; border-radius: 8px; background: var(--ice); }
.pending-facts dt { color: var(--muted); font-size: 11px; }
.pending-facts dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.pending-finance { display: flex; flex-wrap: wrap; gap: 8px; }
.pending-finance p { display: grid; gap: 4px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.pending-finance span { color: var(--muted); font-size: 11px; }
.pending-finance strong { color: var(--navy); font-size: 14px; }
.pending-admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pending-admin-actions form { flex: 1 1 auto; }
.pending-admin-actions .button { width: 100%; }
.order-flag-card { min-width: 0; display: grid; align-content: start; justify-items: start; gap: 6px; margin: 0; padding: 13px; border-radius: 9px; background: var(--ice); }
.order-flag-card > span { color: var(--muted); font-size: 12px; }
.order-flag-card > strong { color: var(--navy); font-size: 18px; }
.order-flag-card form, .order-flag-card .button { width: 100%; }
.pending-filter-panel { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pending-filter-panel .field-search { grid-column: span 2; }

.analytics-page { display: grid; gap: 16px; }
.analytics-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.analytics-heading h1 { margin: 4px 0 6px; color: var(--navy); font-size: clamp(25px, 5vw, 34px); }
.analytics-heading p { margin: 0; }
.analytics-filters { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); align-items: end; }
.analytics-filters > .button { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 12px; }
.metric-grid-compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
.metric-card { min-width: 0; display: grid; align-content: start; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgb(25 40 63 / 4%); }
.metric-card > span { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-card > strong { color: var(--navy); font-size: clamp(20px, 4vw, 26px); overflow-wrap: anywhere; }
.metric-card > small { color: var(--muted); line-height: 1.45; }
.metric-primary { border-color: #b7ded4; background: #f8fcfb; }
.metric-primary > strong { color: #0e655f; }
.metric-warning { border-color: #efd6a8; background: #fffdf8; }
.chart-card { min-width: 0; padding: 18px; }
.chart-card h2 { margin: 0 0 5px; color: var(--navy); font-size: 17px; }
.chart-card > .muted { margin: 0 0 14px; font-size: 12px; }
.monthly-chart { display: grid; gap: 11px; }
.monthly-chart-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.monthly-chart-row > strong { color: var(--navy); font-size: 13px; }
.monthly-chart-values { display: grid; gap: 7px; min-width: 0; }
.monthly-chart-values > div { display: grid; gap: 3px; }
.monthly-chart-values > div > span:first-child { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; color: var(--muted); font-size: 11px; }
.monthly-chart-values b { color: var(--ink); font-weight: 650; }
.chart-track { display: block; width: 100%; height: 8px; overflow: hidden; border-radius: 99px; background: #e8eef3; }
.chart-fill { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.chart-sold { background: var(--teal); }
.chart-paid { background: #9cd9d1; }
.analytics-chart-grid { display: grid; gap: 14px; }
.distribution-chart { display: grid; gap: 13px; margin: 14px 0 0; padding: 0; list-style: none; }
.distribution-chart li { min-width: 0; display: grid; gap: 6px; }
.distribution-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 12px; }
.distribution-label span { min-width: 0; overflow-wrap: anywhere; }
.distribution-label strong { flex: 0 0 auto; color: var(--navy); }
.empty-inline { margin: 8px 0 0; color: var(--muted); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; }
.section-heading > div > .muted { margin: 5px 0 0; font-size: 12px; }
.due-list, .recent-order-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.due-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.due-list li > a { min-width: 0; display: grid; gap: 4px; color: var(--ink); }
.due-list li > a > span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.due-list .status-pill { flex: 0 0 auto; }
.recent-order { min-width: 0; display: grid; grid-template-columns: 68px minmax(0, 1fr) minmax(190px, auto); align-items: center; gap: 9px 13px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.recent-order-cover { display: grid; place-items: center; width: 68px; height: 68px; border: 1px solid var(--line); border-radius: 9px; background: #eaf0f5; object-fit: contain; color: var(--muted); font-size: 10px; }
.recent-order-cover-empty { text-align: center; }
.recent-order-main, .recent-order-amounts { min-width: 0; display: grid; gap: 4px; }
.recent-order small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.recent-order-amounts { justify-items: stretch; }
.recent-order-amounts > span { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.recent-order-amounts > span > span { color: var(--muted); }
.recent-order-amounts strong { color: var(--navy); white-space: nowrap; }
.recent-order-amounts .recent-order-price strong { font-size: 15px; }
.recent-order-statuses, .order-card-statuses { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.recent-order-status { padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 750; }
.recent-order-status.is-complete { background: #e4f4f1; color: #0e655f; }
.recent-order-status.is-pending { background: #f8e9e9; color: #8f2929; }
.analysis-table-card { min-width: 0; }
.analysis-table { min-width: 1100px; }
.analysis-table th, .analysis-table td { white-space: nowrap; }
.analysis-table td:first-child, .analysis-table td:nth-child(2), .analysis-table td:nth-child(4) { white-space: normal; }
.analysis-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.pagination > span { color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; }
    .brand { font-size: 18px; }
    .topnav { order: 3; width: 100%; flex-wrap: wrap; gap: 0 16px; margin: 2px 0 -2px; }
    .topnav a { flex: 0 0 auto; font-size: 13px; }
    .account-menu { margin-left: auto; }
    .account-name { max-width: 90px; }
    .page-content { width: min(100% - 24px, 600px); margin: 18px auto; }
    .welcome-card, .content-card, .page-heading { padding: 20px; }
    .welcome-card { padding: 24px 20px; }
    .login-card { padding: 24px; }
    .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-panel .field-search { grid-column: 1 / -1; }
    .filter-panel > .button { grid-column: 1 / -1; width: 100%; }
    .catalog-heading, .product-detail-heading, .catalog-form-page .page-heading { align-items: flex-start; flex-direction: column; }
    .catalog-heading > .button, .product-detail-heading > .button { width: 100%; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
    .form-grid-3 { grid-template-columns: 1fr; }
    .repeatable-row { grid-template-columns: 1fr; }
    .form-section { padding: 16px; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions > .button { width: 100%; }
    .analytics-heading { align-items: stretch; flex-direction: column; }
    .analytics-heading > .button { width: 100%; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { padding: 13px; }
    .analytics-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-filters > .button { grid-column: 1 / -1; }
}

@media (max-width: 460px) {
    .filter-panel, .form-grid-2, .archive-form { grid-template-columns: 1fr; }
    .filter-panel .field-search, .filter-panel > .button, .archive-form button { grid-column: auto; }
    .product-grid { grid-template-columns: 1fr; }
    .paste-tools .button { width: 100%; }
    .archive-form button { width: 100%; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-detail-actions, .order-detail-actions .button { width: 100%; }
    .order-product-preview { align-items: flex-start; }
    .order-facts { grid-template-columns: 1fr; }
    .order-card-list { grid-template-columns: 1fr; }
    .pending-filter-panel .field-search { grid-column: auto; }
    .analytics-filters { grid-template-columns: 1fr; }
    .analytics-filters > .button { grid-column: auto; }
    .section-heading { align-items: flex-start; }
    .pending-card { padding: 13px; }
    .pending-cover { width: 100%; height: auto; max-height: 240px; aspect-ratio: 16 / 10; }
    .pending-card-main.has-cover { grid-template-columns: minmax(0, 1fr); }
    .pending-admin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pending-admin-actions form:last-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .recent-order { grid-template-columns: 58px minmax(0, 1fr); gap: 8px 10px; }
    .recent-order-cover { width: 58px; height: 58px; }
    .recent-order-amounts { grid-column: 2; }
}

@media (min-width: 900px) {
    .analytics-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.backup-warning { border-left: 5px solid #b47716; background: #fff8e9; }
.backup-list, .backup-create { display: grid; gap: 1rem; }
.backup-item { border: 1px solid #d8e0ea; border-radius: 12px; padding: 1rem; min-width: 0; }
.backup-filename { overflow-wrap: anywhere; font-size: 1rem; }
.backup-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; }
.backup-details dt { color: #586779; font-size: .85rem; }
.backup-details dd { margin: .2rem 0 0; }
.backup-delete { margin-top: 1rem; }
.backup-delete summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: #a42c35; }
.backup-delete form { display: grid; gap: .8rem; }
.checkbox-field { display: flex; gap: .6rem; align-items: center; min-height: 44px; }
.chart-width-0 { width: 0%; }
.chart-width-1 { width: 1%; }
.chart-width-2 { width: 2%; }
.chart-width-3 { width: 3%; }
.chart-width-4 { width: 4%; }
.chart-width-5 { width: 5%; }
.chart-width-6 { width: 6%; }
.chart-width-7 { width: 7%; }
.chart-width-8 { width: 8%; }
.chart-width-9 { width: 9%; }
.chart-width-10 { width: 10%; }
.chart-width-11 { width: 11%; }
.chart-width-12 { width: 12%; }
.chart-width-13 { width: 13%; }
.chart-width-14 { width: 14%; }
.chart-width-15 { width: 15%; }
.chart-width-16 { width: 16%; }
.chart-width-17 { width: 17%; }
.chart-width-18 { width: 18%; }
.chart-width-19 { width: 19%; }
.chart-width-20 { width: 20%; }
.chart-width-21 { width: 21%; }
.chart-width-22 { width: 22%; }
.chart-width-23 { width: 23%; }
.chart-width-24 { width: 24%; }
.chart-width-25 { width: 25%; }
.chart-width-26 { width: 26%; }
.chart-width-27 { width: 27%; }
.chart-width-28 { width: 28%; }
.chart-width-29 { width: 29%; }
.chart-width-30 { width: 30%; }
.chart-width-31 { width: 31%; }
.chart-width-32 { width: 32%; }
.chart-width-33 { width: 33%; }
.chart-width-34 { width: 34%; }
.chart-width-35 { width: 35%; }
.chart-width-36 { width: 36%; }
.chart-width-37 { width: 37%; }
.chart-width-38 { width: 38%; }
.chart-width-39 { width: 39%; }
.chart-width-40 { width: 40%; }
.chart-width-41 { width: 41%; }
.chart-width-42 { width: 42%; }
.chart-width-43 { width: 43%; }
.chart-width-44 { width: 44%; }
.chart-width-45 { width: 45%; }
.chart-width-46 { width: 46%; }
.chart-width-47 { width: 47%; }
.chart-width-48 { width: 48%; }
.chart-width-49 { width: 49%; }
.chart-width-50 { width: 50%; }
.chart-width-51 { width: 51%; }
.chart-width-52 { width: 52%; }
.chart-width-53 { width: 53%; }
.chart-width-54 { width: 54%; }
.chart-width-55 { width: 55%; }
.chart-width-56 { width: 56%; }
.chart-width-57 { width: 57%; }
.chart-width-58 { width: 58%; }
.chart-width-59 { width: 59%; }
.chart-width-60 { width: 60%; }
.chart-width-61 { width: 61%; }
.chart-width-62 { width: 62%; }
.chart-width-63 { width: 63%; }
.chart-width-64 { width: 64%; }
.chart-width-65 { width: 65%; }
.chart-width-66 { width: 66%; }
.chart-width-67 { width: 67%; }
.chart-width-68 { width: 68%; }
.chart-width-69 { width: 69%; }
.chart-width-70 { width: 70%; }
.chart-width-71 { width: 71%; }
.chart-width-72 { width: 72%; }
.chart-width-73 { width: 73%; }
.chart-width-74 { width: 74%; }
.chart-width-75 { width: 75%; }
.chart-width-76 { width: 76%; }
.chart-width-77 { width: 77%; }
.chart-width-78 { width: 78%; }
.chart-width-79 { width: 79%; }
.chart-width-80 { width: 80%; }
.chart-width-81 { width: 81%; }
.chart-width-82 { width: 82%; }
.chart-width-83 { width: 83%; }
.chart-width-84 { width: 84%; }
.chart-width-85 { width: 85%; }
.chart-width-86 { width: 86%; }
.chart-width-87 { width: 87%; }
.chart-width-88 { width: 88%; }
.chart-width-89 { width: 89%; }
.chart-width-90 { width: 90%; }
.chart-width-91 { width: 91%; }
.chart-width-92 { width: 92%; }
.chart-width-93 { width: 93%; }
.chart-width-94 { width: 94%; }
.chart-width-95 { width: 95%; }
.chart-width-96 { width: 96%; }
.chart-width-97 { width: 97%; }
.chart-width-98 { width: 98%; }
.chart-width-99 { width: 99%; }
.chart-width-100 { width: 100%; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }

.existing-file { flex-wrap: wrap; }
.existing-photo-link { flex: 0 0 72px; }
.existing-photo-thumb { display: block; width: 72px; height: 72px; object-fit: contain; border-radius: 7px; border: 1px solid var(--line); background: var(--ice); }
.existing-file > span:first-of-type { min-width: 0; overflow-wrap: anywhere; }
.unit-amount { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.unit-amount[hidden] { display: none; }
.order-flag-card .button-quiet { color: var(--navy); background: var(--teal-soft); border: 1px solid var(--teal); }
.order-flag-card .button-quiet:hover { color: var(--white); background: var(--navy); border-color: var(--navy); }

.fixed-values-form { margin-top: 20px; }
.fixed-values-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.fixed-values-grid .field { display: grid; gap: 8px; align-content: start; }
.fixed-values-grid input { width: 100%; min-width: 0; }
.parameter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.parameter-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.parameter-list dt { color: var(--muted); }
.parameter-list dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 640px) { .fixed-values-grid, .parameter-list { grid-template-columns: 1fr; } }
.order-card-cover { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--ice); object-fit: contain; }
.order-card-cover-empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.order-cover-form { display: grid; gap: 12px; margin: 4px 0 18px; }
.order-cover-form fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.order-cover-form legend { padding: 0 6px; color: var(--navy); font-weight: 700; }
.order-cover-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.order-cover-choice { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.order-cover-choice:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px rgb(25 40 63 / 12%); }
.order-cover-choice input { margin: 3px 0 0; }
.order-cover-choice img { grid-column: 1 / -1; width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: contain; background: var(--ice); }
.order-cover-choice span { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.product-cover-form { display: grid; gap: 12px; margin: 4px 0 18px; }
.product-cover-form fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.product-cover-form legend { padding: 0 6px; color: var(--navy); font-weight: 700; }
.product-cover-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.product-cover-choice { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 6px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.product-cover-choice:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px rgb(25 40 63 / 12%); }
.product-cover-choice input { margin: 3px 0 0; }
.product-cover-choice img { grid-column: 1 / -1; width: 100%; aspect-ratio: 1; border-radius: 6px; object-fit: contain; background: var(--ice); }
.product-cover-choice span { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
