/* Pruned admin stylesheet. Shared/base rules remain; area-specific rules are split. */
* {
    box-sizing: border-box;
}

:root {
    --color-primary: #1f5fd6;
    --color-primary-dark: #174bb0;
    --color-text: #1f2937;
    --color-muted: #667085;
    --color-border: #d9dee8;
    --color-surface: #fff;
    --color-background: #f6f8fc;
    --color-accent-soft: #eaf1ff;
    --color-accent-border: #bfd2ff;
    --color-danger: #b42318;
    --color-success: #16794b;
    --shadow-small: 0 2px 8px rgba(31, 41, 55, .07);
    --control-height: 46px;
    --molecule-hex-bg: url("data:image/svg+xml,%3Csvg width='260' height='190' viewBox='0 0 260 190' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d2dae8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='.72'%3E%3Cpath d='M62 62 92 44 122 62v36l-30 18-30-18Z'/%3E%3Cpath d='M122 62 152 44 182 62v36l-30 18-30-18Z'/%3E%3Cpath d='M182 80 214 62 242 78'/%3E%3Cpath d='M92 116v34l28 16 30-17'/%3E%3Cpath d='M62 80 30 62 8 76'/%3E%3Cpath d='M152 44V18l24-14'/%3E%3Cpath d='M152 116v32l24 15'/%3E%3Cpath d='M214 62v35l-28 16'/%3E%3C/g%3E%3Cg fill='%23f4f6fb' stroke='%23d2dae8' stroke-width='1.8' opacity='.92'%3E%3Ccircle cx='62' cy='62' r='6'/%3E%3Ccircle cx='92' cy='44' r='6'/%3E%3Ccircle cx='122' cy='62' r='6'/%3E%3Ccircle cx='122' cy='98' r='6'/%3E%3Ccircle cx='92' cy='116' r='6'/%3E%3Ccircle cx='62' cy='98' r='6'/%3E%3Ccircle cx='152' cy='44' r='6'/%3E%3Ccircle cx='182' cy='62' r='6'/%3E%3Ccircle cx='182' cy='98' r='6'/%3E%3Ccircle cx='152' cy='116' r='6'/%3E%3Ccircle cx='214' cy='62' r='5'/%3E%3Ccircle cx='242' cy='78' r='5'/%3E%3Ccircle cx='30' cy='62' r='5'/%3E%3Ccircle cx='8' cy='76' r='5'/%3E%3Ccircle cx='120' cy='166' r='5'/%3E%3Ccircle cx='150' cy='149' r='5'/%3E%3Ccircle cx='176' cy='4' r='5'/%3E%3Ccircle cx='176' cy='163' r='5'/%3E%3Ccircle cx='186' cy='113' r='5'/%3E%3C/g%3E%3C/svg%3E");
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-text);
    background: #f7f9ff;
    font: 16px/1.5 Arial, sans-serif;
}

body:not(.admin-page) {
    display: flex;
    flex-direction: column;
}

body:not(.admin-page) > main {
    flex: 1 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6,
th,
legend,
[role="tab"],
.dashboard-card span,
.account-summary-grid article span {
    text-transform: capitalize;
}

a {
    color: var(--color-primary);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--color-primary-dark);
}

label {
    text-transform: capitalize;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
    outline: 3px solid rgba(65, 105, 225, .25);
    outline-offset: 2px;
}

.site-header {
    position: relative;
    z-index: 90;
    padding: 0;
    border-bottom: 5px solid var(--color-primary);
    background: #fff;
}

.site-header > a {
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
}

.site-logo {
    display: block;
    width: auto;
    object-fit: contain;
}

.admin-logo {
    max-width: min(260px, 70vw);
    height: 38px;
}

.site-nav {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.desktop-nav-links {
    display: none;
}

.desktop-nav-links a,
.site-nav .nav-current {
    padding: .45rem .65rem;
    border-radius: 5px;
    text-decoration: none;
}

.desktop-nav-links a {
    color: var(--color-text);
    font-weight: 600;
}

.desktop-nav-links a:hover {
    color: var(--color-primary-dark);
    background: #eef2ff;
}

.mobile-nav-menu {
    flex: 1 1 auto;
    min-width: 0;
}

.mobile-nav-menu select {
    width: 100%;
    height: var(--control-height);
    padding: .65rem 2.5rem .65rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    background-color: #fff;
    font: inherit;
}

.hamburger-icon {
    display: grid;
    width: 1.25rem;
    gap: .24rem;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.admin-header .mobile-nav-menu select {
    border-color: rgba(255, 255, 255, .65);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-current {
    color: var(--color-primary-dark);
    font-weight: 700;
    cursor: default;
}

.site-nav .nav-current {
    border: 0;
    background: #e8eeff;
}

@media (max-width: 599px) {
.site-nav {
        width: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: .4rem;
    }

.mobile-nav-menu {
        display: none;
    }
}

@media (max-width: 410px) {
.site-nav {
        gap: .3rem;
    }

.hamburger-icon {
        width: 1.12rem;
        gap: .2rem;
    }
}

.admin-mobile-menu {
    display: none;
}

.admin-mobile-menu summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: var(--control-height);
    padding: .6rem .8rem;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.admin-mobile-menu summary::-webkit-details-marker {
    display: none;
}

.admin-mobile-menu[open] summary {
    background: rgba(255, 255, 255, .18);
}

.admin-mobile-menu-panel {
    position: absolute;
    z-index: 120;
    top: calc(100% + .65rem);
    right: 1rem;
    display: grid;
    width: min(360px, calc(100vw - 2rem));
    padding: .75rem;
    gap: .35rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 10px;
    background: #143f91;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .25);
}

.admin-mobile-menu-panel a,
.admin-mobile-menu-panel .nav-current {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: .65rem .75rem;
    border-radius: 7px;
    color: #fff;
    text-decoration: none;
}

.admin-mobile-menu-panel a:hover,
.admin-mobile-menu-panel .nav-current {
    background: rgba(255, 255, 255, .15);
}

@media (max-width: 1050px) {
.admin-header {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: .75rem;
        padding: .85rem 1rem;
    }

.admin-brand {
        min-width: 0;
    }

.admin-logo {
        max-width: min(230px, 58vw);
        height: 46px;
    }

.admin-header .site-nav {
        justify-content: flex-end;
    }

.admin-header .desktop-nav-links,
.admin-header .mobile-nav-menu {
        display: none;
    }

.admin-mobile-menu {
        display: block;
    }

.admin-page .container,
.admin-page .wide-container {
        width: min(100% - 1.5rem, 1200px);
    }

.admin-page-heading,
.settings-page-heading,
.page-heading,
.section-heading {
        gap: .8rem;
    }

.heading-actions {
        width: 100%;
        justify-content: flex-start;
    }

.filter-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: .8rem;
        align-items: stretch;
    }

.filter-form .form-row,
.filter-actions {
        width: 100%;
    }

.filter-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: .6rem;
    }

.admin-table {
        font-size: .95rem;
    }

.table-wrap {
        overflow-x: visible;
    }

.fixed-action-bar-inner {
        width: min(100%, 1200px);
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
.admin-header {
        padding: .75rem;
    }

.admin-logo {
        max-width: min(190px, 56vw);
        height: 38px;
    }

.admin-mobile-menu summary {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
    }

.admin-mobile-menu summary > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

.admin-mobile-menu-panel {
        right: .75rem;
        left: .75rem;
        width: auto;
    }

.admin-page .container,
.admin-page .wide-container {
        width: min(100% - 1rem, 1200px);
        margin-top: 1rem;
    }

.admin-page-heading,
.settings-page-heading {
        padding: 1rem;
    }

    .heading-actions .button,
    .heading-actions button,
    .filter-actions .button,
    .filter-actions button {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

.admin-table tr {
        border-radius: 8px;
    }

.admin-table td {
        padding: .8rem;
        overflow-wrap: anywhere;
    }

.fixed-action-bar {
        padding: .65rem .75rem;
    }

    .fixed-action-bar-inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: .55rem;
    }

.fixed-action-bar-inner .button,
.fixed-action-bar-inner button {
        width: 100%;
    }

    .has-fixed-action-bar {
        padding-bottom: 168px;
    }
}

.homepage-admin-list {
    display: grid;
    gap: 1rem;
}

.homepage-admin-row {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-background);
}

.homepage-feature-admin-row {
    display: grid;
    gap: .75rem;
}

.homepage-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.homepage-testing-steps-list {
    margin-top: 1rem;
}

.homepage-testing-step-admin-row {
    display: grid;
    gap: .85rem;
}

.homepage-product-picker-search {
    margin-top: .75rem;
    margin-bottom: 0;
}

.homepage-product-picker-search input {
    background: #fff;
}

.homepage-product-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: .35rem;
    max-height: 360px;
    margin: .4rem 0 .75rem;
    padding: .75rem;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
}

