:root {
  --charcoal: #171512;
  --cream: #f7f4ef;
  --ink: #171512;
  --ink-soft: #4f4a43;
  --paper: #f7f4ef;
  --surface: #fffdfa;
  --sand: #e8dfd4;
  --line: #e2dbd2;
  --rose: #8f5860;
  --focus-ring: #8f5860;
  --rose-dark: #6f3f47;
  --olive: #6f705d;
  --success: #2f6b4f;
  --warning: #97671b;
  --danger: #a43e3e;
  --sidebar: #1b1916;
  --shadow: 0 20px 60px rgba(31, 25, 19, 0.1);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --motion-fast: 150ms;
  --motion-standard: 180ms;
  --motion-slow: 300ms;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 9999; background: white; color: var(--ink); padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { top: 16px; }

.auth-gate { min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 0.8fr) minmax(480px, 1.2fr); background: var(--surface); }
.auth-panel { display: flex; flex-direction: column; padding: clamp(32px, 6vw, 88px); }
.admin-wordmark { display: inline-flex; width: fit-content; flex-direction: column; color: var(--ink); text-decoration: none; line-height: .82; }
.admin-wordmark span { font: 500 42px/0.8 Georgia, serif; letter-spacing: -.08em; }
.admin-wordmark small { margin-top: 8px; font-size: 9px; letter-spacing: .42em; }
.admin-wordmark--light { color: #fff; }
.auth-copy { margin: auto 0 34px; max-width: 520px; }
.eyebrow { margin: 0 0 10px; color: var(--rose); font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.auth-copy h1, .page-heading h1, .modal-card h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.04em; }
.auth-copy h1 { font-size: clamp(46px, 6vw, 74px); }
.auth-copy > p:last-child { max-width: 480px; color: var(--ink-soft); font-size: 17px; }
.auth-panel form { display: grid; gap: 12px; max-width: 440px; }
.auth-panel [hidden] { display: none; }
.auth-panel label, .field { color: var(--ink); font-size: 13px; font-weight: 650; }
.auth-panel input, .field input, .field select { width: 100%; height: 50px; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 0 14px; transition: border-color var(--motion-standard), box-shadow var(--motion-standard); }
.auth-panel input { height: 58px; font-size: 15px; letter-spacing: .02em; text-align: left; }
.auth-panel input:focus, .field input:focus, .field select:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(143, 88, 96, .1); }
.auth-panel form small { color: #706a63; }
.auth-panel form small strong { color: var(--ink); letter-spacing: .08em; }
.totp-enrollment { display: grid; gap: 14px; max-width: 440px; }
.totp-enrollment h2,
.auth-panel [data-auth-restart] h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 4vw, 2.35rem); font-weight: 500; }
.totp-enrollment > p,
.auth-panel [data-auth-restart] > p { margin: 0; color: var(--ink-soft); line-height: 1.65; }
.totp-enrollment img { width: min(224px, 100%); height: auto; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fffaf3; }
.totp-secret { display: grid; gap: 5px; }
.totp-secret span { color: var(--ink-soft); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.totp-secret code { overflow-wrap: anywhere; color: var(--ink); font-size: .86rem; letter-spacing: .08em; }
.demo-note { max-width: 440px; margin: 24px 0 0; color: #7b746c; font-size: 12px; }
.auth-image { min-height: 100dvh; background: linear-gradient(90deg, rgba(21,18,15,.12), transparent), url("/assets/hero-campaign.jpg") center / cover; }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 18px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 18px; font-size: 13px; font-weight: 700; text-decoration: none; transition: background var(--motion-standard), color var(--motion-standard), border-color var(--motion-standard), opacity var(--motion-standard); }
.button:disabled { cursor: wait; opacity: .58; }
[aria-describedby="access-stale-help"]:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.button--primary { background: var(--ink); color: white; }
.button--primary:hover { background: #332f2a; }
.button--secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button--secondary:hover { border-color: #b9aea2; background: white; }
.button--quiet { border-color: transparent; background: transparent; color: var(--rose-dark); }
.button--quiet:hover { background: #f3ebe7; }
.button--danger { border-color: rgba(164, 62, 62, .36); background: white; color: var(--danger); }
.button--danger:hover { border-color: var(--danger); background: #fff7f7; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; }
[data-icon] { display: inline-grid; flex: 0 0 auto; place-items: center; }
[data-icon] svg, .panel-link svg, .metric-card svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.admin-app { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: 264px; display: flex; flex-direction: column; background: var(--sidebar); color: #f9f6f0; }
.sidebar header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; padding: 24px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-close { display: none; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 18px 12px 26px; scrollbar-width: thin; }
.sidebar nav p { margin: 21px 14px 8px; color: #817b73; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { min-height: 44px; width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 8px; background: transparent; color: #beb7ad; padding: 9px 12px; text-align: left; transition: background var(--motion-standard), color var(--motion-standard); }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.is-active { background: #f7f2ea; color: var(--ink); }
.nav-item [data-icon] { width: 21px; height: 21px; display: inline-grid; place-items: center; }
.nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.sidebar footer { min-height: 84px; display: grid; grid-template-columns: 38px 1fr 40px; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar footer .avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--rose); font-size: 11px; font-weight: 800; }
.sidebar footer div { min-width: 0; display: flex; flex-direction: column; }
.sidebar footer strong { font-size: 12px; }
.sidebar footer small { color: #8f8980; font-size: 10px; white-space: nowrap; }
.sidebar-scrim { display: none; }

.admin-workspace { min-width: 0; min-height: 100dvh; margin-left: 264px; }
.topbar { position: sticky; top: 0; z-index: 50; height: 72px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); background: rgba(247,244,239,.94); backdrop-filter: blur(18px); padding: 0 clamp(20px, 3vw, 44px); }
.menu-button { display: none; }
.breadcrumbs { min-width: 0; display: flex; flex: 1 1 auto; align-items: center; gap: 9px; overflow: hidden; font-size: 12px; white-space: nowrap; }
.breadcrumbs span { color: #8a837a; }
.breadcrumbs i { color: #c0b8ae; font-style: normal; }
.breadcrumbs strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { min-width: 0; margin-left: auto; display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.topbar .icon-button { min-width: 44px; min-height: 44px; flex: 0 0 44px; }
.global-search { width: min(28vw, 340px); min-height: 44px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 0 14px; color: #7d766e; }
.global-search [data-icon] { width: 18px; height: 18px; }
.global-search input { min-width: 0; min-height: 44px; flex: 1; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.store-link { min-height: 44px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); padding: 0 10px; font-size: 12px; font-weight: 700; text-decoration: none; }
.store-link [data-icon] svg { width: 16px; height: 16px; }
.notification-button { border: 1px solid var(--line); background: var(--surface); }
.notification-button i { position: absolute; width: 16px; height: 16px; display: grid; place-items: center; margin: -23px 0 0 24px; border-radius: 50%; background: var(--rose); color: white; font: 700 8px/1 sans-serif; }

#admin-main { padding: clamp(24px, 3.5vw, 52px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(32px, 4vw, 48px); }
.page-heading > div > p:last-child { margin: 8px 0 0; color: #746d65; }
.page-actions { display: flex; gap: 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 148px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.metric-card header { display: flex; align-items: center; justify-content: space-between; color: #777068; font-size: 12px; }
.metric-card header span:last-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #f1ebe4; color: var(--rose); }
.metric-card strong { margin-top: auto; font: 400 30px/1 Georgia, serif; font-variant-numeric: tabular-nums; }
.metric-card footer { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: #827b73; font-size: 10px; }
.trend-up { color: var(--success); font-weight: 800; }
.trend-down { color: var(--danger); font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 14px; margin-top: 14px; }
.dashboard-grid > * { min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-header h2 { margin: 0; font: 400 22px/1.2 Georgia, serif; }
.panel-header p { margin: 5px 0 0; color: #80786f; font-size: 11px; }
.panel-link { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--rose-dark); font-size: 11px; font-weight: 800; }
.panel-link svg { width: 16px; height: 16px; }
.sales-chart { height: 220px; display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: clamp(8px, 2vw, 22px); padding: 26px 8px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 54px, #eee8e1 55px); }
.sales-bar { position: relative; height: var(--bar); min-height: 24px; border-radius: 5px 5px 0 0; background: linear-gradient(to top, var(--rose-dark), #bd8c92); }
.sales-bar:hover { background: var(--ink); }
.sales-bar span { position: absolute; inset: auto 0 -24px; color: #827b73; font-size: 10px; text-align: center; }
.task-list { display: grid; gap: 9px; }
.task-row { min-height: 58px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid #eee8e1; padding: 8px 0; }
.task-row:last-child { border: 0; }
.task-row > span:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: #f1ebe4; color: var(--rose-dark); font-weight: 800; }
.task-row div { display: flex; flex-direction: column; }
.task-row strong { font-size: 12px; }
.task-row small { color: #817970; font-size: 10px; }
.task-row b { color: var(--warning); font-size: 11px; }

.module-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.module-filters { display: flex; gap: 8px; overflow-x: auto; }
.filter-chip { min-height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: #6e675f; padding: 0 14px; font-size: 11px; white-space: nowrap; }
.filter-chip.is-active { border-color: var(--ink); background: var(--ink); color: white; }
.data-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 48px; background: #f1ece5; color: #777067; padding: 0 16px; text-align: left; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 64px; border-top: 1px solid #eee8e1; padding: 10px 16px; vertical-align: middle; white-space: nowrap; }
.data-table tbody tr { transition: background var(--motion-fast); }
.data-table tbody tr:hover { background: #fcf9f5; }
.table-edit { min-height: 44px; display: inline-flex; align-items: flex-start; justify-content: center; flex-direction: column; border: 0; border-radius: 7px; background: transparent; color: var(--ink); padding: 4px 8px; text-align: left; }
.table-edit:hover { background: #f3ebe7; }
.table-edit strong { color: var(--rose-dark); }
.table-edit small { color: #817a72; }
.order-link { min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--rose-dark); padding: 0 8px; font-weight: 800; text-decoration: underline; text-decoration-color: rgba(111, 63, 71, .32); text-underline-offset: 4px; }
.order-link:hover { background: #f3ebe7; text-decoration-color: currentColor; }
.order-link:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.cell-primary { display: flex; align-items: center; gap: 10px; }
.cell-primary img { width: 38px; height: 48px; object-fit: cover; border-radius: 5px; background: #eae2d9; }
.cell-primary span { display: flex; flex-direction: column; }
.cell-primary strong { color: var(--ink); }
.cell-primary small { color: #817a72; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: #efeae4; color: #625b54; font-size: 9px; font-weight: 800; text-transform: capitalize; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status--active, .status--paid, .status--published, .status--delivered { background: #e3efe8; color: var(--success); }
.status--draft, .status--review, .status--pending, .status--awaiting_item { background: #f7ecd5; color: var(--warning); }
.status--cancelled, .status--failed { background: #f4dede; color: var(--danger); }
.status--healthy, .status--purchase, .status--return, .status--transfer_in { background: #e3efe8; color: var(--success); }
.status--low, .status--reservation, .status--opening, .status--adjustment { background: #f7ecd5; color: var(--warning); }
.status--out, .status--damage, .status--transfer_out, .status--sale, .status--reservation_release { background: #f4dede; color: var(--danger); }
.table-empty { padding: 60px 24px; color: #7d756d; text-align: center; }
.pagination { min-height: 54px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: 0 16px; color: #7c756d; font-size: 10px; }
.catalog-state { display: grid; justify-items: start; gap: 10px; min-height: 180px; align-content: center; }
.catalog-state h2, .catalog-state p { margin: 0; }
.catalog-state h2 { font: 400 24px/1.2 Georgia, serif; }
.catalog-state p { color: var(--ink-soft); }
.catalog-state--error { border-color: rgba(164, 62, 62, .3); }
.inventory-state { min-height: 180px; display: grid; align-content: center; justify-items: start; gap: 10px; }
.inventory-state h2, .inventory-state p { margin: 0; }
.inventory-state--error { border-color: rgba(164, 62, 62, .3); }
.inventory-filters { align-items: flex-end; }
.inventory-filters label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.inventory-filters select { min-height: 44px; min-width: 180px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); padding: 0 36px 0 12px; text-transform: none; }
.inventory-number, .inventory-sellable { font-variant-numeric: tabular-nums; }
.inventory-number { text-align: right; }
.inventory-sellable { margin-left: 8px; font-size: 13px; }
.inventory-row--low { background: #fffaf0; }
.inventory-row--out { background: #fff6f6; }
.promotions-state { min-height: 180px; display: grid; align-content: center; justify-items: start; gap: 10px; }
.promotions-state h2, .promotions-state p { margin: 0; }
.promotions-filters { align-items: flex-end; }
.promotions-filters .field { min-width: 190px; }
.promotions-table td { white-space: normal; }
.promotions-table td strong, .promotions-table td small, .promotions-table td span { display: block; }
.promotions-table td small { margin-top: 4px; color: var(--ink-soft); }
.promotions-table .status { display: inline-flex; }
.table-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.promotion-modal { width: min(780px, calc(100% - 28px)); }
.promotion-pause-dialog { width: min(520px, calc(100% - 28px)); }
.stale-notice { border: 1px solid #dfc18e; border-radius: var(--radius-sm); background: #fff9ed; color: var(--warning); padding: 12px 14px; }

.returns-state { min-height: 180px; display: grid; align-content: center; justify-items: start; gap: 10px; }
.returns-state h2, .returns-state p { margin: 0; }
.returns-state--error { border-color: rgba(164, 62, 62, .3); }
.returns-panel-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 22px; }
.returns-panel-header h2, .returns-panel-header p { margin: 0; }
.returns-panel-header h2 { font: 400 24px/1.2 Georgia, serif; }
.returns-panel-header > p { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.returns-table td { white-space: normal; }
.status--approved, .status--received, .status--completed { background: #e3efe8; color: var(--success); }
.status--requested { background: #f7ecd5; color: var(--warning); }
.status--rejected { background: #f4dede; color: var(--danger); }
.returns-detail { display: grid; gap: 22px; }
.returns-detail:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.returns-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.returns-detail-header h2, .returns-detail-header p { margin: 0; }
.returns-detail-header h2 { font: 400 clamp(28px, 4vw, 40px)/1.1 Georgia, serif; }
.return-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line); }
.return-summary > div { min-width: 0; background: #fcf9f5; padding: 14px; }
.return-summary-wide { grid-column: 1 / -1; }
.return-summary dt { color: #777067; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.return-summary dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; font-weight: 700; }
.returns-detail-grid { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); gap: 18px; }
.return-detail-section { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fcf9f5; padding: 18px; }
.return-detail-section > h3, .return-operation h3 { margin: 0; font: 400 20px/1.2 Georgia, serif; }
.return-timeline ol, .return-items { display: grid; gap: 0; margin: 16px 0 0; padding: 0; list-style: none; }
.return-timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; min-height: 64px; }
.return-timeline li > span { width: 10px; height: 10px; margin-top: 5px; border: 2px solid var(--surface); border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 1px var(--rose); }
.return-timeline li > div { position: relative; padding-bottom: 14px; }
.return-timeline li:not(:last-child) > div::before { position: absolute; top: 20px; bottom: -1px; left: -17px; width: 1px; background: var(--line); content: ""; }
.return-timeline p, .return-timeline time { display: block; margin: 2px 0 0; color: var(--ink-soft); font-size: 11px; }
.return-item { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.2fr); gap: 18px; border-top: 1px solid var(--line); padding: 16px 0; }
.return-item:first-child { border-top: 0; padding-top: 0; }
.return-item-primary, .return-replacement p { display: flex; flex-direction: column; }
.return-item-primary span, .return-item-primary small, .return-replacement p > span, .return-replacement-empty { color: var(--ink-soft); font-size: 11px; }
.return-replacement { border-left: 2px solid var(--rose); padding-left: 14px; }
.return-replacement p { margin: 0; }
.return-replacement > div { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; color: var(--ink-soft); font-size: 11px; }
.return-replacement-empty { margin: 0; }
.return-operation { display: grid; gap: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #f7f1eb; padding: 20px; }
.return-operation header p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.return-operation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.return-operation > .button { width: fit-content; }
.return-receipt-list { display: grid; gap: 12px; }
.return-receipt-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 14px; }
.return-receipt-item legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 750; }
.return-warning { margin: 0; border-left: 3px solid var(--warning); background: #fff8e9; color: #704f1a; padding: 12px 14px; font-size: 12px; }

.admin-modal { width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 0; border-radius: var(--radius-lg); background: transparent; padding: 0; }
.admin-modal::backdrop { background: rgba(19, 16, 13, .64); backdrop-filter: blur(6px); }
.modal-card { overflow: auto; max-height: calc(100dvh - 32px); border-radius: var(--radius-lg); background: var(--surface); padding: 26px; box-shadow: var(--shadow); }
.modal-card > header, .modal-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.modal-card h2 { font-size: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.field { display: flex; flex-direction: column; }
.field--wide { grid-column: 1 / -1; }
.field textarea { width: 100%; min-height: 112px; margin-top: 8px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 12px 14px; transition: border-color var(--motion-standard), box-shadow var(--motion-standard); }
.field textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(143, 88, 96, .1); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-helper { margin-top: 5px; color: #706a63; font-size: 11px; font-weight: 450; }
.field-error { min-height: 18px; margin-top: 4px; color: var(--danger); font-size: 11px; font-weight: 600; }
.editor-status { min-height: 20px; margin: 0 0 12px; color: var(--ink-soft); font-size: 12px; }
.modal-card > footer { justify-content: flex-end; }
.product-editor { width: min(1040px, calc(100% - 32px)); }
.product-editor .modal-card { padding: 0; }
.product-editor .modal-card > header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .97); padding: 22px 26px; backdrop-filter: blur(14px); }
.product-editor-sections { display: grid; gap: 18px; padding: 24px 26px; }
.product-editor-section { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fcf9f5; padding: 20px; }
.product-editor-section legend { padding: 0 8px; color: var(--ink); font: 400 22px/1.2 Georgia, serif; }
.product-editor-section > p { margin: 0 0 16px; color: var(--ink-soft); font-size: 12px; }
.product-editor-section .form-grid { margin: 0; }
.choice-field { min-height: 44px; display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 650; }
.choice-field input { width: 18px; height: 18px; accent-color: var(--rose-dark); }
.editor-repeater { display: grid; gap: 12px; margin-bottom: 14px; }
.repeater-card { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 16px; }
.repeater-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.repeater-card h4 { margin: 0; font: 400 18px/1.2 Georgia, serif; }
.repeater-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.publication-state { border-radius: var(--radius-sm); background: #f1ebe4; padding: 12px 14px; }
.product-editor .form-error,
.product-editor .editor-status { margin-right: 26px; margin-left: 26px; }
.product-editor-actions { position: sticky; bottom: 0; z-index: 5; justify-content: space-between !important; border-top: 1px solid var(--line); background: rgba(255, 253, 250, .97); padding: 16px 26px; backdrop-filter: blur(14px); }
.product-editor-actions > div { display: flex; gap: 10px; }
.order-modal, .customer-modal { width: min(840px, calc(100% - 32px)); }
.customer-profile-drawer { width: min(760px, 100%); max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.customer-profile-drawer .modal-card { min-height: 100dvh; max-height: 100dvh; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.customer-profile-drawer .modal-card > header { position: sticky; top: -26px; z-index: 3; margin: -26px -26px 0; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .97); padding: 22px 26px; backdrop-filter: blur(14px); }
.inventory-ledger-drawer { width: min(560px, 100%); max-height: 100dvh; height: 100dvh; margin: 0 0 0 auto; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.inventory-ledger-drawer .modal-card { min-height: 100dvh; max-height: 100dvh; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.inventory-ledger-drawer .modal-card > header { position: sticky; top: -26px; z-index: 3; margin: -26px -26px 0; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .97); padding: 22px 26px; backdrop-filter: blur(14px); }
.inventory-ledger-summary { padding: 26px 0 20px; }
.inventory-ledger-summary h3 { margin: 0; font: 400 26px/1.2 Georgia, serif; }
.inventory-ledger-summary > p:last-of-type { margin: 7px 0 0; color: var(--ink-soft); }
.inventory-ledger-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; }
.inventory-ledger-summary dl div { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8f3ed; padding: 11px; }
.inventory-ledger-summary dt, .inventory-ledger-list dt { color: var(--ink-soft); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.inventory-ledger-summary dd { margin: 0; font: 400 21px/1.2 Georgia, serif; }
.inventory-ledger-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.inventory-ledger-list > li { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcf9f5; padding: 16px; }
.inventory-ledger-list > li > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.inventory-ledger-list > li > div:first-child > strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.inventory-ledger-list p { margin: 12px 0; overflow-wrap: anywhere; }
.inventory-ledger-list dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 14px; margin: 0; }
.inventory-ledger-list dl div { min-width: 0; }
.inventory-ledger-list dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }
.inventory-ledger-state { margin-top: 26px; }
.inventory-ledger-empty { color: var(--ink-soft); text-align: center; }
.inventory-adjustment-modal { width: min(680px, calc(100% - 32px)); }
.inventory-adjustment-help { margin: 20px 0 0; border-radius: var(--radius-sm); background: #f3ebe7; color: var(--ink-soft); padding: 12px 14px; font-size: 12px; }
.order-detail { margin-top: 24px; }
.order-detail-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.order-detail-summary > div { min-height: 90px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f8f3ed; padding: 13px; }
.order-detail-summary span:first-child { color: #777067; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.order-detail-summary strong { font: 400 19px/1.2 Georgia, serif; }
.order-payment-state { display: grid; gap: 4px; }
.order-payment-state b { line-height: 1.3; }
.order-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.order-detail-card, .order-items { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.order-detail-card h3, .order-items h3 { margin: 0 0 14px; font: 400 19px/1.2 Georgia, serif; }
.order-detail-card dl { display: grid; gap: 10px; margin: 0; }
.order-detail-card dl div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
.order-detail-card dt { color: #6f675f; font-size: 11px; }
.order-detail-card dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 650; }
.order-items { margin-top: 12px; }
.order-item { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid #eee8e1; padding: 10px 0; }
.order-item div { display: flex; min-width: 0; flex-direction: column; }
.order-item div span, .order-detail-empty, .order-detail-loading { color: #6f675f; font-size: 11px; }
.order-item > span { flex: 0 0 auto; font-size: 12px; font-weight: 750; }
.orders-filters label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.orders-filters select, .orders-filters input { min-height: 44px; min-width: 140px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); padding: 0 10px; }
.order-timeline, .order-operations { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcf9f5; padding: 16px; }
.order-timeline h3, .order-operations h3 { margin: 0 0 12px; font: 400 19px/1.2 Georgia, serif; }
.order-timeline ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.order-timeline li { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); padding: 8px 10px; font-size: 11px; font-weight: 700; }
.order-timeline li span { color: #6f675f; font-size: 10px; font-weight: 600; }
.order-timeline li.is-current { border-color: var(--rose-dark); background: var(--rose-pale); color: var(--rose-dark); }
.order-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.order-actions .button, .order-operations button { min-height: 44px; }
.order-operations form { display: grid; gap: 10px; }
.order-operations textarea { min-height: 88px; }
.order-cancellation { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.order-cancellation p { margin: 0 0 8px; color: var(--rose-dark); font-size: 12px; font-weight: 750; }
.customer-section { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcf9f5; padding: 16px; }
.customer-section h3 { margin: 0 0 12px; font: 400 19px/1.2 Georgia, serif; }
.customer-section form { display: grid; gap: 10px; }
.customer-section textarea { min-height: 76px; }
.customer-section-summary { margin: -4px 0 8px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.customer-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.customer-profile-fields .field:last-child { grid-column: 1 / -1; }
.customer-record-link { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 44px; border: 0; border-top: 1px solid #eee8e1; background: transparent; color: var(--ink); text-align: left; text-decoration: none; padding: 10px 0; font: inherit; font-weight: 750; cursor: pointer; }
.customer-record-link:first-of-type { border-top: 0; }
.customer-record-link span, .consent-event span { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.consent-event { display: grid; gap: 4px; border-top: 1px solid #eee8e1; padding: 11px 0; }
.consent-event:first-of-type { border-top: 0; padding-top: 0; }
.consent-event p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.order-totals { display: grid; gap: 7px; margin: 18px 0 0; }
.order-totals div { display: flex; justify-content: space-between; gap: 12px; }
.order-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 200; max-width: 360px; border-radius: var(--radius-sm); background: var(--ink); color: white; padding: 14px 18px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--motion-standard), transform var(--motion-standard); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

.report-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.report-filters label { min-width: 164px; display: grid; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.report-filters input, .report-filters select { min-width: 0; width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 0 12px; text-transform: none; }
.report-filters input:focus, .report-filters select:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(143, 88, 96, .1); }
.report-filters--full label:first-child { min-width: 190px; }
.report-filter-help { flex-basis: 100%; margin: 0; color: var(--ink-soft); font-size: 11px; }
.report-state { min-height: 210px; display: grid; align-content: center; justify-items: start; gap: 10px; }
.report-state h2, .report-state p { margin: 0; }
.report-state h2 { font: 400 24px/1.2 Georgia, serif; }
.report-state--error { border-color: rgba(164, 62, 62, .34); }
.report-skeleton { width: min(100%, 680px); height: 58px; border-radius: var(--radius-sm); background: linear-gradient(90deg, #eee6dd 20%, #faf7f2 50%, #eee6dd 80%); background-size: 240% 100%; animation: report-skeleton 1.4s ease-in-out infinite; }
.report-skeleton--short { width: min(72%, 460px); height: 24px; }
@keyframes report-skeleton { to { background-position: -240% 0; } }
.report-scope { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; border-left: 3px solid var(--rose); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: #f1ebe4; padding: 13px 16px; }
.report-scope p { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); font-size: 11px; }
.report-scope p:last-child { flex: 0 1 auto; }
.report-metric-grid { margin-bottom: 14px; }
.report-chart-panel { margin-bottom: 14px; overflow: hidden; }
.report-legend { min-height: 32px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 750; }
.report-legend i { width: 24px; height: 3px; border-radius: 999px; background: var(--rose-dark); }
.report-line-wrap { min-width: 0; }
.report-line-chart { width: 100%; min-height: 180px; overflow: visible; border: 1px solid #eee8e1; border-radius: var(--radius-sm); background: repeating-linear-gradient(to bottom, transparent 0, transparent 54px, #eee8e1 55px); }
.report-line-chart polyline { stroke: var(--rose-dark); stroke-width: 3; }
.report-line-chart circle { fill: var(--surface); stroke: var(--rose-dark); stroke-width: 3; }
.report-line-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.report-line-values li { min-width: 0; display: grid; gap: 3px; border-left: 2px solid var(--rose); padding: 4px 8px; }
.report-line-values time { color: var(--ink-soft); font-size: 10px; }
.report-line-values strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.report-chart-empty { margin: 0; color: var(--ink-soft); }
.report-table { min-width: 620px; }
.report-table caption { padding: 12px 16px; color: var(--ink-soft); font-size: 11px; font-weight: 750; text-align: left; }
.report-table td { font-variant-numeric: tabular-nums; }
.report-operational-grid { margin-top: 0; margin-bottom: 14px; }
.report-operational-grid .data-table-wrap { max-width: 100%; overflow-x: auto; }
.report-alert-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.report-alert-list li { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #eee8e1; }
.report-alert-list li:first-child { border-top: 0; }
.report-alert-list span { display: grid; }
.report-alert-list small { color: var(--ink-soft); }
.report-alert-list b { color: var(--warning); font-size: 11px; white-space: nowrap; }
.report-bars { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.report-bars li { display: grid; grid-template-columns: minmax(100px, 180px) minmax(120px, 1fr) minmax(92px, auto); align-items: center; gap: 12px; }
.report-bar-label { min-width: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.report-bar-track { height: 18px; overflow: hidden; border-radius: 999px; background: #eee8e1; }
.report-bar-track i { width: var(--report-bar); height: 100%; display: block; border-radius: inherit; background: var(--rose-dark); }
.report-bar-track--diverging { position: relative; display: grid; grid-template-columns: 1fr 1fr; overflow: visible; border-radius: 4px; }
.report-bar-track--diverging::after { content: ""; position: absolute; top: -3px; bottom: -3px; left: 50%; width: 2px; background: var(--ink-soft); transform: translateX(-1px); }
.report-bar-track--diverging .report-bar--negative { grid-column: 1; justify-self: end; border-radius: 999px 0 0 999px; background: var(--danger); }
.report-bar-track--diverging .report-bar--positive { grid-column: 2; justify-self: start; border-radius: 0 999px 999px 0; background: var(--success); }
.report-bar-value { font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.report-data-panel { margin-bottom: 14px; }

.access-feedback { min-height: 1px; }
.success-notice { border: 1px solid rgba(47, 107, 79, .32); border-radius: var(--radius-sm); background: #eef7f2; color: var(--success); padding: 12px 14px; }
.access-state { min-height: 210px; display: grid; align-content: center; justify-items: start; gap: 10px; }
.access-state h2, .access-state p { margin: 0; }
.access-state h2 { font: 400 24px/1.2 Georgia, serif; }
.access-state--error { border-color: rgba(164, 62, 62, .34); }
.access-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); align-items: start; gap: 14px; }
.access-grid h2, .access-section-heading h2, .role-card h2 { margin: 0; font: 400 24px/1.2 Georgia, serif; }
.invite-admin-panel { position: sticky; top: 90px; }
.access-form, .role-card form { display: grid; gap: 14px; }
.access-form .field, .role-card .field { display: grid; gap: 5px; }
.access-form input, .access-form select, .role-card input, .role-card select, .inline-role-form select, .audit-filters input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 0 12px; }
.access-form input:focus, .access-form select:focus, .role-card input:focus, .role-card select:focus, .inline-role-form select:focus, .audit-filters input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(143, 88, 96, .1); }
.field-error { min-height: 18px; color: var(--danger); font-size: 11px; font-weight: 600; }
.role-list { display: grid; gap: 14px; }
.access-section-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; }
.role-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.role-card header p { margin: 5px 0 0; color: var(--ink-soft); }
.role-card header > span { border-radius: 999px; background: #f1ebe4; color: var(--rose-dark); padding: 6px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.permission-group { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.permission-group legend { padding: 0 6px; color: var(--rose-dark); font-size: 11px; font-weight: 800; }
.permission-options { display: grid; gap: 7px; }
.permission-option { min-height: 44px; display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; border-radius: 6px; padding: 7px 8px; cursor: pointer; }
.permission-option:hover { background: #f6f0e9; }
.permission-option input { width: 18px; min-height: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--rose-dark); }
.permission-option span { display: grid; gap: 2px; }
.permission-option strong { overflow-wrap: anywhere; color: var(--ink); font-size: 11px; }
.permission-option small { color: var(--ink-soft); font-size: 10px; }
.role-merge-conflicts { min-width: 0; margin: 0; border: 1px solid #dfc18e; border-radius: var(--radius-sm); background: #fff9ed; padding: 14px; }
.role-merge-conflicts > legend { padding: 0 6px; color: var(--warning); font-size: 12px; font-weight: 800; }
.role-merge-conflicts > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.role-merge-conflict { display: grid; gap: 10px; border-top: 1px solid rgba(117, 83, 28, .2); padding: 14px 0; }
.role-merge-conflict:first-of-type { border-top: 0; padding-top: 0; }
.role-merge-conflict h3 { margin: 0; color: var(--ink); font-size: 12px; }
.role-merge-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.role-merge-comparison > div { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 10px; }
.role-merge-comparison strong { display: block; margin-bottom: 5px; color: var(--rose-dark); font-size: 10px; }
.role-merge-comparison p, .role-merge-comparison ul { margin: 0; overflow-wrap: anywhere; padding-left: 16px; color: var(--ink-soft); font-size: 10px; }
.role-merge-conflict > label { min-height: 44px; display: flex; align-items: center; gap: 9px; border-radius: 6px; padding: 8px; color: var(--ink); font-size: 11px; cursor: pointer; }
.role-merge-conflict > label:focus-within { box-shadow: 0 0 0 3px rgba(143, 88, 96, .12); }
.role-merge-conflict > label input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--rose-dark); }
.role-merge-actions { display: flex; justify-content: flex-end; border-top: 1px solid rgba(117, 83, 28, .2); padding-top: 12px; }
.access-users { margin-top: 14px; }
.access-table td:first-child strong, .access-table td:first-child small, .audit-table td strong, .audit-table td small { display: block; }
.access-table td:first-child small, .audit-table td small { margin-top: 3px; color: var(--ink-soft); }
.status--invited { background: #f7ecd5; color: var(--warning); }
.status--suspended { background: #f4dede; color: var(--danger); }
.inline-role-form { display: flex; align-items: flex-end; gap: 12px; }
.inline-role-form .field { min-width: 220px; }
.access-confirmation, .audit-detail { width: min(680px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); padding: 0; box-shadow: var(--shadow); }
.access-confirmation::backdrop, .audit-detail::backdrop { background: rgba(23, 21, 18, .58); }
.access-confirmation form, .audit-detail article { padding: clamp(20px, 4vw, 34px); }
.access-confirmation h2, .audit-detail h2 { margin: 0; font: 400 clamp(26px, 4vw, 38px)/1.1 Georgia, serif; }
.access-confirmation p:not(.eyebrow, .form-error) { color: var(--ink-soft); line-height: 1.7; }
.audit-filters { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)) auto; align-items: end; overflow: visible; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 14px; }
.audit-filters .field { min-width: 0; display: grid; gap: 5px; }
.audit-panel { margin-top: 14px; }
.audit-table code { color: var(--rose-dark); font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.audit-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--line); }
.audit-summary div { background: #fcf9f5; padding: 12px; }
.audit-summary dt { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.audit-summary dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.audit-change-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.audit-change-grid section { min-width: 0; }
.audit-change-grid h3 { font: 400 19px/1.2 Georgia, serif; }
.audit-change-grid pre { min-height: 140px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f4eee7; color: var(--ink); padding: 12px; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .access-grid { grid-template-columns: 1fr; }
  .invite-admin-panel { position: static; }
  .audit-filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
}

@media (max-width: 768px) {
  .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-change-grid { grid-template-columns: 1fr; }
  .audit-summary { grid-template-columns: 1fr; }
  .inline-role-form { align-items: stretch; flex-direction: column; }
  .inline-role-form .field { min-width: 0; }
  .role-merge-comparison { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .audit-filters { grid-template-columns: 1fr; }
  .role-card header { flex-direction: column; }
  .access-confirmation, .audit-detail { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
}

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .global-search { width: 240px; }
}

@media (max-width: 900px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-image { display: none; }
  .auth-panel { min-height: 100dvh; }
  .sidebar { transform: translateX(-100%); transition: transform var(--motion-slow) ease-out; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(19,16,13,.52); opacity: 0; pointer-events: none; transition: opacity var(--motion-standard); }
  .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; }
  .admin-workspace { margin-left: 0; }
  .menu-button { display: inline-grid; }
  .breadcrumbs span, .breadcrumbs i { display: none; }
  .store-link { display: none; }
}

@media (max-width: 760px) {
  .order-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-detail-grid { grid-template-columns: 1fr; }
  .repeater-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .return-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .returns-detail-grid { grid-template-columns: 1fr; }
  .report-scope { flex-direction: column; gap: 5px; }
  .report-bars li { grid-template-columns: minmax(90px, 140px) minmax(90px, 1fr); }
  .report-bar-value { grid-column: 2; text-align: left; }
}

@media (max-width: 640px) {
  .topbar { height: 64px; gap: 10px; padding: 0 12px; }
  .topbar-actions { min-width: 0; }
  .global-search { width: min(48vw, 220px); }
  .global-search input::placeholder { color: transparent; }
  #admin-main { padding: 24px 14px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-heading h1 { font-size: 34px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 132px; padding: 14px; }
  .metric-card strong { font-size: 24px; }
  .panel { padding: 16px; }
  .sales-chart { gap: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .product-editor { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .product-editor .modal-card { max-height: calc(100dvh - 16px); }
  .product-editor .modal-card > header,
  .product-editor-sections,
  .product-editor-actions { padding-right: 14px; padding-left: 14px; }
  .product-editor-section { padding: 16px 12px; }
  .repeater-grid { grid-template-columns: 1fr; }
  .order-modal, .customer-modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .order-timeline ol { display: grid; grid-template-columns: 1fr 1fr; }
  .orders-filters .module-filters { width: 100%; grid-template-columns: 1fr; }
  .product-editor .form-error,
  .product-editor .editor-status { margin-right: 14px; margin-left: 14px; }
  .product-editor-actions { align-items: stretch !important; flex-direction: column-reverse; }
  .product-editor-actions > div { width: 100%; }
  .product-editor-actions .button { flex: 1; }
  .module-toolbar { align-items: stretch; flex-direction: column; }
  .inventory-filters .module-filters { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .inventory-filters select { width: 100%; }
  .inventory-ledger-drawer { width: 100%; max-height: 100dvh; border-radius: 0; }
  .inventory-ledger-drawer .modal-card { max-height: 100dvh; border-radius: 0; padding: 18px 14px; }
  .inventory-ledger-drawer .modal-card > header { top: -18px; margin: -18px -14px 0; padding: 16px 14px; }
  .customer-profile-drawer { width: 100%; max-height: 100dvh; border-radius: 0; }
  .customer-profile-drawer .modal-card { max-height: 100dvh; border-radius: 0; padding: 18px 14px; }
  .customer-profile-drawer .modal-card > header { top: -18px; margin: -18px -14px 0; padding: 16px 14px; }
  .customer-profile-fields { grid-template-columns: 1fr; }
  .customer-profile-fields .field:last-child { grid-column: auto; }
  .inventory-ledger-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-adjustment-modal { width: calc(100% - 16px); }
  .auth-panel { padding: 28px 22px; }
  .auth-copy { margin-top: auto; }
  .auth-copy h1 { font-size: 48px; }
  .returns-panel-header { min-height: 76px; padding: 14px; }
  .returns-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .returns-table, .returns-table tbody, .returns-table tr, .returns-table td { display: block; width: 100%; }
  .returns-table tr { border-top: 1px solid var(--line); padding: 12px 14px; }
  .returns-table td { min-height: 44px; height: auto; display: grid; grid-template-columns: minmax(82px, .38fr) minmax(0, 1fr); align-items: center; gap: 10px; border: 0; padding: 3px 0; }
  .returns-table td::before { color: #777067; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; content: attr(data-label); }
  .returns-table .table-edit { width: 100%; padding: 3px 0; }
  .promotions-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .promotions-table, .promotions-table tbody, .promotions-table tr, .promotions-table td { display: block; width: 100%; }
  .promotions-table tr { border-top: 1px solid var(--line); padding: 12px 14px; }
  .promotions-table td { min-height: 44px; height: auto; display: grid; grid-template-columns: minmax(86px, .38fr) minmax(0, 1fr); align-items: center; gap: 10px; border: 0; padding: 5px 0; }
  .promotions-table td::before { color: #777067; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; content: attr(data-label); }
  .promotions-table .table-actions { justify-content: flex-start; }
  .promotion-modal, .promotion-pause-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .promotions-filters .field { width: 100%; min-width: 0; }
  .return-summary, .return-operation-grid { grid-template-columns: 1fr; }
  .return-summary-wide, .return-operation-grid .field--wide { grid-column: auto; }
  .return-item { grid-template-columns: 1fr; gap: 12px; }
  .return-replacement { border-top: 1px solid var(--line); border-left: 0; padding-top: 12px; padding-left: 0; }
  .return-operation { padding: 16px 12px; }
  .return-operation > .button { width: 100%; }
  .report-filters { display: grid; grid-template-columns: 1fr; padding: 14px; }
  .report-filters label, .report-filters--full label:first-child { width: 100%; min-width: 0; }
  .report-filters .button { width: 100%; }
  .report-line-chart { min-height: 150px; }
  .report-line-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-bars li { grid-template-columns: 1fr; gap: 5px; }
  .report-bar-value { grid-column: auto; text-align: left; }
  .report-bar-track { height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
