/* =====================================================================
   TaskFloVA Client Portal — J.A.P. Senior Care Services
   Abyssal-teal dark UI · Bricolage Grotesque / Instrument Sans / Spline Sans Mono
   ===================================================================== */

:root {
  --tf-teal: #0498B1;
  --tf-teal-bright: #1FC8E0;
  --tf-teal-soft: rgba(4, 152, 177, .14);
  --tf-coral: #FD5757;
  --tf-coral-soft: rgba(253, 87, 87, .14);
  --tf-deep: #00353D;

  --bg: #05090B;
  --bg-raise: #07121A;
  --panel: rgba(10, 26, 31, .72);
  --panel-solid: #0A1A1F;
  --panel-hi: rgba(16, 38, 45, .85);
  --line: rgba(31, 200, 224, .10);
  --line-strong: rgba(31, 200, 224, .22);

  --text: #E9F4F5;
  --text-mute: #8FACB2;
  --text-dim: #5F7E85;

  --good: #2BD9A3;
  --warn: #FFC24B;
  --bad: #FD5757;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "Spline Sans Mono", monospace;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(.22, .9, .26, 1);
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.015em; }
::selection { background: rgba(4, 152, 177, .35); }

/* ============================ LOGIN GATE ============================ */
.gate {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background:
    radial-gradient(1100px 700px at 78% -10%, rgba(4, 152, 177, .16), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0, 53, 61, .55), transparent 62%),
    var(--bg);
  overflow: hidden; padding: 24px;
  transition: opacity .55s var(--ease), visibility .55s;
}
.gate.is-unlocked { opacity: 0; visibility: hidden; }
.gate__aurora { position: absolute; inset: -20%; filter: blur(90px); opacity: .5; }
.gate__aurora i {
  position: absolute; border-radius: 50%;
  animation: aurora 16s var(--ease) infinite alternate;
}
.gate__aurora i:nth-child(1) { width: 46vw; height: 46vw; left: 8%; top: 4%; background: rgba(4, 152, 177, .32); }
.gate__aurora i:nth-child(2) { width: 34vw; height: 34vw; right: 6%; top: 28%; background: rgba(253, 87, 87, .13); animation-delay: -6s; }
.gate__aurora i:nth-child(3) { width: 40vw; height: 40vw; left: 32%; bottom: -8%; background: rgba(0, 76, 88, .5); animation-delay: -11s; }
@keyframes aurora {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vw, -4vh) scale(1.18); }
}
.gate__grain {
  position: absolute; inset: 0; opacity: .07; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}