.homepage-product-picker small {
    color: var(--color-muted);
}

@media (min-width: 600px) {
.homepage-product-picker {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
.admin-pagination {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

.admin-pagination-links {
        justify-content: flex-end;
    }

.homepage-feature-admin-row {
        grid-template-columns: minmax(180px, .7fr) minmax(280px, 1.3fr) auto minmax(220px, auto);
        align-items: center;
    }

.homepage-product-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.container {
    width: min(100% - 2rem, 960px);
    margin: 2rem auto;
}

.notice {
    padding: .75rem;
    border-left: 4px solid #b7791f;
    background: #fffaf0;
}

.notice.success {
    border-left-color: var(--color-success);
    background: #f0fff4;
}

.notice.error {
    border-left-color: var(--color-danger);
    background: #fff5f5;
}

.notice.warning {
    border-left-color: #d97706;
    color: #7c2d12;
    background: #fffbeb;
}

.auth-form {
    max-width: 560px;
}

.auth-modal-close {
    position: absolute;
    top: .65rem;
    right: .65rem;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 50%;
    color: var(--color-text);
    background: var(--color-background);
    font-size: 1.5rem;
    line-height: 1;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    margin-bottom: .25rem;
    font-weight: bold;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: .65rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

.html-editor {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
}

.html-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .6rem;
    border-bottom: 1px solid var(--color-border);
    background: #f6f8fc;
}

.html-editor-toolbar .secondary-button {
    min-height: 34px;
    padding: .35rem .6rem;
    font-size: .82rem;
}

.html-editor-surface,
.html-editor textarea {
    width: 100%;
    min-height: 280px;
    padding: .85rem;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--color-text);
    font: inherit;
}

.html-editor-surface {
    overflow-y: auto;
    line-height: 1.6;
    outline: none;
}

.html-editor-surface:focus,
.html-editor textarea:focus {
    box-shadow: inset 0 0 0 2px rgba(31, 95, 214, .18);
}

.html-editor-surface h2,
.html-editor-surface h3 {
    margin: 1rem 0 .5rem;
}

.html-editor-surface p,
.html-editor-surface ul,
.html-editor-surface ol,
.html-editor-surface table {
    margin: 0 0 .85rem;
}

.html-editor-surface table {
    width: 100%;
    border-collapse: collapse;
}

.html-editor-surface th,
.html-editor-surface td {
    padding: .45rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

body:not(.admin-page) .form-row select {
    padding-right: 2.75rem;
    border-color: #c7cfdd;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--color-primary) 50%),
        linear-gradient(135deg, var(--color-primary) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%;
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

body:not(.admin-page) .form-row select:hover {
    border-color: var(--color-primary);
}

.optional-label {
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 600;
    text-transform: none;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: 1.25rem;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: .65rem 1rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    color: #fff;
    background: var(--color-primary);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

button:hover,
.button:hover {
    color: #fff;
    background: var(--color-primary-dark);
}

.is-hidden {
    display: none !important;
}

.help-text {
    color: var(--color-muted);
    font-size: .9rem;
}

.admin-page {
    background: var(--color-background);
}

.admin-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .85rem 1.5rem;
    padding: 1rem 2rem;
    color: #fff;
    border-bottom-color: var(--color-primary-dark);
    background: var(--color-primary);
}

.admin-header .site-nav {
    width: auto;
    flex: 0 1 auto;
    justify-content: flex-end;
}

.admin-brand {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.admin-header .admin-brand.nav-current {
    color: #fff;
}

.admin-header > a,
.admin-header a {
    color: #fff;
    text-decoration: none;
}

.admin-header a:hover {
    color: #fff;
    opacity: 1;
}

.admin-header .desktop-nav-links a {
    color: #fff;
    font-weight: 500;
}

.admin-header .desktop-nav-links {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .45rem;
}

@media (min-width: 1051px) {
.admin-header .desktop-nav-links {
        display: flex;
    }

.admin-header .admin-mobile-menu {
        display: none;
    }
}

@media (max-width: 1050px) {
.admin-header .desktop-nav-links,
.admin-header .mobile-nav-menu {
        display: none;
    }

.admin-header .admin-mobile-menu {
        display: block;
    }
}

.admin-header .desktop-nav-links a,
.admin-header .site-nav .nav-current {
    padding: .45rem .6rem;
}

.admin-header .mobile-nav-menu {
    display: none;
}

.admin-header .desktop-nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .14);
}

.admin-header .site-nav .nav-current {
    color: #fff;
    background: rgba(255, 255, 255, .22);
}

.dashboard-heading {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-heading h1 {
    margin: 0 0 .35rem;
}

.dashboard-heading p {
    margin: 0;
    color: var(--color-muted);
}

.dashboard-heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.dashboard-card,
.admin-menu {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.dashboard-card strong,
.dashboard-card span {
    display: block;
}

.dashboard-card strong {
    color: var(--color-primary);
    font-size: 1.65rem;
}

.dashboard-card-link {
    color: var(--color-text);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.dashboard-card-link:hover,
.dashboard-card-link:focus {
    color: var(--color-text);
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(31, 95, 214, .12);
    transform: translateY(-1px);
}

.sales-report-panel {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-small);
}

.sales-report-heading h2 {
    margin: 0 0 .25rem;
}

.sales-report-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.sales-report-heading p {
    max-width: 760px;
    margin: 0;
    color: var(--color-muted);
}

.sales-report-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    justify-content: flex-end;
}

.sales-report-window-control {
    display: grid;
    min-width: 190px;
    width: auto;
    gap: .25rem;
    color: var(--color-muted);
    font-size: .85rem;
    font-weight: 700;
}

.sales-report-window-control select {
    min-height: var(--control-height);
    padding: .65rem 2.5rem .65rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    color: var(--color-text);
    font: inherit;
}

.sales-report-controls .sales-report-window-control:last-child {
    min-width: 220px;
}

.sales-report-value-paid,
.sales-bar-value-paid {
    display: none;
}

body[data-sales-report-basis="paid_orders"] .sales-report-value-all,
body[data-sales-report-basis="paid_orders"] .sales-bar-value-all {
    display: none;
}

body[data-sales-report-basis="paid_orders"] .sales-report-value-paid,
body[data-sales-report-basis="paid_orders"] .sales-bar-value-paid {
    display: inline;
}

.sales-report-selected {
    display: grid;
    gap: 1rem;
}

.sales-report-card {
    display: none;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid #e3e8f2;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8faff 0%, #fff 100%);
}

.sales-report-card.is-active {
    display: grid;
}

.sales-report-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #e9edf5;
}

.sales-report-card-heading h3 {
    margin: 0;
    color: var(--color-primary-dark);
    font-size: 1rem;
}

.sales-report-card-heading span {
    color: var(--color-muted);
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}

.sales-report-metrics {
    display: grid;
    gap: .75rem;
    margin: 0;
}

.sales-report-metrics div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.sales-report-metrics dt {
    color: var(--color-muted);
    font-size: .85rem;
    font-weight: 700;
}

.sales-report-metrics dd {
    margin: 0;
    color: var(--color-text);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: right;
}

.sales-graph-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #e3e8f2;
    border-radius: 8px;
    background: #fff;
}

.sales-graph-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem 1rem;
}

.sales-graph-heading h3 {
    margin: 0;
    color: var(--color-primary-dark);
}

.sales-graph-heading span {
    color: var(--color-muted);
    font-size: .85rem;
    font-weight: 700;
}

.sales-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 700;
}

.sales-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.sales-chart-legend i {
    display: inline-block;
    width: .85rem;
    height: .85rem;
    border-radius: 3px;
}

.sales-legend-all {
    background: var(--color-primary);
}

.sales-legend-paid {
    background: #16a34a;
}

.sales-chart-shell {
    --sales-chart-plot-height: 190px;
    --sales-chart-value-height: 1.45rem;
    --sales-chart-label-height: 2.4rem;
    --sales-chart-row-gap: .45rem;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
}

.sales-chart-y-axis {
    display: flex;
    height: var(--sales-chart-plot-height);
    flex-direction: column;
    justify-content: space-between;
    margin-top: calc(var(--sales-chart-value-height) + var(--sales-chart-row-gap));
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 700;
    text-align: right;
}

.sales-chart-scroll {
    overflow-x: auto;
    padding-bottom: .35rem;
}

.sales-bar-chart {
    position: relative;
    display: grid;
    min-width: max-content;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    gap: .9rem;
    align-items: end;
    padding: 0 .75rem;
}

.sales-bar-chart::before {
    position: absolute;
    top: calc(var(--sales-chart-value-height) + var(--sales-chart-row-gap));
    right: .75rem;
    left: .75rem;
    height: var(--sales-chart-plot-height);
    content: "";
    border-bottom: 2px solid #ccd6e6;
    background:
        linear-gradient(to bottom, #dfe6f2 1px, transparent 1px) 0 0 / 100% 25%,
        linear-gradient(to right, transparent, transparent);
    pointer-events: none;
}

.sales-bar-item {
    position: relative;
    z-index: 1;
    display: grid;
    min-width: 72px;
    grid-template-rows: var(--sales-chart-value-height) var(--sales-chart-plot-height) var(--sales-chart-label-height);
    gap: var(--sales-chart-row-gap);
    align-items: end;
    text-align: center;
}

.sales-bar-value {
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
}

.sales-bar-track {
    position: relative;
    display: block;
    width: min(100%, 42px);
    height: var(--sales-chart-plot-height);
    justify-self: center;
    overflow: hidden;
    border-radius: 7px 7px 0 0;
    background: rgba(238, 242, 251, .72);
}

.sales-bar-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    min-height: 4px;
    border-radius: 7px 7px 0 0;
}

.sales-bar-fill-all {
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.sales-bar-fill-paid {
    right: auto;
    left: 50%;
    width: 100%;
    border-radius: 0;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    transform: translateX(-50%);
}

.sales-bar-chart[data-sales-graph-mode="paid_orders"] .sales-bar-fill-all {
    opacity: .32;
}

.sales-bar-chart[data-sales-graph-mode="all_orders"] .sales-bar-fill-paid {
    opacity: .86;
}

.sales-bar-label {
    min-height: 2.4rem;
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.2;
}

@media (max-width: 520px) {
    .sales-report-controls,
    .sales-report-window-control,
    .sales-report-controls .sales-report-window-control:last-child {
        width: 100%;
        min-width: 0;
    }

    .sales-chart-shell {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: .5rem;
    }

    .sales-chart-y-axis {
        font-size: .65rem;
    }

    .sales-bar-chart {
        grid-auto-columns: minmax(62px, 1fr);
        gap: .65rem;
    }

    .sales-bar-item {
        min-width: 62px;
    }
}

.secondary-button {
    border-color: var(--color-border);
    color: var(--color-primary);
    background: #fff;
}

.secondary-button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    background: #eef2ff;
}

.danger-button {
    border-color: var(--color-danger);
    color: #fff;
    background: var(--color-danger);
}

.danger-button:hover {
    border-color: #8f1a12;
    color: #fff;
    background: #8f1a12;
}

button:disabled {
    cursor: wait;
    opacity: .65;
}

.wide-container {
    width: min(100% - 2rem, 1200px);
}

.page-heading,
.section-heading,
.filter-form,
.action-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.product-edit-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
}

