@font-face {
    font-family: 'Yekan';
    src: url('../../fonts/yekan/Yekan.woff2') format('woff2'),
    url('../../fonts/yekan/Yekan.woff') format('woff');
    font-display: swap;
}

:root {
    --admin-brand: #2d4f39;
    --admin-brand-soft: #eef4ef;
    --admin-gold: #a8863a;
    --admin-ink: #1b241d;
    --admin-line: #e4e6dc;
}

body, input, textarea, select, button {
    font-family: 'Yekan', Tahoma, sans-serif;
}

#header {
    background: var(--admin-brand);
    color: #fff;
}

#header a:link, #header a:visited {
    color: #fff;
}

div.breadcrumbs {
    background: #243f2e;
}

.module h2, .module caption, .inline-group h2 {
    background: var(--admin-brand);
}

a:link, a:visited {
    color: #2d4f39;
}

/* Unify Django's a.button (tiny padding) with button/submit sizing. */
.button,
button.button,
input[type=submit],
input[type=button],
.submit-row input,
a.button,
a.button:link,
a.button:visited {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 36px;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: var(--admin-brand);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
}

.button:hover,
button.button:hover,
input[type=submit]:hover,
input[type=button]:hover,
a.button:hover,
a.button:focus-visible {
    background: #4a7a5a;
    color: #fff;
}

.button.default,
input[type=submit].default,
.submit-row input.default {
    background: var(--admin-gold);
}

.button.cancel-link,
a.button.cancel-link,
a.cancel-link.button {
    background: #eef1ee;
    color: var(--admin-ink);
}

.button.cancel-link:hover,
a.button.cancel-link:hover,
a.cancel-link.button:hover {
    background: #e1e6e1;
    color: var(--admin-ink);
}

/* Compact action clusters in admin tables / toolbars */
.admin-actions {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 7.5rem;
}

.admin-actions form {
    display: block;
    margin: 0;
}

.admin-actions .button,
.admin-actions a.button,
.admin-actions button.button {
    width: 100%;
}

#content-main table td .button,
#content-main table td button.button,
#content-main table td a.button,
.px-actions .button,
.px-actions a.button {
    min-height: 34px;
    padding: 7px 12px;
}

/* Keep changelist bulk-action controls compact but even. */
#changelist .actions .button,
#changelist .actions button,
#changelist .actions input[type=submit] {
    min-height: 32px;
    padding: 6px 12px;
}

.object-tools a {
    white-space: nowrap;
}

#changelist .results {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

#changelist table thead th,
#changelist table tbody td {
    white-space: nowrap;
}

.sales-dash {
    margin-bottom: 24px;
}

.sales-dash__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sales-dash__head h2 {
    margin: 0;
    font-size: 18px;
    color: var(--admin-ink);
}

.sales-dash__ranges {
    display: flex;
    gap: 6px;
}

.sales-dash__ranges a {
    padding: 6px 12px;
    border: 1px solid var(--admin-line);
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
}

.sales-dash__ranges a.is-active {
    background: var(--admin-brand);
    border-color: var(--admin-brand);
    color: #fff;
}

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

.sales-card {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-radius: 12px;
}

.sales-card span,
.sales-card small {
    display: block;
    color: #5c685f;
}

.sales-card strong {
    display: block;
    margin: 4px 0;
    font-size: 22px;
    color: var(--admin-ink);
}

.sales-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.sales-panel {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-radius: 12px;
}

.sales-panel h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.sales-chart {
    width: 100%;
    height: auto;
    display: block;
}

.sales-chart__area {
    fill: rgba(61, 106, 76, .16);
}

.sales-chart__line {
    fill: none;
    stroke: #2d4f39;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.sales-chart__labels {
    display: flex;
    justify-content: space-between;
    color: #8a948c;
    font-size: 12px;
}

.sales-bars {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sales-bars li {
    margin-bottom: 10px;
}

.sales-bars__name,
.sales-bars__meta {
    display: block;
    font-size: 13px;
}

.sales-bars__meta {
    color: #5c685f;
}

.sales-bars__track {
    display: block;
    height: 8px;
    margin: 4px 0;
    background: var(--admin-brand-soft);
    border-radius: 999px;
    overflow: hidden;
}

.sales-bars__track span {
    display: block;
    height: 100%;
    background: #3d6a4c;
}

.sales-empty {
    margin: 12px 0;
    color: #5c685f;
}

.sales-dash__tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

a.sales-dash__more:link, a.sales-dash__more:visited {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--admin-brand);
    color: #fff;
    text-decoration: none;
}

