/* ─── Art Hackers Design System — tokens.css ─────────────────────────
   This file is the single source of truth for every Art Hackers screen.
   Import it in any page: <link rel="stylesheet" href="tokens.css" />
   Never override these tokens — extend via your page's own <style>. */

/* ─── Fonts ────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700;800&display=swap');

/* ─── Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Warm dark backgrounds — small warm chroma shifts the feel from 
     "developer tool" to "studio" */
  --ah-bg:      oklch(0.145 0.008 30);
  --ah-bg-2:    oklch(0.178 0.008 30);
  --ah-card:    oklch(0.205 0.007 30);
  --ah-card-2:  oklch(0.235 0.006 30);
  --ah-muted:   oklch(0.269 0.005 30);
  --ah-muted-2: oklch(0.32 0.004 30);

  /* Foreground — white with decreasing opacity via lightness */
  --ah-fg:      oklch(0.985 0 0);
  --ah-fg-2:    oklch(0.85 0 0);
  --ah-fg-3:    oklch(0.708 0 0);
  --ah-fg-4:    oklch(0.55 0 0);

  /* Border — white with increasing opacity via alpha */
  --ah-border:   oklch(1 0 0 / 8%);
  --ah-border-2: oklch(1 0 0 / 14%);
  --ah-border-3: oklch(1 0 0 / 22%);

  /* Brand red */
  --ah-red:       oklch(0.637 0.237 25.331);
  --ah-red-fg:    oklch(0.971 0.013 17.38);
  --ah-red-soft:  oklch(0.55 0.20 25 / 18%);
  --ah-red-soft-2: oklch(0.55 0.20 25 / 12%);

  /* Semantic */
  --ah-success: oklch(0.72 0.16 152);
  --ah-warn:    oklch(0.79 0.14 78);
  --ah-info:    oklch(0.74 0.10 240);

  /* Font families */
  --ah-font: 'Inter', system-ui, -apple-system, sans-serif;
  --ah-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  /* Spacing — 4-point grid */
  --ah-space-1: 4px;
  --ah-space-2: 8px;
  --ah-space-3: 12px;
  --ah-space-4: 16px;
  --ah-space-5: 20px;
  --ah-space-6: 24px;
  --ah-space-8: 32px;
  --ah-space-10: 40px;
  --ah-space-12: 48px;
  --ah-space-16: 64px;

  /* Radii */
  --ah-radius-sm: 4px;
  --ah-radius: 8px;
  --ah-radius-lg: 12px;
  --ah-radius-xl: 16px;
  --ah-radius-full: 999px;
}

/* ─── Reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  padding: 0;
  background: var(--ah-bg);
  color: var(--ah-fg);
  font-family: var(--ah-font);
  font-size: 14px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; margin: 0; }
h1, h2, h3, h4, h5, h6 { text-wrap: balance; margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
input, textarea, select { font: inherit; }
table { border-collapse: collapse; }

/* ─── Typography ────────────────────────────────────────────────────── */
.ah-h0 {
  font-family: var(--ah-font);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
.ah-h1 {
  font-family: var(--ah-font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0;
}
.ah-h2 {
  font-family: var(--ah-font);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}
.ah-h3 {
  font-family: var(--ah-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin: 0;
}
.ah-eyebrow {
  font-family: var(--ah-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ah-fg-4);
  margin: 0;
}
.ah-label {
  font-family: var(--ah-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--ah-fg-2);
  margin: 0;
}
.ah-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ah-fg-2);
}
.ah-body-sm {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ah-fg-3);
}
.ah-mono {
  font-family: var(--ah-mono);
  font-variant-numeric: tabular-nums;
}
.ah-mono-sm {
  font-family: var(--ah-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ─── Layout primitives ─────────────────────────────────────────────── */
.ah-row {
  display: flex;
  align-items: center;
  gap: var(--ah-space-4);
}
.ah-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ah-space-4);
}
.ah-row-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ah-space-3);
}
.ah-col {
  display: flex;
  flex-direction: column;
}
.ah-col-gap {
  display: flex;
  flex-direction: column;
  gap: var(--ah-space-4);
}
.ah-center {
  display: grid;
  place-items: center;
}
.ah-flex-1 { flex: 1; }
.ah-gap-1 { gap: var(--ah-space-1); }
.ah-gap-2 { gap: var(--ah-space-2); }
.ah-gap-3 { gap: var(--ah-space-3); }
.ah-gap-4 { gap: var(--ah-space-4); }
.ah-gap-5 { gap: var(--ah-space-5); }
.ah-gap-6 { gap: var(--ah-space-6); }
.ah-gap-8 { gap: var(--ah-space-8); }
.ah-gap-10 { gap: var(--ah-space-10); }

