/* ===========================================================================
   Cherokee customer dashboard — Hub theme.
   Ported from /opt/dashboards\hub\ — matte cards, accent border,
   status pill, drag-to-reorder. Scoped via .hub-grid + .tile so it doesn't
   collide with the rest of base.css.
   =========================================================================== */

/* ===== Ambient background wash (matches hub) ===== */
.ambient-wash {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  background:
    radial-gradient(ellipse 800px 600px at 15% 10%, rgba(0, 212, 255, 0.06), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 90%, rgba(255, 61, 166, 0.05), transparent 60%);
}

.hub-wrap {
  padding: 32px 32px 64px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

/* ===== Hero (matches hub) ===== */
.hub-hero {
  margin-bottom: 48px;
  padding: 28px 0 36px;
}
.hub-hero .hub-eyebrow {
  margin-bottom: 16px;
}
.hub-hero .hub-h1 {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 12px 0;
}
.hub-hero .hub-h1 .gradc {
  font-style: italic;
}
.hub-hero .hub-sub {
  font-size: 16px;
  letter-spacing: 0.02em;
  margin: 0;
  max-width: 560px;
  line-height: 1.5;
}

/* ===== Hero stats (4-column gradient cards) ===== */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 56px;
}
.stat-card {
  background: #0c0c14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  transition: border-color 0.25s, background 0.25s;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, var(--stat-accent, #00d4ff), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: #13131e;
}
.stat-card:hover::before { opacity: 1; }
.stat-card .lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5d68;
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
}
.stat-card .big {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.stat-card .big .gradc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
  background: linear-gradient(120deg, #00d4ff, #ff3da6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .big .dim {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: #5a5d68;
  font-weight: 500;
}
.stat-card .delta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.02em;
}

/* ===== Big section headings (matches hub h2) ===== */
.hub-section h2.hub-section-h2--big {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 28px 0;
  color: #f4f4f6;
  line-height: 1.2;
  text-transform: none;
  display: block;
  font-family: inherit;
}

/* ===== Briefs panels (3 matte panels) ===== */
.briefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.brief-panel {
  background: #0c0c14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  transition: border-color 0.2s;
}
.brief-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}
.brief-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.brief-panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00d4ff;
}
.brief-panel-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.02em;
}
.brief-panel-body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #9da0ac;
  line-height: 1.55;
  flex: 1;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.brief-panel.empty .brief-panel-body {
  color: #5a5d68;
  font-style: italic;
}

/* Hide-button on each brief panel */
.brief-hide-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #5a5d68;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.brief-hide-btn:hover {
  color: #ff3da6;
  border-color: rgba(255, 61, 166, 0.35);
  background: rgba(255, 61, 166, 0.08);
}

/* Hidden-briefs row above the grid */
.brief-hidden-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -8px 0 14px;
  padding: 8px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}