a.sales-dash__more:hover {
    background: #243f2e;
}

.trend {
    display: inline-block;
    margin-inline-start: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    direction: ltr;
    unicode-bidi: isolate;
}

.trend.is-up {
    background: #e6f4ea;
    color: #1e7b3a;
}

.trend.is-down {
    background: #fdecec;
    color: #b3261e;
}

.trend.is-flat {
    background: #f0f1ee;
    color: #5c685f;
}

/* Alerts */
.dash-alerts {
    margin-bottom: 20px;
}

.dash-alerts__title {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--admin-ink);
}

.dash-alerts__ok {
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #cfe8d6;
    border-radius: 12px;
    background: #f1f9f3;
    color: #1e7b3a;
}

.dash-alerts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
    gap: 10px;
}

.dash-alert {
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--admin-line);
    border-inline-start: 4px solid #d9a441;
    border-radius: 12px;
}

.dash-alert--danger {
    border-inline-start-color: #c9453b;
}

.dash-alert--info {
    border-inline-start-color: #3d74b8;
}

.dash-alert--info a.dash-alert__count:link,
.dash-alert--info a.dash-alert__count:visited {
    background: #e8f0fa;
    color: #2a5588;
}

.dash-alert header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.dash-alert header strong {
    font-size: 13px;
    color: var(--admin-ink);
}

a.dash-alert__count:link, a.dash-alert__count:visited {
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fbf1dc;
    color: #8a5a00;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

.dash-alert--danger a.dash-alert__count:link,
.dash-alert--danger a.dash-alert__count:visited {
    background: #fdecec;
    color: #b3261e;
}

.dash-alert ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dash-alert li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-top: 1px dashed var(--admin-line);
    font-size: 12px;
    list-style: none;
}

.dash-alert li a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-alert li span {
    flex-shrink: 0;
    color: #5c685f;
}

.dash-alert__more {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
}

a.dash-alert__action:link, a.dash-alert__action:visited {
    display: block;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #8a5a00;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
}

a.dash-alert__action:hover {
    background: #6e4800;
}

/* App cards (admin home) */
.app-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
    grid-auto-flow: dense;
    gap: 14px;
    margin-top: 8px;
}

.app-card {
    --app-accent: var(--admin-brand);
    --app-soft: var(--admin-brand-soft);
    display: flex;
    flex-direction: column;
    background: var(--body-bg, #fff);
    border: 1px solid var(--hairline-color, var(--admin-line));
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.app-card:hover {
    border-color: var(--app-accent);
    box-shadow: 0 10px 24px -16px rgba(20, 40, 30, .45);
    transform: translateY(-2px);
}

.app-card--accounts {
    --app-accent: #3d74b8;
    --app-soft: #e8f0fa;
}

.app-card--auth {
    --app-accent: #7a5cc0;
    --app-soft: #f0ebfa;
}

.app-card--blog {
    --app-accent: #c0567a;
    --app-soft: #fbecf1;
}

.app-card--theme {
    --app-accent: #7654ad;
    --app-soft: #f3eef9;
}

.theme-dash {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid #e4d8f4;
    border-radius: 14px;
    background: #f7f3fc;
    color: inherit;
    text-decoration: none;
}

.theme-dash:hover {
    border-color: #7654ad;
}

.theme-dash__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #7654ad;
    color: #fff;
}

.theme-dash__mark svg {
    width: 18px;
    height: 18px;
}

.theme-dash__text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
}

.theme-dash__text strong {
    font-size: 15px;
}

.theme-dash__text small {
    color: #6f6787;
    font-size: 12px;
}

.theme-dash__go {
    flex-shrink: 0;
    color: #7654ad;
    font-size: 13px;
    font-weight: 700;
}

.app-card--main {
    --app-accent: #a8863a;
    --app-soft: #f8f1e1;
}

.app-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--hairline-color, var(--admin-line));
    background: linear-gradient(180deg, var(--app-soft), transparent);
}

.app-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--app-accent);
    color: #fff;
}

.app-card__title {
    flex: 1;
    min-width: 0;
}

