/*
 * Central admin — admin.graviteeemart.com
 *
 * The storefront's design language (design-system.css) applied to a working
 * tool. The tokens below are COPIED from design-system.css rather than
 * imported, because that file also restyles the whole bought theme and must
 * not load here. If a brand token changes there, change it here.
 */
:root {
    --g-brand: #B62C5F; --g-brand-deep: #921F4B; --g-brand-soft: #FCEFF4;
    --g-accent: #F67E00; --g-accent-soft: #FFF3E4;
    --g-chrome: #1B1114; --g-chrome-2: #2A1C21; --g-chrome-ink: #F6EFF1; --g-chrome-ink-2: #C4B2B8;
    --g-chrome-line: rgba(246, 239, 241, .12);
    --g-ink: #241C17; --g-ink-2: #5C5149; --g-ink-3: #8A8079;
    --g-line: #EDE7E1; --g-surface: #FFFFFF; --g-surface-2: #FAF7F4;
    --g-ok: #1F8A4C; --g-ok-soft: #E7F5EC; --g-warn: #B26A00; --g-warn-soft: #FFF3E0; --g-bad: #C0392B; --g-bad-soft: #FDECEA;
    --g-r-xs: 8px; --g-r-sm: 12px; --g-r-md: 16px; --g-r-lg: 22px; --g-r-xl: 28px; --g-r-pill: 999px;
    --g-shadow-sm: 0 1px 2px rgba(36, 28, 23, .04), 0 2px 8px rgba(36, 28, 23, .05);
    --g-shadow-md: 0 2px 4px rgba(36, 28, 23, .04), 0 8px 24px rgba(36, 28, 23, .07);
    --g-shadow-lg: 0 4px 8px rgba(36, 28, 23, .05), 0 18px 44px rgba(36, 28, 23, .11);
    --g-ease: cubic-bezier(.22, .61, .36, 1); --g-ease-out: cubic-bezier(.16, 1, .3, 1); --g-fast: .18s; --g-mid: .32s; --g-slow: .6s;
    --ap-side-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.ap {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--g-ink);
    background: var(--g-surface-2);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--g-brand); }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
img { max-width: 100%; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.ap-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--ap-side-w);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    background: var(--g-chrome);
    color: var(--g-chrome-ink);
    z-index: 40;
}
.ap-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; text-decoration: none; }
.ap-brand svg, .ap-brand .g-logo { height: 34px; width: auto; }
.ap-brand-tag {
    font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    padding: 3px 8px; border-radius: var(--g-r-pill); background: var(--g-brand); color: #fff;
}
.ap-nav { display: flex; flex-direction: column; gap: 2px; }
.ap-nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--g-r-sm);
    color: var(--g-chrome-ink-2); text-decoration: none; font-weight: 500;
    transition: background var(--g-fast) var(--g-ease), color var(--g-fast) var(--g-ease);
}
.ap-nav-item i { font-size: 18px; }
.ap-nav-item:hover { background: var(--g-chrome-2); color: var(--g-chrome-ink); }
.ap-nav-item.is-active { background: var(--g-brand); color: #fff; }
.ap-nav-item--quiet { font-size: 12.5px; }
.ap-side-foot { margin-top: auto; border-top: 1px solid var(--g-chrome-line); padding-top: 10px; }

/* ── Top bar (frosted) ───────────────────────────────────────────────────── */
.ap-main { margin-left: var(--ap-side-w); min-height: 100vh; }
.ap-top {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 14px;
    padding: 12px 28px;
    background: rgba(250, 247, 244, .78);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid var(--g-line);
}
.ap-title { font-size: 20px; margin-right: auto; }
.ap-icon-btn.ap-menu { display: none; }
.ap-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--g-r-pill);
    border: 1px solid var(--g-line); background: var(--g-surface); color: var(--g-ink-2);
    font-size: 18px; cursor: pointer;
}
.ap-icon-btn:hover { color: var(--g-brand); border-color: var(--g-brand); }