.gate__card {
  position: relative; width: min(420px, 100%);
  background: linear-gradient(168deg, rgba(14, 32, 38, .92), rgba(7, 18, 22, .94));
  border: 1px solid var(--line-strong); border-radius: 24px;
  padding: 44px 40px 30px; box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: gate-in .8s var(--ease) both;
}
@keyframes gate-in { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.gate__logo { height: 30px; margin: 0 auto 26px; }
.gate__divider { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.gate__divider span { flex: 1; height: 1px; background: var(--line-strong); }
.gate__divider em {
  font-style: normal; font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .34em; color: var(--tf-teal-bright);
}
.gate__client {
  text-align: center; font-size: 27px; font-weight: 600; line-height: 1.16; margin-bottom: 10px;
}
.gate__hint { text-align: center; color: var(--text-mute); font-size: 13.5px; margin: 0 0 26px; }
.gate__field label {
  display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
.gate__inputwrap { position: relative; }
.gate__inputwrap input {
  width: 100%; padding: 14px 46px 14px 16px;
  background: rgba(3, 10, 12, .8); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); color: var(--text);
  font-family: var(--font-mono); font-size: 15px; letter-spacing: .08em;
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.gate__inputwrap input:focus {
  border-color: var(--tf-teal);
  box-shadow: 0 0 0 4px rgba(4, 152, 177, .18);
}
.gate__eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: var(--text-dim); padding: 8px; border-radius: 8px;
  transition: color .2s;
}
.gate__eye:hover { color: var(--tf-teal-bright); }
.gate__error { color: var(--bad); font-size: 12.5px; margin: 9px 2px 0; }
.gate__form.is-error .gate__inputwrap { animation: shake .5s var(--ease); }
.gate__form.is-error .gate__inputwrap input { border-color: var(--bad); }
@keyframes shake {
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(2px); }
}
.gate__btn {
  width: 100%; margin-top: 20px; padding: 15px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(135deg, var(--tf-teal), #027287);
  color: #fff; border: 0; border-radius: var(--r-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  transition: transform .2s var(--ease), box-shadow .25s;
  box-shadow: 0 10px 28px rgba(4, 152, 177, .32);
}
.gate__btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(4, 152, 177, .42); }
.gate__btn:active { transform: translateY(0) scale(.985); }
.gate__btn-arrow { transition: transform .25s var(--ease); }
.gate__btn:hover .gate__btn-arrow { transform: translateX(4px); }
.gate__foot {
  margin: 30px 0 0; text-align: center; font-size: 11.5px; color: var(--text-dim);
  border-top: 1px solid var(--line); padding-top: 18px;
}
.gate__foot strong { color: var(--text-mute); }

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

.side {
  width: 252px; flex-shrink: 0; position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(186deg, #081418 0%, #050C0F 100%);
  border-right: 1px solid var(--line); padding: 26px 18px 20px;
  z-index: 40;
}
.side__brand { padding: 0 8px 22px; }
.side__logo { height: 22px; }
.side__client {
  display: flex; align-items: center; gap: 12px;
  background: var(--tf-teal-soft); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 26px;
}
.side__client-mark {
  width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--tf-teal), #026D81);
  border-radius: 10px; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: #fff;
}
.side__client-meta { display: flex; flex-direction: column; min-width: 0; }
.side__client-meta strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__client-meta em { font-style: normal; font-size: 11px; color: var(--text-dim); }
.side__nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.side__nav-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-dim); margin: 14px 10px 8px;
}
.side__link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: var(--r-sm); color: var(--text-mute); font-weight: 500; font-size: 14px;
  position: relative; transition: color .2s, background .2s, transform .15s var(--ease);
}
.side__link svg { flex-shrink: 0; transition: transform .25s var(--ease); }
.side__link:hover { color: var(--text); background: rgba(31, 200, 224, .06); }
.side__link:hover svg:first-child { transform: translateX(2px) scale(1.06); }
.side__link.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(4, 152, 177, .9), rgba(2, 109, 129, .9));
  box-shadow: 0 8px 22px rgba(4, 152, 177, .28);
}
.side__link.is-active::before {
  content: ""; position: absolute; left: -18px; top: 22%; bottom: 22%; width: 3px;
  background: var(--tf-teal-bright); border-radius: 0 3px 3px 0;
}
.side__ext { margin-left: auto; opacity: .5; }
.side__foot { border-top: 1px solid var(--line); padding-top: 16px; }
.side__logout {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-mute); font-size: 13.5px; font-weight: 500; padding: 10px 12px;
  transition: color .2s, border-color .2s, background .2s;
}
.side__logout:hover { color: var(--tf-coral); border-color: rgba(253, 87, 87, .3); background: var(--tf-coral-soft); }
.side__credit { font-size: 10.5px; color: var(--text-dim); margin: 12px 12px 0; letter-spacing: .04em; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 18px;
  padding: 18px 34px; backdrop-filter: blur(14px);
  background: rgba(5, 9, 11, .78); border-bottom: 1px solid var(--line);
}
.topbar__burger { display: none; }
.topbar__title h2 { font-size: 21px; font-weight: 600; }
.topbar__title p { margin: 1px 0 0; font-size: 12.5px; color: var(--text-dim); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar__live {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em;
  color: var(--good); background: rgba(43, 217, 163, .1);
  border: 1px solid rgba(43, 217, 163, .25); border-radius: 99px; padding: 6px 13px;
}
.topbar__live i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--good);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 217, 163, .5); }
  70% { box-shadow: 0 0 0 7px rgba(43, 217, 163, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 217, 163, 0); }
}
.topbar__date { font-family: var(--font-mono); font-size: 12px; color: var(--text-mute); }
.topbar__avatar {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--tf-coral), #C73A3A);
  border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 12.5px;
}