.app-card__title h2 {
    margin: 0;
    padding: 0;
    background: none;
    font-size: 16px;
    font-weight: bold;
    text-transform: none;
    letter-spacing: 0;
}

.app-card__title h2 a:link,
.app-card__title h2 a:visited {
    color: var(--body-fg, var(--admin-ink));
    text-decoration: none;
}

.app-card__title h2 a:hover {
    color: var(--app-accent);
}

.app-card__title p {
    margin: 2px 0 0;
    padding: 0;
    color: var(--body-quiet-color, #6b756e);
    font-size: 12px;
}

.app-card__settings {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid var(--hairline-color, var(--admin-line));
    background: var(--body-bg, #fff);
    color: var(--app-accent);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

a.app-card__settings:link,
a.app-card__settings:visited {
    color: var(--app-accent);
    text-decoration: none;
}

a.app-card__settings:hover {
    border-color: var(--app-accent);
    background: var(--app-accent);
    color: #fff;
}

.app-card__badge {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--app-soft);
    color: var(--app-accent);
    font-size: 12px;
    font-weight: bold;
}

.app-card__models {
    margin: 0;
    padding: 6px 8px 10px;
    list-style: none;
}

.app-card__model {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 10px;
    list-style: none;
    transition: background .15s ease;
}

.app-card__model:hover {
    background: var(--darkened-bg, #f6f7f4);
}

.app-card__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

a.app-card__name:link,
a.app-card__name:visited {
    color: var(--body-fg, var(--admin-ink));
    text-decoration: none;
}

a.app-card__name:hover {
    color: var(--app-accent);
}

.app-card__count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--darkened-bg, #f0f1ee);
    color: var(--body-quiet-color, #5c685f);
    font-size: 11px;
}

.app-card__actions {
    display: inline-flex;
    gap: 4px;
    opacity: .55;
    transition: opacity .15s ease;
}

.app-card__model:hover .app-card__actions,
.app-card__actions:focus-within {
    opacity: 1;
}

a.app-card__btn:link,
a.app-card__btn:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid var(--hairline-color, var(--admin-line));
    background: var(--body-bg, #fff);
    color: var(--body-quiet-color, #5c685f);
}

a.app-card__btn:hover {
    border-color: var(--app-accent);
    background: var(--app-accent);
    color: #fff;
}

a.app-card__btn--add:link,
a.app-card__btn--add:visited {
    color: var(--app-accent);
}

a.app-card__btn--add:hover {
    color: #fff;
}

/* Stats page */
.shop-stats #content {
    max-width: 1280px;
}

.stats-range,
.stats-note {
    color: #8a948c;
    font-size: 12px;
}

.stats-note {
    margin: 8px 0 0;
}

.stats-exports {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 6px;
    padding: 10px 12px;
    border: 1px dashed var(--hairline-color, var(--admin-line));
    border-radius: 12px;
}

.stats-exports__label {
    color: #8a948c;
    font-size: 12px;
    margin-left: 4px;
}

.stats-export {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 12px;
    border: 1px solid var(--hairline-color, var(--admin-line));
    border-radius: 10px;
    background: var(--body-bg, #fff);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.stats-export:hover,
.stats-export:focus-visible {
    border-color: #1d6f42;
    box-shadow: 0 4px 14px rgba(29, 111, 66, .14);
    transform: translateY(-1px);
    text-decoration: none;
}

.stats-export__icon {
    flex: none;
    padding: 6px;
    border-radius: 8px;
    background: #e3f1e8;
    color: #1d6f42;
}

.stats-export strong {
    display: block;
    color: var(--body-fg, var(--admin-ink));
    font-size: 13px;
}

.stats-export small {
    display: block;
    color: #8a948c;
    font-size: 11px;
}

.stats-section {
    margin: 22px 0 10px;
    font-size: 15px;
    color: var(--admin-ink);
}

.sales-cards + .sales-cards {
    margin-top: 10px;
}

.sales-cards--stack {
    grid-template-columns: 1fr;
    align-content: start;
}

.stats-block {
    margin-top: 10px;
}

.sales-panel h3 small {
    color: #8a948c;
    font-weight: normal;
}

.sales-bars--inline {
    display: grid;
    grid-template-columns: 84px 1fr 44px;
    align-items: center;
    gap: 8px;
}

.sales-bars--inline .sales-bars__track {
    margin: 0;
}

.sales-bars--inline .sales-bars__meta {
    text-align: left;
}

.sales-bars__track.status--1 span {
    background: #c9453b;
}

.sales-bars__track.status-0 span {
    background: #d9a441;
}

.hour-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 140px;
    direction: ltr;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--admin-line);
}

.hour-chart__col {
    flex: 1;
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.hour-chart__col span {
    display: block;
    width: 100%;
    min-height: 2px;
    background: #3d6a4c;
    border-radius: 3px 3px 0 0;
}

.hour-chart + .sales-chart__labels {
    direction: ltr;
}

.stats-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stats-table th,
.stats-table td {
    padding: 7px 6px;
    border-bottom: 1px solid var(--admin-line);
    text-align: right;
    white-space: nowrap;
}

.stats-table th {
    background: transparent;
    color: #5c685f;
    font-weight: normal;
}

.stats-table td small {
    display: block;
    color: #8a948c;
}

/*
 * Responsive layout, Bootstrap-like steps: sm 576, md 768, 860 (four KPI cards of ~210px), xl 1200.
 * Page layout follows the viewport; the dashboard grids follow the width of the content column
 * (container queries), because the same viewport leaves very different room with or without
 * the recent-actions column.
 */
.dashboard #content {
    width: auto;
}

.dashboard #content-main,
.shop-stats #content-main {
    container: admin-main / inline-size;
}

@container admin-main (min-width: 576px) {
    .sales-cards:not(.sales-cards--stack) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-card--wide {
        grid-column: span 2;
    }

    .app-card--wide .app-card__models {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 10px;
    }
}

@container admin-main (min-width: 768px) {
    .sales-panels {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }

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

@container admin-main (min-width: 860px) {
    .sales-cards:not(.sales-cards--stack) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.dashboard .colMS {
    margin-left: 0;
    margin-right: 0;
}

.dashboard #content-related {
    float: none;
    clear: both;
    width: auto;
    margin: 20px 0 0;
    background:none;
}

.dashboard #content-related .actionlist {
    columns: 2;
    column-gap: 24px;
}

.dashboard #content-related .actionlist li {
    break-inside: avoid;
}

@media (max-width: 1024px) {
    #content {
        padding: 12px;
    }
}