.product-edit-title-row h1 {
    min-width: 0;
}

.product-edit-back-button {
    flex: 0 0 auto;
    justify-self: end;
    white-space: nowrap;
}

.product-edit-back-mobile {
    display: none;
}

.product-edit-back-desktop {
    white-space: nowrap;
}

.product-edit-header-delete-form.product-edit-back-mobile {
    display: none;
}

.product-edit-actions {
    align-items: center;
    gap: .5rem;
    justify-content: flex-end;
    justify-self: end;
}

.product-edit-actions .button {
    min-height: 38px;
    padding: .5rem .8rem;
    font-size: .9rem;
}

.product-edit-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem 1rem;
}

.admin-page-heading,
.settings-page-heading {
    align-items: stretch;
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

.admin-page-heading h1,
.settings-page-heading h1 {
    margin: 0 0 .4rem;
}

.admin-page-heading p,
.settings-page-heading p {
    margin: 0;
    color: var(--color-muted);
}

.admin-page-heading .heading-actions,
.settings-page-heading .heading-actions {
    width: 100%;
    padding: .25rem 0 .5rem;
}

.page-heading,
.section-heading {
    align-items: flex-start;
}

.detail-page-heading {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-small);
}

.detail-page-heading h1 {
    margin: 0 0 .35rem;
}

