/* The admin console's layout.
 *
 * Same contract as ecom-layout.css: structure, spacing and breakpoints live
 * here and never change between projects; colour, type, radius and motion
 * come from the run's design system through the same tokens, with the same
 * fallbacks. The console therefore matches the storefront it administers
 * without a byte of this file changing. Classes are `adm-` prefixed; the
 * shared primitives (buttons, fields, toast) are reused from ecom-layout.css.
 *
 * The shell follows what the store back offices share (surveyed on Mobbin,
 * 2026-08-29: Shopify, Squarespace, Square, Kajabi, Webflow, HubSpot): an
 * icon sidebar with grouped sections and counts, a page header with one
 * primary action, card-based content, KPI tiles with a sparkline, and index
 * tables with status tabs and inline edits.
 */

/* ---------- shell ---------- */

/* Several layout classes set `display`, which would beat the `hidden`
 * attribute's own `display: none`; scripts here toggle `hidden` on the cart
 * summary, the hero photo, panels and the admin shell, so it has to win. */
.adm-page [hidden] { display: none !important; }


.adm-page { min-height: 100vh; }

.adm-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.adm-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 12px;
  background: var(--color-surface, #ffffff);
  border-right: 1px solid var(--color-border, #e2dcd0);
  box-sizing: border-box;
  overflow-y: auto;
}

.adm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 14px;
  text-decoration: none;
}

.adm-brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ecom-radius-sm, 4px);
  background: var(--color-primary, #8a4b2f);
  color: var(--color-primary-contrast, #ffffff);
  font-weight: 700;
  font-size: 0.95rem;
}

.adm-brand-name {
  display: block;
  font-family: var(--ecom-display, inherit);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text, #2b2620);
}

.adm-brand-tag {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted, #6f6759);
}

.adm-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adm-nav + .adm-nav { margin-top: 12px; }

.adm-nav-heading {
  padding: 0 12px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted, #6f6759);
}

.adm-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--ecom-radius-sm, 4px);
  color: var(--color-text, #2b2620);
  text-decoration: none;
  font-weight: 500;
  transition: background var(--motion-fast, 120ms ease);
}