@media (max-width: 767px) {
    .app-card__actions {
        opacity: 1;
    }

    #header {
        padding: 10px 12px;
    }

    #user-tools {
        float: none;
        margin-top: 8px;
        text-align: right;
    }

    .dashboard #content {
        width: auto;
    }

    #content-related {
        margin-right: 0;
        width: auto;
        float: none;
    }

    .object-tools {
        float: none;
        margin: 0 0 10px;
    }

    .object-tools li {
        display: inline-block;
        margin: 0 0 6px 6px;
    }

    .submit-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }

    .submit-row input, .submit-row a {
        float: none;
        margin: 0;
    }

    .form-row {
        padding: 8px 10px;
    }

    input, select, textarea {
        max-width: 100%;
    }
}

/* ============================ off-canvas drawers ============================
   #nav-sidebar and #changelist-filter overlay the page instead of taking a
   column, so the changelist table always gets the full width. Selectors start
   with `html` + ids to outrank nav_sidebar.css / changelists.css / rtl.css. */
#toggle-nav-sidebar {
    display: none !important;
}

#branding {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* responsive.css centers the stacked header below 1024px; keep the burger at the start edge */
@media (max-width: 1024px) {
    #header #branding {
        align-self: stretch;
    }

    #header #branding h1 {
        margin: 0;
    }

    #header #user-tools {
        align-self: stretch;
        text-align: start;
    }
}

.admin-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 25, 18, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}

body.nav-drawer-open .admin-drawer-backdrop,
body.filter-drawer-open .admin-drawer-backdrop {
    opacity: 1;
    visibility: visible;
}

body.nav-drawer-open,
body.filter-drawer-open {
    overflow: hidden;
}

/* --- shared panel --- */
html #main > #nav-sidebar,
html #changelist-filter {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 1001;
    box-sizing: border-box;
    display: block;
    flex: none;
    order: 0;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    background: var(--body-bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, .2);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .28s;
}

/* app menu: start side (right in RTL) */
html #main > #nav-sidebar {
    left: 0;
    right: auto;
    width: min(300px, 86vw);
    padding: 0 12px 16px;
    transform: translateX(-100%);
}