.detail-page-heading p {
    margin: 0;
    color: var(--color-muted);
}

.order-edit-heading {
    gap: 1rem;
}

.order-edit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    color: var(--color-muted);
    font-size: .95rem;
}

.order-edit-meta span {
    position: relative;
}

.order-edit-meta span + span::before {
    content: "";
    position: absolute;
    left: -.48rem;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-border-strong);
    transform: translateY(-50%);
}

.filter-form {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.filter-form .form-row {
    width: 100%;
    margin: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
}

.filter-actions .button,
.filter-actions button {
    width: auto;
}

.table-wrap {
    overflow-x: auto;
}

.admin-pagination {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin: 1rem 0 0;
    padding: .85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
}

.admin-pagination p {
    margin: 0;
    color: var(--color-muted);
    font-size: .9rem;
}

.admin-pagination-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.admin-pagination-page,
.admin-pagination-current {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: .35rem .65rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
}

.admin-pagination-current {
    color: #fff;
    border-color: var(--color-primary);
    background: var(--color-primary);
    font-weight: 700;
}

.admin-pagination-page:hover,
.admin-pagination-page:focus {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    background: var(--color-accent-soft);
}

.admin-table {
    display: block;
    width: 100%;
}

.admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.admin-table tbody,
.admin-table tr,
.admin-table td {
    display: block;
    width: 100%;
}

.admin-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.admin-table td {
    padding: .75rem;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    vertical-align: top;
}

.table-detail {
    display: block;
    color: var(--color-muted);
    font-size: .85rem;
}

.admin-product-summary {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.admin-product-title-link {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}

.admin-product-title-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.table-code {
    font-family: Arial, sans-serif;
    letter-spacing: .01em;
}

.product-price-cell {
    font-weight: 700;
}

.stock-count {
    display: inline-flex;
    min-width: 2.25rem;
    justify-content: center;
    padding: .12rem .45rem;
    border-radius: 999px;
    color: var(--color-text);
    background: #f3f6fb;
    font-weight: 700;
}

.admin-product-image-cell {
    width: 92px;
}

.admin-product-thumbnail {
    display: grid;
    width: 72px;
    aspect-ratio: 1;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    background: var(--color-background);
    font-size: .7rem;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.admin-product-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table td[data-label]::before {
    display: block;
    margin-bottom: .25rem;
    color: var(--color-muted);
    content: attr(data-label);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.products-table .admin-product-image-cell::before,
.products-table .product-action-cell::before {
    display: none;
}

.status-label {
    display: inline-block;
    padding: .15rem .45rem;
    border: 1px solid var(--color-border);
    border-radius: 3px;
    font-size: .85rem;
}

.status-active {
    border-color: #b7e3cc;
    color: #087443;
    background: #ecfdf3;
}

.status-draft {
    border-color: #cfd7e6;
    color: #475467;
    background: #f8fafc;
}

.status-inactive {
    border-color: #f3d19f;
    color: #9a5b13;
    background: #fff7ed;
}

.status-archived {
    border-color: #e4e7ec;
    color: #667085;
    background: #f2f4f7;
}

.old-price {
    color: var(--color-muted);
    text-decoration: line-through;
}

.inline-form {
    display: inline;
}

.action-cell,
.table-action-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.table-action-cell .inline-form,
.action-cell .inline-form {
    display: inline-flex;
}

.product-action-cell {
    flex-wrap: nowrap;
    align-items: center;
    gap: .35rem;
}

.table-action-button,
.table-action-cell .table-action-button,
.action-cell .table-action-button {
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 36px;
    margin: .15rem .25rem .15rem 0;
    padding: .4rem .7rem;
    font-size: .85rem;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.product-table-action,
.action-cell .product-table-action {
    min-width: 74px;
    border-color: #cfd7e6;
    color: var(--color-primary);
    background: #fff;
    box-shadow: none;
}

.product-icon-action,
.action-cell .product-icon-action {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0;
}

.product-action-cell .inline-form {
    flex: 0 0 auto;
    margin: 0;
}

.product-icon-action svg {
    display: block;
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.product-table-action:hover,
.action-cell .product-table-action:hover {
    border-color: var(--color-primary);
    color: #fff;
    background: var(--color-primary);
}

.product-table-action-danger,
.action-cell .product-table-action-danger {
    color: #9f1b13;
}

.product-table-action-danger:hover,
.action-cell .product-table-action-danger:hover {
    border-color: var(--color-danger);
    color: #fff;
    background: var(--color-danger);
}

.table-action-danger {
    border-color: #d92d20;
    color: #b42318;
    background: #fff;
}

.table-action-danger:hover {
    border-color: #b42318;
    color: #fff;
    background: #b42318;
}

.admin-users-table select {
    min-width: 150px;
}

.admin-users-table select:disabled {
    color: var(--color-text);
    opacity: .8;
}

.admin-dialog {
    width: min(92vw, 760px);
    max-height: 90vh;
    padding: 1.5rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(31, 41, 55, .22);
    overflow: auto;
}

.confirm-dialog {
    width: min(92vw, 520px);
}

.confirm-dialog h2 {
    margin: 0 3rem .5rem 0;
}

.confirm-dialog p {
    margin: 0 0 1.25rem;
    color: var(--color-muted);
}

.dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .75rem;
}

.admin-dialog::backdrop {
    background: rgba(17, 24, 39, .45);
}

.admin-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-dialog-heading h2 {
    margin: 0;
}

.admin-dialog-form {
    display: grid;
    gap: 1rem;
}

.link-button {
    padding: 0;
    border: 0;
    color: var(--color-primary);
    background: transparent;
    text-decoration: underline;
}

.link-button:hover,
.link-button:focus {
    color: var(--color-primary-dark);
    background: transparent;
    text-decoration: underline;
}

.empty-state,
.form-section {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.checkbox-row + .form-row {
    margin-top: 1rem;
}

.dynamic-row {
    display: grid;
    gap: .5rem;
    margin-bottom: .5rem;
}

.size-row {
    grid-template-columns: 1fr;
}

.characteristic-row {
    grid-template-columns: 1fr;
}

.dynamic-row input {
    min-width: 0;
    width: 100%;
    padding: .55rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.dynamic-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

input.is-calculated-stock:disabled {
    color: var(--color-muted);
    background: #f3f6fb;
    cursor: not-allowed;
    opacity: 1;
}

.tax-report-summary {
    margin-bottom: 1rem;
}

.dynamic-field {
    display: block;
    min-width: 0;
}

.dynamic-field span {
    display: block;
    margin-bottom: .25rem;
    color: var(--color-text);
    font-size: .85rem;
    font-weight: 700;
}

.has-fixed-action-bar {
    padding-bottom: 88px;
}

.fixed-action-bar {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    padding: .75rem 1rem;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -4px 18px rgba(31, 41, 55, .1);
    backdrop-filter: blur(8px);
}

.fixed-action-bar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(100%, 1200px);
    margin: 0 auto;
}

.product-save-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    white-space: nowrap;
}

.product-save-actions {
    justify-content: flex-end;
}

.product-delete-bar-form {
    display: none;
    margin: 0;
}

.product-delete-bar-button {
    min-height: var(--control-height);
    padding: .65rem 1rem;
}

.mobile-product-edit-actions {
    display: none;
}

.mobile-product-edit-actions summary {
    list-style: none;
}

.mobile-product-edit-actions summary::-webkit-details-marker {
    display: none;
}

.mobile-product-edit-actions-panel {
    display: none;
}

.mobile-product-edit-actions[open] .mobile-product-edit-actions-panel {
    display: grid;
}

.product-save-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: .65rem 1rem;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    color: var(--color-primary);
    background: #fff;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

.product-save-cancel:hover,
.product-save-cancel:focus {
    color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    background: #eef2ff;
    text-decoration: none;
}

@media (max-width: 640px) {
    .product-edit-back-mobile {
        display: inline-flex;
    }

    .product-edit-header-delete-form.product-edit-back-mobile {
        display: inline-flex;
    }

    .product-edit-back-desktop {
        display: none;
    }

    .product-edit-actions {
        display: none;
    }

    .product-edit-heading {
        grid-template-columns: 1fr;
    }

    .product-edit-title-row {
        width: 100%;
    }

    .fixed-action-bar-inner.product-save-actions {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, .58fr) minmax(0, 1.34fr) minmax(0, .58fr);
        align-items: center;
        gap: .55rem;
    }

    .fixed-action-bar-inner.product-save-actions:not(:has(.mobile-product-edit-actions)) {
        grid-template-columns: 1fr;
    }

    .save-status {
        grid-column: 1 / -1;
        min-height: 1.2rem;
        text-align: center;
    }

    .mobile-product-edit-actions {
        position: relative;
        display: block;
        width: 100%;
    }

    .mobile-product-edit-actions summary {
        min-height: var(--control-height);
        width: 100%;
    }

    .mobile-product-edit-actions-panel {
        position: absolute;
        bottom: calc(100% + .65rem);
        left: 0;
        z-index: 40;
        width: min(300px, calc(100vw - 1.5rem));
        overflow: hidden;
        gap: 0;
        border: 1px solid var(--color-border);
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 18px 38px rgba(15, 23, 42, .22);
    }

    .mobile-product-edit-actions-panel a {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: .75rem .9rem;
        border-bottom: 1px solid #edf0f5;
        color: var(--color-text);
        font-weight: 700;
        text-decoration: none;
    }

    .mobile-product-edit-actions-panel a:last-child {
        border-bottom: 0;
    }

    .mobile-product-edit-actions-panel a:hover,
    .mobile-product-edit-actions-panel a:focus {
        color: var(--color-primary-dark);
        background: #eef2ff;
    }

    .product-save-button {
        width: 100%;
    }

    .product-save-cancel {
        display: inline-flex;
        width: 100%;
    }

    .has-fixed-action-bar {
        padding-bottom: 132px;
    }
}

@media (max-width: 420px) {
    .fixed-action-bar-inner.product-save-actions {
        grid-template-columns: minmax(0, .55fr) minmax(0, 1.45fr) minmax(0, .55fr);
    }

    .fixed-action-bar-inner.product-save-actions:not(:has(.mobile-product-edit-actions)) {
        grid-template-columns: 1fr;
    }

    .product-edit-back-button {
        width: auto;
        padding-inline: .8rem;
    }
}

.save-button-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: save-spinner .7s linear infinite;
}

.product-save-button.is-saving .save-button-spinner {
    display: inline-block;
}

.save-status {
    color: var(--color-muted);
    font-size: .9rem;
    font-weight: 700;
}

.save-status.is-saved {
    color: var(--color-success);
}

.save-status.is-error {
    color: var(--color-danger);
}

.save-status.is-unsaved {
    color: #9a6700;
}

@keyframes save-spinner {
    to {
        transform: rotate(360deg);
    }
}

.admin-order-actions {
    justify-content: flex-end;
}

.admin-order-actions .button,
.admin-order-actions button {
    width: auto;
}

.admin-note-input {
    width: 100%;
    min-height: 150px;
}

.settings-option-list {
    display: grid;
    gap: .75rem;
}

.settings-option-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-background);
}

.settings-option-row.is-pending-delete {
    opacity: .58;
    border-color: rgba(185, 28, 28, .28);
    background: #fff7f7;
}

.settings-option-row.is-pending-delete::after {
    content: "This option will be deleted when you save.";
    color: #991b1b;
    font-size: .82rem;
    font-weight: 700;
}

.settings-option-row .form-row {
    margin: 0;
}

.settings-option-description textarea,
.settings-option-success textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
}