.brief-hidden-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5d68;
  margin-right: 4px;
}
.brief-show-btn {
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.30);
  color: #00d4ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.brief-show-btn:hover {
  background: rgba(0, 212, 255, 0.10);
  border-color: rgba(0, 212, 255, 0.60);
}
.brief-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
  font-size: 11px;
  align-items: baseline;
}
.brief-row:last-child { border-bottom: none; }
.brief-row .t { color: #5a5d68; font-feature-settings: "tnum"; }
.brief-row .v { color: #f4f4f6; }

/* ===== Watchdog panel ===== */
.watchdog {
  background: #0c0c14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  transition: border-color 0.25s;
  margin-bottom: 24px;
}
.watchdog:hover { border-color: rgba(255, 255, 255, 0.12); }
.wd-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.wd-head:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.wd-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00d4ff;
  margin-right: auto;
}
.wd-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
}
.wd-pulse.dead { background: #ff3333; }
.wd-pulse.warn { background: #ffaa00; }
.wd-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wd-stats .pill {
  padding: 5px 10px;
  font-size: 9px;
}

/* Per-bot pulse list inside the customer watchdog panel */
.wd-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.wd-row-bot {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  border-left: 2px solid #5a5d68;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s, border-color 0.15s;
}
.wd-row-bot:hover { background: rgba(0, 212, 255, 0.04); }
.wd-row-bot.healthy { border-left-color: #4ade80; }
.wd-row-bot.errored,
.wd-row-bot.down    { border-left-color: #ff3333; }
.wd-row-bot.missed  { border-left-color: #ffaa00; }
.wd-row-bot.idle,
.wd-row-bot.pending { border-left-color: #5a5d68; }

.wd-bot-name {
  font-size: 13px;
  color: #f4f4f6;
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wd-bot-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.02em;
}
.wd-bot-state {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9da0ac;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 4, 6, 0.5);
  white-space: nowrap;
}
.wd-row-bot.healthy .wd-bot-state { color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
.wd-row-bot.errored .wd-bot-state,
.wd-row-bot.down    .wd-bot-state { color: #ff3333; border-color: rgba(255, 51, 51, 0.35); }
.wd-row-bot.missed  .wd-bot-state { color: #ffaa00; border-color: rgba(255, 170, 0, 0.35); }

/* BIG DOG · ACTIVE badge — gradient pill, visible only on bigdog tier */
.pill.pill-bigdog {
  background: linear-gradient(120deg, rgba(0,212,255,0.18), rgba(255,61,166,0.18));
  border: 1px solid rgba(0, 212, 255, 0.55);
  color: #00d4ff;
  font-weight: 800;
  letter-spacing: 0.16em;
}

/* Big Dog upsell card — bottom of standard-tier watchdog panel */
.bigdog-upsell {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px dashed rgba(0, 212, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(255, 61, 166, 0.04));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bigdog-upsell-title {
  font-size: 14px;
  font-weight: 700;
  color: #f4f4f6;
  margin-bottom: 4px;
}
.bigdog-upsell-title .gradc {
  background: linear-gradient(120deg, #00d4ff, #ff3da6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.bigdog-upsell-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #9da0ac;
  line-height: 1.55;
  max-width: 540px;
}
.bigdog-upsell-cta {
  background: rgba(0, 212, 255, 0.12);
  border: 1px solid rgba(0, 212, 255, 0.45);
  color: #00d4ff;
  padding: 10px 18px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s;
}
.bigdog-upsell-cta:hover {
  background: rgba(0, 212, 255, 0.20);
  border-color: rgba(0, 212, 255, 0.70);
}

/* Postmortem cards — "self-healed" recovery feed under the watchdog panel.
   Matte aesthetic, sharp 6-8px corners, no glass/shine. Cyan border-left
   accent for unseen (recent) recoveries; muted for older ones. */
.postmortem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.postmortem-card {
  background: #0b0b10;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 2px solid rgba(255, 255, 255, 0.10);
  border-radius: 6px;
  padding: 14px 16px;
  transition: border-color 0.15s, background 0.15s;
}
.postmortem-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  border-left-color: rgba(0, 212, 255, 0.55);
  background: #0d0d13;
}
.postmortem-card--recent {
  border-left-color: #00d4ff;
}
.postmortem-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.postmortem-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.postmortem-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.55);
  flex-shrink: 0;
}
.postmortem-bot {
  font-size: 13px;
  font-weight: 600;
  color: #f4f4f6;
  letter-spacing: 0.01em;
}
.postmortem-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.postmortem-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
}
.postmortem-badge--bigdog {
  color: #00d4ff;
  border-color: rgba(0, 212, 255, 0.38);
  background: rgba(0, 212, 255, 0.06);
}
.postmortem-since {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #6c6f7a;
  text-transform: uppercase;
}
.postmortem-summary {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: #b8bac4;
}

.hub-header {
  margin-bottom: 32px;
}
.hub-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00d4ff;
  margin-bottom: 12px;
  font-weight: 600;
}
.hub-eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: #00d4ff;
}
.hub-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00d4ff;
  flex-shrink: 0;
}
.hub-h1 {
  margin: 0 0 6px 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f4f6;
  line-height: 1.15;
}
.hub-h1 .gradc {
  background: linear-gradient(120deg, #00d4ff, #ff3da6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.hub-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #9da0ac;
  letter-spacing: 0.02em;
  margin: 0;
  max-width: 560px;
  line-height: 1.5;
}

/* Section divider */
.hub-section {
  margin-bottom: 40px;
}
.hub-section-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #00d4ff;
  margin-bottom: 8px;
  font-weight: 600;
}
.hub-section-label.muted {
  color: #9da0ac;
}
.hub-section-h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4f4f6;
  margin: 0 0 18px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.hub-section-h2 .count {
  font-size: 11px;
  color: #5a5d68;
  font-weight: 500;
}

/* ===== Grid ===== */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ===== Tile ===== */
.hub-grid .tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  background: #0c0c14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 144px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.hub-grid .tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(135deg, transparent 30%, var(--tile-accent, #00d4ff), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.hub-grid .tile:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: #13131e;
  transform: translateY(-2px);
}
.hub-grid .tile:hover::before {
  opacity: 1;
}
.hub-grid .tile.no-link {
  cursor: default;
}
.hub-grid .tile.no-link:hover {
  transform: none;
  background: #0c0c14;
  border-color: rgba(255, 255, 255, 0.06);
}

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 2;
}
.tile-id {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.tile-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tile-accent, #00d4ff);
  flex-shrink: 0;
  position: relative;
}
.tile-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4f4f6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.03em;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-body {
  flex: 1;
  position: relative;
  z-index: 2;
}
.tile-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
  color: var(--tile-accent, #00d4ff);
}
.tile-stat.dim {
  color: #5a5d68;
  font-weight: 500;
}
.tile-substat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #9da0ac;
  margin-top: 4px;
  letter-spacing: 0.02em;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #9da0ac;
  position: relative;
  z-index: 2;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tile-arrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #5a5d68;
  transition: color 0.2s, transform 0.2s;
  white-space: nowrap;
}
.hub-grid .tile:hover .tile-arrow {
  color: var(--tile-accent, #00d4ff);
  transform: translateX(3px);
}

/* ===== Status pill ===== */
.tile .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  padding: 4px 9px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 4, 6, 0.6);
  color: #9da0ac;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.tile .pill .blob {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.tile .pill.ok    { color: #4ade80; border-color: rgba(74, 222, 128, 0.35); }