html[dir="rtl"] #main > #nav-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

html body.nav-drawer-open #main > #nav-sidebar {
    visibility: visible;
    transform: none;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}

html #main > #nav-sidebar + .content {
    max-width: 100%;
}

/* filters: end side (left in RTL) */
html #changelist-filter {
    right: 0;
    left: auto;
    width: min(320px, 88vw);
    padding: 0 0 16px;
    transform: translateX(100%);
}

html[dir="rtl"] #changelist-filter {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

html body.filter-drawer-open #changelist-filter {
    visibility: visible;
    transform: none;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility 0s;
}

/* --- drawer headers --- */
.admin-drawer__head,
#changelist-filter h2 {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--admin-brand);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.admin-drawer__head {
    margin: 0 -12px 10px;
}

#changelist-filter h2 {
    margin: 0 0 12px;
}

.admin-drawer__close {
    flex: none;
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.admin-drawer__close:hover,
.admin-drawer__close:focus-visible {
    background: rgba(255, 255, 255, .3);
}

/* --- hamburger --- */
.admin-drawer-toggle--nav {
    flex: none;
    width: 40px;
    height: 40px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
    transition: background .2s;
}

.admin-drawer-toggle--nav:hover,
.admin-drawer-toggle--nav:focus-visible {
    background: rgba(255, 255, 255, .26);
}

.admin-drawer-toggle--nav span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

/* --- filter button --- */
.admin-drawer-toggle--filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--admin-line);
    border-radius: 999px;
    background: var(--body-bg);
    color: var(--admin-brand);
    font-size: .8125rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}

.admin-drawer-toggle--filter:hover,
.admin-drawer-toggle--filter:focus-visible,
.admin-drawer-toggle--filter[aria-expanded="true"] {
    background: var(--admin-brand-soft);
    border-color: var(--admin-brand);
}

.admin-drawer-toggle__count {
    min-width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--admin-gold);
    color: #fff;
    font-size: .72rem;
    line-height: 1;
}

#toolbar.has-filter-toggle {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#toolbar.has-filter-toggle > form {
    flex: 1 1 280px;
    min-width: 0;
}

#toolbar.has-filter-toggle > .admin-drawer-toggle--filter {
    margin-inline-start: auto;
}

.admin-filterbar {
    display: flex;
    margin-bottom: 10px;
}

/* the filter no longer takes a column, so drop the space reserved for it */
.change-list .filtered {
    min-height: 0;
}

/* ============================ product excel modal ============================ */
body.px-modal-open {
    overflow: hidden;
}

.px-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.px-modal[hidden] {
    display: none !important;
}

.px-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 18, .45);
}

.px-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(90vh, 900px);
    overflow: auto;
    background: var(--body-bg, #fff);
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    box-shadow: 0 20px 48px -20px rgba(20, 40, 30, .45);
}

.px-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--admin-brand);
    color: #fff;
}

.px-modal__head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.px-modal__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.px-modal__close:hover {
    background: rgba(255, 255, 255, .3);
}

.px-modal__body {
    padding: 14px 16px 18px;
}

.px-section {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--admin-line);
}

.px-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.px-section h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--admin-ink);
}

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

.px-fields {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--admin-line);
    border-radius: 10px;
    background: var(--admin-brand-soft);
}

.px-fields legend {
    padding: 0 6px;
    font-weight: 700;
    color: var(--admin-brand);
}

.px-field-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.px-field-list li {
    list-style: none;
}

.px-loading {
    display: none;
    margin-top: 10px;
    color: #5c685f;
}

#product-excel-form.is-loading .px-loading {
    display: block;
}

/* Plugin settings form */
.plugin-settings {
    max-width: 980px;
}

.plugin-settings__intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 16px 18px;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(45, 79, 57, .08), transparent 48%),
        linear-gradient(180deg, #fff, var(--admin-brand-soft));
}

.plugin-settings__eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    color: #6b756e;
}

.plugin-settings__title {
    margin: 0;
    font-size: 22px;
    color: var(--admin-ink);
}

.plugin-settings__desc {
    margin: 8px 0 0;
    max-width: 52ch;
    line-height: 1.7;
    color: #5c685f;
}