/* ─── Avatar ────────────────────────────────────────────────────────── */
.ah-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ah-radius-full);
  background: linear-gradient(135deg, var(--ah-red), oklch(0.5 0.15 340));
  color: var(--ah-fg);
  font-family: var(--ah-font);
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}
.ah-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 12px;
}
.ah-avatar-md {
  width: 48px;
  height: 48px;
  font-size: 17px;
}
.ah-avatar-lg {
  width: 96px;
  height: 96px;
  font-size: 32px;
}
.ah-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--ah-radius-full);
}

/* ─── Btn ────────────────────────────────────────────────────────────── */
.ah-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--ah-radius);
  border: 1px solid transparent;
  font-family: var(--ah-font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  cursor: pointer;
  user-select: none;
}
.ah-btn:active { transform: translateY(1px); }
.ah-btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

/* Primary red */
.ah-btn-primary {
  background: var(--ah-red);
  color: var(--ah-red-fg);
  border-color: var(--ah-red);
}
.ah-btn-primary:hover {
  background: oklch(0.57 0.24 25);
  border-color: transparent;
}

/* Outline */
.ah-btn-outline {
  background: transparent;
  color: var(--ah-fg-2);
  border-color: var(--ah-border-2);
}
.ah-btn-outline:hover {
  border-color: var(--ah-border-3);
  color: var(--ah-fg);
}

/* Ghost */
.ah-btn-ghost {
  background: transparent;
  color: var(--ah-fg-3);
  border-color: transparent;
}
.ah-btn-ghost:hover {
  background: oklch(1 0 0 / 6%);
  color: var(--ah-fg-2);
}

/* Danger */
.ah-btn-danger {
  background: transparent;
  color: var(--ah-red);
  border-color: oklch(0.637 0.237 25 / 30%);
}
.ah-btn-danger:hover {
  background: var(--ah-red-soft);
  border-color: var(--ah-red);
}

/* With left icon SVG slot */
.ah-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.ah-btn-sm svg { width: 13px; height: 13px; }

/* ─── Chip (filter pill) ────────────────────────────────────────────── */
.ah-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--ah-radius-full);
  border: 1px solid var(--ah-border-2);
  background: transparent;
  color: var(--ah-fg-3);
  font-family: var(--ah-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}
.ah-chip:hover {
  border-color: var(--ah-border-3);
  color: var(--ah-fg-2);
}
.ah-chip-active {
  background: var(--ah-red-soft);
  border-color: oklch(0.637 0.237 25 / 30%);
  color: var(--ah-red);
}
.ah-chip-active:hover {
  background: oklch(0.55 0.20 25 / 22%);
}

/* ─── Badge ──────────────────────────────────────────────────────────── */
.ah-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: var(--ah-radius-full);
  font-family: var(--ah-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  user-select: none;
}
.ah-badge-active {
  background: oklch(0.72 0.16 152 / 15%);
  color: var(--ah-success);
  border: 1px solid oklch(0.72 0.16 152 / 25%);
}
.ah-badge-pending {
  background: oklch(0.79 0.14 78 / 15%);
  color: var(--ah-warn);
  border: 1px solid oklch(0.79 0.14 78 / 25%);
}
.ah-badge-inactive {
  background: oklch(1 0 0 / 6%);
  color: var(--ah-fg-4);
  border: 1px solid var(--ah-border-2);
}
.ah-badge-red {
  background: var(--ah-red-soft-2);
  color: var(--ah-red);
  border: 1px solid oklch(0.637 0.237 25 / 25%);
}