.settings-option-success textarea {
    min-height: 120px;
}

.payment-method-option-row {
    background: #fff;
}

.payment-method-option-row .settings-delete-button {
    align-self: start;
    justify-self: start;
}

.payment-method-option-row .settings-option-toggle,
.payment-method-option-row .settings-delete-option {
    position: relative;
    align-self: start;
    min-height: 0;
    padding: .45rem .7rem .45rem 2rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.payment-method-option-row .settings-option-toggle input,
.payment-method-option-row .settings-delete-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-method-option-row .settings-option-toggle::before,
.payment-method-option-row .settings-delete-option::before {
    content: "";
    position: absolute;
    left: .65rem;
    top: 50%;
    width: 14px;
    height: 14px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
}

.payment-method-option-row .settings-option-toggle:has(input:checked) {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    background: var(--color-accent-soft);
}

.payment-method-option-row .settings-option-toggle:has(input:checked)::before {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: inset 0 0 0 3px #fff;
}

.payment-method-option-row .settings-default-option:has(input:checked) {
    border-color: var(--color-success);
    color: #146c43;
    background: #edf9f2;
}

.payment-method-option-row .settings-delete-option {
    color: var(--color-danger);
    background: #fff7f7;
}

.payment-method-option-row .settings-delete-option:has(input:checked) {
    border-color: var(--color-danger);
    background: #ffecec;
}

.payment-method-option-row .settings-delete-option:has(input:checked)::before {
    border-color: var(--color-danger);
    background: var(--color-danger);
    box-shadow: inset 0 0 0 3px #fff;
}

.checkout-verification-admin-row textarea {
    width: 100%;
    min-height: 130px;
}

.promo-code-list {
    display: grid;
    gap: 1rem;
}

.promo-code-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-small);
    overflow: hidden;
}