.ap-site-switch {
    display: inline-flex; padding: 4px; gap: 2px;
    border-radius: var(--g-r-pill); background: var(--g-surface); border: 1px solid var(--g-line);
    box-shadow: var(--g-shadow-sm);
}
.ap-site-switch button {
    border: 0; background: transparent; cursor: pointer;
    padding: 7px 14px; border-radius: var(--g-r-pill);
    font: 500 13px/1 'Poppins', sans-serif; color: var(--g-ink-2);
}
.ap-site-switch button.is-on { background: var(--g-brand); color: #fff; }

.ap-content { padding: 24px 28px 48px; max-width: 1400px; }

/* ── Cards, stats, tables ────────────────────────────────────────────────── */
.ap-card {
    background: var(--g-surface); border: 1px solid var(--g-line);
    border-radius: var(--g-r-lg); padding: 18px 20px; margin-bottom: 20px;
    box-shadow: var(--g-shadow-sm);
}
.ap-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.ap-card-head h2 { font-size: 16px; }
.ap-card-note { flex-basis: 100%; margin: 0; }
.ap-count { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: var(--g-r-pill); background: var(--g-surface-2); color: var(--g-ink-2); }

.ap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.ap-stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 18px 20px; border-radius: var(--g-r-lg);
    background: var(--g-surface); border: 1px solid var(--g-line); box-shadow: var(--g-shadow-sm);
}
.ap-stat-label { font-size: 12.5px; color: var(--g-ink-3); font-weight: 500; }
.ap-stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.ap-stat-sub { font-size: 12px; color: var(--g-ink-3); }
.ap-stat--alert { border-color: var(--g-brand); background: var(--g-brand-soft); }
.ap-stat--alert .ap-stat-value { color: var(--g-brand); }
.ap-stat--warn .ap-stat-value { color: var(--g-warn); }

.ap-grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.ap-grid-2 > .ap-card { margin-bottom: 20px; }

.ap-table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ap-table th { text-align: left; font-weight: 600; color: var(--g-ink-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--g-line); white-space: nowrap; }
.ap-table td { padding: 10px; border-bottom: 1px solid var(--g-line); vertical-align: middle; }
.ap-table tr:last-child td { border-bottom: 0; }
.ap-table tbody tr:hover { background: var(--g-surface-2); }
.ap-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--g-ink-2); }

.ap-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--g-line); }
.ap-row:last-child { border-bottom: 0; }
.ap-row img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--g-r-xs); background: var(--g-surface-2); flex: none; }
.ap-row > div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ap-row strong { font-weight: 500; font-size: 13.5px; }
.ap-issues { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }

.ap-badge {
    display: inline-block; padding: 2px 9px; border-radius: var(--g-r-pill);
    font-size: 11.5px; font-weight: 600; background: var(--g-surface-2); color: var(--g-ink-2); white-space: nowrap;
}
.ap-badge--pending, .ap-badge--processing { background: var(--g-warn-soft); color: var(--g-warn); }
.ap-badge--shipped { background: var(--g-accent-soft); color: var(--g-accent); }
.ap-badge--delivered, .ap-badge--paid, .ap-badge--on { background: var(--g-ok-soft); color: var(--g-ok); }
.ap-badge--cancelled, .ap-badge--returned, .ap-badge--failed { background: var(--g-bad-soft); color: var(--g-bad); }

.ap-empty { color: var(--g-ink-3); margin: 6px 0; }
.ap-muted { color: var(--g-ink-3); }
.ap-flash { padding: 10px 14px; border-radius: var(--g-r-sm); background: var(--g-ok-soft); color: var(--g-ok); margin-bottom: 16px; font-weight: 500; }
.ap-error { color: var(--g-bad); font-size: 13px; margin: -4px 0 12px; }
.ap-note { padding: 8px 12px; border-radius: var(--g-r-sm); background: var(--g-warn-soft); color: var(--g-warn); font-size: 13px; }
.ap-fine { font-size: 12px; color: var(--g-ink-3); margin: 14px 0 0; text-align: center; }

