/* Holla Lola admin: a calm workplace in the shop's own colours. One dark rail, cream frames around
   white work surfaces, green for action, spice tints for at-a-glance numbers. Structure from
   docs/agents/design.md (Feetpath's admin). Radius: --radius-sm/md/lg only. */

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: rgb(var(--ink-900)); background: rgb(var(--white)); -webkit-font-smoothing: antialiased; }
a { color: rgb(var(--brand)); }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid rgb(var(--brand)); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: rgb(var(--white)); padding: 8px 12px; border-radius: var(--radius-sm); }
.muted { color: rgb(var(--ink-500)); }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.rail { width: 264px; flex: none; background: rgb(var(--ink-900)); color: rgb(var(--white)); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.rail__brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 6px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.04em; color: rgb(var(--white)); text-decoration: none; }
.rail__dot { width: 12px; height: 12px; background: rgb(var(--sun)); transform: rotate(45deg); flex: none; }
.rail__stripe { display: grid; grid-template-columns: repeat(6, 1fr); height: 4px; margin: 12px 20px 4px; border-radius: 4px; overflow: hidden; }
.rail__stripe span:nth-child(1) { background: rgb(var(--brand-soft)); }
.rail__stripe span:nth-child(2) { background: rgb(var(--leaf)); }
.rail__stripe span:nth-child(3) { background: rgb(var(--lime)); }
.rail__stripe span:nth-child(4) { background: rgb(var(--sun)); }
.rail__stripe span:nth-child(5) { background: rgb(var(--accent)); }
.rail__stripe span:nth-child(6) { background: rgb(var(--chilli)); }
.rail__nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; scrollbar-width: thin; }
.rail__group { margin-top: 16px; }
.rail__label { font-size: .75rem; font-weight: 500; color: rgb(255 255 255 / .6); padding: 0 12px 6px; }
.rail__nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rail__item { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); color: rgb(255 255 255 / .86); font-weight: 500; text-decoration: none; transition: background-color 150ms, color 150ms; }
.rail__icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.rail__item:hover .rail__icon, .rail__item[aria-current="page"] .rail__icon { opacity: 1; }
.rail__item:hover { background: rgb(255 255 255 / .08); color: rgb(var(--white)); }
.rail__item[aria-current="page"] { background: rgb(var(--white)); color: rgb(var(--ink-900)); font-weight: 600; }
.rail__foot { border-top: 1px solid rgb(255 255 255 / .14); padding: 14px 20px 18px; }
.rail__me strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__me span { display: block; font-size: 13px; color: rgb(255 255 255 / .66); margin-bottom: 8px; }
.rail__signout { background: none; border: 0; padding: 4px 0; font: inherit; color: rgb(255 255 255 / .82); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.rail__signout:hover { color: rgb(var(--sun)); }
.rail :focus-visible { outline-color: rgb(var(--sun)); }
.work { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: rgb(255 255 255 / .95); border-bottom: 1px solid rgb(var(--ink-200) / .7); backdrop-filter: blur(6px); }
.topbar__word { font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 50%; background: rgb(var(--sun-soft)); color: rgb(var(--brand)); font-weight: 700; }
.btn.menu-btn { display: none; }
main#main { padding: 32px 40px; flex: 1; min-width: 0; outline: none; animation: route-fade 200ms ease; }
@keyframes route-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Page anatomy ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; justify-content: space-between; padding-bottom: 28px; }
.page-title { font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.035em; }
.page-desc { font-size: .9375rem; color: rgb(var(--ink-500)); margin-top: 4px; max-width: 70ch; }
.page-action { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.grid-2 { display: grid; gap: 20px; }
@media (min-width: 1280px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.notice { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: var(--radius-md); background: rgb(var(--mint)); color: rgb(var(--ink-900)); margin-bottom: 16px; }
.notice--warn { background: rgb(var(--sun-soft)); }
.notice--error { background: rgb(var(--chilli-soft)); color: rgb(var(--state-bad)); font-weight: 500; }

/* ---------- Panel: a cream frame around a white body. Never nested. ---------- */
.panel { background: rgb(var(--paper-deep)); border-radius: var(--radius-lg); padding: 6px; min-width: 0; }
.panel__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; gap: 8px; }
.panel__title { font-size: 1rem; font-weight: 600; letter-spacing: -0.012em; }
.panel__body { background: rgb(var(--white)); border: 1px solid rgb(var(--ink-200) / .6); border-radius: 12px; padding: 20px; min-width: 0; }
.panel__body.is-flush { padding: 0; overflow: hidden; }

/* ---------- Stat cards ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { border-radius: 14px; padding: 16px; background: rgb(var(--tone, var(--paper-deep))); color: rgb(var(--ink-900)); text-decoration: none; display: block; min-width: 0; transition: transform 150ms; }
a.stat:hover { transform: translateY(-2px); }
.stat.is-brand { background: rgb(var(--brand)); color: rgb(var(--white)); }
.stat.is-mint { --tone: var(--mint); }
.stat.is-sun { --tone: var(--sun-soft); }
.stat.is-chilli { --tone: var(--chilli-soft); }
.stat.is-lime { --tone: var(--lime-soft); }
.stat__label { font-size: 13px; font-weight: 500; color: rgb(var(--ink-700)); }
.stat.is-brand .stat__label, .stat.is-brand .stat__foot { color: rgb(255 255 255 / .86); }
.stat__value { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -0.035em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.stat__foot { margin-top: 8px; font-size: 13px; color: rgb(var(--ink-500)); }

/* ---------- Status pill: a tint, not an outline ---------- */
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill--ok { background: rgb(var(--state-ok) / .1); color: rgb(var(--state-ok)); }
.pill--warn { background: rgb(var(--state-warn) / .1); color: rgb(var(--state-warn)); }
.pill--bad { background: rgb(var(--state-bad) / .1); color: rgb(var(--state-bad)); }
.pill--quiet { background: rgb(var(--ink-100)); color: rgb(var(--ink-700)); }
.pill--brand { background: rgb(var(--brand-soft)); color: rgb(var(--brand)); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 150ms, border-color 150ms, transform 120ms; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--sm { height: 34px; padding: 0 12px; }
.btn--block { width: 100%; }
.btn--primary { background: rgb(var(--brand)); color: rgb(var(--white)); }
.btn--primary:hover:not(:disabled) { background: rgb(var(--brand-strong)); }
.btn--quiet, .btn--outline { background: rgb(var(--white)); border-color: rgb(var(--ink-200)); color: rgb(var(--ink-900)); }
.btn--quiet:hover:not(:disabled), .btn--outline:hover:not(:disabled) { background: rgb(var(--paper-tint)); }
.btn--ghost { background: none; color: rgb(var(--ink-700)); }
.btn--ghost:hover:not(:disabled) { background: rgb(var(--ink-100)); }
.btn--danger { background: rgb(var(--state-bad)); color: rgb(var(--white)); }
.btn--danger:hover:not(:disabled) { filter: brightness(.9); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: rgb(var(--brand)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button.is-danger { color: rgb(var(--state-bad)); }
.field { margin-bottom: 14px; min-width: 0; display: grid; gap: 6px; }
.field label, .field__label { font-weight: 500; }
.field__hint { font-size: 13px; color: rgb(var(--ink-500)); }
.field__error { color: rgb(var(--state-bad)); font-weight: 500; font-size: 13px; }
input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid rgb(var(--ink-200)); border-radius: var(--radius-sm); font: inherit; color: inherit; background: rgb(var(--white)); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: rgb(var(--brand)); box-shadow: 0 0 0 3px rgb(var(--brand) / .15); }
.field--error input, .field--error select, .field--error textarea { border-color: rgb(var(--state-bad)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-inline { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: end; }
.form-inline .field { flex: 1 1 160px; }
.form-inline .btn { margin-bottom: 14px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; padding-bottom: 16px; }
.filterbar .field { margin-bottom: 0; flex: 0 1 240px; }

/* Switch: a real button with role="switch", not a styled checkbox. */
.switch { width: 40px; height: 24px; border-radius: 999px; border: 0; background: rgb(var(--ink-200)); position: relative; cursor: pointer; transition: background-color 150ms; flex: none; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: rgb(var(--white)); transition: transform 150ms var(--ease-settle); box-shadow: 0 1px 2px rgb(var(--ink-900) / .2); }
.switch[aria-checked="true"] { background: rgb(var(--brand)); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.switch:disabled { opacity: .55; cursor: not-allowed; }
.setting { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-top: 1px solid rgb(var(--ink-100)); }
.setting:first-child { border-top: 0; padding-top: 0; }
.setting__text { flex: 1 1 16rem; min-width: 0; }
.setting__label { font-weight: 600; }
.switch-field { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }

/* Description editor */
.editor { border: 1px solid rgb(var(--ink-200)); border-radius: var(--radius-md); background: rgb(var(--white)); overflow: hidden; }
.editor:focus-within { border-color: rgb(var(--brand)); box-shadow: 0 0 0 3px rgb(var(--brand) / .15); }
.editor__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; background: rgb(var(--paper-tint)); border-bottom: 1px solid rgb(var(--ink-200)); }
.editor__bar button { min-height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: rgb(var(--ink-700)); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.editor__bar button:hover { background: rgb(var(--ink-100)); color: rgb(var(--ink-900)); }
.editor__surface { min-height: 220px; max-height: 60vh; overflow-y: auto; padding: 14px 16px; outline: none; line-height: 1.6; }
.editor__surface > * + * { margin-top: .8em; }

/* ---------- Data table: one frame, no zebra, no vertical rules ---------- */
.table-wrap { border: 1px solid rgb(var(--ink-200) / .7); border-radius: 12px; background: rgb(var(--white)); overflow-x: auto; overscroll-behavior-x: contain; }
.panel__body.is-flush .table-wrap { border: 0; border-radius: 0; }
.dt { width: 100%; border-collapse: collapse; }
.dt th { background: rgb(var(--paper-tint) / .9); font-size: .8125rem; font-weight: 500; color: rgb(var(--ink-500)); text-align: left; padding: 10px 14px; white-space: nowrap; }
.dt td { padding: 13px 14px; border-top: 1px solid rgb(var(--ink-100)); vertical-align: middle; }
.dt tbody tr { transition: background-color 120ms; }
.dt tbody tr:hover { background: rgb(var(--paper-tint) / .7); }
.dt tr.is-link { cursor: pointer; }
.dt .num { text-align: right; font-variant-numeric: tabular-nums; }
.dt td:first-child a { font-weight: 600; color: rgb(var(--ink-900)); text-decoration: none; }
.dt td:first-child a:hover { color: rgb(var(--brand)); text-decoration: underline; }
.thumb { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: rgb(var(--mint)); flex: none; display: block; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 4px 0; font-size: 13px; color: rgb(var(--ink-500)); }
.pager { display: flex; gap: 6px; align-items: center; }

/* Rows inside panels */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid rgb(var(--ink-100)); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows > li:last-child { padding-bottom: 0; }
.rows .is-total { font-weight: 700; font-size: 1.0625rem; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.kv dt { font-size: 13px; color: rgb(var(--ink-500)); }
.kv dd { margin: 2px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.json { font-family: ui-monospace, Menlo, monospace; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: rgb(var(--ink-700)); background: rgb(var(--paper-tint)); padding: 6px 8px; border-radius: var(--radius-sm); max-width: 320px; }
.message-text { white-space: pre-wrap; margin-top: 6px; color: rgb(var(--ink-700)); }

/* Photos */
.images { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 16px; }
.images li { display: grid; gap: 6px; justify-items: start; }
.images img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-md); background: rgb(var(--mint)); }
.team-thumb { width: 52px; height: 64px; object-fit: cover; object-position: 50% 18%; border-radius: var(--radius-sm); background: rgb(var(--sun-soft)); flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.25rem; color: rgb(var(--brand)); }

/* ---------- States ---------- */
.state { padding: 40px 20px; text-align: center; display: grid; gap: 8px; justify-items: center; }
.state__icon { width: 44px; height: 44px; border-radius: 12px; background: rgb(var(--sun-soft)); display: inline-flex; align-items: center; justify-content: center; color: rgb(var(--brand)); font-weight: 700; font-size: 1.25rem; }
.state__title { font-weight: 600; font-size: 15px; }
.state__desc { color: rgb(var(--ink-500)); }
.bones { display: grid; gap: 10px; }
.bone { height: 14px; border-radius: 6px; background: rgb(var(--ink-100)); animation: pulse 1.4s ease-in-out infinite; }
.bone.is-title { height: 28px; width: 40%; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Dialog: native <dialog>, head / body / foot ---------- */
dialog.dlg { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 60px rgb(var(--ink-900) / .24); color: inherit; }
dialog.dlg::backdrop { background: rgb(var(--ink-900) / .4); }
.dlg__inner { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.dlg__head { padding: 20px 20px 8px; }
.dlg__title { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.dlg__sub { color: rgb(var(--ink-500)); font-size: 13px; margin-top: 4px; }
.dlg__body { padding: 8px 20px 16px; overflow-y: auto; }
.dlg__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; flex-wrap: wrap; }

/* ---------- Toasts: bottom right ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: rgb(var(--ink-900)); color: rgb(var(--white)); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 24px rgb(var(--ink-900) / .24); animation: toast-in 180ms var(--ease-settle); }
.toast.is-bad { background: rgb(var(--state-bad)); }
.toast.is-leaving { opacity: 0; transition: opacity 200ms var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Sign-in ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgb(var(--brand)); background-image: linear-gradient(135deg, rgb(var(--brand)) 0 55%, rgb(var(--leaf)) 55% 70%, rgb(var(--sun)) 70% 82%, rgb(var(--chilli)) 82%); }
main#main.auth-card, .auth-card { flex: none; animation: none; background: rgb(var(--white)); border-radius: var(--radius-lg); padding: 32px; width: min(420px, 100%); box-shadow: 0 24px 60px rgb(var(--ink-900) / .28); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.04em; }
.auth-brand span { width: 12px; height: 12px; background: rgb(var(--chilli)); transform: rotate(45deg); }
.auth-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin: 20px 0; }
.auth-foot { margin-top: 14px; }
.auth-card .btn { width: 100%; height: 44px; }

/* ---------- Phone and tablet: the rail becomes a drawer ---------- */
.rail-scrim { display: none; }
@media (max-width: 1023px) {
  .btn.menu-btn { display: inline-flex; }
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform 250ms var(--ease-settle); }
  .rail.is-open { transform: none; }
  .rail.is-open + .rail-scrim { display: block; position: fixed; inset: 0; background: rgb(var(--ink-900) / .3); z-index: 39; }
  main#main { padding: 24px 16px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: auto; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .dt .secondary { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Blog, comments, stores ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; font: inherit; font-weight: 500; color: rgb(var(--ink-700)); background: rgb(var(--paper-deep)); border: 0; border-radius: 999px; cursor: pointer; transition: background-color 150ms, color 150ms; }
.tab:hover { background: rgb(var(--ink-100)); }
.tab.is-active { background: rgb(var(--ink-900)); color: rgb(var(--white)); }
.tab__count { min-width: 22px; padding: 0 6px; border-radius: 999px; font-size: .8125rem; text-align: center; background: rgb(var(--white) / .22); }
.tab:not(.is-active) .tab__count { background: rgb(var(--white)); }
.comment-rows li { display: block; }
.comment-row { display: grid; gap: 6px; }
.comment-row__top { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.cover-preview { display: block; max-width: 420px; width: 100%; border-radius: var(--radius-md); margin-bottom: 14px; }
.logo-thumb { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; object-fit: contain; background: rgb(var(--paper-deep)); border-radius: var(--radius-sm); font-weight: 700; color: rgb(var(--brand)); }
