/* =========================================================
   Recovery System for Centers — B2B platform
   Shared visual language, business-grade interface
   ========================================================= */
@import url("shared/ios-tabbar.css");

:root {
  --bg: #ffffff;
  --bg-muted: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --line: #e6e6e9;
  --accent: #0f766e;
  --accent-ink: #0b5a54;
  --accent-soft: #e6f2f0;
  --dark: #111113;

  --radius-sm: 16px;
  --radius: 24px;
  --radius-lg: 32px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 12px 40px rgba(17, 17, 19, .06);
  --shadow-lg: 0 24px 70px rgba(17, 17, 19, .10);

  --maxw: 1200px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --bg-gradient-teal:
    radial-gradient(ellipse 90% 58% at 50% 108%, rgba(20, 160, 143, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 70% 45% at 50% 95%, rgba(15, 118, 110, 0.4) 0%, transparent 52%),
    linear-gradient(180deg, #083a36 0%, #0a4540 28%, #0b524c 55%, #0a3f3a 100%);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -.02em; font-weight: 600; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 500;
  padding: 14px 26px;
  border-radius: 980px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease),
    box-shadow .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
  white-space: nowrap;
}
.btn--sm { padding: 10px 20px; font-size: 15px; }
.btn--lg { padding: 17px 34px; font-size: 17px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }

.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}

