/* ============================================================
   Store Admin — application stylesheet (v3, polished)
   ============================================================ */

:root {
  /* canvas */
  --bg:          #f5f4f1;
  --surface:     #ffffff;
  --surface-2:   #faf9f7;
  --surface-3:   #f0eeea;
  --border:      #e8e5e0;
  --border-firm: #d8d4ce;
  --text:        #1a1d1f;
  --text-soft:   #4f5256;
  --text-mute:   #8a8d8f;
  --text-faint:  #b8b9ba;

  /* brand */
  --accent:       #1f787b;
  --accent-deep:  #155e60;
  --accent-soft:  #e3eded;
  --accent-line:  #cfe0e0;

  /* signals */
  --danger:      #b8332c;
  --danger-soft: #f9e5e3;
  --warn:        #a76822;
  --warn-soft:   #f7ebd8;
  --ok:          #3a7339;
  --ok-soft:     #e3eee2;

  /* shadows */
  --shadow-1:    0 1px 2px rgba(20,20,18,0.05);
  --shadow-2:    0 4px 12px rgba(20,20,18,0.08);
  --shadow-3:    0 18px 48px -16px rgba(20,20,18,0.22);

  /* radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* type */
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --sidebar-w: 250px;
  --topbar-h:  64px;

  --easeOut: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #16171a;
    --surface:     #1d1f23;
    --surface-2:   #232629;
    --surface-3:   #2a2d31;
    --border:      #2f3236;
    --border-firm: #3d4045;
    --text:        #eceeef;
    --text-soft:   #a8acb0;
    --text-mute:   #777a7e;
    --text-faint:  #5a5d61;
    --accent:      #4ea7a9;
    --accent-deep: #6cbabc;
    --accent-soft: #1d3839;
    --accent-line: #2a4f51;
    --danger:      #e0716c;
    --danger-soft: #391f1c;
    --warn:        #d99847;
    --warn-soft:   #392812;
    --ok:          #7bb377;
    --ok-soft:     #1f3220;
    --shadow-1:    0 1px 2px rgba(0,0,0,0.4);
    --shadow-2:    0 4px 12px rgba(0,0,0,0.45);
    --shadow-3:    0 18px 48px -16px rgba(0,0,0,0.6);
  }
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; min-width: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { overflow-x: hidden; }

button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: white; }

/* shared utility text */
.muted  { color: var(--text-mute); }
.small  { font-size: 12px; }
.mono   { font-family: var(--mono); font-size: 12.5px; }

/* ============================================================
   LOGIN
   ============================================================ */
.login {
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 25% 15%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(circle at 75% 85%, var(--accent-soft) 0%, transparent 55%),
    var(--bg);
}
.login__card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-2);
}
.login__brand { text-align: center; margin-bottom: 28px; }
.login__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 16px;
}
.login__brand h1 {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.015em; margin-bottom: 4px;
}
.login__host {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-mute);
}
.login__form { display: flex; flex-direction: column; gap: 16px; }
.login__msg {
  display: none;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  color: var(--danger);
}

/* ============================================================
   FIELDS / INPUTS
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 12px; font-weight: 600;
  color: var(--text-soft); letter-spacing: 0.01em;
}

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="datetime-local"],
input:not([type]), select, textarea {
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-firm);
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, input[readonly], select:disabled, textarea:disabled, textarea[readonly] {
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: not-allowed;
}

textarea { min-height: 80px; resize: vertical; font-family: var(--sans); }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%238a8d8f' d='M6 9 1.5 4h9z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text-soft); cursor: pointer;
  user-select: none;
}
.check input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--accent);
  cursor: pointer;
}

/* search input with left icon */
.field--search {
  position: relative; display: flex; align-items: center;
  min-width: 240px; flex: 1; max-width: 380px;
}
.field--search svg {
  position: absolute; left: 12px;
  color: var(--text-mute); pointer-events: none;
}
.field--search input {
  padding-left: 36px;
}