.plugin-settings__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.plugin-settings__chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--admin-line);
    background: #fff;
    color: var(--admin-brand);
    font-size: 12px;
    direction: ltr;
}

.plugin-settings__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.plugin-settings__card {
    margin: 0;
    padding: 0;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(27, 36, 29, .03);
}

.plugin-settings__card-head {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--admin-line);
    background: linear-gradient(180deg, var(--admin-brand-soft), #fff);
}

.plugin-settings__card-head h2 {
    margin: 0;
    font-size: 15px;
    color: var(--admin-brand);
    background: none;
    padding: 0;
}

.plugin-settings__card-head p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: #6b756e;
}

.plugin-settings__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
    padding: 16px 18px 18px;
}

.plugin-settings__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.plugin-settings__field--wide,
.plugin-settings__field--bool {
    grid-column: 1 / -1;
}

.plugin-settings__field--info {
    grid-column: 1 / -1;
}

.plugin-settings__info {
    padding: 12px 14px;
    border: 1px dashed var(--admin-line);
    border-radius: 10px;
    background: #f8fafc;
    color: var(--admin-ink);
}

.plugin-settings__info strong {
    display: block;
    margin-bottom: 6px;
}

.plugin-settings__info-body {
    font-size: 13px;
    line-height: 1.7;
    direction: ltr;
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plugin-settings__label {
    margin: 0;
    font-weight: 700;
    font-size: 13px;
    color: var(--admin-ink);
    float: none;
    width: auto;
    padding: 0;
}

.plugin-settings__input,
.plugin-settings__field input[type=text],
.plugin-settings__field input[type=number],
.plugin-settings__field select,
.plugin-settings__field textarea {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--admin-line);
    border-radius: 10px;
    background: #fff;
    color: var(--admin-ink);
    font: inherit;
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
}

/*
 * Django admin base.css sets `select { height: 1.875rem }` which clips text
 * when our shared padding (9–10px) is applied. Override height and give selects
 * the same visual box as text inputs.
 */
.plugin-settings__field select,
select.plugin-settings__input {
    height: auto !important;
    min-height: 42px;
    padding: 10px 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b756e' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 12px 8px;
    /* Default: RTL admin — chevron on the inline-start (left in RTL). */
    background-position: left 12px center;
    padding-left: 36px;
}

html[dir="ltr"] .plugin-settings__field select,
html[dir="ltr"] select.plugin-settings__input {
    background-position: right 12px center;
    padding-left: 12px;
    padding-right: 36px;
}

.plugin-settings__field select[multiple],
select.plugin-settings__input[multiple] {
    min-height: 120px;
    padding: 9px 12px !important;
    background-image: none;
}

.plugin-settings__color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plugin-settings__swatch {
    flex: none;
    width: 44px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--admin-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
}

.plugin-settings__swatch::-webkit-color-swatch-wrapper {
    padding: 3px;
}

.plugin-settings__swatch::-webkit-color-swatch {
    border: none;
    border-radius: 7px;
}

.plugin-settings__swatch::-moz-color-swatch {
    border: none;
    border-radius: 7px;
}

.plugin-settings__input--color {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .02em;
}

.plugin-settings__input:focus,
.plugin-settings__field input:focus,
.plugin-settings__field select:focus,
.plugin-settings__field textarea:focus {
    outline: none;
    border-color: var(--admin-brand);
    box-shadow: 0 0 0 3px rgba(45, 79, 57, .12);
}

.plugin-settings__help {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
    color: #6b756e;
}

.plugin-settings__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--admin-line);
    border-radius: 12px;
    background: var(--admin-brand-soft);
    cursor: pointer;
}

.plugin-settings__check input {
    margin-top: 3px;
    width: auto;
}

.plugin-settings__check strong {
    display: block;
    color: var(--admin-ink);
}

.plugin-settings__check small {
    display: block;
    margin-top: 4px;
    color: #6b756e;
    line-height: 1.55;
}

.plugin-settings__actions {
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--admin-line);
    border-radius: 14px;
    background: #fff;
}

.plugin-settings__actions .cancel-link {
    margin-inline-start: 8px;
}

@media (max-width: 720px) {
    .plugin-settings__fields {
        grid-template-columns: 1fr;
    }

    .plugin-settings__field--wide,
    .plugin-settings__field--bool {
        grid-column: auto;
    }
}
