/* Horizon AI Dashboard - light corporate, single green accent.
   Self-contained: doesn't share variables with horizonai.com.au styles.css. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f7f6f2;
  --surface:      #ffffff;
  --surface-2:    #fbfaf7;
  --line:         #e8e4dc;
  --line-soft:    #f0ede5;
  --ink:          #0d0d0d;
  --ink-2:        #2a2926;
  --muted:        #5f5e57;
  --muted-soft:   #b8b6ad;
  --brand:        #0d0d0d;       /* deep ink - was #1a3a4a navy */
  --brand-2:      #2a2926;
  --brand-soft:   #ececea;
  --accent:       #1f7a52;       /* Horizon green - was #b88a2b gold */
  --accent-soft:  #e3f1ea;
  --accent-glow:  #b3f1cf;
  --success:      #1f7a52;
  --success-soft: #e3f1ea;
  --warning:      #c47d1c;
  --warning-soft: #fbf2e1;
  --danger:       #b8362f;
  --danger-soft:  #f6e3e1;
  --info:         #2563a8;
  --info-soft:    #e3edf8;
  --purple:       #6c2bd6;
  --purple-soft:  #f0e6fc;
  --sans:         'Geist', -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mono:         'Geist Mono', ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --shadow-sm:    0 1px 2px rgba(15,20,30,0.05);
  --shadow:       0 2px 8px rgba(15,20,30,0.07);
  --shadow-lg:    0 10px 30px rgba(15,20,30,0.10);
}

/* Pull in Geist from the main horizonai.com.au font folder.
   The dashboard lives at /dashboard/<sector>/ so ../../assets/fonts/ resolves cleanly. */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/assets/fonts/geist-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html { background: var(--bg); -webkit-text-size-adjust: 100%; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans);
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  overflow: hidden;
  display: flex; justify-content: center;
  padding: 28px 0;
}
a { color: inherit; text-decoration: none; }

.phone {
  width: 100%; max-width: 430px; height: 92vh; max-height: 920px;
  background: var(--surface); border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15,20,30,0.04);
  position: relative;
}
@media (max-width: 480px) {
  body { padding: 0; }
  .phone {
    border-radius: 0; max-width: 100%;
    height: 100vh; height: 100dvh; max-height: 100dvh;
    box-shadow: none;
  }
}

/* topbar - left/right split with empty middle (room for Dynamic Island) */
.topbar {
  padding: 12px 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 110px;  /* leaves room in the middle for the Dynamic Island */
}
.topbar-left {
  display: flex; align-items: center; gap: 11px;
  min-width: 0;
  color: inherit;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--ink); color: #fff;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; font-size: 15px; letter-spacing: -0.5px;
}
.logo-mark .accent-dot {
  width: 5px; height: 5px; border-radius: 999px;
  background: var(--accent); margin-left: 1px;
}
.topbar-left-stack {
  display: flex; flex-direction: column;
  gap: 3px; min-width: 0;
}
.logo-name {
  font-weight: 600; font-size: 15px;
  letter-spacing: -0.3px; color: var(--ink); line-height: 1;
}
.logo-sub {
  font-size: 9.5px; color: var(--muted);
  letter-spacing: 0.6px; font-weight: 700;
  line-height: 1; text-transform: uppercase;
}
.topbar-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px;
  flex-shrink: 0;
}
.badge.live-big {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 5px;
}
.badge.live-big .dot {
  width: 7px; height: 7px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 6px var(--accent); animation: pulse-dot 1.8s infinite;
}
.topbar-sub {
  font-size: 9.5px; color: var(--muted);
  letter-spacing: 0.5px; font-weight: 700;
  text-transform: uppercase; line-height: 1;
  white-space: nowrap;
}
@keyframes pulse-dot { 0%,100% { opacity: 1 } 50% { opacity: 0.4 } }