/* input with a clickable icon (camera scanner) on the left */
.input-with-icon { position: relative; }
.input-with-icon input { padding-left: 42px; }
.input-icon {
  position: absolute; left: 4px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--text-mute);
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.input-icon:hover { color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-firm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover  { background: var(--surface-2); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--accent); color: white; border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn--ghost {
  background: transparent; border-color: transparent;
  color: var(--text-soft);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }

.btn--danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn--danger:hover { background: #952a24; border-color: #952a24; }

.btn--sm    { padding: 6px 12px; font-size: 12.5px; }
.btn--block { width: 100%; padding: 11px 16px; }

.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  min-height: 100dvh;
  display: flex; flex-direction: column;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  height: var(--topbar-h);
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 20;
}
.topbar__menu { display: none; }
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.topbar__logo {
  color: var(--accent);
  display: inline-flex; flex-shrink: 0;
}
.topbar__name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar__tenant {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  padding: 3px 9px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}
.topbar__tenant--super {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-deep);
  font-weight: 600;
}
.topbar__right { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   LAYOUT + SIDEBAR
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1; min-height: 0;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--topbar-h));
  position: sticky; top: var(--topbar-h);
  overflow: hidden;
}
.sidebar__nav {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 12px;
  overflow-y: auto;
}
.sidebar__item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500;
  color: var(--text-soft);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sidebar__item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar__item--active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
}
.sidebar__item svg {
  color: var(--text-mute);
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar__item:hover svg     { color: var(--text-soft); }
.sidebar__item--active svg   { color: var(--accent); }

/* sidebar profile + logout at bottom */
.sidebar__profile {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
}
.profile-btn {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  text-align: left;
  transition: background 0.15s;
}
.profile-btn:hover { background: var(--surface); }
.profile-btn__avatar {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
}
.profile-btn__meta {
  display: flex; flex-direction: column;
  min-width: 0; line-height: 1.25;
}
.profile-btn__name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-btn__email {
  font-size: 11px; color: var(--text-mute);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-btn__role {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 2px 6px;
  border-radius: 999px;
}
.sidebar__logout {
  width: 100%;
  justify-content: flex-start;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main {
  padding: 32px 40px;
  overflow-y: auto;
  background: var(--bg);
}
.view__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.view__title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 4px;
}
.view__sub {
  color: var(--text-soft);
  font-size: 14px;
  max-width: 60ch;
}
.view__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.loading {
  padding: 80px 0;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
}
.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-mute);
  background: var(--surface);
  border: 1px dashed var(--border-firm);
  border-radius: var(--r);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card--padded { padding: 24px; }
.card__head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card__head h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.card__body { padding: 22px; }
.card__body--actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}
/* Subtle colored accent strip on top of each card — distinguishes them
   visually without changing the dashboard background. The strip uses
   nth-child to rotate through 5 boutique-friendly hues. */
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-accent, #94a3b8);
}
.stat:nth-child(5n+1) { --stat-accent: #2d6a4f; }  /* emerald */
.stat:nth-child(5n+2) { --stat-accent: #c47148; }  /* copper  */
.stat:nth-child(5n+3) { --stat-accent: #7a8a6f; }  /* sage    */
.stat:nth-child(5n+4) { --stat-accent: #c9a000; }  /* gold    */
.stat:nth-child(5n+5) { --stat-accent: #6b7d61; }  /* olive   */

/* Tint the label + value in the accent color, then deepen the tile bg
   subtly so each card has its own identity. */
.stat .stat__label { color: var(--stat-accent, var(--text-mute)); }
.stat:hover {
  border-color: var(--stat-accent, var(--border-firm));
  box-shadow: 0 6px 18px -8px color-mix(in oklab, var(--stat-accent, #000) 35%, transparent);
  transform: translateY(-1px);
}
.stat__label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.stat__value {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.stat__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-soft);
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 13px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table__check { width: 36px; }

.thumb {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  object-fit: cover;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.thumb--placeholder {
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}

/* ============================================================
   FILTERS BAR (above tables)
   ============================================================ */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px; align-items: center;
}
.filters .select {
  padding: 9px 32px 9px 14px;
  font-size: 13px;
}

/* bulk action bar */
.bulkbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--accent-deep);
}
/* The bulk action buttons previously all looked identical (white-on-white
   over the accent-soft bar). Each action now has its own tint so they
   read at a glance; all keep black text for readability. */
.bulkbar .btn {
  color: #1d2122;
  border: 1px solid rgba(29, 33, 34, 0.18);
  font-weight: 600;
}
.bulkbar .btn[data-bulk="mark_sold"] {
  background: #fde68a;       /* warm gold — "this is moving out" */
  border-color: #ca8a04;
}
.bulkbar .btn[data-bulk="mark_sold"]:hover { background: #fcd34d; }

.bulkbar .btn[data-bulk="activate"] {
  background: #bbf7d0;       /* soft green — "bring back to life" */
  border-color: #16a34a;
}
.bulkbar .btn[data-bulk="activate"]:hover { background: #86efac; }

.bulkbar .btn[data-bulk="deactivate"] {
  background: #fecaca;       /* soft red — destructive-ish */
  border-color: #b91c1c;
}
.bulkbar .btn[data-bulk="deactivate"]:hover { background: #fca5a5; }

.bulkbar #bulkClear,
.bulkbar .btn--ghost {
  background: #e2e8f0;       /* neutral gray — cancel */
  border-color: #94a3b8;
}
.bulkbar #bulkClear:hover,
.bulkbar .btn--ghost:hover { background: #cbd5e1; }

/* ============================================================
   CHIPS / PILLS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.chip--ok    { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.chip--warn  { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.chip--mute  { background: var(--surface-3);   color: var(--text-mute); border-color: transparent; }
.chip--accent{ background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }

.chip--removable {
  padding-right: 5px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: var(--accent-line);
}
.chip__x {
  width: 16px; height: 16px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
  font-size: 13px; line-height: 1;
  background: rgba(0,0,0,0.06);
  color: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.chip__x:hover { background: rgba(0,0,0,0.16); }

/* chip editor */
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-firm);
  border-radius: var(--r-sm);
  min-height: 44px;
  align-items: center;
}
.chips__add {
  flex: 1;
  min-width: 120px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  outline: none;
  width: auto !important;
}

/* ============================================================
   FORMS (in drawer)
   ============================================================ */
.form {
  display: flex; flex-direction: column; gap: 22px;
}
.form-section {
  display: flex; flex-direction: column; gap: 13px;
}
.form-section + .form-section {
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.form-section h3 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 2px;
}
.form-actions {
  display: flex; gap: 10px; align-items: center;
  padding-top: 16px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}

.reset-pw {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.reset-pw summary {
  cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--text-soft);
  user-select: none;
}
.reset-pw[open] summary { margin-bottom: 8px; }

/* ============================================================
   DRAWER (right-side edit panel)
   ============================================================ */
.drawer {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; justify-content: flex-end;
}
.drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,18,0.42);
  backdrop-filter: blur(2px);
  animation: fade 0.18s ease;
}
.drawer__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 100%;
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: slideIn 0.28s var(--easeOut);
  overflow: hidden;
}
.drawer__head {
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer__head h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  z-index: 110;
  display: grid; place-items: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(20,20,18,0.45);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  background: var(--surface);
  border-radius: var(--r);
  width: 100%; max-width: 460px;
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
  animation: modalIn 0.2s var(--easeOut);
  overflow: hidden;
}
.modal__head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal__head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.modal__body { padding: 22px; }

/* ============================================================
   SCANNER (full-screen camera)
   ============================================================ */
.scanner {
  position: fixed; inset: 0;
  z-index: 200;
  background: #000;
  display: flex; flex-direction: column;
}
.scanner__top {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  background: linear-gradient(rgba(0,0,0,0.65), transparent);
  color: white;
}
.scanner__top .icon-btn {
  color: white;
  background: rgba(255,255,255,0.08);
}
.scanner__top .icon-btn:hover { background: rgba(255,255,255,0.18); color: white; }
.scanner__title {
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.01em;
}
.scanner__video { width: 100%; height: 100%; object-fit: cover; }
.scanner__reticle {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(72vw, 320px); height: min(72vw, 320px);
  pointer-events: none;
}
.scanner__reticle span {
  position: absolute;
  width: 32px; height: 32px;
  border: 3px solid white;
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.5));
}
.scanner__reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.scanner__reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 4px; }
.scanner__reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 4px; }
.scanner__reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }
.scanner__hint {
  position: absolute; left: 0; right: 0; bottom: 48px;
  text-align: center;
  color: white;
  font-size: 14px; font-weight: 500;
  padding: 10px;
  background: rgba(0,0,0,0.55);
}