.adm-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.adm-nav-link:hover { background: var(--color-bg, #faf7f2); }
.adm-nav-link:focus-visible {
  outline: 2px solid var(--color-primary, #8a4b2f);
  outline-offset: 2px;
}
.adm-nav-link[aria-current="page"] {
  background: var(--color-bg, #faf7f2);
  color: var(--color-primary, #8a4b2f);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-primary, #8a4b2f);
}

/* Counts on Orders (open orders) and Inventory (products to restock), filled
 * by admin.js from the overview figures; empty until then, and hidden at 0. */
.adm-nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--color-primary, #8a4b2f);
  color: var(--color-primary-contrast, #ffffff);
}

.adm-nav-count[data-tone="warn"] { background: #fef3c7; color: #92400e; }
.adm-nav-count:empty { display: none; }

.adm-sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--color-border, #e2dcd0);
}

.adm-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-accent, #3f6b4f);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.adm-signed-in {
  margin: 0;
  min-width: 0;
  font-size: var(--font-size-sm, 0.85rem);
  line-height: 1.25;
  color: var(--color-text-muted, #6f6759);
}

.adm-signed-in strong {
  display: block;
  color: var(--color-text, #2b2620);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adm-signout {
  padding: 0;
  font: inherit;
  font-size: var(--font-size-sm, 0.85rem);
  border: 0;
  background: none;
  color: var(--color-text-muted, #6f6759);
  text-decoration: underline;
  cursor: pointer;
}

.adm-signout:hover { color: var(--color-text, #2b2620); }

.adm-main {
  min-width: 0;
  max-width: 1600px;
  width: 100%;
  padding: 28px clamp(20px, 3vw, 48px) 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.adm-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.adm-title {
  margin: 0;
  font-family: var(--ecom-display, inherit);
  font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text, #2b2620);
}

.adm-subtitle {
  margin: 2px 0 0;
  color: var(--color-text-muted, #6f6759);
  line-height: 1.5;
  max-width: 64ch;
}

.adm-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.adm-button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ---------- tiles & cards ---------- */

.adm-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.adm-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto;
  gap: 2px 12px;
  padding: 16px 18px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: var(--ecom-radius-md, 10px);
}

.adm-tile-label {
  grid-column: 1 / -1;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  color: var(--color-text-muted, #6f6759);
}

.adm-tile-value {
  grid-column: 1;
  grid-row: 2;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #2b2620);
}

.adm-tile[data-tone="warn"] .adm-tile-value { color: #92400e; }

.adm-tile-note {
  grid-column: 1 / -1;
  grid-row: 3;
  margin-top: 4px;
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-text-muted, #6f6759);
}

/* The last 14 days as a line beside the number. One series, the brand hue;
 * the endpoint is the value shown. */
.adm-tile-spark {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  width: 72px;
  height: 32px;
}

.adm-tile-spark path { fill: var(--color-primary, #8a4b2f); opacity: 0.1; }
.adm-tile-spark polyline {
  fill: none;
  stroke: var(--color-primary, #8a4b2f);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.adm-tile-spark circle { fill: var(--color-primary, #8a4b2f); }

.adm-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.adm-col-3-2 {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 16px;
}

.adm-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: var(--ecom-radius-md, 10px);
  min-width: 0;
}

.adm-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.adm-card-title {
  margin: 0;
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text, #2b2620);
}

.adm-card-link {
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 500;
  color: var(--color-accent, #3f6b4f);
  text-decoration: none;
  white-space: nowrap;
}

.adm-card-link:hover { text-decoration: underline; }

.adm-card-note {
  margin: 0;
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-text-muted, #6f6759);
  line-height: 1.5;
}

.adm-muted { color: var(--color-text-muted, #6f6759); }
.adm-small { font-size: var(--font-size-sm, 0.85rem); }
.adm-nowrap { white-space: nowrap; }
.adm-num { font-variant-numeric: tabular-nums; }

.adm-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- tables ---------- */

.adm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.adm-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--color-border, #e2dcd0);
  overflow-x: auto;
}

.adm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 500;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-text-muted, #6f6759);
  cursor: pointer;
  white-space: nowrap;
}

.adm-tab:focus-visible {
  outline: 2px solid var(--color-primary, #8a4b2f);
  outline-offset: -2px;
}

.adm-tab[aria-selected="true"] {
  color: var(--color-text, #2b2620);
  font-weight: 600;
  border-bottom-color: var(--color-primary, #8a4b2f);
}

.adm-tab span {
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e2dcd0);
  background: var(--color-bg, #faf7f2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.adm-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.adm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  font: inherit;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 500;
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: 999px;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #2b2620);
  cursor: pointer;
}

.adm-chip:hover { border-color: var(--color-text-muted, #6f6759); }
.adm-chip:focus-visible {
  outline: 2px solid var(--color-primary, #8a4b2f);
  outline-offset: 2px;
}
.adm-chip[aria-pressed="true"] {
  background: var(--color-text, #2b2620);
  color: var(--color-surface, #ffffff);
  border-color: var(--color-text, #2b2620);
}

.adm-chip[data-tone="low"] { color: #92400e; }
.adm-chip[data-tone="out"] { color: #991b1b; }
.adm-chip[data-tone][aria-pressed="true"] { color: var(--color-surface, #ffffff); }

/* A search that filters the table it sits above, client-side. A <form>, so
 * the generated design-system.css's bare-form flex reset applies and is
 * pinned here to the single row it should be. */
.adm-search {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  width: 280px;
  max-width: 100%;
  margin: 0;
  padding: 0 12px;
  min-height: 38px;
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: 999px;
  background: var(--color-bg, #faf7f2);
}

.adm-search:focus-within {
  outline: 2px solid var(--color-primary, #8a4b2f);
  outline-offset: 1px;
}

.adm-search-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--color-text-muted, #6f6759);
  stroke-width: 2;
  stroke-linecap: round;
}

.adm-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 4px 0;
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--color-text, #2b2620);
}

.adm-search input:focus { outline: none; }

/* Tables bleed to the card's edges and scroll sideways when narrow. */
.adm-table-wrap {
  overflow-x: auto;
  margin: 0 -20px -20px;
}

/* The storefront shell sets overflow-wrap: anywhere so a long product name
 * never overflows a card; in a dense table it breaks headers and badges one
 * letter per line. Tables wrap at word boundaries and scroll when narrow. */
.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  overflow-wrap: normal;
}

.adm-table-wrap .adm-table { min-width: 640px; }

.adm-table th {
  white-space: nowrap;
  text-align: left;
  padding: 10px 12px;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  color: var(--color-text-muted, #6f6759);
  border-bottom: 1px solid var(--color-border, #e2dcd0);
}

.adm-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border, #e2dcd0);
  color: var(--color-text, #2b2620);
}

.adm-table th:first-child, .adm-table td:first-child { padding-left: 20px; }
.adm-table th:last-child, .adm-table td:last-child { padding-right: 20px; }
.adm-table tbody tr:last-child td { border-bottom: 0; }
.adm-table tbody tr:hover td { background: var(--color-bg, #faf7f2); }
.adm-table .adm-right { text-align: right; }
.adm-table tr[hidden] { display: none; }

.adm-table-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-text-muted, #6f6759);
}

.adm-product {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.adm-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: var(--ecom-radius-sm, 4px);
  background: var(--color-bg, #faf7f2);
  border: 1px solid var(--color-border, #e2dcd0);
}

.adm-product-name { display: block; font-weight: 600; }
.adm-product-sub { display: block; font-size: var(--font-size-sm, 0.85rem); color: var(--color-text-muted, #6f6759); }

.adm-input { width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.adm-input-narrow { width: 80px; }

/* The order status: a select that wears its state's colour, so the table
 * reads at a glance and the change is one click. */
.adm-select {
  min-height: 34px;
  min-width: 130px;
  padding: 4px 30px 4px 12px;
  font: inherit;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  text-transform: capitalize;
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: 999px;
  background-color: var(--color-surface, #ffffff);
  color: var(--color-text, #2b2620);
  cursor: pointer;
}

.adm-select[data-status="shipped"] { color: #1d4ed8; background-color: #dbeafe; border-color: transparent; }
.adm-select[data-status="delivered"] { color: #065f46; background-color: #d1fae5; border-color: transparent; }
.adm-select[data-status="cancelled"] { color: #991b1b; background-color: #fee2e2; border-color: transparent; }

.adm-code {
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-size-sm, 0.85rem);
  background: var(--color-bg, #faf7f2);
  border-radius: var(--ecom-radius-sm, 4px);
  padding: 2px 6px;
}

/* Stock and order states are fixed semantic colours rather than tokens, for
 * the same reason as the storefront's out-of-stock badge and star rating: a
 * warning has to read as a warning under every palette. The dot in front is
 * a second cue, so state is never colour alone. */
.adm-badge,
.adm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.adm-badge::before,
.adm-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.adm-badge[data-state="ok"] { color: #065f46; background: #d1fae5; }
.adm-badge[data-state="low"] { color: #92400e; background: #fef3c7; }
.adm-badge[data-state="out"] { color: #991b1b; background: #fee2e2; }

.adm-status {
  text-transform: capitalize;
  background: var(--color-bg, #faf7f2);
  border: 1px solid var(--color-border, #e2dcd0);
  color: var(--color-text, #2b2620);
}

.adm-status[data-status="shipped"] { color: #1d4ed8; background: #dbeafe; border-color: transparent; }
.adm-status[data-status="delivered"] { color: #065f46; background: #d1fae5; border-color: transparent; }
.adm-status[data-status="cancelled"] { color: #991b1b; background: #fee2e2; border-color: transparent; }

/* ---------- attention list ---------- */

.adm-list { display: flex; flex-direction: column; }

.adm-list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border, #e2dcd0);
}

.adm-list-row:last-child { border-bottom: 0; }

/* ---------- add product ---------- */

/* Collapsed behind the header's "Add product" button, so the table is the
 * page and the form appears when it is wanted. */
.adm-panel { border-color: var(--color-primary, #8a4b2f); }
.adm-panel[hidden] { display: none; }

/* A <form>: the generated design-system.css's bare-form flex reset is
 * overridden here for the same reason as the review and sign-in forms. */
.adm-add-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 16px;
}

.adm-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.adm-add-wide { grid-column: 1 / -1; }

.adm-optional {
  font-weight: 400;
  color: var(--color-text-muted, #6f6759);
  font-size: var(--font-size-sm, 0.85rem);
}

.adm-file { padding: 7px 12px; }

.adm-add-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- charts, bars, funnel, events ---------- */

/* A bar per day, drawn as SVG by admin.js: the preview's content-security
 * policy allows no chart library, and fourteen bars need none. One series,
 * the brand hue; today in the accent; a dashed grid at 0, half and full. */
.adm-chart {
  display: block;
  width: 100%;
  height: 200px;
}

.adm-chart .adm-chart-grid { stroke: var(--color-border, #e2dcd0); stroke-width: 1; stroke-dasharray: 2 3; }
.adm-chart .adm-chart-axis { fill: var(--color-text-muted, #6f6759); font-size: 11px; font-family: inherit; }
.adm-chart .adm-chart-bar { fill: var(--color-primary, #8a4b2f); opacity: 0.85; transition: opacity var(--motion-fast, 120ms ease); }
.adm-chart .adm-chart-bar:hover { opacity: 1; }
.adm-chart .adm-chart-bar[data-today="true"] { fill: var(--color-accent, #3f6b4f); opacity: 1; }
.adm-chart .adm-chart-label { fill: var(--color-text, #2b2620); font-size: 11px; font-weight: 600; font-family: inherit; text-anchor: middle; }

.adm-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adm-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 3fr) auto;
  align-items: center;
  gap: 12px;
}

.adm-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  color: var(--color-text, #2b2620);
}

.adm-bar-label .adm-thumb { width: 26px; height: 26px; }

.adm-bar-track {
  height: 10px;
  background: var(--color-bg, #faf7f2);
  border-radius: 4px;
  overflow: hidden;
}

.adm-bar-fill {
  height: 100%;
  min-width: 2px;
  background: var(--color-primary, #8a4b2f);
  opacity: 0.85;
  border-radius: 4px;
  transition: width var(--motion-fast, 120ms ease);
}

.adm-bar-value {
  font-weight: 600;
  white-space: nowrap;
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.adm-bar-value .adm-muted { font-weight: 400; margin-left: 4px; }

.adm-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--ecom-radius-sm, 4px);
  background: #fef3c7;
  color: #78350f;
  font-size: var(--font-size-sm, 0.85rem);
}

.adm-callout-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.adm-funnel {
  display: flex;
  flex-direction: column;
}

.adm-funnel-step {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 140px 80px;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border, #e2dcd0);
}

.adm-funnel-step:last-child { border-bottom: 0; }

.adm-funnel-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.adm-funnel-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--color-bg, #faf7f2);
  border: 1px solid var(--color-border, #e2dcd0);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted, #6f6759);
}

.adm-funnel-track {
  height: 22px;
  background: var(--color-bg, #faf7f2);
  border-radius: 4px;
  overflow: hidden;
}

.adm-funnel-fill {
  height: 100%;
  background: var(--color-primary, #8a4b2f);
  opacity: 0.85;
  border-radius: 4px;
  transition: width var(--motion-fast, 120ms ease);
}

.adm-funnel-value { font-variant-numeric: tabular-nums; }
.adm-funnel-value strong { display: block; }
.adm-funnel-value span { font-size: var(--font-size-sm, 0.85rem); color: var(--color-text-muted, #6f6759); }

.adm-funnel-drop {
  text-align: right;
  font-size: var(--font-size-sm, 0.85rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.adm-funnel-drop[data-worst="true"] { color: #92400e; }

.adm-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow-y: auto;
}

.adm-event {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border, #e2dcd0);
  font-size: 0.95rem;
}

.adm-event:last-child { border-bottom: 0; }

.adm-event-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-primary, #8a4b2f);
  opacity: 0.6;
  transform: translateY(-2px);
}

.adm-event-name {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.adm-event-when {
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-text-muted, #6f6759);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- sign in ---------- */

.adm-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

/* A <form>, so the generated design-system.css's flex reset for bare forms
 * applies -- overridden here exactly as ecom-layout.css does for the review
 * form, or every field shrinks to its own width and sits centered. */
.adm-login {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 32px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2dcd0);
  border-radius: var(--ecom-radius-md, 10px);
  box-sizing: border-box;
}

.adm-login .adm-brand { padding: 0; }

.adm-login-title {
  margin: 0;
  font-size: var(--font-size-lg, 1.25rem);
  line-height: 1.2;
}

.adm-login-submit { width: 100%; }

.adm-login-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--ecom-radius-sm, 4px);
  color: #991b1b;
  background: #fee2e2;
  font-size: var(--font-size-sm, 0.85rem);
}

.adm-login-hint {
  margin: 0;
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-text-muted, #6f6759);
}

.adm-login-hint code {
  background: var(--color-bg, #faf7f2);
  border-radius: 4px;
  padding: 1px 6px;
}

.adm-login-back {
  font-size: var(--font-size-sm, 0.85rem);
  color: var(--color-accent, #3f6b4f);
  text-decoration: none;
}

.adm-login-back:hover { text-decoration: underline; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .adm-two-col, .adm-col-3-2 { grid-template-columns: 1fr; }
  .adm-add-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .adm-funnel-step { grid-template-columns: minmax(0, 1fr) 80px; }
  .adm-funnel-track { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border, #e2dcd0);
  }
  .adm-brand { padding: 4px 8px; }
  .adm-nav { flex-direction: row; flex-wrap: wrap; }
  .adm-nav + .adm-nav { margin-top: 0; }
  .adm-nav-heading { display: none; }
  .adm-sidebar-footer { margin-top: 0; margin-left: auto; padding: 0; border-top: 0; }
  .adm-signed-in strong { display: none; }
  .adm-main { padding: 20px 16px 40px; gap: 16px; }
  .adm-title { font-size: 1.5rem; }
  .adm-add-grid { grid-template-columns: 1fr; }
  .adm-search { width: 100%; }
  .adm-table-wrap { margin: 0 -16px -16px; }
  .adm-card { padding: 16px; }
  .adm-table th:first-child, .adm-table td:first-child { padding-left: 16px; }
  .adm-table th:last-child, .adm-table td:last-child { padding-right: 16px; }
  .adm-bar-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  .adm-nav-link, .adm-bar-fill, .adm-funnel-fill, .adm-chart .adm-chart-bar { transition: none; }
}