.content { padding: 30px 34px 10px; flex: 1; outline: none; }
.appfoot {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 34px 26px; color: var(--text-dim); font-size: 12px;
}
.appfoot__logo { height: 13px; opacity: .4; }
.appfoot p { margin: 0; }
.appfoot strong { color: var(--text-mute); font-weight: 500; }

/* page transitions */
.page { animation: page-in .5s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } }

/* staggered card reveals */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }

/* ============================ CARDS / GRID ============================ */
.grid { display: grid; gap: 18px; }
.grid--kpi { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.grid--two { grid-template-columns: 1.9fr 1fr; margin-bottom: 18px; }
.grid--three { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 24px; position: relative; overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .3s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 20px 44px rgba(0, 0, 0, .4); }
.card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card__title { font-size: 15.5px; font-weight: 600; }
.card__sub { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
.card__spacer { margin-left: auto; }

.kpi { padding: 20px 22px; }
.kpi__label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.kpi__label svg { color: var(--tf-teal-bright); }
.kpi__value {
  font-family: var(--font-display); font-size: 34px; font-weight: 650; line-height: 1.1;
  margin: 10px 0 2px; font-variant-numeric: tabular-nums;
}
.kpi__value small { font-size: 16px; color: var(--text-mute); font-weight: 500; }
.kpi__meta { display: flex; align-items: center; gap: 10px; min-height: 22px; }
.kpi__delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11.5px; padding: 3px 9px; border-radius: 99px;
}
.kpi__delta--up { color: var(--good); background: rgba(43, 217, 163, .1); }
.kpi__delta--down { color: var(--bad); background: var(--tf-coral-soft); }
.kpi__hint { font-size: 11.5px; color: var(--text-dim); }
.kpi__spark { position: absolute; right: 14px; bottom: 14px; opacity: .9; }

.note {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-dim); margin: 4px 0 22px;
}
.note svg { flex-shrink: 0; color: var(--warn); }