/* ── Forms and buttons ───────────────────────────────────────────────────── */
.ap-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ap-field > span { font-size: 13px; font-weight: 500; color: var(--g-ink-2); }
.ap-field input, .ap-field select, .ap-field textarea {
    font: 400 14px/1.4 'Poppins', sans-serif; color: var(--g-ink);
    padding: 11px 14px; border-radius: var(--g-r-sm);
    border: 1px solid var(--g-line); background: var(--g-surface);
    transition: border-color var(--g-fast) var(--g-ease), box-shadow var(--g-fast) var(--g-ease);
}
.ap-field input:focus, .ap-field select:focus, .ap-field textarea:focus {
    outline: none; border-color: var(--g-brand); box-shadow: 0 0 0 4px var(--g-brand-soft);
}
.ap-otp { letter-spacing: .5em; font-size: 22px !important; text-align: center; font-weight: 600 !important; }

.ap-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--g-r-pill); border: 1px solid transparent;
    font: 600 14px/1.2 'Poppins', sans-serif; cursor: pointer; text-decoration: none;
    transition: background var(--g-fast) var(--g-ease), transform var(--g-fast) var(--g-ease);
}
.ap-btn:active { transform: translateY(1px); }
.ap-btn--primary { background: var(--g-brand); color: #fff; }
.ap-btn--primary:hover { background: var(--g-brand-deep); }
.ap-btn--ghost { background: var(--g-surface); color: var(--g-ink); border-color: var(--g-line); }
.ap-btn--ghost:hover { border-color: var(--g-brand); color: var(--g-brand); }
.ap-btn--block { width: 100%; }
.ap-link { border: 0; background: none; color: var(--g-brand); font: 500 13px 'Poppins', sans-serif; cursor: pointer; padding: 0; }
.ap-link:hover { text-decoration: underline; }

/* ── Sign-in and the site pop-up ─────────────────────────────────────────── */
body.ap-auth {
    background:
        radial-gradient(60% 70% at 10% 0%, var(--g-brand-soft) 0%, transparent 70%),
        radial-gradient(50% 60% at 100% 100%, var(--g-accent-soft) 0%, transparent 70%),
        var(--g-surface-2);
}
.ap-auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.ap-auth-card, .ap-modal {
    width: 100%; max-width: 400px; padding: 32px 28px; border-radius: var(--g-r-xl);
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--g-shadow-lg);
}
.ap-auth-card h1, .ap-modal h1 { font-size: 22px; margin-bottom: 4px; }
.ap-auth-card .ap-muted { margin: 0 0 20px; }
.ap-auth-logo { margin-bottom: 18px; }
.ap-auth-logo svg, .ap-auth-logo .g-logo { height: 40px; width: auto; }
.ap-resend { text-align: center; margin-top: 14px; }

.ap-modal { max-width: 620px; text-align: center; }
.ap-site-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.ap-site-choice {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 24px 16px; border-radius: var(--g-r-lg); cursor: pointer;
    border: 1px solid var(--g-line); background: var(--g-surface); color: var(--g-ink);
    font-family: 'Poppins', sans-serif;
    transition: border-color var(--g-fast) var(--g-ease), box-shadow var(--g-mid) var(--g-ease), transform var(--g-fast) var(--g-ease);
}
.ap-site-choice:hover { border-color: var(--g-brand); box-shadow: var(--g-shadow-md); transform: translateY(-2px); }
.ap-site-choice i { font-size: 30px; color: var(--g-brand); width: 58px; height: 58px; display: flex; align-items: center; justify-content: center; border-radius: var(--g-r-pill); background: var(--g-brand-soft); margin-bottom: 6px; }
.ap-site-choice strong { font-size: 16px; }
.ap-site-choice span { font-size: 12.5px; color: var(--g-ink-3); }
.ap-site-choice em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--g-ink-2); margin-top: 6px; }