/* ─── Style / category tags ─────────────────────────────────────────── */
.ah-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--ah-radius-full);
  border: 1px solid;
  font-family: var(--ah-font);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
}
.ah-tag-botanical {
  background: oklch(0.25 0.05 152 / 80%);
  color: oklch(0.72 0.16 152);
  border-color: oklch(0.72 0.16 152 / 30%);
}
.ah-tag-geometric {
  background: oklch(0.22 0.05 240 / 80%);
  color: oklch(0.74 0.10 240);
  border-color: oklch(0.74 0.10 240 / 30%);
}
.ah-tag-memorial {
  background: oklch(0.25 0.02 60 / 80%);
  color: oklch(0.79 0.08 60);
  border-color: oklch(0.79 0.08 60 / 30%);
}
.ah-tag-blackwork {
  background: oklch(0.18 0 0 / 90%);
  color: oklch(0.65 0 0);
  border-color: oklch(0.65 0 0 / 30%);
}
.ah-tag-neotraditional {
  background: oklch(0.25 0.06 50 / 80%);
  color: oklch(0.79 0.14 50);
  border-color: oklch(0.79 0.14 50 / 30%);
}
.ah-tag-script {
  background: oklch(0.24 0.04 35 / 80%);
  color: oklch(0.76 0.10 35);
  border-color: oklch(0.76 0.10 35 / 30%);
}
.ah-tag-walkin {
  background: var(--ah-red-soft);
  color: var(--ah-red);
  border-color: oklch(0.637 0.237 25 / 30%);
}
.ah-tag-coverup {
  background: oklch(0.25 0.06 60 / 80%);
  color: var(--ah-warn);
  border-color: oklch(0.79 0.14 78 / 30%);
}
.ah-tag-fineline {
  background: oklch(0.22 0.04 290 / 80%);
  color: oklch(0.78 0.10 290);
  border-color: oklch(0.78 0.10 290 / 30%);
}
.ah-tag-default {
  background: var(--ah-bg-2);
  color: var(--ah-fg-3);
  border-color: var(--ah-border-2);
}

/* ─── Stage tags (inline status with diamond glyph) ─────────────────── */
.ah-stage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ah-font);
  font-size: 12px;
  font-weight: 500;
}
.ah-stage::before {
  content: '';
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  flex-shrink: 0;
  border-radius: 1px;
}
.ah-stage-new::before { background: var(--ah-info); }
.ah-stage-consult::before { background: oklch(0.72 0.14 285); }
.ah-stage-quoted::before { background: var(--ah-warn); }
.ah-stage-booked::before { background: var(--ah-success); }
.ah-stage-inchair::before {
  background: var(--ah-red);
  animation: ah-pulse-diamond 1.2s ease-in-out infinite;
}
.ah-stage-healing::before { background: oklch(0.68 0.14 190); }
.ah-stage-closed::before { background: var(--ah-fg-4); }