/* ----- APP-FEEL: page fade-in + staggered card entrances ----- */
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.content { animation: page-fade-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi-row .kpi {
  animation: card-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.kpi-row .kpi:nth-child(1) { animation-delay: 60ms; }
.kpi-row .kpi:nth-child(2) { animation-delay: 120ms; }
.kpi-row .kpi:nth-child(3) { animation-delay: 180ms; }
.kpi-row .kpi:nth-child(4) { animation-delay: 240ms; }

.agent-grid .agent-card { animation: card-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.agent-grid .agent-card:nth-child(1)  { animation-delay: 80ms; }
.agent-grid .agent-card:nth-child(2)  { animation-delay: 110ms; }
.agent-grid .agent-card:nth-child(3)  { animation-delay: 140ms; }
.agent-grid .agent-card:nth-child(4)  { animation-delay: 170ms; }
.agent-grid .agent-card:nth-child(5)  { animation-delay: 200ms; }
.agent-grid .agent-card:nth-child(6)  { animation-delay: 230ms; }
.agent-grid .agent-card:nth-child(7)  { animation-delay: 260ms; }
.agent-grid .agent-card:nth-child(8)  { animation-delay: 290ms; }
.agent-grid .agent-card:nth-child(9)  { animation-delay: 320ms; }

/* Bottom-nav tap feedback */
.bottom-nav a { transition: color var(--dur, 160ms) ease-out, transform 120ms ease-out; }
.bottom-nav a:active { transform: scale(0.94); }
.kpi:active, .agent-card:active, .feed-row:active, .approval-row:active, .intg-pill:active {
  transform: scale(0.985);
  transition: transform 100ms ease-out;
}

/* Feed shimmer until items load */
.feed { position: relative; }
.feed:empty::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .content,
  .kpi-row .kpi,
  .agent-grid .agent-card,
  .bottom-nav a,
  .kpi, .agent-card, .feed-row, .approval-row, .intg-pill {
    animation: none !important;
    transition: none !important;
  }
}

/* ----- page header (sub-pages) ----- */
.page-header { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-header h1 { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.5px; }
.page-header .sub { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.page-header .crumbs { font-size: 11.5px; color: var(--muted); letter-spacing: 0.3px; margin-bottom: 5px; font-weight: 500; }
.page-header .crumbs a { color: var(--accent); font-weight: 600; }

/* ----- generic expandable pattern ----- */
details.expandable { display: block; }
details.expandable > summary { cursor: pointer; list-style: none; position: relative; }
details.expandable > summary::-webkit-details-marker { display: none; }
details.expandable > summary::marker { content: ''; }
.expandable-chevron {
  display: inline-block;
  color: var(--muted); font-size: 20px; line-height: 1;
  flex-shrink: 0;
  transition: transform 0.18s, color 0.18s;
}
details.expandable[open] .expandable-chevron { transform: rotate(90deg); color: var(--accent); }
.expandable-detail {
  padding: 14px 18px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
  animation: detail-open 0.16s ease-out;
}
@keyframes detail-open { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }

.trace-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  padding: 5px 0;
  align-items: flex-start;
  font-size: 12.5px;
}
.trace-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.7px;
  color: var(--muted); font-weight: 700; text-transform: uppercase;
  padding-top: 3px;
}
.trace-value { color: var(--ink-2); line-height: 1.55; word-wrap: break-word; }

/* ----- sales pipeline ----- */
.pipeline {
  display: flex; overflow-x: auto;
  padding: 16px 14px; gap: 10px;
  scrollbar-width: thin;
}
.pipe-stage {
  flex-shrink: 0; width: 250px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.pipe-stage-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.pipe-stage-head .stage-name { color: var(--ink); font-weight: 600; }
.pipe-stage-head .stage-count {
  background: var(--ink); color: white;
  padding: 2px 11px; border-radius: 12px;
  font-weight: 700; font-size: 11px;
}
.pipe-stage .stage-value { font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.pipe-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 12px 10px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  padding-right: 32px;
}
.pipe-card .addr { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.pipe-card .meta { font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
summary.pipe-card .expandable-chevron { position: absolute; top: 10px; right: 10px; }
details.expandable[open] > summary.pipe-card { background: var(--surface-2); border-radius: 9px 9px 0 0; }
details.expandable > summary.pipe-card + .expandable-detail {
  margin: 0 0 5px; background: var(--surface); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 9px 9px; padding: 12px 12px 14px;
}

/* ----- open-home list rows ----- */
.list-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; gap: 12px; align-items: center;
  background: var(--surface);
}
.list-row:hover { background: var(--surface-2); }
.list-row .l-time {
  font-family: var(--mono); font-size: 12px;
  color: var(--accent); flex-shrink: 0;
  min-width: 92px; font-weight: 700;
}
.list-row .l-main { flex: 1; min-width: 0; }
.list-row .l-main .l-addr { font-size: 14px; font-weight: 600; color: var(--ink); }
.list-row .l-main .l-meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.list-row .l-side { font-size: 12px; color: var(--ink-2); flex-shrink: 0; font-weight: 600; }
.list-row .l-side em { color: var(--success); font-style: normal; font-weight: 700; }
summary.list-row .expandable-chevron { margin-left: auto; align-self: center; }
details.expandable[open] > summary.list-row { background: var(--surface-2); border-bottom-color: transparent; }

/* ----- campaign cards ----- */
.campaign-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  padding-right: 32px;
}
.campaign-card .c-head { display: flex; justify-content: space-between; align-items: baseline; }
.campaign-card .c-addr { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.campaign-card .c-trend { font-size: 11.5px; color: var(--success); font-weight: 700; }
.campaign-card .c-trend.flat { color: var(--warning); }
.campaign-card .c-trend.down { color: var(--danger); }
.campaign-card .c-note { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.campaign-card .c-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin-top: 10px; }
.campaign-card .c-stat {
  text-align: center; padding: 7px 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.campaign-card .c-stat .v { font-size: 13.5px; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.campaign-card .c-stat .l { font-size: 9.5px; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; margin-top: 2px; font-weight: 700; }
summary.campaign-card .expandable-chevron { position: absolute; top: 10px; right: 10px; }
details.expandable[open] > summary.campaign-card { background: var(--surface-2); }
details.expandable > summary.campaign-card + .expandable-detail { border-top: 1px solid var(--line); }

/* ----- rentals portfolio strip + maintenance + applications + renewals ----- */
.portfolio-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.portfolio-strip .p { background: var(--surface); padding: 14px 6px; text-align: center; }
.portfolio-strip .p .v { font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.portfolio-strip .p .v.amber { color: var(--warning); } .portfolio-strip .p .v.red { color: var(--danger); } .portfolio-strip .p .v.green { color: var(--success); }
.portfolio-strip .p .l { font-size: 10px; color: var(--muted); margin-top: 4px; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 700; }

.maint-list { padding: 0 14px 14px; }
.maint {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  position: relative;
  padding-right: 32px;
}
.maint .m-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.maint .m-addr { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.maint .m-age { font-family: var(--mono); font-size: 11px; color: var(--muted); flex-shrink: 0; }
.maint .m-issue { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }
.maint .m-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11.5px; }
.maint .m-trade { color: var(--muted); }
.maint .m-urgency { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.maint .m-urgency.urgent { background: var(--danger-soft); color: var(--danger); }
.maint .m-urgency.normal { background: var(--surface-2); color: var(--muted); }
.maint .m-quote { margin-left: auto; font-family: var(--mono); color: var(--accent); font-weight: 700; }
summary.maint .expandable-chevron { position: absolute; top: 10px; right: 10px; }
details.expandable[open] > summary.maint { background: var(--surface-2); border-radius: 10px 10px 0 0; border-bottom: 0; }
details.expandable > summary.maint + .expandable-detail {
  margin: -7px 0 6px; background: var(--surface); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 10px 10px;
}

.app-card, .renew-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 14px 6px;
  position: relative;
  padding-right: 32px;
}
.app-card .a-head, .renew-card .r-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.app-card .a-addr, .renew-card .r-addr { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.app-card .a-rent, .renew-card .r-rent { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 12px; }
.app-card .a-meta, .renew-card .r-meta { font-size: 12px; color: var(--ink-2); margin-top: 5px; line-height: 1.45; }
.app-card .a-status { font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.renew-card .r-uplift { font-size: 11px; font-weight: 700; color: var(--success); margin-top: 4px; }
.renew-card .r-uplift.hold { color: var(--muted); }
.renew-card .r-flag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--danger); margin-top: 4px; }
summary.app-card .expandable-chevron, summary.renew-card .expandable-chevron { position: absolute; top: 10px; right: 10px; }

/* system strip */
.sys-strip {
  display: flex; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
  font-family: var(--mono); font-size: 11px;
  flex-shrink: 0;
}
.sys-strip::-webkit-scrollbar { display: none; }
.sys {
  padding: 8px 14px; white-space: nowrap;
  color: var(--muted); border-right: 1px solid var(--line);
  display: inline-flex; gap: 6px; align-items: center; letter-spacing: 0.2px;
}
.sys em {
  color: var(--ink); font-style: normal;
  font-variant-numeric: tabular-nums; font-weight: 600;
}
.sys.green em { color: var(--success); }
.sys.red em { color: var(--danger); }
.sys.blue em { color: var(--info); }
.sys.amber em { color: var(--warning); }
.sys.amber { color: var(--warning); }

/* content scroll area */
.content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* section bar */
.section-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 22px 18px 10px;
  font-size: 11px; letter-spacing: 1.1px;
  color: var(--muted); text-transform: uppercase; font-weight: 700;
}
.section-bar h2 {
  font-size: 11px; font-weight: 700;
  color: var(--muted); letter-spacing: 1.1px;
}
.section-meta {
  margin-left: auto;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.3px; text-transform: none;
  display: flex; align-items: center; gap: 6px;
}
.section-meta a { color: var(--accent); }
.section-meta a:hover { color: var(--ink); }
.section-meta .live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--success); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px; font-size: 10.5px;
}
.section-meta .live-pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 5px var(--success);
  animation: pulse-dot 1.8s infinite;
}

/* KPI tiles */
.kpi-row {
  padding: 6px 14px 4px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative; overflow: hidden;
  display: block; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  cursor: pointer;
}
.kpi:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.kpi-label {
  font-size: 11px; letter-spacing: 0.7px;
  color: var(--muted); text-transform: uppercase; font-weight: 700;
}
.kpi-value {
  font-size: 30px; font-weight: 600; color: var(--ink);
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 4px;
  letter-spacing: -0.7px; font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi-trend { font-size: 12px; color: var(--success); margin-top: 5px; font-weight: 600; }
.kpi-trend.amber { color: var(--warning); }
.kpi-trend.red { color: var(--danger); }
.kpi .sparkline {
  position: absolute; bottom: 0; left: 0; right: 0;
  width: 100%; height: 28px; opacity: 0.35; pointer-events: none;
}
.kpi .sparkline polyline {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}
.kpi.green .sparkline polyline { stroke: var(--success); }
.kpi.red .sparkline polyline { stroke: var(--danger); }
.kpi.blue .sparkline polyline { stroke: var(--info); }

#tasksInFlight, #hoursSaved {
  display: inline-block;
  transform-origin: center;
  will-change: transform, color;
}
@keyframes kpi-flash-up {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.10); color: var(--success); }
  100% { transform: scale(1);    color: var(--ink); }
}
@keyframes kpi-flash-down {
  0%   { transform: scale(1);    color: var(--ink); }
  35%  { transform: scale(1.10); color: var(--warning); }
  100% { transform: scale(1);    color: var(--ink); }
}
#tasksInFlight.flash-up, #hoursSaved.flash-up { animation: kpi-flash-up 0.6s ease-out; }
#tasksInFlight.flash-down { animation: kpi-flash-down 0.6s ease-out; }

/* agent grid */
.agent-grid {
  padding: 4px 14px 10px;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: 170px;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.agent-grid::-webkit-scrollbar { display: none; }
.agent-card { scroll-snap-align: start; }
.agent-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 12px;
  color: inherit; display: block;
  position: relative; overflow: hidden;
  min-height: 124px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.agent-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.agent-card .orb {
  display: inline-block; width: 9px; height: 9px;
  background: var(--muted-soft); border-radius: 50%;
  margin-right: 8px; vertical-align: middle; flex-shrink: 0;
}
.agent-card.status-working  .orb { background: var(--accent); box-shadow: 0 0 6px var(--accent); animation: pulse-dot 1.6s infinite; }
.agent-card.status-approval .orb { background: var(--info);   box-shadow: 0 0 6px var(--info);   animation: pulse-dot 1.6s infinite; }
.agent-card.status-urgent   .orb { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse-dot 0.8s infinite; }
.agent-head { display: flex; align-items: center; }
.agent-name { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.2px; }
.agent-task { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.agent-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 11px; letter-spacing: 0.2px;
}
.model-chip {
  padding: 3px 8px; background: var(--accent-soft); border-radius: 5px;
  color: var(--accent); font-family: var(--mono);
  font-size: 10.5px; font-weight: 600;
}
.model-chip.claude-opus-4-7 { background: var(--purple-soft); color: var(--purple); }
.model-chip.gemini-3-1-pro  { background: var(--info-soft); color: var(--info); }
.model-chip.perplexity-sonar-pro { background: var(--success-soft); color: var(--success); }
.model-chip.deepseek-r1 { background: rgba(232, 142, 35, 0.12); color: #c25e00; }
.queue { color: var(--muted); margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 500; }

/* live feed */
.feed-wrap { padding: 0 14px; }
.feed {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--muted-soft) transparent;
}
.feed::-webkit-scrollbar { width: 5px; }
.feed::-webkit-scrollbar-thumb { background: var(--muted-soft); border-radius: 3px; }
.feed::-webkit-scrollbar-track { background: transparent; }
.feed-row {
  display: flex; gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px; align-items: center;
  color: var(--ink);
  animation: feed-in 0.4s ease-out;
  transition: background 0.12s;
}
.feed-row:first-child { border-top: none; }
.feed-row:hover { background: var(--surface-2); }
@keyframes feed-in { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: translateY(0) } }
.feed-time {
  color: var(--muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono); font-size: 11px;
  min-width: 60px;
}
.feed-agent { color: var(--accent); flex-shrink: 0; font-weight: 700; }
.feed-model { color: var(--muted); flex-shrink: 0; font-family: var(--mono); font-size: 11px; }
.feed-action {
  color: var(--ink-2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-row.tag-urgent .feed-agent { color: var(--danger); }
.feed-row.tag-urgent .feed-time::before { content: "▶ "; color: var(--danger); }
.feed-row.tag-done   .feed-agent { color: var(--success); }
.feed-row.tag-review .feed-agent { color: var(--info); }

/* approvals */
.approvals {
  margin: 14px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, #f0f8f3 100%);
  border: 1px solid #b8e0c9;
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 15px 16px;
}
.approval-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.approval-head .label {
  font-size: 11.5px; letter-spacing: 1px; color: var(--accent);
  font-weight: 700; text-transform: uppercase;
}
.approval-head .count {
  font-size: 11.5px; background: var(--accent); color: white;
  padding: 3px 11px; border-radius: 12px; font-weight: 700;
}
.approval-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-top: 1px solid #c5e2d2;
  gap: 12px; color: var(--ink);
  transition: opacity 0.15s;
}
.approval-row:hover { opacity: 0.85; }
.approval-row:first-of-type { border-top: none; }
.approval-text { font-size: 14px; flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.approval-text.priority::before { content: "● "; color: var(--danger); font-size: 12px; }
.approval-text small {
  display: block; font-size: 12px; color: var(--ink-2);
  margin-top: 3px; font-weight: 400;
}
.approval-cta {
  font-size: 11px; padding: 7px 14px;
  background: var(--accent); color: white;
  border-radius: 6px; font-weight: 700;
  letter-spacing: 0.5px; flex-shrink: 0; border: none;
  text-transform: uppercase;
}

/* integration strip */
.intg-strip {
  margin: 0 14px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font-size: 11.5px;
}
.intg-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink-2); font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.intg-pill .d {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 5px var(--success);
}
.intg-pill.degraded .d { background: var(--warning); box-shadow: 0 0 5px var(--warning); }
.intg-pill.degraded { color: var(--warning); border-color: #efdcb3; }
.intg-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* bottom nav (locked) */
.bottom-nav {
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(15,20,30,0.04);
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px 4px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  transition: color 0.15s;
}
.bottom-nav a:hover { color: var(--accent); }
.bottom-nav .nav-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bottom-nav .nav-icon svg { width: 22px; height: 22px; display: block; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

/* ========================================================================
   APP-FEEL POLISH v2 - sitewide dashboards
   View transitions, spring curves, sticky topbar blur, smooth nav indicator,
   richer press states, staggered entrances, refined KPI feedback.
   ======================================================================== */

:root {
  --spring:        cubic-bezier(0.34, 1.34, 0.64, 1);     /* iOS overshoot */
  --spring-soft:   cubic-bezier(0.22, 1, 0.36, 1);        /* iOS gentle */
  --spring-snap:   cubic-bezier(0.2, 0.8, 0.2, 1);        /* tight */
  --dur-fast:      140ms;
  --dur-mid:       260ms;
  --dur-slow:      420ms;
}

/* (1) Native MPA view transitions between dashboard pages.
   Cross-fade with a subtle vertical lift - feels like a single-page app. */
@view-transition { navigation: auto; }
::view-transition-old(root) {
  animation: 180ms cubic-bezier(0.4, 0, 0.2, 1) both vt-out;
}
::view-transition-new(root) {
  animation: 280ms var(--spring-snap) both vt-in;
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-3px); } }
@keyframes vt-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* (2) Sticky topbar with backdrop blur once content scrolls under.
   Real-app polish - the bar stays put + frosts as you scroll. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: background 200ms var(--spring-snap), border-color 200ms ease, box-shadow 200ms ease;
}
.content.is-scrolled + .topbar,
.topbar.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(13, 13, 13, 0.08);
  box-shadow: 0 1px 0 rgba(13, 13, 13, 0.04);
}