.tile .pill.err   { color: #ff3333; border-color: rgba(255, 51, 51, 0.35); }
.tile .pill.warn  { color: #ffaa00; border-color: rgba(255, 170, 0, 0.35); }
.tile .pill.live .blob {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: blob-pulse 2s ease-in-out infinite;
}
@keyframes blob-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.5); opacity: 0.55; }
}

/* ===== Toggle button for available bots ===== */
.tile-toggle-form {
  margin: 0;
  display: contents;
}
.tile-enable-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.10);
  border: 1px solid rgba(0, 212, 255, 0.40);
  color: #00d4ff;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.tile-enable-btn:hover {
  background: rgba(0, 212, 255, 0.18);
  border-color: rgba(0, 212, 255, 0.70);
}

/* ===== Drag-to-reorder ===== */
.hub-grid .tile.dragging {
  opacity: 0.85;
  transform: scale(1.02) translate(var(--x, 0), var(--y, 0));
  box-shadow: 0 0 0 2px var(--tile-accent, #00d4ff);
  z-index: 50;
  cursor: grabbing;
  border-color: var(--tile-accent, #00d4ff);
}
.hub-grid.reorder-mode {
  cursor: grabbing;
}
.hub-grid.reorder-mode .tile:not(.dragging) {
  transition: transform 0.18s;
}
.reorder-hint {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #13131e;
  border: 1px solid #00d4ff;
  border-radius: 6px;
  padding: 10px 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #00d4ff;
  z-index: 200;
  pointer-events: none;
}
.reorder-hint.show {
  display: block;
}
.reorder-reset-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5d68;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-top: 14px;
}
.reorder-reset-btn:hover {
  color: #f4f4f6;
  border-color: rgba(255, 255, 255, 0.18);
}

/* ===== Section rearrange (edit mode + drag) ===== */
.rearrange-toggle {
  position: absolute;
  top: 18px;
  right: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5d68;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
  z-index: 5;
}
.rearrange-toggle:hover {
  color: #00d4ff;
  border-color: rgba(0, 212, 255, 0.45);
}
.rearrange-toggle.active {
  color: #00d4ff;
  border-color: #00d4ff;
  background: rgba(0, 212, 255, 0.08);
}
.hub-hero { position: relative; }

/* When in edit mode, every draggable section gets a dashed cyan border and
   grab cursor. The hero stays untouched (no data-section-id). */
.hub-wrap.sections-edit-mode section[data-section-id] {
  outline: 1px dashed rgba(0, 212, 255, 0.45);
  outline-offset: 6px;
  border-radius: 6px;
  cursor: grab;
  position: relative;
  transition: outline-color 0.18s;
}
.hub-wrap.sections-edit-mode section[data-section-id]:hover {
  outline-color: #00d4ff;
}
/* Small drag handle in the corner to telegraph "this is draggable" */
.hub-wrap.sections-edit-mode section[data-section-id]::before {
  content: "⋮⋮";
  position: absolute;
  top: -2px;
  right: -2px;
  background: #13131e;
  border: 1px solid rgba(0, 212, 255, 0.45);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0;
  color: #00d4ff;
  z-index: 4;
  pointer-events: none;
}

/* Active drag — slight scale + cyan glow */
.hub-wrap section.section-dragging {
  opacity: 0.92;
  transform: scale(1.01) translate(var(--sx, 0), var(--sy, 0));
  box-shadow: 0 0 0 2px #00d4ff, 0 8px 30px rgba(0, 212, 255, 0.18);
  z-index: 50;
  cursor: grabbing !important;
  outline-color: #00d4ff !important;
}
.hub-wrap.section-reorder-mode {
  cursor: grabbing;
}
.hub-wrap.section-reorder-mode section[data-section-id]:not(.section-dragging) {
  transition: transform 0.18s;
}

/* ===== Empty state ===== */
.hub-empty {
  text-align: center;
  padding: 60px 20px;
  color: #5a5d68;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
}
.hub-empty a {
  color: #00d4ff;
  text-decoration: none;
}
.hub-empty a:hover {
  text-decoration: underline;
}

/* ===== Bot workspace page ===== */
.bot-wrap {
  padding: 32px 24px 64px;
  max-width: 1100px;
  margin: 0 auto;
}
.bot-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #5a5d68;
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.18s;
}
.bot-back:hover { color: #00d4ff; }
.bot-header {
  border-top: 2px solid var(--bot-accent, #00d4ff);
  background: #0c0c14;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 0 10px 10px;
  padding: 22px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.bot-header-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.bot-header-slug {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.bot-header-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f4f4f6;
  margin: 0;
}
.bot-header-summary {
  color: #9da0ac;
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0 0;
  max-width: 640px;
}
.bot-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bot-panels {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
@media (max-width: 860px) {
  .bot-panels { grid-template-columns: 1fr; }
}
.bot-panel {
  background: #0c0c14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 20px 22px;
}
.bot-panel-h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00d4ff;
  margin: 0 0 14px 0;
}
.bot-runs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bot-run-row {
  display: grid;
  grid-template-columns: 110px 70px 1fr;
  gap: 10px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  border-radius: 4px;
  border-left: 2px solid #5a5d68;
  background: transparent;
  color: #9da0ac;
  align-items: center;
}
.bot-run-row.ok    { border-left-color: #4ade80; }
.bot-run-row.error { border-left-color: #ff3333; }
.bot-run-time { color: #5a5d68; font-feature-settings: "tnum"; }
.bot-run-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
}
.bot-run-row.ok    .bot-run-status { color: #4ade80; }
.bot-run-row.error .bot-run-status { color: #ff3333; }
.bot-runs-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #5a5d68;
  text-align: center;
  padding: 18px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
/* Sparkline (14-day runs histogram, no JS, plain SVG) */
.bot-sparkline-wrap {
  margin: 0 0 14px 0;
  padding: 12px 14px 10px;
  background: #07070d;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}
.bot-sparkline-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.bot-sparkline {
  display: block;
  max-width: 100%;
}
.bot-sparkline-base {
  fill: rgba(255, 255, 255, 0.04);
}
.bot-sparkline-bar {
  fill: #00d4ff;
  opacity: 0.85;
}
.bot-sparkline-bar-err {
  fill: #ff3da6;
  opacity: 0.85;
}
.bot-sparkline-cell:hover .bot-sparkline-bar {
  opacity: 1;
}

/* Recent outputs (last 5 agent_runs cards) */
.bot-outputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-output-row {
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  border-radius: 4px;
  border-left: 2px solid #5a5d68;
  background: #07070d;
  color: #9da0ac;
}
.bot-output-row.ok    { border-left-color: #4ade80; }
.bot-output-row.error { border-left-color: #ff3333; }
.bot-output-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.bot-output-time { color: #5a5d68; font-feature-settings: "tnum"; }
.bot-output-status {
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 700;
  color: #5a5d68;
}
.bot-output-row.ok    .bot-output-status { color: #4ade80; }
.bot-output-row.error .bot-output-status { color: #ff3333; }
.bot-output-stats {
  color: #9da0ac;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-word;
}
.bot-output-error {
  color: #ff6677;
  font-size: 11px;
  margin-top: 4px;
  word-break: break-word;
}

.bot-config-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.bot-config-row:last-child { border-bottom: none; }
.bot-config-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #5a5d68;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bot-config-val {
  color: #9da0ac;
  font-family: 'JetBrains Mono', monospace;
  word-break: break-word;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .hub-wrap { padding: 22px 16px 40px; }
  .hub-h1 { font-size: 24px; }
  .hub-grid { grid-template-columns: 1fr; gap: 12px; }
  .hub-grid .tile { min-height: 124px; padding: 16px 18px; }
  .bot-wrap { padding: 22px 16px 40px; }
  .bot-header { padding: 18px 18px; }
  .bot-header-name { font-size: 22px; }

  /* Problem 1: hero-stats — force 2-col so cards pair evenly instead of auto-fit orphan row */
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 36px; }
  .stat-card { padding: 14px 14px; }
  .stat-card .big .gradc { font-size: 22px; }
  .stat-card .big .dim { font-size: 14px; }

  /* Problem 2: brief-panel-head — let meta+button wrapper drop below title when tight */
  .brief-panel-head { flex-wrap: wrap; row-gap: 6px; }
  .brief-panel-title { flex: 1 1 auto; min-width: 0; }
  .brief-panel-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

  /* Problem 3: wd-row-bot — stack name on top, meta + state on the bottom row */
  .wd-row-bot {
    grid-template-columns: 16px 1fr auto;
    grid-template-areas:
      "pulse name name"
      ".     meta state";
    row-gap: 4px;
    padding: 10px 12px;
  }
  .wd-pulse { grid-area: pulse; align-self: center; }
  .wd-bot-name { grid-area: name; white-space: normal; }
  .wd-bot-meta { grid-area: meta; }
  .wd-bot-state { grid-area: state; justify-self: end; }

  /* Problem 4: bigdog-upsell — stack so CTA goes full-width below copy */
  .bigdog-upsell { flex-direction: column; align-items: stretch; gap: 12px; }
  .bigdog-upsell-cta { text-align: center; }

  /* Problem 5: wd-head — stack title above pills so .wd-stats doesn't squeeze */
  .wd-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .wd-title { margin-right: 0; }
  .wd-stats { width: 100%; }

  /* Problem 6: tile-foot lower min-height */
  .hub-grid .tile { min-height: 124px; }

  /* Problem 7: bot-header-actions — wrap + give breathing room at narrow widths */
  .bot-header-actions { flex-wrap: wrap; width: 100%; gap: 8px; }

  /* Briefs grid stacks (auto-fit already does at 280px min but make gap snug) */
  .briefs-grid { gap: 12px; }
}

@media (max-width: 420px) {
  /* Tightest iPhone widths — switch to single column everywhere */
  .hub-wrap { padding-left: 16px; padding-right: 16px; }
  .hero-stats { grid-template-columns: 1fr; gap: 12px; }
  .briefs-grid { grid-template-columns: 1fr; gap: 12px; }
  .tile-name { font-size: 11px; }

  /* Hub h1 trims slightly more on truly narrow screens */
  .hub-h1 { font-size: 22px; }

  /* Bot header name + padding shrink at 360px-ish */
  .bot-header { padding: 16px 14px; }
  .bot-header-name { font-size: 20px; }

  /* Brief panel padding tightens; body font already small */
  .brief-panel { padding: 14px 14px; min-height: 160px; }

  /* Watchdog panel side padding */
  .watchdog { padding: 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-grid .tile, .hub-grid .tile::before, .tile-arrow,
  .tile .pill.live .blob {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* ===== On-call status badge (hero) ===== */
.on-call-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 3px 9px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(12, 12, 20, 0.6);
  color: #5a5d68;
  vertical-align: middle;
  transition: color 180ms ease, border-color 180ms ease;
}
.on-call-badge .on-call-pulse {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #5a5d68;
  box-shadow: 0 0 0 0 rgba(90, 93, 104, 0);
}
.on-call-badge[data-state="online"] {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}
.on-call-badge[data-state="online"] .on-call-pulse {
  background: #4ade80;
  animation: onCallPulse 1.8s ease-out infinite;
}
.on-call-badge[data-state="active"] {
  color: #00d4ff;
  border-color: rgba(0, 212, 255, 0.35);
}
.on-call-badge[data-state="active"] .on-call-pulse {
  background: #00d4ff;
}
.on-call-badge[data-state="away"] {
  color: #5a5d68;
  border-color: rgba(255, 255, 255, 0.08);
}
@keyframes onCallPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .on-call-badge[data-state="online"] .on-call-pulse { animation: none; }
}

/* =====================================================================
   COMPACT MODE — customer tile-grid collapsed into a single-column list.
   Toggle persisted server-side (data/ui_prefs/<client>.json) and applied
   as .hub-grid.compact. Customers with 1-2 bots can opt into this so the
   dashboard doesn't feel empty. Admin layout is unaffected.
   Added 2026-05-17.
   ===================================================================== */
.compact-toggle {
  display: inline-block;
  margin: 0 0 14px 0;
  background: transparent;
  border: none;
  padding: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #00d4ff;
  cursor: pointer;
  text-transform: lowercase;
  transition: color 0.15s, opacity 0.15s;
  opacity: 0.85;
}
.compact-toggle:hover {
  color: #6ee7ff;
  opacity: 1;
}
.compact-toggle:focus-visible {
  outline: 1px solid rgba(0, 212, 255, 0.55);
  outline-offset: 2px;
}

.hub-grid.compact {
  grid-template-columns: 1fr;
  gap: 6px;
}
.hub-grid.compact .tile {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: auto;
  padding: 12px 16px;
  border-left: 2px solid var(--tile-accent, #00d4ff);
  border-radius: 6px;
}
/* Kill the diagonal accent shimmer on row layout — the left border is the accent. */
.hub-grid.compact .tile::before {
  display: none;
}
.hub-grid.compact .tile:hover {
  transform: none;
  background: #13131e;
}
.hub-grid.compact .tile-head {
  flex: 1;
  min-width: 0;
  gap: 12px;
}
.hub-grid.compact .tile-body,
.hub-grid.compact .tile-foot {
  display: none;
}
.hub-grid.compact .tile-path {
  margin-top: 0;
}
/* Pull the status pill out of .tile-head's flow so it sits on the far right. */
.hub-grid.compact .tile-head .pill {
  flex-shrink: 0;
}

/* =========================================================================
   Events inbox (2026-05-17). Persistent customer-facing notifications shown
   at the top of the dashboard. Distinct from Flask flash() — flash is
   transient, this is actionable + survives reloads. See dashboard.html
   section_events() macro and database.client_events table.
   Severity vocabulary (kind | hex):
     info    #00d4ff  (cyan)
     success #4ade80  (green)
     warn    #ffaa00  (amber)
     error   #ff3333  (red)
   Solid-opaque per "no shine/glass on dashboard panels" rule.
   ========================================================================= */
.events-panel {
  margin: 24px 0 32px;
}
.events-panel .events-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.events-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.events-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 4px;
  background: #ff3333;
  color: #fff;
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.events-seeall {
  color: #00d4ff;
  text-decoration: none;
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: .05em;
}
.events-seeall:hover {
  color: #ffffff;
}
.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.event-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  background: #13131e;            /* solid-opaque, matches matte aesthetic */
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid #00d4ff; /* default = info cyan; override per severity */
  border-radius: 6px;
  padding: 12px 14px;
  overflow: hidden;
}
.event-card--unread {
  background: #181826;
  border-color: rgba(255, 255, 255, 0.10);
}
.event-card--info    { border-left-color: #00d4ff; }
.event-card--success { border-left-color: #4ade80; }
.event-card--warn    { border-left-color: #ffaa00; }
.event-card--error   { border-left-color: #ff3333; }

.event-card-main {
  flex: 1;
  min-width: 0;
}
.event-card-title {
  color: #f4f4f6;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 3px;
}
.event-card-body {
  color: #b6b8c0;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.event-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 10.5px/1 'JetBrains Mono', monospace;
  color: #5a5d68;
  letter-spacing: .04em;
}
.event-card-kind {
  text-transform: uppercase;
}
.event-card--info    .event-card-kind { color: #00d4ff; }
.event-card--success .event-card-kind { color: #4ade80; }
.event-card--warn    .event-card-kind { color: #ffaa00; }
.event-card--error   .event-card-kind { color: #ff3333; }
.event-card-link {
  color: #00d4ff;
  text-decoration: none;
}
.event-card-link:hover {
  color: #ffffff;
}
.event-card-dismiss {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: #5a5d68;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.event-card-dismiss:hover {
  color: #f4f4f6;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}
.event-card-dismiss:disabled {
  opacity: .35;
  cursor: default;
}

/* "All caught up" pill — collapsed inbox state */
.events-allclear {
  margin: 18px 0 24px;
  display: flex;
}
.events-allclear span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 4px;
  color: #4ade80;
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: .05em;
}