@keyframes ah-pulse-diamond {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Image placeholder ──────────────────────────────────────────────── */
.ah-img-placeholder {
  background: repeating-linear-gradient(
    135deg,
    oklch(0.22 0.006 30) 0 8px,
    oklch(0.19 0.006 30) 8px 16px
  );
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.ah-img-placeholder::after {
  content: attr(data-label);
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: oklch(0 0 0 / 40%);
  font-family: var(--ah-mono);
  font-size: 10px;
  color: var(--ah-fg-3);
  letter-spacing: 0.04em;
}
.ah-img-placeholder-sm { width: 48px; height: 48px; border-radius: var(--ah-radius-sm); }
.ah-img-placeholder-sm::after { display: none; }

/* ─── Card ───────────────────────────────────────────────────────────── */
.ah-card {
  background: var(--ah-card);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius-lg);
  padding: var(--ah-space-5);
}
.ah-card-2 {
  background: var(--ah-card-2);
  border: 1px solid var(--ah-border-2);
  border-radius: var(--ah-radius-lg);
  padding: var(--ah-space-5);
}
.ah-card-hover:hover {
  border-color: var(--ah-border-3);
  background: oklch(from var(--ah-card) l c h / 1);
}

/* ─── Divider ────────────────────────────────────────────────────────── */
.ah-divider {
  border: 0;
  border-top: 1px solid var(--ah-border);
  margin: 0;
}
.ah-divider-2 {
  border: 0;
  border-top: 1px solid var(--ah-border-2);
  margin: 0;
}

/* ─── Form elements ──────────────────────────────────────────────────── */
.ah-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--ah-bg-2);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  color: var(--ah-fg);
  font-family: var(--ah-font);
  font-size: 13px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  outline: none;
}
.ah-input::placeholder { color: var(--ah-fg-4); }
.ah-input:focus {
  border-color: var(--ah-red);
  box-shadow: 0 0 0 3px var(--ah-red-soft-2);
}
.ah-input-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.ah-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--ah-bg-2);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  color: var(--ah-fg);
  font-family: var(--ah-font);
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  line-height: 1.55;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ah-textarea::placeholder { color: var(--ah-fg-4); }
.ah-textarea:focus {
  border-color: var(--ah-red);
  box-shadow: 0 0 0 3px var(--ah-red-soft-2);
}
.ah-label-tag {
  display: block;
  font-family: var(--ah-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ah-fg-4);
  margin-bottom: 5px;
}
.ah-select {
  width: 100%;
  height: 38px;
  padding: 0 30px 0 12px;
  background: var(--ah-bg-2);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  color: var(--ah-fg);
  font-family: var(--ah-font);
  font-size: 13px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b5b0ab' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */
.ah-sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  background: var(--ah-bg-2);
  border-right: 1px solid var(--ah-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ah-sidebar-collapsed {
  width: 60px;
  min-width: 60px;
}

.ah-sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
  padding: var(--ah-space-4) var(--ah-space-4) 0;
  height: 56px;
}
.ah-sidebar-brand-icon {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
}
.ah-sidebar-brand-name {
  font-family: var(--ah-font);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ah-fg);
  white-space: nowrap;
  overflow: hidden;
}
.ah-sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--ah-space-4) var(--ah-space-3);
  overflow-y: auto;
  gap: 2px;
}
.ah-sidebar-section-label {
  font-family: var(--ah-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ah-fg-4);
  padding: var(--ah-space-5) var(--ah-space-3) var(--ah-space-2);
}
.ah-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
  padding: 7px var(--ah-space-3);
  border-radius: var(--ah-radius);
  color: var(--ah-fg-3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease, color 0.1s ease;
  position: relative;
  text-decoration: none;
}
.ah-sidebar-item:hover {
  background: oklch(1 0 0 / 5%);
  color: var(--ah-fg-2);
}
.ah-sidebar-item-active {
  background: var(--ah-red-soft-2);
  color: var(--ah-red);
}
.ah-sidebar-item-active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--ah-red);
  border-radius: 0 2px 2px 0;
}
.ah-sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ah-fg-4);
}
.ah-sidebar-item-active svg {
  color: var(--ah-red);
}
.ah-sidebar-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ah-sidebar-badge {
  margin-left: auto;
  background: var(--ah-red-soft);
  color: var(--ah-red);
  font-family: var(--ah-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  min-width: 18px;
  height: 16px;
  border-radius: var(--ah-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User pod */
.ah-sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
  padding: var(--ah-space-3) var(--ah-space-3);
  border-top: 1px solid var(--ah-border);
  margin: 0 var(--ah-space-3);
  cursor: pointer;
  border-radius: var(--ah-radius) var(--ah-radius) 0 0;
  transition: background 0.1s ease;
}
.ah-sidebar-user:hover {
  background: oklch(1 0 0 / 4%);
}
.ah-sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.ah-sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ah-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ah-sidebar-user-handle {
  font-family: var(--ah-mono);
  font-size: 10px;
  color: var(--ah-fg-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Floating card variant */
.ah-sidebar-floating {
  position: fixed;
  left: var(--ah-space-4);
  top: var(--ah-space-4);
  bottom: var(--ah-space-4);
  width: 240px;
  background: var(--ah-card);
  border: 1px solid var(--ah-border-2);
  border-radius: var(--ah-radius-xl);
  box-shadow: 0 8px 32px oklch(0 0 0 / 40%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Topbar ─────────────────────────────────────────────────────────── */
.ah-topbar {
  height: 56px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: var(--ah-space-4);
  padding: 0 var(--ah-space-5);
  background: oklch(0.155 0.008 30 / 88%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ah-border);
}
.ah-topbar-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ah-fg-3);
}
.ah-topbar-breadcrumbs a {
  color: var(--ah-fg-3);
  transition: color 0.1s ease;
}
.ah-topbar-breadcrumbs a:hover { color: var(--ah-fg); }
.ah-topbar-breadcrumbs-sep {
  color: var(--ah-fg-4);
  font-family: var(--ah-mono);
  font-size: 11px;
}
.ah-topbar-search {
  flex: 1;
  max-width: 320px;
}
.ah-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--ah-space-2);
  margin-left: auto;
}
.ah-topbar-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--ah-radius);
  border: none;
  background: transparent;
  color: var(--ah-fg-3);
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}
.ah-topbar-icon-btn:hover {
  background: oklch(1 0 0 / 6%);
  color: var(--ah-fg);
}
.ah-topbar-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ─── AppShell ───────────────────────────────────────────────────────── */
.ah-appshell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.ah-appshell-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.ah-appshell-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--ah-space-6) var(--ah-space-8);
}