/* ============================================================
   IMAGE GALLERY (product editor)
   ============================================================ */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.gallery__empty {
  grid-column: 1 / -1;
  padding: 22px;
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-firm);
  border-radius: var(--r-sm);
  color: var(--text-mute);
}
.gallery__cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  margin: 0;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.gallery__cell.is-primary { border-color: var(--accent); }
.gallery__cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__cell-actions {
  position: absolute; top: 4px; right: 4px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery__cell:hover .gallery__cell-actions,
.gallery__cell.is-primary .gallery__cell-actions { opacity: 1; }
.gallery__cell-actions .icon-btn {
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.55);
  color: white;
  backdrop-filter: blur(6px);
}
.gallery__cell-actions .icon-btn:hover { background: rgba(0,0,0,0.78); color: white; }

/* ============================================================
   SLIDE CARDS
   ============================================================ */
.slides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.slide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.slide-card:hover {
  border-color: var(--border-firm);
  box-shadow: var(--shadow-2);
}
.slide-card.dragging { opacity: 0.5; }
.slide-card.is-disabled .slide-card__img { opacity: 0.45; }
.slide-card__img {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.slide-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-card__no-img { color: var(--text-mute); font-size: 12px; }
.slide-card__body { padding: 14px 16px; flex: 1; }
.slide-card__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}
.slide-card__title {
  font-weight: 600;
  font-size: 14.5px;
  margin: 4px 0 10px;
  letter-spacing: -0.01em;
}
.slide-card__meta {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.slide-card__drag {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  background: rgba(0,0,0,0.45);
  color: white;
  cursor: grab;
  backdrop-filter: blur(4px);
}
.slide-card__drag:hover { background: rgba(0,0,0,0.65); color: white; }
.slide-card__drag:active { cursor: grabbing; }

.slide-img-preview {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 8px;
}
.slide-img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-img-preview__empty {
  display: grid; place-items: center;
  height: 100%; color: var(--text-mute);
}

/* ============================================================
   ANNOUNCEMENT CARDS
   ============================================================ */
.ann-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.ann-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ann-card:hover { border-color: var(--border-firm); box-shadow: var(--shadow-2); }
.ann-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.ann-card__body { padding: 16px 18px; }
.ann-card h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.ann-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 12px; align-items: center;
}