.promo-code-card summary {
    list-style: none;
}

.promo-code-card summary::-webkit-details-marker {
    display: none;
}

.promo-code-card-summary {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, auto) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
}

.promo-code-card-summary:hover,
.promo-code-card[open] .promo-code-card-summary {
    background: #f8faff;
}

.promo-code-summary-main,
.promo-code-summary-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
}

.promo-code-summary-main strong {
    color: var(--color-primary-dark);
    font-size: 1.1rem;
}

.promo-code-summary-meta {
    justify-content: flex-end;
    color: var(--color-muted);
    font-size: .9rem;
}

.promo-code-edit-toggle {
    min-height: 38px;
    padding: .45rem .85rem;
}

.promo-code-card[open] .promo-code-edit-toggle {
    color: #fff;
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.promo-code-edit-form {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
}

@media (max-width: 760px) {
    .promo-code-card-summary {
        grid-template-columns: 1fr auto;
        gap: .75rem;
    }

    .promo-code-summary-meta {
        grid-column: 1 / -1;
        justify-content: flex-start;
        order: 3;
    }

    .promo-code-edit-toggle {
        justify-self: end;
    }
}

@media (max-width: 420px) {
    .promo-code-card-summary {
        grid-template-columns: 1fr;
    }

    .promo-code-edit-toggle {
        width: 100%;
        justify-self: stretch;
    }

    .promo-code-summary-meta {
        order: 0;
    }
}

.settings-delete-option {
    color: var(--color-danger);
}

.shipping-weight-total {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-bottom: .5rem;
}

.shipping-weight-total strong {
    color: var(--color-primary);
    font-size: 1.35rem;
}

.shipping-weight-total span,
.order-item-weight {
    color: var(--color-muted);
    font-size: .85rem;
}

.customer-search-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
}

.customer-search-actions .button,
.customer-search-actions button {
    width: auto;
}

.email-template-layout {
    display: grid;
    gap: 1rem;
}

.email-template-list {
    display: grid;
    gap: .5rem;
}

.email-template-list a {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    background: var(--color-surface);
    text-decoration: none;
}

.email-template-list a.is-active {
    border-color: var(--color-primary);
    box-shadow: inset 4px 0 0 var(--color-primary);
}

.email-template-list span {
    color: var(--color-muted);
    font-size: .85rem;
}

.email-template-editor {
    margin: 0;
}

.template-variable-panel {
    padding: 1rem;
    border-radius: 6px;
    background: var(--color-background);
}

.template-variable-panel h3 {
    margin-top: 0;
}

.template-variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.template-variable-list code {
    padding: .3rem .45rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
}

.affiliate-commission-list {
    display: grid;
    gap: 1.15rem;
}

.affiliate-commission-card {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 1.15rem;
    border-color: #e4e9f3;
    box-shadow: 0 4px 16px rgba(31, 41, 55, .06);
}

.affiliate-commission-details {
    display: grid;
    align-content: start;
    gap: .9rem;
}

.affiliate-commission-heading {
    display: grid;
    gap: .15rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid #edf1f7;
}

.affiliate-commission-heading strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.affiliate-commission-heading .table-detail {
    margin-top: 0;
    line-height: 1.35;
}

.affiliate-commission-notes textarea {
    min-height: 128px;
    resize: vertical;
}

.affiliate-commission-action {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.affiliate-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--color-border);
}

.affiliate-add-code {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: .75rem;
    margin-top: 1rem;
}

.image-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    object-fit: cover;
    background: var(--color-background);
}

.image-placeholder {
    display: grid;
    place-items: center;
    color: var(--color-muted);
}

.crop-workspace {
    max-width: 520px;
    margin: 1rem 0;
}

#crop_canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 2px solid var(--color-primary);
    background: #eef2ff;
}

.crop-position-controls,
.image-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.image-card-actions {
    margin-top: .65rem;
}

.image-action-button {
    width: 100%;
    min-height: 38px;
    padding: .45rem .55rem;
    font-size: .8rem;
    line-height: 1.15;
}

.image-action-button span {
    margin-left: .3rem;
}

.image-admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.image-admin-card {
    padding: .75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.image-admin-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: .75rem;
    object-fit: cover;
}

.main-image-label {
    display: inline-block;
    margin-bottom: .5rem;
    padding: .2rem .5rem;
    border-radius: 3px;
    color: #fff;
    background: var(--color-primary);
}

.danger-link {
    color: var(--color-danger);
}