/* ─── PageHead ───────────────────────────────────────────────────────── */
.ah-pagehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ah-space-6);
  margin-bottom: var(--ah-space-6);
}
.ah-pagehead-body {
  flex: 1;
  min-width: 0;
}
.ah-pagehead-eyebrow {
  font-family: var(--ah-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ah-fg-4);
  margin-bottom: 4px;
}
.ah-pagehead-title {
  font-family: var(--ah-font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ah-fg);
  margin: 0;
}
.ah-pagehead-sub {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ah-fg-3);
  line-height: 1.5;
  max-width: 56ch;
}
.ah-pagehead-actions {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
  flex-shrink: 0;
}

/* ─── CommitBar ──────────────────────────────────────────────────────── */
.ah-commitbar {
  min-height: 56px;
  padding: 0 var(--ah-space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ah-space-4);
  background: oklch(0.155 0.008 30 / 88%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--ah-border);
  flex-shrink: 0;
}
.ah-commitbar-left {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
}
.ah-commitbar-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--ah-radius-full);
  flex-shrink: 0;
}
.ah-commitbar-dot-saved { background: var(--ah-success); }
.ah-commitbar-dot-edited { background: var(--ah-warn); }
.ah-commitbar-dot-error { background: var(--ah-red); }
.ah-commitbar-status {
  font-size: 12px;
  color: var(--ah-fg-3);
}
.ah-commitbar-timestamp {
  font-family: var(--ah-mono);
  font-size: 11px;
  color: var(--ah-fg-4);
}
.ah-commitbar-actions {
  display: flex;
  align-items: center;
  gap: var(--ah-space-2);
}

/* ─── Data table ─────────────────────────────────────────────────────── */
.ah-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ah-table th {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--ah-border);
  font-family: var(--ah-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-fg-4);
}
.ah-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ah-border);
  color: var(--ah-fg-2);
}
.ah-table tbody tr:hover {
  background: oklch(1 0 0 / 3%);
}
.ah-table .ah-mono-cell {
  font-family: var(--ah-mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
.ah-appshell-content::-webkit-scrollbar,
.ah-sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.ah-appshell-content::-webkit-scrollbar-track,
.ah-sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.ah-appshell-content::-webkit-scrollbar-thumb,
.ah-sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--ah-border-2);
  border-radius: 2px;
}
.ah-appshell-content::-webkit-scrollbar-thumb:hover,
.ah-sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--ah-border-3);
}