/* ============================================================
   INFO BLOCK EDITOR
   ============================================================ */
.blocks { display: flex; flex-direction: column; gap: 10px; }
.block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px;
}
.block__head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 8px;
  font-weight: 600;
}
.block textarea, .block > input {
  width: 100%;
}
.block-items {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
}
.block-item {
  display: flex; gap: 6px; align-items: center;
}
.block-item input { flex: 1; }
.block-add {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ============================================================
   PEOPLE / AVATARS
   ============================================================ */
.person {
  display: flex; align-items: center; gap: 10px;
}
.person__name {
  font-weight: 600;
  font-size: 13.5px;
}
.person__email {
  margin-top: 2px;
  font-size: 11.5px;
}
.avatar {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   HOURS EDITOR
   ============================================================ */
.hours-list { display: flex; flex-direction: column; gap: 6px; }
.hour-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   SESSIONS LIST
   ============================================================ */
.sessions {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex; flex-direction: column; gap: 8px;
}
.sessions li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  gap: 12px;
}

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.feed {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 12px;
}
.feed__item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 4px 0;
}
.feed__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}
.feed__title {
  font-weight: 500;
  font-size: 13.5px;
}
.feed__entity {
  font-size: 11px;
  color: var(--text-mute);
  margin-left: 6px;
  font-family: var(--mono);
}
.feed__meta {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  background: var(--text); color: var(--surface);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-3);
  animation: toastIn 0.25s var(--easeOut);
  max-width: calc(100vw - 40px);
}
.toast--err { background: var(--danger); color: white; }
.toast--ok  { background: var(--ok);     color: white; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .topbar__menu { display: inline-grid; }
  .topbar { padding: 0 16px; }

  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0; bottom: 0;
    width: 280px;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.25s var(--easeOut);
    box-shadow: var(--shadow-3);
  }
  .sidebar--open { transform: translateX(0); }

  .main { padding: 22px 18px; }
  .view__title { font-size: 22px; }
  .topbar__tenant { display: none; }
  .drawer__panel { width: 100vw; max-width: 100vw; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat__value { font-size: 22px; }
  .topbar__name { font-size: 14px; }
}