.section-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.document-current {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.document-current {
    margin-bottom: 1rem;
}

.coa-seal {
    display: inline-grid;
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 3px double var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
    background: #eef2ff;
    font-weight: 700;
    letter-spacing: .08em;
    box-shadow: inset 0 0 0 4px #fff;
}

.small-seal {
    width: 54px;
    height: 54px;
    font-size: .8rem;
}

.resource-admin-list {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.resource-admin-item {
    display: grid;
    gap: .75rem;
    margin-bottom: .75rem;
    padding: .75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
}

.resource-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.resource-edit-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
}

.resource-edit-fields input {
    width: 100%;
    padding: .55rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font: inherit;
}

.button-secondary {
    color: var(--color-primary);
    background: #fff;
}

.cart-estimated-total {
    margin-top: .75rem;
    padding-top: .85rem;
    border-top: 1px solid var(--color-accent-border);
    font-size: 1.08rem;
}

.account-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.account-summary-grid article {
    padding: 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.account-summary-grid strong,
.account-summary-grid span {
    display: block;
}

.account-summary-grid strong {
    color: var(--color-primary);
    font-size: 1.35rem;
}

.status-pill {
    display: inline-flex !important;
    width: fit-content;
    align-items: center;
    min-height: 30px;
    padding: .25rem .65rem;
    border-radius: 999px;
    color: var(--color-primary-dark);
    background: var(--color-accent-soft);
    font-size: .85rem;
    line-height: 1.2;
}

.success-pill {
    color: #166534;
    background: #dcfce7;
}

.warning-pill {
    color: #92400e;
    background: #fef3c7;
}

.section-title-row {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1rem;
}

.section-title-row h2,
.section-title-row p {
    margin: 0;
}

.section-title-row p {
    color: var(--color-muted);
}

.tax-exemption-detail-section {
    margin-top: 1rem;
}

.tax-exemption-form {
    max-width: none;
}

.tax-exemption-form .checkbox-row {
    margin-bottom: 1rem;
}

.customer-danger-zone {
    border-color: #f1c6c1;
}

.customer-account-action-grid {
    display: grid;
    gap: 1rem;
}

.customer-account-action-grid article {
    display: grid;
    gap: .75rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
}

.customer-account-action-grid h3,
.customer-account-action-grid p {
    margin: 0;
}

.customer-account-action-grid p {
    color: var(--color-muted);
}

.order-line {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--color-border);
}

.order-line:last-child {
    border-bottom: 0;
}

.order-line span {
    display: block;
    color: var(--color-muted);
    font-size: .85rem;
}

.address-book-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.saved-address-card {
    padding: 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.saved-address-card > strong {
    display: block;
    color: var(--color-text);
    font-size: 1.05rem;
}

.saved-address-card address {
    margin-top: .5rem;
    color: var(--color-muted);
    font-style: normal;
}

.address-use-label {
    display: inline-block;
    margin-right: .35rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    color: var(--color-primary);
    background: #eef2ff;
    font-size: .78rem;
    font-weight: 700;
}

.admin-order-layout {
    display: grid;
    gap: 1rem;
}

.admin-order-layout address {
    font-style: normal;
}

.admin-note {
    margin-top: .75rem;
    padding: .75rem;
    border-left: 3px solid var(--color-primary);
    background: var(--color-background);
}

.admin-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-small);
}

.admin-section h2 {
    margin-top: 0;
}

.shipping-brackets {
    display: grid;
    gap: 1rem;
}

.shipping-bracket {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.shipping-bracket legend {
    padding: 0 .35rem;
    color: var(--color-primary);
    font-weight: 700;
}

.tax-rate-list {
    display: grid;
    gap: 1rem;
}

.tax-rate-row {
    min-width: 0;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.tax-rate-row legend {
    padding: 0 .35rem;
    color: var(--color-primary);
    font-weight: 700;
}

.tax-rate-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

.tax-rate-fields label {
    font-size: .85rem;
    font-weight: 700;
}

.tax-rate-fields input {
    width: 100%;
    height: var(--control-height);
    margin-top: .25rem;
    padding: .65rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font: inherit;
}

.tax-rate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: .75rem;
}

.tax-rate-actions button {
    width: auto;
}

.nexus-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

.nexus-status {
    display: inline-block;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: #e8ecf5;
    font-size: .8rem;
    font-weight: 700;
}

.nexus-counter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: .75rem;
}

.nexus-counter-grid div {
    padding: .6rem;
    border-radius: 5px;
    background: var(--color-background);
}

.nexus-counter-grid span,
.nexus-counter-grid strong {
    display: block;
}

.nexus-counter-grid span {
    color: var(--color-muted);
    font-size: .75rem;
}

.nexus-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: 1rem;
}

.nexus-filters label {
    font-size: .85rem;
    font-weight: 700;
}

.nexus-filters input,
.nexus-filters select {
    width: 100%;
    height: var(--control-height);
    margin-top: .25rem;
    padding: .65rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

[data-tab-panel] {
    padding: clamp(1.25rem, 4vw, 2rem);
}

[data-tab-panel] > :first-child {
    margin-top: 0;
}

[data-tab-panel] > :last-child {
    margin-bottom: 0;
}

.admin-customer-layout {
    display: grid;
    gap: 1rem;
}

.detail-list {
    display: grid;
    grid-template-columns: minmax(90px, .45fr) 1fr;
    gap: .5rem 1rem;
    margin: 0;
}

.detail-list dt {
    color: var(--color-muted);
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.customer-default-addresses {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.customer-default-addresses h3 {
    margin-top: 0;
}

.customer-default-addresses address {
    font-style: normal;
}

@media (min-width: 600px) {
.site-nav {
        width: auto;
        flex-wrap: wrap;
        gap: 1rem;
    }

body:not(.admin-page) .desktop-nav-links {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 1rem;
    }

.mobile-nav-menu {
        display: none;
    }
}

@media (min-width: 760px) {
.account-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

.address-book-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.admin-order-layout {
        grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
    }

.admin-customer-layout,
.customer-default-addresses {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.tax-rate-fields {
        grid-template-columns: 110px 110px minmax(180px, 1fr) 140px;
    }

.settings-option-row {
        grid-template-columns: minmax(220px, 1fr) auto auto;
        align-items: center;
    }

.checkout-verification-admin-row {
        grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
        align-items: start;
    }

.checkout-verification-admin-row [data-remove-checkout-verification] {
        align-self: end;
    }

#payment_method .settings-option-row {
        grid-template-columns: minmax(200px, .8fr) minmax(260px, 1.2fr) minmax(180px, .7fr) minmax(180px, .7fr);
        grid-template-areas:
            "label description feeType feeValue"
            "success success success success"
            "controls controls controls controls";
        align-items: start;
        gap: 1rem;
        padding: 1.15rem;
    }

#payment_method .payment-method-option-row > .form-row:first-of-type {
        grid-area: label;
    }

#payment_method .payment-method-option-row .settings-option-description {
        grid-area: description;
    }

#payment_method .payment-method-option-row .settings-option-success {
        grid-area: success;
    }

#payment_method .payment-method-option-row .settings-option-fee-type {
        grid-area: feeType;
    }

#payment_method .payment-method-option-row .settings-option-fee-value {
        grid-area: feeValue;
    }