/* ── Small screens ───────────────────────────────────────────────────────── */
.ap-scrim { display: none; }
@media (max-width: 1100px) {
    .ap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ap-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .ap-side { transform: translateX(-100%); transition: transform var(--g-mid) var(--g-ease); }
    body.ap-side-open .ap-side { transform: none; }
    body.ap-side-open .ap-scrim { display: block; position: fixed; inset: 0; background: rgba(27, 17, 20, .4); z-index: 35; }
    .ap-main { margin-left: 0; }
    .ap-icon-btn.ap-menu { display: inline-flex; }
    .ap-top { padding: 10px 16px; flex-wrap: wrap; }
    .ap-title { font-size: 17px; }
    .ap-site-switch { order: 5; width: 100%; }
    .ap-site-switch button { flex: 1; }
    .ap-content { padding: 16px 16px 40px; }
    .ap-site-choices { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .ap-stats { gap: 10px; }
    .ap-stat { padding: 14px; }
    .ap-stat-value { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.ap-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 100;
    transform: translate(-50%, 16px); opacity: 0;
    padding: 11px 18px; border-radius: var(--g-r-pill);
    background: var(--g-chrome); color: var(--g-chrome-ink); font-weight: 500; box-shadow: var(--g-shadow-lg);
    transition: opacity var(--g-mid) var(--g-ease), transform var(--g-mid) var(--g-ease);
}
.ap-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.ap-toast--bad { background: var(--g-bad); color: #fff; }

/* ── Logo — copied from design-system.css (lines 966-1002), which is not loaded here ── */
.g-logo { display: inline-flex; align-items: center; line-height: 0; }

.g-logo svg {
    height: 46px;
    width: auto;
    display: block;
    overflow: visible;
    transition: height var(--g-slow) var(--g-ease-out);
}

.g-logo__mark   { fill: var(--g-accent); }
.g-logo__handle { stroke: var(--g-accent); }

.g-logo__word {
    fill: var(--g-brand);
    font-family: Poppins, system-ui, sans-serif;
    font-weight: 700;
    font-size: 46px;
    letter-spacing: -0.6px;
    transition: fill var(--g-mid) var(--g-ease);
}

.g-logo__sub rect { fill: var(--g-accent); }

.g-logo__subtext {
    fill: #fff;
    font-family: Poppins, system-ui, sans-serif;
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: 1.8px;
    text-anchor: middle;
}

/* .g-logo--light is for genuinely dark surfaces — the footer. The scrolled
   header is no longer one of them, so the wordmark keeps its magenta at every
   scroll position. */
.g-logo--light .g-logo__word { fill: var(--g-chrome-ink); }

/* ── Utilities ───────────────────────────────────────────────────────────── */
.ap-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ap-small { font-size: 12px; }
.ap-center { text-align: center !important; }
.ap-right { text-align: right; }
.ap-grow { flex: 1; }
.ap-pad { padding: 18px 20px; }
.ap-mb { margin-bottom: 16px; }
.ap-warn-text { color: var(--g-warn); font-weight: 600; }
.ap-hint { display: block; font-size: 12px; color: var(--g-ink-3); }
.ap-counter { font-style: normal; font-size: 12px; font-weight: 500; color: var(--g-ok); margin-left: auto; }
.ap-counter.is-short { color: var(--g-warn); }
.ap-field > span .ap-counter { float: right; }
.ap-alert { padding: 14px 18px; border-radius: var(--g-r-md); background: var(--g-bad-soft); color: var(--g-bad); margin-bottom: 18px; }
.ap-alert ul { margin: 6px 0 0; padding-left: 18px; }
.ap-btn--sm { padding: 7px 13px; font-size: 13px; }

/* ── Toolbar, tabs, filters ──────────────────────────────────────────────── */
.ap-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ap-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--g-r-pill); background: var(--g-surface); border: 1px solid var(--g-line); }
.ap-tabs a { padding: 7px 14px; border-radius: var(--g-r-pill); color: var(--g-ink-2); text-decoration: none; font-weight: 500; font-size: 13px; }
.ap-tabs a span { font-size: 11.5px; color: var(--g-ink-3); margin-left: 4px; }
.ap-tabs a.is-on { background: var(--g-chrome); color: var(--g-chrome-ink); }
.ap-tabs a.is-on span { color: var(--g-chrome-ink-2); }
.ap-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.ap-field--inline { margin: 0; }
.ap-field--inline input, .ap-field--inline select { padding: 9px 12px; }
.ap-filters .ap-grow { min-width: 220px; }

/* ── Product table ───────────────────────────────────────────────────────── */
.ap-card--flush { padding: 0; }
.ap-card--flush .ap-table-wrap { margin: 0; padding: 0; }
.ap-table--products td, .ap-table--products th { padding-left: 14px; padding-right: 14px; }
.ap-prod { display: flex; gap: 12px; align-items: flex-start; min-width: 280px; }
.ap-prod img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--g-r-xs); background: var(--g-surface-2); flex: none; }
.ap-prod > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-prod-name { color: var(--g-ink); font-weight: 500; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-prod-name:hover { color: var(--g-brand); }
.ap-issues--left { justify-content: flex-start; margin-top: 2px; }
.ap-stock-input { width: 76px; padding: 6px 8px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); font: 500 13px 'Poppins', sans-serif; }
.ap-stock-input:focus { outline: none; border-color: var(--g-brand); box-shadow: 0 0 0 3px var(--g-brand-soft); }
.ap-stock-input.is-saving { opacity: .5; }
.ap-pager { padding: 12px 16px; border-top: 1px solid var(--g-line); }
.ap-pages { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.ap-pages a { color: var(--g-brand); font-weight: 600; text-decoration: none; }
.ap-pages .is-off { color: var(--g-ink-3); }

/* The switch — one control, both in the table and on the form. */
.ap-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.ap-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.ap-switch > span[aria-hidden] { position: absolute; inset: 0; border-radius: var(--g-r-pill); background: #D9D2CC; transition: background var(--g-fast) var(--g-ease); }
.ap-switch > span[aria-hidden]::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform var(--g-fast) var(--g-ease);
}
.ap-switch input:checked + span[aria-hidden] { background: var(--g-ok); }
.ap-switch input:checked + span[aria-hidden]::after { transform: translateX(18px); }
.ap-switch input:focus-visible + span[aria-hidden] { box-shadow: 0 0 0 3px var(--g-brand-soft); }
.ap-switch input:disabled + span[aria-hidden] { opacity: .5; }

/* ── Product form ────────────────────────────────────────────────────────── */
.ap-form { max-width: 1100px; }
.ap-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.ap-sell-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.ap-sell-toggle { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--g-r-md); border: 1px solid var(--g-line); background: var(--g-surface-2); cursor: pointer; flex: 1 1 240px; }
.ap-sell-toggle > span:last-child { display: flex; flex-direction: column; }