/* ============================================================
   MISC
   ============================================================ */
.btn__label { display: inline-block; }
.row-product { cursor: pointer; }

/* ============================================================
   INSIGHTS GRID (dashboard)
   ============================================================ */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.insight-card { margin: 0; }
.insight-head {
  align-items: flex-start;
}
.insight-head h2 { margin-bottom: 2px; }
.insight-sub { margin: 0; line-height: 1.4; }
.insight-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.insight-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.insight-row:last-child { border-bottom: 0; }
.insight-row__main { min-width: 0; flex: 1; }
.insight-row__name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.insight-row__meta {
  font-size: 11.5px;
  color: var(--text-mute);
  margin-top: 2px;
}
.insight-row__metric {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: right;
}
.insight-row__metric strong { color: var(--text); }
.insight-miss { color: var(--danger); }
.insight-miss strong { color: var(--danger); }

/* ============================================================
   INSIGHT CARD FOOTER (View all link) + modal list overrides
   ============================================================ */
.insight-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  text-align: right;
}
.insight-viewall {
  font-size: 12.5px;
  color: var(--accent, #5dd3d6);
  text-decoration: none;
  font-weight: 500;
}
.insight-viewall:hover { text-decoration: underline; }
.insight-list--modal {
  list-style: none;
  padding: 0; margin: 0;
  max-height: 60vh;
  overflow-y: auto;
}

/* ============================================================
   Super-admin storage table
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.table th {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  background: rgba(255,255,255,0.015);
}
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }

/* Small helper hint that sits inline next to a form label —
   e.g. "SKU — auto-assigned when saved" */
.field__hint {
  color: var(--muted, #807872);
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}

/* ============================================================
   Star (featured) button in product list
   ============================================================ */
.table__star { width: 36px; text-align: center; }
.star-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: 6px;
  color: var(--muted, #807872);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  background: transparent;
  border: 0;
}
.star-btn:hover {
  background: rgba(255, 196, 0, 0.10);
  color: #c9a000;
}
.star-btn--on {
  color: #d4a017;
}
.star-btn--on:hover {
  transform: scale(1.08);
}

/* Archived rows — slightly faded so admins know at a glance */
.row-product--archived {
  opacity: 0.78;
}
.row-product--archived td {
  background: rgba(0, 0, 0, 0.02);
}

/* Inline action buttons inside the Status column for Archived rows */
.row-action {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  background: transparent;
  border: 1px solid var(--rule, rgba(0,0,0,0.1));
  color: var(--ink, #1d2122);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.row-action--restore:hover {
  background: var(--ink, #1d2122);
  color: var(--surface, #faf7f0);
  border-color: var(--ink, #1d2122);
}
.row-action--delete {
  color: #b3261e;
  border-color: rgba(179, 38, 30, 0.3);
}
.row-action--delete:hover {
  background: #b3261e;
  color: white;
  border-color: #b3261e;
}

/* ============================================================
   JSON import dialog
   ============================================================ */
.json-sample {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--rule, rgba(0,0,0,0.1));
  border-radius: 6px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  max-height: 280px;
  overflow: auto;
  margin: 8px 0;
}
.import-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.import-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--rule, rgba(0,0,0,0.06));
  font-size: 13px;
}
.import-errors {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow: auto;
}
.import-errors li {
  padding: 8px 12px;
  margin-bottom: 4px;
  background: rgba(179, 38, 30, 0.06);
  border-left: 3px solid #b3261e;
  font-size: 13px;
  border-radius: 3px;
}
.text-err { color: #b3261e; }

/* ============================================================
   Dashboard — inventory section
   ============================================================ */
.section-head {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #807872);
  margin: 32px 0 12px;
}
.stats--inventory {
  margin-bottom: 12px;
}

/* ============================================================
   Billing view
   ============================================================ */

/* Status pills */
.chip--ok   { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.chip--err  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Pricing preview inside the super-admin plan editor drawer */
.bill-preview {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(45, 106, 79, 0.07);
  border-left: 3px solid #2d6a4f;
  border-radius: 4px;
  font-size: 13.5px;
  color: var(--text);
}
.bill-preview .muted { display: block; margin-top: 3px; }

.bill-pay-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}

/* Company-facing billing cards */
.bill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.bill-card { padding: 22px 24px; }
.bill-card--primary {
  background: linear-gradient(135deg, #2d6a4f 0%, #1f4d3a 100%);
  color: #faf7f0;
  border: 0;
}
.bill-card--primary .bill-card__label { color: rgba(250, 247, 240, 0.75); }
.bill-card--primary .bill-card__sub   { color: rgba(250, 247, 240, 0.85); }

.bill-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute, #807872);
  margin-bottom: 12px;
}
.bill-card__big {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.bill-card__big .bill-unit {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  margin-left: 2px;
}
.bill-card__sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-soft, #4a4744);
}
.bill-save {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(250, 247, 240, 0.15);
  border-radius: 6px;
  font-size: 13px;
}

.row-bill { cursor: pointer; }
.row-bill:hover td { background: rgba(0, 0, 0, 0.025); }

/* Compact table variant used in payments list */
.table--compact th,
.table--compact td {
  padding: 8px 12px;
  font-size: 13px;
}

/* Owner-side notes card from the administrator gets a bit more room */
.bill-notes {
  padding: 20px;
}

/* ============================================================
   Tickets view
   ============================================================ */

/* Unread dot next to row */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: transparent;
}
.dot--unread {
  background: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.18);
}
.row-ticket { cursor: pointer; }
.row-ticket:hover td { background: rgba(0, 0, 0, 0.025); }
.row-ticket--unread td { font-weight: 500; }
.row-ticket--unread strong { color: #2d6a4f; }

/* Detail drawer layout */
.ticket-detail {
  display: flex; flex-direction: column;
  gap: 16px;
  height: 100%;
}
.ticket-detail__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule, rgba(0,0,0,0.08));
}
.ticket-detail__subject {
  font-family: var(--serif, serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

/* Thread — scrolls inside the drawer; reply form stays pinned at the bottom */
.ticket-thread {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 14px;
  padding: 8px 4px;
  min-height: 280px;
  max-height: 60vh;
}

/* Message bubbles — "mine" on the right (emerald), "theirs" on the left (neutral) */
.ticket-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bg-deep, #f0e8d8);
  color: var(--ink, #1d2122);
  border: 1px solid var(--rule, rgba(0,0,0,0.06));
  font-size: 14px;
  line-height: 1.5;
}
.ticket-msg--mine {
  align-self: flex-end;
  background: #2d6a4f;
  color: #faf7f0;
  border-color: transparent;
}
.ticket-msg--mine .muted { color: rgba(250, 247, 240, 0.7); }
.ticket-msg__meta {
  font-size: 12px;
  margin-bottom: 4px;
  display: flex; align-items: baseline; gap: 6px;
}
.ticket-msg__body {
  word-wrap: break-word;
}
.ticket-msg__atts {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ticket-att {
  display: inline-block;
  width: 96px; height: 96px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.1);
  transition: transform 0.15s;
}
.ticket-att:hover { transform: scale(1.04); }
.ticket-att img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Reply form, pinned at the bottom of the detail drawer */
.ticket-reply {
  border-top: 1px solid var(--rule, rgba(0,0,0,0.08));
  padding-top: 12px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.ticket-reply textarea {
  width: 100%;
  border: 1px solid var(--rule, rgba(0,0,0,0.12));
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  background: var(--surface, #faf7f0);
}
.ticket-reply textarea:focus {
  outline: none;
  border-color: #2d6a4f;
}
.ticket-reply__row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.ticket-closed-banner {
  padding: 14px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  text-align: center;
}

/* File chips shown after picking attachment files */
.file-list {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.file-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-deep, #f0e8d8);
  border-radius: 999px;
  font-size: 12px;
}

/* Mobile tightening */
@media (max-width: 600px) {
  .ticket-msg { max-width: 92%; }
  .ticket-att { width: 72px; height: 72px; }
}

/* ============================================================
   Stock breakdown box in product editor
   Sits below the Available stock input. Light bordered tile with
   the three counters on the left and the Adjust button on the right.
   ============================================================ */
.stock-breakdown {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--rule, rgba(0, 0, 0, 0.08));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stock-breakdown__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
}
.stock-breakdown__counts strong { color: var(--text, #1d2122); }
.stock-breakdown .btn { flex-shrink: 0; }
@media (max-width: 520px) {
  .stock-breakdown { flex-direction: column; align-items: stretch; }
  .stock-breakdown__counts { justify-content: space-between; gap: 8px; }
  .stock-breakdown .btn { width: 100%; }
}

/* Activity feed enhancements: colored dots + diff line + SKU tag */
.feed__dot--ok   { background: #2d6a4f; }
.feed__dot--warn { background: #d4a017; }
.feed__dot--err  { background: #b91c1c; }
.feed__dot--info { background: #2563eb; }
.feed__sku {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(45, 106, 79, 0.10);
  color: #2d6a4f;
  border-radius: 4px;
}
.feed__diff {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-soft, #4a4744);
}
.feed__diff em {
  font-style: normal;
  color: var(--text, #1d2122);
}

/* ============================================================
   Ticket detail header — refresh/delete icon buttons
   ============================================================ */
.ticket-detail__head {
  align-items: flex-start;
}
.ticket-detail__head-text {
  flex: 1;
  min-width: 0;
}
.ticket-detail__head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ticket-detail__refreshed {
  font-size: 11.5px;
  color: var(--text-mute, #8a8d8f);
}

/* Generic icon-only button used for refresh / delete in the header.
   Reuses .icon-btn if you already had one; this adds two variants. */
.icon-btn {
  width: 32px; height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft, #4f5256);
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  background: var(--surface-2, #faf9f7);
  color: var(--text, #1a1d1f);
  border-color: var(--border, #e8e5e0);
}
.icon-btn--danger {
  color: #b91c1c;
}
.icon-btn--danger:hover {
  background: rgba(185, 28, 28, 0.08);
  border-color: rgba(185, 28, 28, 0.3);
  color: #b91c1c;
}
.icon-btn.is-spinning svg {
  animation: iconSpin 0.7s linear infinite;
}
@keyframes iconSpin {
  to { transform: rotate(360deg); }
}

/* Adjust modal inline hint */
.adjust-hint {
  min-height: 18px;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--text-soft, #4f5256);
}
.adjust-hint--err {
  color: #b91c1c;
  font-weight: 500;
}
.adjust-hint--info {
  color: #155e60;
}

/* ============================================================
   Mobile polish — products page header buttons
   ============================================================
   On narrow screens the Import + Add product buttons were
   stacking awkwardly. Make them share a tidy row that fills
   the width so they read as a deliberate pair, not leftovers.
*/
@media (max-width: 640px) {
  .view__head {
    align-items: stretch;
    gap: 14px;
  }
  .view__actions {
    width: 100%;
    gap: 10px;
  }
  .view__actions .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
}

/* ============================================================
   Owner billing — Payment history heading spacing
   ============================================================ */
#billOwner .card h3 {
  padding: 14px;
  margin: 0;
}

/* ============================================================
   Available stock input — make it visually distinct
   ============================================================
   The Adjust modal kept causing confusion because the Sold /
   Damaged / Lost numbers looked similar to the Available stock
   input above. Tint the Available stock field so the eye
   instantly knows which number is "what's left to sell".
*/
.field input[name="stock"] {
  background: #317d7f;
  color: #ffffff;
  border-color: #2a6c6e;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.field input[name="stock"]:focus {
  background: #2a6c6e;
  border-color: #1f5a5c;
  outline: none;
  box-shadow: 0 0 0 3px rgba(49, 125, 127, 0.25);
}
/* Soften the spinner arrows so they don't clash with the dark fill */
.field input[name="stock"]::-webkit-inner-spin-button,
.field input[name="stock"]::-webkit-outer-spin-button {
  filter: invert(1);
  opacity: 0.6;
}

/* Soft inline hint on the owner billing primary card. Sits inside
   the emerald gradient, so use a tone that's readable without
   shouting. */
.bill-card--primary .bill-soft-hint {
  color: rgba(250, 247, 240, 0.92);
  font-weight: 500;
}