/* Shared Amitav administration palette. Public checkout keeps its own theme. */
.admin-body, .setup-theme {
  --bg: #101c16;
  --surface: #1b2b21;
  --surface-2: #24382b;
  --input: #111f17;
  --line: #3c5142;
  --text: #edf2e9;
  --muted: #b5c4b8;
  --accent: #f2bf59;
  --accent-rgb: 242, 191, 89;
  --cyan: var(--accent);
  --blue: #c28d39;
  --green: #a6dab4;
  --good: var(--green);
  --green-rgb: 166, 218, 180;
  --amber: #f2bf59;
  --danger: #ffa8ac;
  --danger-rgb: 255, 168, 172;
  --accent-soft: rgba(var(--accent-rgb), .10);
  --radius: 18px;
  --shadow: 0 16px 42px rgba(4, 11, 6, .22);
  color-scheme: dark;
  color: var(--text);
  background: radial-gradient(ellipse at 92% 0, rgba(83, 125, 80, .12), transparent 38rem), var(--bg);
}
.admin-body .ambient, .setup-theme .ambient { display: none; }
.admin-body ::selection, .setup-theme ::selection { background: #896b30; color: #fff; }
:is(.admin-body, .setup-theme) :is(h1, h2, h3, h4) { color: var(--text); }
:is(.admin-body, .setup-theme) .eyebrow { color: var(--accent); }
:is(.admin-body, .setup-theme) :is(.lead, .form-note, .label-hint) { color: var(--muted); }
:is(.admin-body, .setup-theme) a { text-underline-offset: 4px; }
:is(.admin-body, .setup-theme) :is(button, input, select, textarea) { font: inherit; }
:is(.admin-body, .setup-theme) :is(button, a, input, select, textarea, summary, [contenteditable]):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:is(.admin-body, .setup-theme) :is(input, select, textarea) { accent-color: var(--accent); }
:is(.admin-body, .setup-theme) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea) {
  min-width: 0; min-height: 46px; max-width: 100%; border-color: var(--line); background: var(--input); color: var(--text); border-radius: 12px;
}
:is(.admin-body, .setup-theme) :is(input, textarea)::placeholder { color: #9fb2a3; opacity: 1; }
:is(.admin-body, .setup-theme) :is(input, select, textarea):focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
:is(.admin-body, .setup-theme) :is(input, select, textarea):disabled { background: #26332a; color: #a8b5aa; cursor: not-allowed; opacity: .8; }
:is(.admin-body, .setup-theme) select option { background: var(--input); color: var(--text); }
:is(.admin-body, .setup-theme) input[type=file]::file-selector-button { padding: 8px 12px; margin-right: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
:is(.admin-body, .setup-theme) :is(.form-stack, .button-setting-grid, .emoji-manager-form, .wallet-adjust-form) label { color: #dbe6da; }
:is(.admin-body, .setup-theme) .button { min-height: 44px; border-radius: 11px; line-height: 1.4; }
:is(.admin-body, .setup-theme) .button-primary { border-color: #edc875; background: linear-gradient(140deg, #f6cd79, #e8b14c); color: #2c2516; box-shadow: 0 7px 18px rgba(7, 13, 8, .2); }
:is(.admin-body, .setup-theme) .button-primary:hover { background: #f8d28c; border-color: #ffdf9a; }
:is(.admin-body, .setup-theme) .button-ghost { background: #24362a; border-color: var(--line); color: var(--text); }
:is(.admin-body, .setup-theme) .button-ghost:hover { background: #2d4433; border-color: #8a9d80; }
:is(.admin-body, .setup-theme) .button-danger { border-color: rgba(var(--danger-rgb), .4); background: rgba(var(--danger-rgb), .10); color: var(--danger); }
:is(.admin-body, .setup-theme) button:disabled { cursor: not-allowed; transform: none; box-shadow: none; }
:is(.admin-body, .setup-theme) .panel, .setup-theme .auth-card { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
:is(.admin-body, .setup-theme) :is(.tool-card, .editor-card, .add-drawer, .stock-product-card, .stock-item-card, .wallet-user-card, .emoji-manager-card) { border-color: var(--line); background: var(--surface); box-shadow: none; }
:is(.admin-body, .setup-theme) :is(.emoji-help, .customer-detail-config, .order-detail-card, .catalog-bulk-form, .catalog-quick-move, .wallet-scope) { border-color: #526748; background: rgba(var(--accent-rgb), .055); }
.admin-body :is(.emoji-help p, .customer-detail-config__heading, .catalog-quick-move-heading strong) { color: var(--text); }
.admin-body .customer-detail-config.is-disabled { opacity: .72; }
.admin-body .danger-zone { background: rgba(var(--danger-rgb), .04); border-color: rgba(var(--danger-rgb), .28); }
.admin-body :is(.pill, .section-nav a, .wallet-tabs a[aria-current=page]) { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .3); }
.admin-body .section-nav a { min-height: 42px; display: flex; align-items: center; }
.admin-body .wallet-status { color: var(--muted); background: #2a3c2e; }
.admin-body :is(.status-good, .wallet-status-credited) { color: var(--green); background: rgba(var(--green-rgb), .09); border-color: rgba(var(--green-rgb), .3); }
.admin-body :is(.status-warning, .wallet-status-pending, .wallet-status-verifying, .wallet-status-initializing) { color: var(--amber); background: var(--accent-soft); }
.admin-body :is(.status-danger, .wallet-status-failed, .wallet-status-expired) { color: var(--danger); background: rgba(var(--danger-rgb), .09); }
.admin-body .text-good { color: var(--green) !important; }
.admin-body .text-accent { color: var(--accent) !important; }
.admin-body .text-danger { color: var(--danger) !important; }
:is(.admin-body, .setup-theme) .alert { border-color: var(--line); background: var(--surface-2); color: var(--text); }
:is(.admin-body, .setup-theme) .alert-success { border-color: #587360; background: #1c3728; color: #c2e8c7; }
:is(.admin-body, .setup-theme) :is(.alert-error, .alert-danger) { border-color: #865358; background: #3d2529; color: #ffbdc0; }
:is(.admin-body, .setup-theme) .alert-warning { border-color: #886f39; background: #3b3320; color: #f7d491; }
.admin-body .ajax-toast { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.admin-body :is(.summary-icon, .wallet-avatar, .user-avatar-initial) { color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.admin-body .switch span { background: #546452; }
.admin-body .switch input:checked + span { background: #527750; }
.admin-body .switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }
.admin-body .admin-sidebar { width: 272px; gap: 18px; padding: 24px 16px 16px; height: 100dvh; border-color: #364d3c; background: linear-gradient(180deg, #192c20, #132219); box-shadow: 16px 0 44px rgba(3, 11, 5, .16); }
.admin-body .admin-sidebar .brand { padding: 4px 8px 12px; letter-spacing: -.02em; }
.admin-body .admin-sidebar .brand strong { font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; }
.admin-body .admin-sidebar .brand small { color: var(--muted); letter-spacing: .09em; }
:is(.admin-body, .setup-theme) .shop-mark { border: 1px solid #778463; border-radius: 13px; background: #284b34; color: var(--accent); box-shadow: none; }
.admin-body .admin-command-trigger { min-height: 44px; border-color: var(--line); background: #23392b; color: var(--text); }
.admin-body .admin-command-trigger:hover { background: #2e4735; border-color: #788c6b; }
.admin-body kbd { background: var(--input); border-color: var(--line); color: var(--muted); }
.admin-body .admin-nav { scrollbar-color: #526b55 transparent; }
.admin-body .admin-nav-label { color: #9fb5a0; margin: 13px 12px 4px; letter-spacing: .14em; }
.admin-body .admin-nav a { min-height: 44px; padding: 9px 12px; color: #cfdfd0; border-radius: 11px; }
.admin-body .admin-nav a:hover { color: #fff; background: #294230; border-color: #425b44; }
.admin-body .admin-nav a.is-active { background: linear-gradient(95deg, #374b2e, #25392a); color: #ffe2a1; border-color: #5d6948; box-shadow: inset 3px 0 var(--accent); }
.admin-body .admin-nav a.is-active .nav-icon { filter: none; }
.admin-body .nav-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: rgba(var(--green-rgb), .06); }
.admin-body .admin-sidebar-footer { padding-top: 14px; border-top: 1px solid var(--line); }
.admin-body .admin-main { max-width: 1680px; padding: 36px clamp(22px, 3vw, 46px) 80px; }
.admin-body .page-heading h1 { line-height: 1.08; letter-spacing: -.04em; }
.admin-body .dashboard-hero { position: relative; align-items: center; padding: clamp(24px, 3vw, 38px); border: 1px solid #48694e; border-radius: 24px; background: radial-gradient(ellipse at 95% 0, rgba(var(--accent-rgb), .1), transparent 28rem), linear-gradient(125deg, #2b573b, #193a29); box-shadow: var(--shadow); }
.admin-body .dashboard-hero h1 { margin-bottom: 12px; font-size: clamp(2.1rem, 4vw, 3.3rem); }
.admin-body .dashboard-hero .lead { color: #d1e2ce; }
.dashboard-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-body :is(.metrics article, .wallet-metrics article, .wallet-balance-card, .kpi-card) { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: none; }
.admin-body :is(.metrics span, .wallet-metrics span, .kpi-label, .kpi-sub, .meta-label, .user-stat-label, .user-stat-sub, .wallet-help, .wallet-balance-card span) { color: var(--muted); }
.admin-body :is(.metrics strong, .wallet-metrics strong, .wallet-balance-card strong, .meta-value) { color: var(--text); }
.admin-body .metrics strong { margin-top: 12px; font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
.admin-body .metrics article:after { background: rgba(var(--green-rgb), .05); }
.admin-body .quick-action-strip a { min-height: 74px; border-color: var(--line); border-radius: 14px; background: #21372a; }
.admin-body .quick-action-strip a:hover { background: #2b4432; border-color: #708463; }
.admin-body .quick-action-strip strong { color: var(--text); }
.admin-body .quick-action-strip small { color: var(--muted); }

/* Tables, filters and editors share the same surfaces on every screen. */
.admin-body :is(th, td) { border-color: var(--line); }
.admin-body th { color: #c0d1c0; background: #21372a; }
.admin-body td { color: var(--text); }
.admin-body tbody tr:hover { background: rgba(var(--green-rgb), .045); }
.admin-body :is(.table-scroll, .table-wrap) { scrollbar-color: #638061 var(--input); }
.admin-body :is(.stock-editor-textarea, .sold-table pre, .delivery-preview pre, .premium-editor-shell, .shortcode-input) { border-color: var(--line); background: var(--input); color: var(--text); }
.admin-body :is(.sold-history-card, .chart-container-box, .tg-chat-mock) { border-color: var(--line); background: var(--input); }
.admin-body :is(.chart-tab-controls, .status-filter-group, .stat-badge, .wallet-balance-pair b, .tg-bubble) { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.admin-body :is(.chart-tab, .filter-pill) { min-height: 44px; padding: 10px 14px; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.admin-body :is(.chart-tab.active, .filter-pill.active) { background: var(--accent); color: #2c2516; }
.admin-body .bar-fill { background: linear-gradient(180deg, #dabb72, #866c35); }
.admin-body .bar-fill-weekly { background: linear-gradient(180deg, #a6dab4, #507653); }
.admin-body .bar-fill-monthly { background: linear-gradient(180deg, #e7d8b5, #94846b); }
.admin-body .stat-available { background: rgba(var(--green-rgb), .07); border-color: #526f55; }
.admin-body .stat-sold { background: var(--accent-soft); border-color: #79643e; }
.admin-body .stat-available .stat-value { color: var(--green); }
.admin-body .stat-sold .stat-value { color: var(--accent); }
.admin-body .catalog-selection-status { color: var(--accent); }
.admin-body .catalog-clear-selection { color: var(--muted); min-height: 44px; }
.admin-body .catalog-selection-controls .catalog-checkbox { color: var(--text); }
.admin-body .catalog-checkbox input { accent-color: var(--accent); }
.admin-body .catalog-product.is-selected { border-color: #a88d51; box-shadow: 0 0 0 1px #a88d51; }
.admin-body .premium-editor-toolbar { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.admin-body :is(.premium-editor-picker-button, .emoji-id-picker-button, .premium-emoji-chip) { border-color: #596849; background: var(--accent-soft); color: var(--accent); }
.admin-body :is(.premium-editor-picker-button, .emoji-id-picker-button) { min-height: 44px; }
.admin-body .premium-editor-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.admin-body :is(.premium-emoji-option, .emoji-manager-preview) { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.admin-body .premium-emoji-option:hover { background: #344c35; border-color: #889b6e; }
.admin-body .emoji-id-hint { color: var(--muted); }
.admin-body :is(.command-palette, .premium-emoji-picker, .admin-modal) { border: 1px solid #647752; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0, 0, 0, .55); }
.admin-body dialog::backdrop { background: rgba(4, 12, 7, .75); backdrop-filter: blur(5px); }
.admin-body :is(.command-palette-head button, .emoji-picker-close) { min-width: 44px; min-height: 44px; background: var(--surface-2); border-color: var(--line); color: var(--text); }
.admin-body .command-palette-head input { background: transparent; color: var(--text); }
.admin-body .command-group-title { color: var(--muted); }
.admin-body .command-palette-body a > span:first-child { background: var(--surface-2); }
.admin-body .command-palette-body a:hover, .admin-body .command-palette-body a:focus { background: var(--accent-soft); border-color: #7c7950; }
.admin-body .premium-emoji-picker-tools input { background: var(--input); border-color: var(--line); color: var(--text); }
.admin-body .premium-emoji-picker-tools a { color: var(--accent); }
.admin-body .admin-disclosure-summary:hover, .admin-body .stock-product-header:hover { background: rgba(var(--accent-rgb), .035); }
.admin-body .stock-product-card[open] > .stock-product-header { background: rgba(var(--accent-rgb), .035); }
.admin-body .admin-disclosure-summary { min-height: 64px; }
.admin-body .search-input-wrapper { min-width: min(260px, 100%); }
.admin-body .pagination-bar { flex-wrap: wrap; gap: 14px; }
.admin-body .pagination-buttons { flex-wrap: wrap; }
.admin-body .wallet-admin-panel .wallet-adjust-form {
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}
.admin-body .wallet-admin-panel .wallet-adjust-form label { min-width: 0; }
.admin-body .wallet-admin-panel .wallet-adjust-form button { white-space: normal; }
.admin-body .admin-modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
.admin-body .admin-disclosure.table-panel .panel-heading { margin-bottom: 0; }
.admin-skip-link { position: fixed; left: 18px; top: -70px; z-index: 1000; padding: 12px 18px; border-radius: 10px; background: var(--accent); color: #292414; font-weight: 800; }
.admin-skip-link:focus { top: 14px; }
#adminContent:focus { outline: none; }
.setup-theme .site-header { border-color: var(--line); }
.setup-theme .brand { color: var(--text); }
.setup-theme .setup-step { border-color: #816d3d; background: var(--accent-soft); color: var(--accent); }
.setup-theme .checkbox-label { display: flex; align-items: flex-start; gap: 10px; color: var(--text); }
.setup-theme .checkbox-label input { width: 20px; min-width: 20px; height: 20px; margin-top: 2px; }
.admin-auth .auth-card { margin-top: clamp(24px, 7vh, 80px); border-radius: 24px; }
.admin-auth .auth-card h1 { font-size: clamp(2rem, 6vw, 2.5rem); }

@media (min-width: 701px) {
  .admin-body .orders-panel :is(th, td):last-child { background: var(--surface); box-shadow: -10px 0 18px rgba(6, 15, 8, .4); }
}
@media (max-width: 1100px) {
  .admin-body .field-grid-4, .admin-body .button-setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .admin-body .admin-main { padding: 24px 14px 60px; }
  .admin-body .admin-sidebar { width: min(310px, 88vw); padding: 18px 15px; }
  .admin-body .admin-mobile-bar { height: 66px; grid-template-columns: 44px 1fr 44px; border-color: var(--line); background: rgba(20, 36, 25, .96); }
  .admin-body :is(.admin-menu-toggle, .admin-mobile-search) { width: 44px; height: 44px; border-color: var(--line); background: var(--surface-2); }
  .admin-body .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-body .stock-product-title { flex: 1 1 100%; min-width: 0; }
  .admin-body .stock-editor-label-row { flex-wrap: wrap; gap: 6px; }
}
@media (max-width: 700px) {
  .admin-body .orders-panel .order-data-row { border-color: var(--line); background: var(--surface); }
  .admin-body .wallet-table tbody tr { background: var(--surface); }
  .admin-body .chart-container-box { padding: 16px 12px; }
  .admin-body .chart-tab-controls { flex-wrap: wrap; }
  .admin-body .stats-pills { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  :is(.admin-body, .setup-theme) :is(input, select, textarea) { font-size: 16px; }
  .admin-body :is(.field-grid-3, .field-grid-4, .button-setting-grid) { grid-template-columns: minmax(0, 1fr); }
  .admin-body .dashboard-hero { padding: 22px; border-radius: 18px; }
  .dashboard-hero-actions { width: 100%; }
  .dashboard-hero-actions .button { flex: 1 1 auto; padding-inline: 12px; }
  .admin-body .metrics article { padding: 16px; min-height: 105px; }
  .admin-body .quick-action-strip a { min-height: 58px; }
  .admin-body .premium-emoji-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-body .premium-editor-toolbar { flex-wrap: wrap; }
  .admin-body .user-meta-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-body .admin-modal .form-stack { padding: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.admin-body, .setup-theme) *, :is(.admin-body, .setup-theme) *::before, :is(.admin-body, .setup-theme) *::after { scroll-behavior: auto; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