/* ---------------- Header ---------------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }

/* Overlay header over gradient hero (landing top position) */
.header--overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.header--overlay:not(.is-scrolled) .brand__icon--dark { display: none; }
.header--overlay:not(.is-scrolled) .brand__icon--light { display: block; }
.header--overlay:not(.is-scrolled) .brand__name { color: #fff; }
.header--overlay:not(.is-scrolled) .brand__sub { color: rgba(255, 255, 255, 0.8); }
.header--overlay:not(.is-scrolled) .nav__link { color: rgba(255, 255, 255, 0.9); }
.header--overlay:not(.is-scrolled) .nav__link:hover { color: #fff; }
.header--overlay:not(.is-scrolled) .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.header--overlay:not(.is-scrolled) .btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }
.header--overlay:not(.is-scrolled) .btn--primary { background: #fff; color: var(--accent-ink); border-color: #fff; }
.header--overlay:not(.is-scrolled) .btn--primary:hover { background: rgba(255, 255, 255, 0.9); }
.header--overlay:not(.is-scrolled) .menu-toggle span { background: #fff; }
.header--overlay.is-scrolled {
  position: fixed;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand__mark {
  width: 22px; height: 22px; border-radius: 7px; background: var(--accent);
  position: relative; flex: none;
}
.brand__mark::after { content: ""; position: absolute; inset: 6px; border-radius: 3px; background: #fff; }
.brand__icon { display: block; height: 34px; width: 34px; object-fit: contain; flex: none; }
.brand__icon--light { display: none; }
.brand--footer .brand__icon { height: 42px; width: 42px; }
.brand__name { display: inline-flex; flex-direction: column; line-height: 1.1; font-size: 15px; letter-spacing: -.01em; }
.brand__sub { color: var(--ink-faint); font-weight: 500; font-size: 11px; }

@media (min-width: 901px) {
  .header .brand__name { display: none; }
  .header .brand__icon { height: 40px; width: 40px; }
}

.nav { display: flex; gap: 34px; }
.nav__link { font-size: 15px; color: var(--ink-soft); transition: color .25s var(--ease); }
.nav__link:hover { color: var(--ink); }

.header__actions { display: flex; align-items: center; gap: 12px; }

.menu-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; border: none; background: transparent; cursor: pointer;
}
.menu-toggle span { display: block; width: 20px; height: 1.5px; background: var(--ink); margin: 0 auto; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column; gap: 4px; padding: 8px 24px 24px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu__link { padding: 14px 4px; font-size: 18px; border-bottom: 1px solid var(--line); }
.mobile-menu .btn { margin-top: 16px; }

/* ---------------- Hero ---------------- */
.hero { padding: 72px 0 48px; position: relative; }
.hero__inner { display: grid; grid-template-columns: 1fr 1.05fr; column-gap: 56px; row-gap: 40px; align-items: center; }
.hero__title { font-size: clamp(36px, 5vw, 62px); letter-spacing: -.03em; margin-bottom: 22px; }
.hero__subtitle { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 42ch; margin-bottom: 34px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.hero__meta { display: flex; gap: 40px; flex-wrap: wrap; }
.hero__meta div { display: flex; flex-direction: column; gap: 2px; }
.hero__meta strong { font-size: 26px; letter-spacing: -.02em; }
.hero__meta span { font-size: 14px; color: var(--ink-faint); }

/* Hero product shot */
.hero__shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: 0 40px 90px rgba(0, 0, 0, .32);
}

/* Hero logo — shown on mobile (top-left) only */
.hero__logo { display: none; }

/* Gradient hero */
.hero--gradient {
  background: var(--bg-gradient-teal);
  color: #fff;
  padding-top: 108px;
  padding-bottom: 92px;
  overflow: hidden;
}
.hero--gradient .eyebrow { color: rgba(167, 243, 232, 0.95); }
.hero--gradient .hero__title { color: #fff; }
.hero--gradient .hero__subtitle { color: rgba(255, 255, 255, 0.88); }
.hero--gradient .hero__meta strong { color: #fff; }
.hero--gradient .hero__meta span { color: rgba(255, 255, 255, 0.72); }
.hero--gradient .btn--primary {
  background: #fff; color: var(--accent-ink); border-color: #fff;
}
.hero--gradient .btn--primary:hover { background: rgba(255, 255, 255, 0.92); color: var(--accent-ink); }
.hero--gradient .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.hero--gradient .btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.hero--gradient .hero__shot { box-shadow: 0 44px 100px rgba(0, 0, 0, .42); }

/* Desktop hero placement: text top-left, numbers under it, image spanning right */
@media (min-width: 901px) {
  .hero__content { grid-column: 1; grid-row: 1; }
  .hero__meta { grid-column: 1; grid-row: 2; }
  .hero__preview { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* ---------------- Dashboard preview ---------------- */
.hero__preview { min-width: 0; }
.dashboard {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 460px;
}
.dashboard__side {
  background: var(--bg-muted);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.dashboard__brand { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.dashboard__brand .brand__mark { width: 18px; height: 18px; border-radius: 6px; }
.dashboard__nav { display: flex; flex-direction: column; gap: 2px; }
.dashboard__nav a {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-soft);
  padding: 9px 10px; border-radius: 10px;
}
.dashboard__nav a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.dashboard__status {
  margin-top: auto; font-size: 12px; color: var(--accent-ink);
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); padding: 10px 12px; border-radius: 12px;
}
.dashboard__status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.dashboard__main { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dashboard__topbar { display: flex; align-items: flex-start; justify-content: space-between; }
.dashboard__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.dashboard__topbar h3 { font-size: 20px; margin-top: 2px; }
.chip { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 980px; background: var(--bg-muted); color: var(--ink-soft); }
.chip--soft { background: var(--accent-soft); color: var(--accent-ink); }

.dashboard__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--bg-muted); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { font-size: 11px; color: var(--ink-faint); }
.stat__value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.stat__trend { font-size: 11px; color: var(--ink-faint); }
.stat__trend.up { color: var(--accent); }

.dashboard__panel { background: var(--bg-muted); border-radius: 16px; padding: 16px; }
.dashboard__panel-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-soft); margin-bottom: 14px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 84px; }
.bars span { flex: 1; height: var(--h); background: var(--accent); border-radius: 6px 6px 3px 3px; opacity: .85; transition: height .8s var(--ease); }
.bars span:last-child { opacity: 1; }

.dashboard__list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-muted); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.row__name { font-weight: 500; }
.row__badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 980px; }
.row__badge.new { background: var(--accent-soft); color: var(--accent-ink); }
.row__badge.work { background: #eef1f6; color: #495a75; }
.row__badge.done { background: #eef3ee; color: #4a6b4a; }

/* ---------------- Dashboard icons ---------------- */
.di { width: 16px; height: 16px; position: relative; flex: none; display: inline-block; }
.di::before { content: ""; position: absolute; inset: 1px; border: 1.6px solid currentColor; border-radius: 4px; opacity: .9; }
.di[data-di="grid"]::before { border-radius: 3px; }
.di[data-di="inbox"]::before { border-radius: 4px 4px 6px 6px; }
.di[data-di="users"]::before { border-radius: 50%; inset: 2px 4px; }
.di[data-di="program"]::before { border-radius: 3px; transform: rotate(45deg); inset: 3px; }
.di[data-di="team"]::before { border-radius: 50%; }
.di[data-di="chart"]::before { border-radius: 3px; border-left-width: 1.6px; border-bottom-width: 1.6px; border-top: none; border-right: none; }
.di[data-di="shield"]::before { border-radius: 5px 5px 8px 8px; }
.di[data-di="api"]::before { border-radius: 50%; border-style: dashed; }
.di[data-di="lecture"]::before { border-radius: 3px; inset: 3px 1px; }

.di--lg { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.di--lg::before { position: static; inset: auto; width: 20px; height: 20px; }

/* ---------------- Sections ---------------- */
.section { padding: 92px 0; }
.section--muted { background: var(--bg-muted); }
.section--gradient {
  background: var(--bg-gradient-teal);
  color: #fff;
}
.section--gradient .eyebrow { color: rgba(167, 243, 232, 0.95); }
.section--gradient .section__title { color: #fff; }
.section--gradient .section__lead { color: rgba(255, 255, 255, 0.88); }
.section--gradient .feature-card,
.section--gradient .chart-card {
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.14);
}
.section--gradient .chip { background: rgba(255, 255, 255, 0.16); color: #fff; }
.section--gradient .chip--soft { background: var(--accent-soft); color: var(--accent-ink); }
.section__head { max-width: 660px; margin-bottom: 56px; }
.section__title { font-size: clamp(30px, 4vw, 46px); margin-bottom: 16px; }
.section__lead { font-size: 19px; color: var(--ink-soft); }

/* ---------------- Overview grid ---------------- */
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.overview-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.overview-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.overview-card .di--lg { margin-bottom: 18px; }
.overview-card h3 { font-size: 19px; margin-bottom: 6px; }
.overview-card p { color: var(--ink-soft); font-size: 15px; }

/* ---------------- Features ---------------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-card .di--lg { margin-bottom: 18px; }
.feature-card h3 { font-size: 18px; margin-bottom: 6px; }
.feature-card p { color: var(--ink-soft); font-size: 14px; }

/* ---------------- Steps ---------------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: step; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position: relative;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--dark); color: #fff; font-weight: 600; font-size: 16px;
  margin-bottom: 20px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--ink-soft); }

/* ---------------- Analytics ---------------- */
.analytics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.chart-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; gap: 22px;
  transition: box-shadow .35s var(--ease);
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card--wide { grid-column: span 1; }
.chart-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-card__label { display: block; font-size: 14px; color: var(--ink-soft); }
.chart-card__value { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; }

/* line chart */
.linechart { width: 100%; height: 180px; }
.linechart svg { width: 100%; height: 100%; }
.linechart__line { stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.chart-card.is-visible .linechart__line { animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* donut */
.donut {
  width: 170px; height: 170px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--val) * 1%), var(--bg-muted) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.donut::after { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--surface); }
.donut__center { position: relative; z-index: 1; text-align: center; }
.donut__center strong { display: block; font-size: 30px; letter-spacing: -.02em; }
.donut__center span { font-size: 13px; color: var(--ink-faint); }

/* progress list */
.progress-list { display: flex; flex-direction: column; gap: 18px; }
.progress { display: grid; grid-template-columns: 100px 1fr 44px; align-items: center; gap: 12px; }
.progress__name { font-size: 14px; color: var(--ink-soft); }
.progress__track { height: 10px; background: var(--bg-muted); border-radius: 980px; overflow: hidden; }
.progress__track span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 980px; transition: width 1.1s var(--ease); }
.chart-card.is-visible .progress__track span { width: var(--w); }
.progress__val { font-size: 13px; font-weight: 600; text-align: right; }

.bars--lg { height: 130px; }

/* ---------------- Integrations ---------------- */
.integrations { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.int-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.int-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.int-card__tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 32px; padding: 0 12px;
  border-radius: 10px; background: var(--bg-muted);
  font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft);
  margin-bottom: 18px;
}
.int-card h3 { font-size: 18px; margin-bottom: 6px; }
.int-card p { font-size: 14px; color: var(--ink-soft); }

/* ---------------- Final CTA ---------------- */
.cta { padding: 40px 0 100px; }
.cta__inner { background: var(--dark); color: #fff; border-radius: var(--radius-lg); padding: 84px 40px; text-align: center; }
.cta__title { font-size: clamp(32px, 4.5vw, 52px); margin-bottom: 16px; }
.cta__text { font-size: 19px; color: rgba(255, 255, 255, .7); margin-bottom: 34px; }
.cta__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.cta .btn--ghost:hover { border-color: #fff; }

/* ---------------- Footer ---------------- */
.footer { background: var(--bg-muted); border-top: 1px solid var(--line); padding: 64px 0 32px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--line); }
.footer__tagline { margin-top: 16px; color: var(--ink-soft); font-size: 15px; max-width: 28ch; }
.footer__col h4 { font-size: 14px; margin-bottom: 18px; }
.footer__col a { display: block; font-size: 15px; color: var(--ink-soft); padding: 6px 0; transition: color .25s var(--ease); }
.footer__col a:hover { color: var(--ink); }
.footer__bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 28px; font-size: 14px; color: var(--ink-faint); }
.footer__bottom a { color: var(--accent); }

/* ---------------- Reveal ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .linechart__line { stroke-dashoffset: 0; animation: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .features { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .header__actions .btn--sm { display: none; }
  .menu-toggle { display: flex; width: 44px; height: 44px; border-radius: 12px; }
  .mobile-menu {
    padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-menu .btn { width: 100%; justify-content: center; }

  .hero { padding: 48px 0 24px; }
  .hero__inner { grid-template-columns: 1fr; gap: 44px; }
  .hero__subtitle { max-width: none; }
  .hero__actions .btn { min-height: 44px; }

  /* Gradient hero on mobile: header is hidden (tab bar), show logo top-left */
  .hero--gradient {
    padding-top: calc(env(safe-area-inset-top, 0px) + 78px);
    padding-bottom: 56px;
  }
  .hero--gradient .hero__logo {
    display: block;
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: 20px;
    z-index: 5;
  }
  .hero--gradient .hero__logo img {
    display: block;
    height: 42px;
    width: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
  }
  .hero--gradient .hero__inner { gap: 32px; }
  .hero__shot { border-radius: var(--radius); box-shadow: 0 24px 64px rgba(0, 0, 0, .36); }

  .section { padding: 68px 0; }
  .section__head { margin-bottom: 40px; }

  .analytics { grid-template-columns: 1fr; }
  .integrations { grid-template-columns: 1fr 1fr; }
  .dashboard { min-height: 380px; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }

  .hero__meta { gap: 24px; }
  .hero__meta strong { font-size: 22px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: center; min-height: 48px; }

  .dashboard { grid-template-columns: 1fr; min-height: 0; }
  .dashboard__side {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .dashboard__nav { flex-direction: row; flex-wrap: wrap; }
  .dashboard__status { margin: 0; }
  .dashboard__stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat__value { font-size: 20px; }

  .overview-grid,
  .features,
  .steps,
  .integrations { grid-template-columns: 1fr; }

  .cta__inner { padding: 48px 20px; }
  .cta__actions { flex-direction: column; }
  .cta__actions .btn { width: 100%; justify-content: center; }

  .footer__inner { grid-template-columns: 1fr; gap: 28px; }
  .footer__brand { grid-column: auto; }
  .footer__bottom { flex-direction: column; gap: 10px; align-items: flex-start; }

  .page-hero { padding: 36px 0 8px; }
  .page-hero__title { max-width: none; font-size: clamp(28px, 7vw, 40px); }
}

/* =========================================================
   SUBPAGES — onboarding, dashboard, requests, profile
   ========================================================= */

/* ---- Breadcrumb + page hero ---- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-faint); margin-bottom: 22px; }
.breadcrumb a { color: var(--ink-soft); transition: color .25s var(--ease); }
.breadcrumb a:hover { color: var(--ink); }
.page-hero { padding: 56px 0 12px; }
.page-hero__title { font-size: clamp(32px, 4.4vw, 54px); letter-spacing: -.03em; margin-bottom: 16px; max-width: 22ch; }
.page-hero__lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink-soft); max-width: 56ch; }

/* ---- Onboarding wizard ---- */
.wizard { max-width: 760px; margin: 0 auto; }
.wizard__steps { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; }
.wizard__steps li { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 13px; color: var(--ink-faint); }
.wizard__dot {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
  background: var(--bg-muted); color: var(--ink-soft); border: 1px solid var(--line);
  transition: all .3s var(--ease);
}
.wizard__steps li.is-done .wizard__dot,
.wizard__steps li.is-active .wizard__dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.wizard__steps li.is-active { color: var(--ink); font-weight: 600; }
.wizard__line { flex: 1; height: 1px; background: var(--line); }

.wizard__card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 40px; box-shadow: var(--shadow);
}
.wizard__title { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.wizard__sub { color: var(--ink-soft); font-size: 16px; margin-bottom: 28px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; width: 100%;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field__hint { font-size: 13px; color: var(--ink-faint); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.choice:hover { border-color: var(--ink); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice span { font-size: 15px; }

.wizard__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.wizard__result { text-align: center; }
.wizard__result .result-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent-ink);
  padding: 8px 16px; border-radius: 980px; font-weight: 600; font-size: 14px; margin-bottom: 20px;
}
.wizard__result h3 { font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 14px; }
.wizard__result p { color: var(--ink-soft); font-size: 17px; max-width: 48ch; margin: 0 auto 28px; }
.wizard__result-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---- Cabinet app shell ---- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.app__side {
  background: var(--bg-muted); border-right: 1px solid var(--line);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.app__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.app__nav { display: flex; flex-direction: column; gap: 4px; }
.app__nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
  font-size: 15px; color: var(--ink-soft); transition: background .2s var(--ease), color .2s var(--ease);
}
.app__nav a:hover { color: var(--ink); background: rgba(0,0,0,.03); }
.app__nav a.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.app__side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.app__status { font-size: 12px; color: var(--accent-ink); display: flex; align-items: center; gap: 8px; background: var(--accent-soft); padding: 10px 12px; border-radius: 12px; }
.app__status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.app__main { padding: 26px 34px 60px; max-width: 1180px; width: 100%; }
.app__topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.app__topbar h1 { font-size: 26px; letter-spacing: -.02em; }
.app__topbar-eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.app__topbar-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }

/* KPI stat cards for cabinet */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 132px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.kpi__label {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-faint);
}
.kpi__value {
  display: block;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
}
.kpi__trend {
  display: block;
  margin-top: auto;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-faint);
}
.kpi__trend.up { color: var(--accent); }
.kpi__trend.down { color: #b4532a; }

.panels { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel--full { grid-column: 1 / -1; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel__head h3 { font-size: 18px; }

/* Bars reuse from dashboard preview but standalone */
.panel .bars { height: 150px; }

/* ---- Table (requests) ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 600; background: var(--bg-muted); }
.table tbody tr { transition: background .2s var(--ease); cursor: default; }
.table tbody tr:hover { background: var(--bg-muted); }
.table tbody tr:last-child td { border-bottom: none; }
.table__name { font-weight: 600; color: var(--ink); }
.table__meta { color: var(--ink-faint); font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 980px; }
.pill--new { background: var(--accent-soft); color: var(--accent-ink); }
.pill--work { background: #eef1f6; color: #495a75; }
.pill--done { background: #eef3ee; color: #4a6b4a; }
.pill--lost { background: #f5eeee; color: #8a4a4a; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.table__action { color: var(--accent); font-weight: 500; cursor: pointer; background: none; border: none; font-family: inherit; font-size: 14px; }
.table__action:hover { text-decoration: underline; }

/* Mini capacity meter (programs page) */
.prog-meter { display: inline-block; width: 110px; height: 6px; border-radius: 999px; background: #e9edf1; overflow: hidden; vertical-align: middle; margin-top: 4px; }
.prog-meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Graceful fallback when an <img> fails to load */
.img-fallback {
  background:
    linear-gradient(180deg, rgba(17, 17, 19, .04), rgba(17, 17, 19, .07)),
    linear-gradient(135deg, #e8eaed 0%, #f3f4f6 55%, #eaecef 100%);
  object-fit: cover;
}

/* Analytics breakdown rows */
.an-row { padding: 12px 0; }
.an-row + .an-row { border-top: 1px solid var(--line); }
.an-row__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; color: var(--ink-soft); }
.an-row__top .table__name { color: var(--ink); }

/* ---- Profile page ---- */
.profile { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.profile-card__head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
.profile-logo { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 24px; flex: none; }
.profile-card__head h2 { font-size: 24px; margin-bottom: 6px; }
.profile-card__loc { color: var(--ink-soft); font-size: 15px; }
.profile-info { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.info-row { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-top: 1px solid var(--line); }
.info-row__label { font-size: 13px; color: var(--ink-faint); }
.info-row__value { font-size: 15px; color: var(--ink); font-weight: 500; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tag { font-size: 13px; color: var(--ink-soft); padding: 5px 12px; border: 1px solid var(--line); border-radius: 980px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; }
.side-card h3 { font-size: 17px; margin-bottom: 16px; }
.status-line { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 14px; color: var(--ink-soft); border-top: 1px solid var(--line); }
.status-line:first-of-type { border-top: none; }
.status-check { color: var(--accent); font-weight: 600; }

/* ---- Filter bar (requests, catalog) ---- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 24px; }
.search {
  flex: 1 1 260px; min-width: 220px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 980px; padding: 12px 20px;
}
.search input { border: none; outline: none; background: transparent; font-size: 15px; width: 100%; font-family: inherit; color: var(--ink); }
.search__icon { width: 16px; height: 16px; border: 2px solid var(--ink-faint); border-radius: 50%; flex: none; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  font-size: 14px; padding: 10px 18px; border-radius: 980px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  transition: all .25s var(--ease); font-family: inherit;
}
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.chip-btn.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }
.results-count { font-size: 14px; color: var(--ink-faint); margin-bottom: 18px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-faint); font-size: 16px; }

@media (max-width: 1024px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .panels { grid-template-columns: minmax(0, 1fr); }
  .profile { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  html { overflow-x: hidden; }
  .app { display: block; min-height: 100vh; }
  .app__side { display: none; }
  .app__main { padding: 22px 16px 48px; max-width: 100%; min-width: 0; }
  .panels, .kpis { min-width: 0; }
  .panel, .chart-card, .kpi { min-width: 0; }
  .field input, .field select, .field textarea, .search input { font-size: 16px; }

  .app__topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
  }
  .app__topbar h1 { font-size: 22px; }
  .app__topbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .app__topbar-actions .btn--sm {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    min-height: 44px;
  }
  .avatar { margin-left: auto; }

  .filters { flex-direction: column; align-items: stretch; gap: 14px; }
  .search { flex: none; width: 100%; min-width: 0; }
  .chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
  }
  .chip-group::-webkit-scrollbar { display: none; }
  .chip-btn { flex: 0 0 auto; min-height: 44px; }

  .form-grid, .choice-grid, .profile-info { grid-template-columns: 1fr; }
  .wizard__card { padding: 28px 22px; }
  .wizard__steps li span.label { display: none; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 640px; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr; gap: 12px; }
  .kpi { min-height: 0; padding: 18px 20px; }
  .kpi__value { font-size: 26px; }

  .panel { padding: 18px 16px; }
  .panel__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .panel .bars { height: 120px; }

  .wizard__nav { flex-direction: column-reverse; gap: 12px; }
  .wizard__nav .btn { width: 100%; justify-content: center; min-height: 48px; }
  .wizard__result-actions { flex-direction: column; }
  .wizard__result-actions .btn { width: 100%; justify-content: center; }

  .profile-card { padding: 22px 18px; }
  .profile-card__head { flex-direction: column; align-items: flex-start; }

  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { border-top: none; padding: 10px 0 0; }
  .kv dd { padding: 2px 0 12px; border-top: none; border-bottom: 1px solid var(--line); }
  .kv dd:last-child { border-bottom: none; }

  .detail-actions .btn { min-height: 48px; }

  .toast-host {
    right: 16px;
    left: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }
}

/* =========================================================
   IMAGE PLACEHOLDERS (fill later with real photos)
   ========================================================= */
.img-ph {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #edeff2 0%, #f6f7f9 100%);
  overflow: hidden; color: var(--ink-faint); border-radius: var(--radius-sm);
}
.img-ph__glyph { width: 46px; height: 46px; border: 2px solid #c4c8ce; border-radius: 10px; position: relative; }
.img-ph__glyph::before { content: ""; position: absolute; top: 8px; left: 9px; width: 9px; height: 9px; border-radius: 50%; background: #c4c8ce; }
.img-ph__glyph::after {
  content: ""; position: absolute; left: 4px; right: 4px; bottom: 5px; height: 16px; background: #c4c8ce;
  clip-path: polygon(0 100%, 30% 42%, 52% 72%, 74% 28%, 100% 100%);
}
.img-ph--wide { aspect-ratio: 16 / 9; }
.img-ph--card { aspect-ratio: 3 / 2; }

/* Center profile cover + gallery */
.profile-cover { margin-bottom: 20px; }
.profile-cover .img-ph { border-radius: var(--radius); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.gallery .img-ph { border-radius: 14px; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* =========================================================
   POLISH — focus, toasts, loading, feedback, request detail
   ========================================================= */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible { outline-offset: 3px; }

.linkish { font: inherit; background: none; border: none; padding: 0; margin: 0; color: inherit; cursor: pointer; text-align: left; }
.footer__col .linkish { display: block; font-size: 15px; color: var(--ink-soft); padding: 6px 0; transition: color .25s var(--ease); }
.footer__col .linkish:hover { color: var(--ink); }

.toast-host { position: fixed; right: 24px; bottom: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 48px); }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--dark); color: #fff; padding: 14px 18px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  transform: translateY(12px); opacity: 0; transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.toast.is-in { transform: none; opacity: 1; }
.toast__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.toast--success .toast__dot { background: #2f9e78; }
.toast--error .toast__dot { background: #c2543a; }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; margin: auto; inset: 0;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: nsv-spin .7s linear infinite;
}
.btn--primary.is-loading::after { border-color: rgba(255, 255, 255, .5); border-top-color: #fff; }
@keyframes nsv-spin { to { transform: rotate(360deg); } }

.form-success { text-align: center; }
.form-success__badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: 8px 16px; border-radius: 980px; font-weight: 600; font-size: 14px; margin-bottom: 14px;
}
.form-success h3 { font-size: 22px; margin-bottom: 10px; }
.form-success p { color: var(--ink-soft); font-size: 15px; }

/* Request detail */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.detail-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.detail-panel h3 { font-size: 18px; margin-bottom: 18px; }
.detail-panel + .detail-panel { margin-top: 20px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; }
.kv dt { color: var(--ink-faint); font-size: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv dd { font-size: 15px; font-weight: 500; padding: 10px 0; border-top: 1px solid var(--line); }
.kv dt:first-of-type, .kv dd:first-of-type { border-top: none; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 20px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li:last-child { padding-bottom: 0; }
.timeline__time { font-size: 12px; color: var(--ink-faint); }
.timeline__text { font-size: 15px; margin-top: 2px; }

.detail-actions { display: flex; flex-direction: column; gap: 10px; }
.detail-actions .btn { width: 100%; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .toast-host { right: 16px; left: 16px; bottom: 16px; }
}