/* (3) Enhanced bottom-nav: smooth indicator + spring scale on active. */
.bottom-nav {
  position: sticky;
  bottom: 0;
  z-index: 9;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.bottom-nav a {
  transition: color var(--dur-fast) var(--spring-snap), transform var(--dur-fast) var(--spring);
}
.bottom-nav a .nav-icon {
  transition: transform var(--dur-mid) var(--spring), color var(--dur-fast) var(--spring-snap);
}
.bottom-nav a:active { transform: scale(0.9); }
.bottom-nav a:active .nav-icon { transform: scale(0.88); }
.bottom-nav a.active .nav-icon { transform: scale(1.08); }

/* Soft halo behind active nav icon */
.bottom-nav a.active::after {
  content: "";
  position: absolute;
  top: 4px; left: 50%;
  width: 38px; height: 38px;
  transform: translateX(-50%);
  background: var(--accent-soft);
  border-radius: 12px;
  z-index: -1;
  animation: nav-halo-pop 380ms var(--spring) both;
}
@keyframes nav-halo-pop {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6); }
  60%  { opacity: 1; transform: translateX(-50%) scale(1.06); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Sharpen the existing active-tab underline with a spring grow */
.bottom-nav a.active::before {
  animation: nav-indicator-pop 320ms var(--spring) both;
  transform-origin: center top;
}
@keyframes nav-indicator-pop {
  0%   { opacity: 0; transform: translateX(-50%) scaleX(0); }
  100% { opacity: 1; transform: translateX(-50%) scaleX(1); }
}

/* (4) Card press states - more pronounced + with brief glow ring. */
.kpi, .agent-card, .feed-row, .approval-row, .intg-pill, .pipe-card, .app-card, .expandable summary {
  transition: transform 120ms var(--spring), box-shadow 180ms ease-out, border-color 180ms ease-out;
}
.kpi:active, .agent-card:active, .feed-row:active, .approval-row:active,
.intg-pill:active, .pipe-card:active, .app-card:active, .expandable summary:active {
  transform: scale(0.972);
  transition-duration: 80ms;
}

/* (5) Smoother KPI flash + value transitions */
.kpi-value, .kpi-value span {
  transition: color 320ms var(--spring-snap), text-shadow 320ms ease-out;
}
.kpi-value .flash-up, .kpi-value.flash-up {
  color: var(--accent) !important;
  text-shadow: 0 0 12px var(--accent-glow);
  transition: none;
}
.kpi-value .flash-down, .kpi-value.flash-down {
  color: var(--danger) !important;
  text-shadow: 0 0 12px var(--danger-soft);
  transition: none;
}

/* (6) Staggered entrance on more elements - approvals, integrations, feed rows */
.approvals .approval-row {
  animation: card-rise 420ms var(--spring-soft) both;
}
.approvals .approval-row:nth-child(1) { animation-delay: 380ms; }
.approvals .approval-row:nth-child(2) { animation-delay: 420ms; }
.approvals .approval-row:nth-child(3) { animation-delay: 460ms; }
.approvals .approval-row:nth-child(4) { animation-delay: 500ms; }
.approvals .approval-row:nth-child(5) { animation-delay: 540ms; }

.intg-strip .intg-pill {
  animation: card-rise 360ms var(--spring-soft) both;
}
.intg-strip .intg-pill:nth-child(1)  { animation-delay: 520ms; }
.intg-strip .intg-pill:nth-child(2)  { animation-delay: 560ms; }
.intg-strip .intg-pill:nth-child(3)  { animation-delay: 600ms; }
.intg-strip .intg-pill:nth-child(4)  { animation-delay: 640ms; }
.intg-strip .intg-pill:nth-child(5)  { animation-delay: 680ms; }
.intg-strip .intg-pill:nth-child(n+6) { animation-delay: 720ms; }

/* Feed rows that get inserted dynamically should slide in from top */
.feed-row {
  animation: feed-slide-in 380ms var(--spring-soft) both;
}
@keyframes feed-slide-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.985); max-height: 0; }
  to   { opacity: 1; transform: translateY(0) scale(1); max-height: 80px; }
}