/* segmented toggle */
.seg {
  display: inline-flex; background: rgba(3, 10, 12, .7);
  border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px;
}
.seg button {
  border: 0; background: none; color: var(--text-mute);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 500;
  padding: 7px 16px; border-radius: 99px; transition: color .2s, background .25s var(--ease);
}
.seg button.is-on { background: var(--tf-teal); color: #fff; box-shadow: 0 4px 14px rgba(4, 152, 177, .35); }

/* ============================ CHARTS ============================ */
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .axis-text { font-family: var(--font-mono); font-size: 10px; fill: var(--text-dim); }
.chart-svg .gridline { stroke: rgba(31, 200, 224, .07); }
.chart-area { opacity: 0; transition: opacity .9s ease .45s; }
.chart-area.is-in { opacity: 1; }
.chart-line {
  fill: none; stroke: var(--tf-teal-bright); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 4px 10px rgba(31, 200, 224, .35));
}
.chart-dot { fill: var(--tf-teal-bright); stroke: var(--bg); stroke-width: 2; opacity: 0; transition: opacity .15s; }
.chart-dot.is-on { opacity: 1; }
.chart-bar { fill: url(#barGrad); rx: 5; transform-origin: bottom; cursor: pointer; transition: filter .2s; }
.chart-bar:hover { filter: brightness(1.35); }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #0E2229; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 9px 13px; font-size: 12px; opacity: 0; transform: translate(-50%, -8px);
  transition: opacity .15s; white-space: nowrap; box-shadow: var(--shadow);
}
.chart-tip strong { font-family: var(--font-mono); color: var(--tf-teal-bright); display: block; font-size: 14px; }
.chart-tip em { font-style: normal; color: var(--text-dim); font-size: 10.5px; }
.chart-tip.is-on { opacity: 1; }
.chart-crosshair { stroke: rgba(31, 200, 224, .25); stroke-dasharray: 3 4; opacity: 0; }
.chart-crosshair.is-on { opacity: 1; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { position: relative; width: 158px; height: 158px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; stroke-linecap: round; }
.donut__center {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.donut__center strong { font-family: var(--font-display); font-size: 26px; display: block; }
.donut__center em { font-style: normal; font-size: 10.5px; color: var(--text-dim); letter-spacing: .1em; text-transform: uppercase; }
.legend { display: flex; flex-direction: column; gap: 11px; flex: 1; }
.legend__row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend__dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.legend__name { color: var(--text-mute); }
.legend__val { margin-left: auto; font-family: var(--font-mono); font-size: 12.5px; }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 15px; }
.hbar__top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.hbar__name { color: var(--text-mute); }
.hbar__val { font-family: var(--font-mono); color: var(--text); }
.hbar__track { height: 8px; background: rgba(3, 10, 12, .8); border-radius: 99px; overflow: hidden; }
.hbar__fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--tf-deep), var(--tf-teal), var(--tf-teal-bright));
  width: 0; transition: width 1.1s var(--ease);
}
.hbar__fill--coral { background: linear-gradient(90deg, #7E2B2B, var(--tf-coral)); }

/* ============================ PERFORMANCE ============================ */
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 18px; }
.gauge-card { text-align: center; padding: 26px 18px 22px; }
.gauge { position: relative; width: 132px; height: 132px; margin: 0 auto 14px; }
.gauge svg { transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.gauge__track { stroke: rgba(31, 200, 224, .08); }
.gauge__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 33px; font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.gauge-card h4 { font-size: 14px; font-weight: 600; font-family: var(--font-body); }
.gauge-card p { margin: 3px 0 0; font-size: 11.5px; color: var(--text-dim); }
.score-good { color: var(--good); } .score-warn { color: var(--warn); } .score-bad { color: var(--bad); }

.cwv { display: flex; flex-direction: column; gap: 14px; }
.cwv__row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(3, 10, 12, .5); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 18px;
}
.cwv__badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em;
  padding: 5px 11px; border-radius: 8px; flex-shrink: 0;
}
.cwv__badge--good { color: var(--good); background: rgba(43, 217, 163, .12); }
.cwv__badge--warn { color: var(--warn); background: rgba(255, 194, 75, .12); }
.cwv__badge--bad { color: var(--bad); background: var(--tf-coral-soft); }
.cwv__name { font-size: 13.5px; }
.cwv__name em { display: block; font-style: normal; font-size: 11px; color: var(--text-dim); }
.cwv__val { margin-left: auto; font-family: var(--font-mono); font-size: 16px; }

.perf-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--tf-teal), #027287); color: #fff;
  border: 0; border-radius: var(--r-sm); padding: 11px 20px;
  font-size: 13.5px; font-weight: 600;
  transition: transform .2s var(--ease), box-shadow .25s;
  box-shadow: 0 8px 22px rgba(4, 152, 177, .3);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(4, 152, 177, .4); }
.btn:disabled { opacity: .55; cursor: progress; transform: none; }
.btn--ghost { background: none; border: 1px solid var(--line-strong); box-shadow: none; color: var(--text-mute); }
.btn--ghost:hover { color: var(--text); border-color: var(--tf-teal); box-shadow: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skel { position: relative; overflow: hidden; background: rgba(31, 200, 224, .05); border-radius: 8px; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(31, 200, 224, .1) 50%, transparent 70%);
  animation: shimmer 1.6s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ============================ TUTORIALS ============================ */
.tut-progress {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(4, 152, 177, .14), rgba(0, 53, 61, .3));
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 20px 26px;
}
.tut-progress__ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.tut-progress__ring svg { transform: rotate(-90deg); }
.tut-progress__ring circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.tut-progress__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 14px; color: var(--tf-teal-bright);
}
.tut-progress h3 { font-size: 17px; }
.tut-progress p { margin: 3px 0 0; font-size: 13px; color: var(--text-mute); }