.ap-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.ap-photo { position: relative; margin: 0; border-radius: var(--g-r-md); overflow: hidden; border: 1px solid var(--g-line); background: var(--g-surface-2); aspect-ratio: 1; }
.ap-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-photo label, .ap-photo-drop, .ap-photo-flag {
    position: absolute; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: var(--g-r-pill);
    background: rgba(255, 255, 255, .92); color: var(--g-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.ap-photo-main { left: 6px; bottom: 6px; }
.ap-photo-remove { right: 6px; bottom: 6px; }
.ap-photo-drop { right: 6px; top: 6px; border: 0; width: 26px; height: 26px; justify-content: center; font-size: 16px; }
.ap-photo-flag { left: 6px; top: 6px; background: var(--g-bad); color: #fff; }
.ap-photo:has(input[name="main_choice"]:checked) { outline: 3px solid var(--g-brand); outline-offset: -3px; }
.ap-photo.is-removed img { opacity: .3; filter: grayscale(1); }
.ap-photo.is-bad { border-color: var(--g-bad); }
.ap-photo--add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; color: var(--g-ink-3); cursor: pointer; font-weight: 500; }
.ap-photo--add i { font-size: 28px; color: var(--g-brand); }
.ap-photo--add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ap-photo--add:hover { border-color: var(--g-brand); }

.ap-variants td { padding: 6px; }
.ap-variants select, .ap-variants input { width: 100%; padding: 8px 10px; border: 1px solid var(--g-line); border-radius: var(--g-r-xs); font: 400 13px 'Poppins', sans-serif; background: var(--g-surface); }
.ap-variants select:focus, .ap-variants input:focus { outline: none; border-color: var(--g-brand); box-shadow: 0 0 0 3px var(--g-brand-soft); }
.ap-in-sku { min-width: 130px; }
.ap-in-num { min-width: 88px; }
.ap-variants tr.has-error td { background: var(--g-bad-soft); }
.ap-variants th small { font-weight: 400; }
#addVariant { margin-top: 12px; }

.ap-details summary { cursor: pointer; list-style: none; }
.ap-details summary::-webkit-details-marker { display: none; }
.ap-details summary h2 { display: inline; font-size: 16px; }
.ap-details summary::after { content: '▾'; float: right; color: var(--g-ink-3); }
.ap-details[open] summary { margin-bottom: 10px; }

.ap-savebar {
    position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    margin: 0 -28px; padding: 14px 28px;
    background: rgba(250, 247, 244, .85);
    -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
    border-top: 1px solid var(--g-line);
}
.ap-danger { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; padding: 16px 20px; border-radius: var(--g-r-lg); border: 1px solid #F3C9C4; background: #FFF8F7; max-width: 1100px; }
.ap-danger p { margin: 2px 0 0; }

@media (max-width: 860px) {
    .ap-cols-2 { grid-template-columns: 1fr; }
    .ap-savebar { margin: 0 -16px; padding: 12px 16px; }
    .ap-filters .ap-grow { min-width: 100%; }
}

/* ── Description editor ──────────────────────────────────────────────────── */
.ap-rich-bar { display: flex; gap: 4px; padding: 6px; border: 1px solid var(--g-line); border-bottom: 0; border-radius: var(--g-r-sm) var(--g-r-sm) 0 0; background: var(--g-surface-2); }
.ap-rich-bar button { width: 32px; height: 32px; border: 0; border-radius: var(--g-r-xs); background: transparent; color: var(--g-ink-2); font-size: 16px; cursor: pointer; }
.ap-rich-bar button:hover { background: var(--g-surface); color: var(--g-brand); }
.ap-rich {
    min-height: 170px; padding: 12px 14px; border: 1px solid var(--g-line); border-radius: 0 0 var(--g-r-sm) var(--g-r-sm);
    background: var(--g-surface); line-height: 1.6; outline: none; overflow-wrap: anywhere;
}
.ap-rich:focus { border-color: var(--g-brand); box-shadow: 0 0 0 4px var(--g-brand-soft); }
.ap-rich:empty::before { content: attr(data-placeholder); color: var(--g-ink-3); }
.ap-rich p { margin: 0 0 8px; }
.ap-rich ul, .ap-rich ol { margin: 0 0 8px; padding-left: 22px; }

/* ── Orders ──────────────────────────────────────────────────────────────── */
.ap-row-link { cursor: pointer; }
.ap-block { display: block; }
.ap-nowrap { white-space: nowrap; }
.ap-toolbar-actions { display: flex; gap: 8px; }
.ap-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--g-line); }
.ap-totals dt { color: var(--g-ink-2); }
.ap-totals dd { margin: 0; text-align: right; }
.ap-totals .ap-total { font-weight: 700; font-size: 16px; color: var(--g-ink); }
.ap-facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; }
.ap-facts dt { color: var(--g-ink-3); font-size: 13px; }
.ap-facts dd { margin: 0; overflow-wrap: anywhere; }
.ap-inline-form { display: flex; gap: 8px; margin-bottom: 8px; }
.ap-select { flex: 1; padding: 9px 12px; border-radius: var(--g-r-sm); border: 1px solid var(--g-line); font: 400 14px 'Poppins', sans-serif; background: var(--g-surface); }
.ap-cols-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; }
.ap-tabs--small { margin-bottom: 12px; }
.ap-tabs--small button { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--g-r-pill); font: 500 13px 'Poppins', sans-serif; color: var(--g-ink-2); cursor: pointer; }
.ap-tabs--small button.is-on { background: var(--g-chrome); color: var(--g-chrome-ink); }
.ap-row > span.ap-nowrap { color: var(--g-ink-2); font-size: 13px; }
@media (max-width: 860px) { .ap-cols-4 { grid-template-columns: 1fr 1fr; } }
.ap-resend .ap-link { display: block; margin: 6px auto 0; }