/* Section bars also fade in slightly delayed */
.section-bar {
  animation: section-fade-in 360ms var(--spring-soft) both;
  animation-delay: 340ms;
}
@keyframes section-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* (7) Refined LIVE pill - smoother dot pulse */
.badge.live-big .dot {
  animation: live-dot-pulse 1.6s var(--spring-soft) infinite;
}
@keyframes live-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px var(--accent); }
  50%      { opacity: 0.45; transform: scale(0.85); box-shadow: 0 0 0 var(--accent); }
}

/* (8) Use spring curve on the global content entrance */
.content {
  animation: page-fade-in 420ms var(--spring-soft) both;
}

/* (9) Bottom-nav active label gets a tiny weight bump */
.bottom-nav a.active { font-weight: 700; }

/* (10) Reduced motion - kill ALL the new bits cleanly */
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none !important; }
  .approvals .approval-row,
  .intg-strip .intg-pill,
  .feed-row,
  .section-bar,
  .bottom-nav a.active::after,
  .bottom-nav a.active::before,
  .badge.live-big .dot { animation: none !important; }
}

/* (11) is-pressed class - pointerdown feedback that lasts ~140ms regardless of OS :active timing */
.is-pressed { transform: scale(0.972) !important; transition: transform 60ms var(--spring-snap) !important; }
.bottom-nav a.is-pressed { transform: scale(0.9) !important; }
.bottom-nav a.is-pressed .nav-icon { transform: scale(0.86) !important; }