.tut-group { margin-bottom: 28px; }
.tut-group__label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--tf-teal-bright); margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
}
.tut-group__label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tut-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.tut { cursor: pointer; }
.tut__head { display: flex; align-items: center; gap: 14px; }
.tut__icon {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--tf-teal-soft); border: 1px solid var(--line-strong);
  border-radius: 12px; color: var(--tf-teal-bright);
  transition: transform .3s var(--ease), background .25s;
}
.tut:hover .tut__icon { transform: rotate(-6deg) scale(1.08); background: rgba(4, 152, 177, .25); }
.tut__meta { min-width: 0; flex: 1; }
.tut__meta h4 { font-size: 15px; font-weight: 600; font-family: var(--font-body); }
.tut__meta p { margin: 2px 0 0; font-size: 12px; color: var(--text-dim); }
.tut__state { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tut__done {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; color: transparent; transition: all .25s var(--ease);
}
.tut.is-done .tut__done { background: var(--good); border-color: var(--good); color: #04261C; }
.tut__chev { color: var(--text-dim); transition: transform .3s var(--ease); }
.tut.is-open .tut__chev { transform: rotate(180deg); }
.tut__body {
  display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease);
}
.tut.is-open .tut__body { grid-template-rows: 1fr; }
.tut__body-inner { overflow: hidden; }
.tut__steps { margin: 18px 0 0; padding: 18px 0 4px; border-top: 1px solid var(--line); counter-reset: step; }
.tut__steps li {
  list-style: none; position: relative; padding: 0 0 16px 44px; counter-increment: step;
  font-size: 13.5px; color: var(--text-mute); line-height: 1.6;
}
.tut__steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: -1px;
  font-family: var(--font-mono); font-size: 11px; color: var(--tf-teal-bright);
  width: 30px; height: 30px; display: grid; place-items: center;
  background: rgba(4, 152, 177, .1); border: 1px solid var(--line-strong); border-radius: 9px;
}
.tut__steps li strong { color: var(--text); font-weight: 600; }
.tut__steps code {
  font-family: var(--font-mono); font-size: 12px; color: var(--tf-teal-bright);
  background: rgba(4, 152, 177, .1); padding: 2px 7px; border-radius: 6px;
}
.tut__actions { display: flex; gap: 10px; padding: 6px 0 6px; flex-wrap: wrap; }
.tut__mark {
  background: none; border: 1px solid var(--line-strong); color: var(--text-mute);
  font-size: 12.5px; font-weight: 500; border-radius: 99px; padding: 8px 16px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s;
}
.tut__mark:hover { border-color: var(--good); color: var(--good); }
.tut.is-done .tut__mark { background: rgba(43, 217, 163, .1); border-color: var(--good); color: var(--good); }

/* confetti burst on completing a tutorial */
.burst { position: fixed; pointer-events: none; z-index: 80; width: 6px; height: 6px; border-radius: 2px; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1240px) {
  .grid--kpi { grid-template-columns: repeat(2, 1fr); }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .grid--two { grid-template-columns: 1fr; }
  .grid--three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .side {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .35s var(--ease); box-shadow: var(--shadow);
  }
  .side.is-open { transform: none; }
  .topbar__burger {
    display: flex; flex-direction: column; gap: 5px; background: none; border: 0; padding: 6px;
  }
  .topbar__burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: all .3s var(--ease); }
  .topbar { padding: 14px 18px; }
  .content { padding: 22px 18px 8px; }
  .appfoot { padding: 18px; }
  .topbar__date { display: none; }
}
@media (max-width: 640px) {
  .grid--kpi, .grid--three, .gauges, .tut-grid { grid-template-columns: 1fr; }
  .gate__card { padding: 34px 26px 24px; }
  .donut-wrap { flex-direction: column; }
  .topbar__live { display: none; }
  .kpi__value { font-size: 29px; }
}