#payment_method .payment-method-option-row .settings-option-controls {
        grid-area: controls;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .55rem;
        padding-top: .15rem;
    }

#payment_method .payment-method-option-row .settings-option-controls .settings-delete-button {
        margin-left: auto;
    }

.nexus-filters {
        grid-template-columns: minmax(220px, 1fr) 220px;
    }

.form-actions,
.page-heading,
.section-heading,
.filter-form,
.action-cell {
        flex-direction: row;
        align-items: center;
    }

.page-heading,
.section-heading {
        justify-content: space-between;
    }

.section-title-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

.customer-account-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.admin-page-heading,
.settings-page-heading {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

.admin-page-heading .heading-actions,
.settings-page-heading .heading-actions {
        width: 100%;
    }

.product-edit-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

.product-edit-heading .product-edit-actions {
        width: auto;
        justify-content: flex-end;
    }

.filter-form {
        flex-wrap: wrap;
    }

.filter-form .form-row {
        width: auto;
        min-width: 180px;
    }

.product-filter-form,
.order-filter-form {
        align-items: flex-end;
        flex-wrap: nowrap;
    }

.product-filter-form .product-filter-search,
.order-filter-form .order-filter-search {
        flex: 1 1 auto;
        min-width: 260px;
    }

.filter-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

@media (max-width: 1050px) {
.admin-page .filter-form,
.admin-page .product-filter-form,
.admin-page .order-filter-form,
.admin-page .customer-search-form {
            display: grid;
            grid-template-columns: 1fr;
            align-items: stretch;
            gap: .8rem;
        }

.admin-page .filter-form .form-row,
.admin-page .product-filter-form .product-filter-search,
.admin-page .order-filter-form .order-filter-search,
.admin-page .customer-search-form .customer-search-field {
            width: 100%;
            min-width: 0;
        }

.admin-page .filter-actions,
.admin-page .customer-search-actions {
            width: 100%;
            margin-left: 0;
            justify-content: flex-start;
        }
}

.customer-search-form {
        flex-wrap: nowrap;
        align-items: flex-end;
    }

.customer-search-form .customer-search-field {
        flex: 1 1 auto;
        width: auto;
        min-width: 300px;
    }

.customer-search-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }

.email-template-layout {
        grid-template-columns: minmax(210px, .4fr) minmax(0, 1.6fr);
        align-items: start;
    }

.affiliate-commission-card {
        grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.5fr) auto;
        column-gap: 2rem;
        align-items: start;
    }

.affiliate-commission-action {
        min-width: 150px;
        justify-content: flex-end;
    }

.dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

.form-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

.admin-table {
        display: table;
        border-collapse: collapse;
        background: #fff;
    }

.admin-table thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }

.admin-table tbody {
        display: table-row-group;
    }

.admin-table tr {
        display: table-row;
        margin: 0;
        border: 0;
    }

.admin-table th,
.admin-table td {
        display: table-cell;
        width: auto;
        padding: .75rem;
        border: 1px solid var(--color-border);
    }

.products-table th,
.products-table td {
        vertical-align: middle;
    }

.admin-table td[data-label]::before {
        display: none;
    }

.products-table .admin-product-image-cell {
        width: 88px;
    }

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
        min-width: 190px;
    }

.products-table th:nth-child(4),
.products-table td:nth-child(4),
.products-table th:nth-child(5),
.products-table td:nth-child(5),
.products-table th:nth-child(6),
.products-table td:nth-child(6) {
        white-space: nowrap;
    }

.products-table th:last-child,
.products-table td:last-child {
        width: 136px;
    }

.products-table .product-action-cell {
        justify-content: flex-end;
        white-space: nowrap;
    }

.size-row {
        grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
    }

.characteristic-row {
        grid-template-columns: 1fr 2fr auto;
    }

.image-admin-grid {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    }

.resource-admin-item {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

.resource-edit-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 760px) and (max-width: 1120px) {
    #payment_method .settings-option-row {
        grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
        grid-template-areas:
            "label description"
            "feeType feeValue"
            "success success"
            "controls controls";
    }

    #payment_method .payment-method-option-row .settings-option-controls {
        align-items: flex-start;
    }
}

@media (max-width: 759px) {
    #payment_method .settings-option-row {
        gap: .9rem;
    }

    .payment-method-option-row .settings-option-controls {
        display: grid;
        grid-template-columns: 1fr;
    }

    .payment-method-option-row .settings-option-toggle,
    .payment-method-option-row .settings-delete-button,
    .payment-method-option-row [data-remove-new-setting] {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1050px) {
.site-header {
        position: relative;
        z-index: 90;
    }

.site-nav {
        width: auto;
        flex-wrap: nowrap;
        justify-content: flex-end;
        gap: .4rem;
    }

.mobile-nav-menu {
        display: none;
    }
}

@media (min-width: 760px) and (max-width: 1050px) {
    #payment_method .settings-option-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        grid-template-areas:
            "label description"
            "success success"
            "enabled checkout"
            "default default"
            "delete delete";
    }

    #payment_method .settings-option-toggle,
    #payment_method .settings-delete-option {
        min-height: 0;
    }
}

@media (max-width: 410px) {
.site-nav {
        gap: .3rem;
    }

.hamburger-icon {
        width: 1.12rem;
        gap: .2rem;
    }
}

@media (min-width: 760px) {
    .dashboard-heading {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .dashboard-heading-actions {
        justify-content: flex-end;
    }
}

@media print {
    .site-header,
    .no-print,
    .admin-pagination,
    .admin-mobile-menu,
    .desktop-nav-links {
        display: none !important;
    }

    body,
    .admin-page {
        color: #111827;
        background: #fff;
    }

    .container,
    .wide-container {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .admin-section,
    .dashboard-card,
    .page-heading {
        box-shadow: none;
        break-inside: avoid;
    }

    .dashboard-grid,
    .tax-report-summary {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .5rem;
    }

    .dashboard-card {
        padding: .55rem;
        border: 1px solid #d1d5db;
    }

    .dashboard-card strong {
        font-size: 1.05rem;
    }

    .dashboard-card span {
        font-size: .72rem;
    }

    .table-wrap {
        overflow: visible;
    }

    .admin-table {
        display: table;
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
        background: #fff;
    }

    .admin-table thead {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
    }

    .admin-table tbody {
        display: table-row-group;
    }

    .admin-table tr {
        display: table-row;
        margin: 0;
        border: 0;
        box-shadow: none;
    }

    .admin-table th,
    .admin-table td {
        display: table-cell;
        width: auto;
        padding: .4rem;
        border: 1px solid #d1d5db;
        text-align: left;
        vertical-align: top;
    }

    .admin-table td[data-label]::before {
        display: none;
    }

}