/* ─── ViewSwitcher component ──────────────────────────────────────────── */
.ah-view-switcher {
  display: flex;
  background: var(--ah-card);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius);
  overflow: hidden;
  flex-shrink: 0;
}
.ah-view-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: none;
  background: transparent;
  color: var(--ah-fg-3);
  font-family: var(--ah-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  border-right: 1px solid var(--ah-border);
  white-space: nowrap;
}
.ah-view-btn:last-child { border-right: none; }
.ah-view-btn:hover { color: var(--ah-fg-2); background: oklch(1 0 0 / 4%); }
.ah-view-btn-active {
  background: var(--ah-red-soft);
  color: var(--ah-red);
}
.ah-view-btn-active:hover { background: var(--ah-red-soft); }
.ah-view-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── EmptyState component ───────────────────────────────────────────── */
.ah-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--ah-space-10) var(--ah-space-6);
  gap: var(--ah-space-3);
  flex: 1;
}
.ah-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--ah-radius-full);
  background: var(--ah-card-2);
  border: 1px solid var(--ah-border);
  display: grid;
  place-items: center;
  color: var(--ah-fg-4);
  margin-bottom: var(--ah-space-1);
}
.ah-empty-icon svg { width: 20px; height: 20px; }
.ah-empty-title {
  font-size: 14px;
  color: var(--ah-fg-3);
  line-height: 1.5;
  max-width: 32ch;
  margin: 0;
}
.ah-empty-title strong { font-weight: 600; color: var(--ah-fg-2); }
.ah-empty-desc {
  font-size: 13px;
  color: var(--ah-fg-4);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0;
}
.ah-empty-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--ah-space-2);
  padding: 6px 14px;
  border-radius: var(--ah-radius);
  border: 1px solid var(--ah-border-2);
  font-size: 12px;
  font-weight: 500;
  color: var(--ah-fg-3);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.ah-empty-action:hover {
  border-color: var(--ah-border-3);
  color: var(--ah-fg-2);
}
.ah-empty-action svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── KPI item component ─────────────────────────────────────────────── */
.ah-kpi-item {
  background: var(--ah-card);
  border: 1px solid var(--ah-border);
  border-radius: var(--ah-radius-lg);
  padding: var(--ah-space-4) var(--ah-space-5);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ah-kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ah-fg);
  font-variant-numeric: tabular-nums;
}
.ah-kpi-label {
  font-family: var(--ah-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ah-fg-4);
}

/* ─── KpiStrip ─────────────────────────────────────────────────────────── */
.ah-kpi-strip {
  display: grid;
  grid-template-columns: repeat(var(--kpi-columns, 4), 1fr);
  gap: var(--ah-space-4);
}

/* ─── LivePill ──────────────────────────────────────────────────────────── */
.ah-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ah-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ah-red);
  user-select: none;
}
.ah-live-pill-sm { font-size: 9px; gap: 4px; }
.ah-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ah-red);
  animation: ah-live-pulse 1.2s ease-in-out infinite;
}
.ah-live-pill-sm .ah-live-dot { width: 5px; height: 5px; }

@keyframes ah-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── SectionHeader ─────────────────────────────────────────────────────── */
.ah-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ah-space-4);
  margin-bottom: var(--ah-space-4);
}
.ah-section-header-left {
  display: flex;
  align-items: center;
  gap: var(--ah-space-3);
  min-width: 0;
}
.ah-section-header-title {
  font-family: var(--ah-font);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ah-fg);
  margin: 0;
  white-space: nowrap;
}
.ah-section-header-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--ah-radius-full);
  background: var(--ah-muted);
  color: var(--ah-fg-3);
  font-family: var(--ah-mono);
  font-size: 10px;
  font-weight: 600;
}

/* ─── DepositBar ────────────────────────────────────────────────────────── */
.ah-deposit-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ah-deposit-bar-track {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  background: var(--ah-border);
  overflow: hidden;
}
.ah-deposit-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.ah-deposit-bar-fill-none { width: 0 !important; }
.ah-deposit-bar-fill-partial { background: var(--ah-warn); }
.ah-deposit-bar-fill-full { background: var(--ah-success); }
.ah-deposit-bar-label {
  font-family: var(--ah-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ah-fg-4);
  min-width: 3ch;
}

/* ─── ImageTile ─────────────────────────────────────────────────────────── */
.ah-img-tile {
  width: 48px;
  height: 48px;
  border-radius: var(--ah-radius-sm);
  background: repeating-linear-gradient(
    135deg,
    oklch(0.22 0.006 30) 0 8px,
    oklch(0.19 0.006 30) 8px 16px
  );
  border: 1px solid var(--ah-border);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.ah-img-tile-sm { width: 20px; height: 20px; border-radius: 3px; }
.ah-img-tile + .ah-img-tile { margin-left: -6px; }

/* ─── StageBadge sm variant ─────────────────────────────────────────────── */
.ah-stage-sm { font-size: 10px; gap: 4px; }
.ah-stage-sm::before { width: 5px; height: 5px; }

/* ─── Utility ────────────────────────────────────────────────────────── */
.ah-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ah-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