/* scrim for mobile nav */
.scrim {
  position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.scrim.is-on { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================ TUTORIAL DEMO PLAYER ============================ */
.demo {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center;
  padding: 28px; background: rgba(2, 6, 8, .82); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.demo.is-open { opacity: 1; pointer-events: auto; }
.demo__box {
  width: min(1060px, 100%); max-height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(170deg, #0C1E24, #07141A);
  border: 1px solid var(--line-strong); border-radius: 22px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6);
  transform: translateY(18px) scale(.98); transition: transform .35s var(--ease);
}
.demo.is-open .demo__box { transform: none; }
.demo__head {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.demo__head img { height: 14px; opacity: .65; }
.demo__head h3 { font-size: 15.5px; font-weight: 600; font-family: var(--font-body); }
.demo__count {
  margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--tf-teal-bright);
  background: var(--tf-teal-soft); border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 12px;
}
.demo__close {
  background: none; border: 1px solid var(--line-strong); color: var(--text-mute);
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  transition: all .2s;
}
.demo__close:hover { color: var(--tf-coral); border-color: rgba(253, 87, 87, .4); }
.demo__bars { display: flex; gap: 5px; padding: 12px 20px 0; }
.demo__bar { flex: 1; height: 3px; border-radius: 99px; background: rgba(31, 200, 224, .14); overflow: hidden; cursor: pointer; }
.demo__bar i { display: block; height: 100%; width: 0; background: var(--tf-teal-bright); border-radius: 99px; }
.demo__bar.is-done i { width: 100%; }
.demo__bar.is-now i { transition: width linear; }
.demo__stage { position: relative; margin: 14px 20px 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #0A161B; aspect-ratio: 16 / 10; }
.demo__stage img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .4s ease, transform 7s linear;
}
.demo__stage img.is-on { opacity: 1; }
.demo__stage.is-text { display: grid; place-items: center;
  background: radial-gradient(700px 360px at 70% 0%, rgba(4, 152, 177, .18), transparent 60%), #0A161B; }
.demo__slide { max-width: 520px; text-align: center; padding: 30px; }
.demo__slide h4 { font-family: var(--font-display); font-size: 26px; margin-bottom: 12px; }
.demo__slide p { color: var(--text-mute); font-size: 15px; line-height: 1.65; margin: 0; }
.demo__ring {
  position: absolute; border: 2.5px solid var(--tf-teal-bright); border-radius: 10px;
  box-shadow: 0 0 0 4000px rgba(3, 10, 13, .42), 0 0 22px rgba(31, 200, 224, .55);
  transition: all .55s var(--ease); pointer-events: none; opacity: 0;
}
.demo__ring.is-on { opacity: 1; animation: ring-pulse 1.8s ease-out infinite; }
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 4000px rgba(3, 10, 13, .42), 0 0 14px rgba(31, 200, 224, .45); }
  50% { box-shadow: 0 0 0 4000px rgba(3, 10, 13, .42), 0 0 30px rgba(31, 200, 224, .8); }
}
.demo__foot { display: flex; align-items: center; gap: 16px; padding: 16px 20px 18px; }
.demo__cap { flex: 1; font-size: 14.5px; line-height: 1.55; color: var(--text); min-height: 44px; }
.demo__cap strong { color: var(--tf-teal-bright); }
.demo__cap em { font-style: normal; color: var(--text-mute); display: block; font-size: 12.5px; margin-top: 2px; }
.demo__nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.demo__btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(31, 200, 224, .08); border: 1px solid var(--line-strong); color: var(--text);
  transition: all .2s var(--ease);
}
.demo__btn:hover { background: rgba(31, 200, 224, .2); transform: scale(1.06); }
.demo__btn--play { width: 48px; height: 48px; background: linear-gradient(135deg, var(--tf-teal), #027287);
  border: 0; box-shadow: 0 8px 22px rgba(4, 152, 177, .35); }
.demo__btn:disabled { opacity: .35; pointer-events: none; }
.tut__watch {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--tf-teal), #027287); color: #fff; border: 0;
  font-size: 12.5px; font-weight: 600; border-radius: 99px; padding: 8px 16px;
  transition: transform .2s var(--ease), box-shadow .25s;
  box-shadow: 0 6px 16px rgba(4, 152, 177, .3);
}
.tut__watch:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(4, 152, 177, .42); }
@media (max-width: 760px) {
  .demo { padding: 10px; }
  .demo__stage { margin: 10px 12px 0; }
  .demo__foot { flex-wrap: wrap; padding: 12px; }
  .demo__cap { flex-basis: 100%; min-height: 0; }
  .demo__nav { margin-left: auto; }
}
