/* Orbitrix Management Dashboards — styles */
:root {
  color-scheme: light;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e6e8ee;
  --line-2: #eef0f4;
  --ink: #0d1526;
  --ink-2: #4b5468;
  --ink-3: #8a91a3;
  --navy: #0b1530;
  --navy-2: #13204a;
  --brand: #2a78d6;
  --brand-ink: #1c5cab;
  --cta: #ff7a1a;
  --cta-ink: #ffffff;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s7: #6250d6;
  --ghost: #cfd4de; --ghost-line: #9aa1b2;
  --good: #0ca30c; --good-ink: #0a7a0a; --good-bg: #e8f6e8;
  --warning: #fab219; --warning-ink: #8a5a00; --warning-bg: #fff4da;
  --serious: #ec835a; --serious-ink: #a3401a; --serious-bg: #fdeee7;
  --critical: #d03b3b; --critical-ink: #b42a2a; --critical-bg: #fdecec;
  --shadow: 0 1px 2px rgba(13, 21, 38, .04), 0 4px 16px rgba(13, 21, 38, .05);
  --shadow-lg: 0 20px 60px rgba(13, 21, 38, .22);
  --r: 16px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f1a; --surface: #141a28; --surface-2: #1a2132; --line: #263048; --line-2: #1f2840;
    --ink: #eef1f7; --ink-2: #b4bccd; --ink-3: #7c8599;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s7: #9085e9;
    --ghost: #3a4560; --ghost-line: #6b7590;
    --good-ink: #5fd35f; --good-bg: rgba(12, 163, 12, .14);
    --warning-ink: #fac35a; --warning-bg: rgba(250, 178, 25, .13);
    --serious-ink: #f2a07f; --serious-bg: rgba(236, 131, 90, .14);
    --critical: #e25555; --critical-ink: #ff8a8a; --critical-bg: rgba(226, 85, 85, .15);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.sm { font-size: 12px; }
.num, .kpi-val, .hb-val, .dr-big, td, .ent-a b { font-variant-numeric: tabular-nums; }

/* icons */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 15px; height: 15px; }
.ic.xs { width: 12px; height: 12px; stroke-width: 2.2; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #c8d0e4; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.side-brand { padding: 2px 8px 14px; }
.brand-img.brand-lockup { max-width: 150px; max-height: 36px; display: block; }
.brand-img.brand-icon { width: 32px; height: 32px; object-fit: contain; display: block; border-radius: 8px; }
/* Official icon file has generous padding: show it in a rounded tile, zoomed to the mark (file itself is unchanged) */
.brand-tile { display: block; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; background: #03050e; box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); flex: none; }
.brand-tile img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.38); display: block; }
.side-mark .brand-tile { width: 44px; height: 44px; border-radius: 12px; }
.ph-app .brand-tile { width: 20px; height: 20px; border-radius: 5px; }
.logo-slot { border: 1.5px dashed #ff9f43; border-radius: 8px; color: #ff9f43; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; background: repeating-linear-gradient(45deg, rgba(255, 159, 67, .07) 0 6px, transparent 6px 12px); }
.logo-slot span { font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.logo-slot small { font-size: 9px; opacity: .85; }
.logo-slot-lockup { width: 150px; height: 40px; }
.logo-slot-icon { width: 34px; height: 34px; }
.logo-slot-icon small { display: none; }
.logo-slot-icon span { font-size: 7px; letter-spacing: .02em; }
.biz { display: flex; gap: 10px; align-items: center; padding: 12px 10px; margin: 0 0 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.biz b { color: #fff; display: block; font-size: 14px; }
.biz small { font-size: 11px; color: #8f9abb; }
.biz-av { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #ff9f43, #eb6834); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 13px; flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #b7c0d8; font-weight: 500; transition: background .2s, color .2s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.on { background: rgba(57, 135, 229, .18); color: #fff; box-shadow: inset 2px 0 0 #5aa2ff; }
.nav-item.locked { color: #7d88a6; }
.nav-item.locked .ic.sm { margin-left: auto; opacity: .6; }
.nav-sep { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #66708e; padding: 16px 11px 4px; font-weight: 600; }
.side-cta { margin-top: auto; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, #1a2a5c, #121d42); display: flex; flex-direction: column; gap: 8px; }
.side-cta p { margin: 0 0 2px; color: #fff; font-weight: 600; font-size: 13px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); padding: 16px 28px 12px; border-bottom: 1px solid var(--line-2); }
.top-row { display: flex; align-items: center; gap: 14px; }
.m-brand { display: none; }
.title-block { min-width: 0; flex: 1; }
.title-block h1 { font-size: 22px; font-weight: 750; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); max-width: 100%; }
.live > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .dot, .dot.ok { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .5); animation: breathe 2.4s infinite; flex: none; }
.live.ping .dot { animation: ping .9s ease-out, breathe 2.4s infinite .9s; }
.live.mini { font-weight: 600; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, .35); } 50% { box-shadow: 0 0 0 5px rgba(12, 163, 12, 0); } }
@keyframes ping { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(12, 163, 12, .6); } 50% { transform: scale(1.35); } 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(12, 163, 12, 0); } }
.top-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.periods { display: flex; gap: 6px; align-items: center; margin-top: 12px; overflow-x: auto; scrollbar-width: none; transition: opacity .2s; }
.periods::-webkit-scrollbar { display: none; }
.periods.muted .per.on { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.per { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-weight: 550; font-size: 13px; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.per:hover { color: var(--ink); }
.per.on { background: var(--ink); color: var(--surface); box-shadow: none; }
.per-range { margin-left: 8px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }

.view { padding: 22px 28px 36px; display: flex; flex-direction: column; gap: 18px; transition: opacity .17s ease, transform .17s ease; outline: none; }
.view.switching { opacity: 0; transform: translateY(6px); }
.foot { padding: 18px 28px 28px; color: var(--ink-3); font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; border-top: 1px solid var(--line-2); }
.foot a { text-decoration: none; color: var(--ink-2); }
.foot a:hover { color: var(--brand); }
.tabbar { display: none; }

.rise { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 11px; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; transition: transform .15s, background .2s, box-shadow .2s, color .2s; }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 11px; font-size: 12px; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.primary:hover { background: var(--brand-ink); color: #fff; }
.btn.ghost { box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn.subtle { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.btn.subtle:hover { color: var(--ink); }
.btn.cta { background: var(--cta); color: var(--cta-ink); box-shadow: 0 6px 18px rgba(255, 122, 26, .3); }
.btn.cta:hover { background: #ff8b38; box-shadow: 0 8px 22px rgba(255, 122, 26, .42); }
.btn.ghost-dark { color: #b7c0d8; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.btn.ghost-dark:hover { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.btn.spinning .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-weight: 600; font-size: 13px; }
.link:hover { color: var(--brand-ink); }
.link.xs { font-size: 12px; }
.mt { margin-top: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- chips & pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 650; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.chip.good { color: var(--good-ink); background: var(--good-bg); }
.chip.bad { color: var(--critical-ink); background: var(--critical-bg); }
.chip.flat { color: var(--ink-2); background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.pill.good { color: var(--good-ink); background: var(--good-bg); }
.pill.warning { color: var(--warning-ink); background: var(--warning-bg); }
.pill.serious { color: var(--serious-ink); background: var(--serious-bg); }
.pill.critical { color: var(--critical-ink); background: var(--critical-bg); }
.tag { font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); padding: 2px 7px; border-radius: 6px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; flex: none; }
.sw.lg { width: 12px; height: 34px; border-radius: 4px; margin: 0; }

/* ---------- hero insight ---------- */
.hero { display: flex; gap: 18px; padding: 22px 24px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand); }
.hero.tone-bad::before { background: var(--critical); }
.hero.tone-warn::before { background: var(--warning); }
.hero.tone-good::before { background: var(--good); }
.hero::after { content: ''; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--critical) 10%, transparent), transparent); pointer-events: none; }
.hero.tone-good::after { background: radial-gradient(closest-side, color-mix(in srgb, var(--good) 10%, transparent), transparent); }
.hero-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--critical-bg); color: var(--critical-ink); }
.hero.tone-good .hero-ic { background: var(--good-bg); color: var(--good-ink); }
.hero.tone-warn .hero-ic { background: var(--warning-bg); color: var(--warning-ink); }
.hero-ic .ic { width: 22px; height: 22px; }
.hero-body { min-width: 0; position: relative; z-index: 1; }
.eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.hero h2 { font-size: 21px; line-height: 1.3; font-weight: 750; margin: 6px 0 8px; max-width: 62ch; text-wrap: balance; }
.hero p { margin: 0; color: var(--ink-2); max-width: 78ch; font-size: 14.5px; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.more-ins { display: grid; gap: 8px; margin-top: -6px; }
.more-ins[hidden] { display: none; }
.more-ins.drop { animation: rise .4s ease both; }
.ins-row { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); transition: transform .15s, box-shadow .2s; }
.ins-row:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13, 21, 38, .09); }
.ins-row > span:nth-child(2) { flex: 1; min-width: 0; }
.ins-row b { display: block; font-weight: 650; }
.ins-row small { color: var(--ink-2); font-size: 12.5px; }
.ins-dot { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); }
.ins-row.tone-bad .ins-dot { background: var(--critical-bg); color: var(--critical-ink); }
.ins-row.tone-warn .ins-dot { background: var(--warning-bg); color: var(--warning-ink); }
.ins-row.tone-good .ins-dot { background: var(--good-bg); color: var(--good-ink); }

/* ---------- KPI cards ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); transition: transform .18s, box-shadow .2s; overflow: hidden; min-width: 0; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13, 21, 38, .1); }
.kpi:focus-visible, .btn:focus-visible, .per:focus-visible, .nav-item:focus-visible, .tab:focus-visible, .hbar.click:focus-visible, .alert:focus-visible, .ins-row:focus-visible, .card.branch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kpi-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi-val { font-size: 25px; font-weight: 780; letter-spacing: -.02em; line-height: 1.15; }
.kpi-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.bad { color: var(--critical-ink); font-weight: 600; }
.kpi-spark { height: 30px; margin-top: 4px; }
.spark { width: 100%; height: 30px; display: block; }
.spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s cubic-bezier(.4, .1, .2, 1) .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.kpi-go { position: absolute; right: 10px; bottom: 12px; color: var(--ink-3); opacity: 0; transform: translateX(-4px); transition: .2s; }
.kpi:hover .kpi-go, .card.branch:hover .kpi-go { opacity: 1; transform: none; }
.kpi.bump { animation: bump .6s ease; }
@keyframes bump { 30% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 45%, transparent), var(--shadow); } }
.fly { position: absolute; right: 14px; top: 38px; color: var(--good-ink); font-weight: 750; font-size: 13px; pointer-events: none; animation: fly 1.5s ease-out forwards; }
@keyframes fly { 0% { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-22px); } }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 18px 16px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h3 { font-size: 15px; font-weight: 700; }
.card-h p { margin: 2px 0 0; font-size: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-3b { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; background: var(--critical-bg); color: var(--critical-ink); font-weight: 750; font-size: 12px; display: grid; place-items: center; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.dash { height: 0; border-top: 2px dashed; background: none; }
.lede { margin: 0; color: var(--ink-2); max-width: 80ch; }

/* charts */
.chart-host { position: relative; width: 100%; }
.chart { display: block; overflow: visible; touch-action: pan-y; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .grid.zero { stroke: var(--line); }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .dlabel { fill: var(--ink-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .cross.on { opacity: .6; }
.chart .hdot { opacity: 0; transition: opacity .1s; }
.chart .hdot.on { opacity: 1; }
.chart .pulse-ring { stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ringp 2s ease-out infinite; }
@keyframes ringp { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow .75s cubic-bezier(.2, .7, .2, 1) both; transition: opacity .15s; }
.chart g.dim .bar { opacity: .35; }
.chart .bar.hl { filter: saturate(1.2); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.tt { position: absolute; top: 0; left: 0; pointer-events: none; background: var(--ink); color: var(--surface); padding: 8px 10px; border-radius: 10px; font-size: 12px; min-width: 150px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; z-index: 5; }
.tt.on { opacity: 1; transform: none; }
.tt-h { font-weight: 650; margin-bottom: 4px; opacity: .8; }
.tt-row { display: flex; align-items: center; gap: 7px; }
.tt-row i { width: 8px; height: 8px; border-radius: 2px; }
.tt-row span { flex: 1; opacity: .85; }
.tt-row b { font-variant-numeric: tabular-nums; }

/* alerts */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 11px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); transition: background .2s, transform .15s; width: 100%; }
.alert:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); }
.al-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.sev-critical .al-ic { background: var(--critical-bg); color: var(--critical-ink); }
.sev-serious .al-ic { background: var(--serious-bg); color: var(--serious-ink); }
.sev-warning .al-ic { background: var(--warning-bg); color: var(--warning-ink); }
.al-txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.al-sev { font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.sev-critical .al-sev { color: var(--critical-ink); }
.sev-serious .al-sev { color: var(--serious-ink); }
.sev-warning .al-sev { color: var(--warning-ink); }
.al-txt b { font-weight: 650; font-size: 13.5px; line-height: 1.35; }
.al-txt small { color: var(--ink-2); font-size: 12px; }
.al-act { color: var(--brand); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; }

/* hbar */
.hbar { display: block; width: 100%; padding: 8px 6px; margin: 0 -6px; width: calc(100% + 12px); border-radius: 10px; transition: background .2s; }
.hbar.click:hover { background: var(--surface-2); }
.hbar.hl { background: var(--critical-bg); }
.hb-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; align-items: baseline; }
.hb-name { font-weight: 600; display: inline-flex; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-val { font-weight: 700; white-space: nowrap; }
.hb-track { position: relative; height: 6px; border-radius: 99px; background: var(--line-2); overflow: visible; }
.hb-track.tall { height: 8px; }
.hb-fill { height: 100%; width: 0; border-radius: 99px; transition: width 1s cubic-bezier(.2, .7, .2, 1); }
.hb-fill.in { width: var(--w); }
.hb-meta { font-size: 12px; margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tbar { padding: 8px 0; }
.pace { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.pace::after { content: ''; position: absolute; top: -5px; left: -3px; border: 4px solid transparent; border-top-color: var(--ink); }

/* branches */
.card.branch { display: flex; flex-direction: column; gap: 12px; position: relative; text-align: left; transition: transform .18s, box-shadow .2s; }
.card.branch:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(13, 21, 38, .1); }
.card.branch.warn { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--critical) 55%, transparent), var(--shadow); }
.br-h { display: flex; gap: 12px; align-items: center; }
.br-h > div { flex: 1; min-width: 0; }
.br-h h3 { font-size: 17px; }
.br-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.br-kpis > div { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.br-kpis b { font-size: 18px; font-weight: 750; }
.lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.wk, table.pl { width: 100%; border-collapse: collapse; font-size: 13px; }
.wk th, .wk td, .pl th, .pl td { padding: 9px 8px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.wk thead th, .pl thead th { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.wk th:first-child, .pl th:first-child { text-align: left; }
.wk tbody th { font-weight: 650; display: flex; align-items: center; }
.wk td.ok { color: var(--good-ink); font-weight: 650; }
.wk td.no { color: var(--critical-ink); font-weight: 650; background: var(--critical-bg); }
.pl tr.tot th, .pl tr.tot td { font-weight: 750; border-top: 1px solid var(--line); }
.pl tr.big th, .pl tr.big td { font-size: 15px; }
.pl tr[data-drill] { cursor: pointer; }
.pl tr[data-drill]:hover { background: var(--surface-2); }

/* targets */
.pace-line { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); }
.pace-line .hb-track { flex: 1; max-width: 420px; }
.tgt { display: flex; gap: 18px; align-items: center; }
.tgt-ring { position: relative; flex: none; }
.ring-track { fill: none; stroke: var(--line-2); }
.ring-fill { fill: none; transition: stroke-dashoffset 1.3s cubic-bezier(.2, .7, .2, 1); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-c b { font-size: 22px; font-weight: 800; }
.ring-c small { font-size: 11px; color: var(--ink-3); }
.tgt-body h3 { font-size: 16px; }
.tgt-body p { margin: 0; }
.tgt-nums { margin: 8px 0; font-size: 13px; }
.tgt-nums b { font-size: 20px; font-weight: 780; }
.tgt-note { font-size: 12.5px; color: var(--ink-2); margin-top: 8px !important; }
.tgt-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input { font: inherit; font-size: 15px; color: var(--ink); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); width: 100%; font-variant-numeric: tabular-nums; }
.field input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.peso-in { position: relative; }
.peso-in i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-size: 15px; }
.peso-in input { padding-left: 28px; }
.form-err { color: var(--critical-ink); font-size: 12.5px; min-height: 1em; }
.form-actions, .md-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* sources */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card.src { display: flex; flex-direction: column; gap: 10px; transition: box-shadow .3s; }
.card.src.flash { animation: flash 1.2s ease; }
@keyframes flash { 20% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 50%, transparent), var(--shadow); } }
.src-h { display: flex; gap: 11px; align-items: flex-start; }
.src-h > div { flex: 1; min-width: 0; }
.src-h h3 { font-size: 14.5px; }
.src-h small { font-size: 12px; }
.src-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); flex: none; }
.src-st { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.src-rec { font-size: 12px; }
.card.src .btn { align-self: flex-start; }
.card.src.add { align-items: center; justify-content: center; text-align: center; border: 1.5px dashed var(--line); box-shadow: none; background: transparent; color: var(--ink-2); min-height: 170px; }
.card.src.add:hover { border-color: var(--brand); color: var(--brand); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li.new { animation: slide .5s ease; background: linear-gradient(90deg, var(--good-bg), transparent); }
@keyframes slide { from { opacity: 0; transform: translateY(-8px); } }
.fd-t { flex: 1; min-width: 0; }
.fd-ago { width: 70px; text-align: right; }

/* summary */
.sum-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: center; max-width: 1040px; }
.sum-copy h2 { font-size: 30px; line-height: 1.15; font-weight: 800; margin: 18px 0 12px; letter-spacing: -.02em; }
.sum-copy p { color: var(--ink-2); font-size: 15px; max-width: 52ch; }
.ticks { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 8px; }
.ticks li { display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
.ticks .ic { color: var(--good-ink); }
.sum-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-2); transition: .2s; white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--surface); }
.seg.in-dr { display: flex; overflow-x: auto; margin: 4px 0 12px; scrollbar-width: none; }
.phone { width: 340px; height: 690px; border-radius: 48px; background: #0a0d14; padding: 12px; box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3142; position: relative; justify-self: center; }
.ph-notch { position: absolute; top: 20px; left: 50%; width: 96px; height: 26px; border-radius: 20px; background: #000; transform: translateX(-50%); z-index: 3; }
.ph-screen { height: 100%; border-radius: 38px; overflow: hidden; background: linear-gradient(170deg, #1b2c63 0%, #2a3f7d 40%, #e8ecf5 40.1%); position: relative; padding: 52px 14px 14px; display: flex; flex-direction: column; gap: 10px; color: #0d1526; }
.ph-status { position: absolute; top: 18px; left: 30px; right: 30px; display: flex; justify-content: space-between; color: #fff; font-weight: 650; font-size: 13px; }
.ph-sig { display: flex; gap: 2px; align-items: flex-end; }
.ph-sig i { width: 3px; background: #fff; border-radius: 1px; }
.ph-sig i:nth-child(1) { height: 5px; } .ph-sig i:nth-child(2) { height: 8px; } .ph-sig i:nth-child(3) { height: 11px; }
.ph-notif { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); border-radius: 18px; padding: 10px 12px; font-size: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.ph-notif.drop-in { animation: dropin .7s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes dropin { from { opacity: 0; transform: translateY(-30px) scale(.95); } }
.ph-notif p { margin: 2px 0 0; color: #333b4d; line-height: 1.35; }
.ph-app { display: flex; gap: 7px; align-items: center; font-size: 10.5px; color: #59627a; font-weight: 600; margin-bottom: 4px; letter-spacing: .04em; }
.ph-app .logo-slot-icon, .ph-app .brand-icon { width: 20px; height: 20px; border-radius: 5px; }
.ph-app .logo-slot-icon span { font-size: 4.5px; }
.ph-card { background: #fff; border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; box-shadow: 0 10px 30px rgba(13, 21, 38, .14); min-height: 0; overflow: hidden; }
.ph-h small { color: #8a91a3; font-size: 11px; font-weight: 600; }
.ph-h b { display: block; font-size: 15px; margin-bottom: 4px; }
.ph-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #eef0f4; gap: 8px; }
.ph-row small { display: block; font-size: 11px; color: #59627a; font-weight: 600; }
.ph-row em { font-style: normal; font-size: 10.5px; color: #8a91a3; }
.ph-v { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.ph-v b { font-size: 16px; font-weight: 780; font-variant-numeric: tabular-nums; }
.ph-v .chip { font-size: 10px; padding: 1px 6px; }
.ph-card .chip.good { color: #0a7a0a; background: #e8f6e8; } .ph-card .chip.bad { color: #b42a2a; background: #fdecec; }
.ph-ins { background: #fdecec; border-radius: 12px; padding: 8px 10px; margin: 8px 0; }
.ph-ins small { display: flex; gap: 4px; align-items: center; color: #b42a2a; font-weight: 700; font-size: 10.5px; }
.ph-ins p { margin: 2px 0 0; font-size: 12px; font-weight: 600; line-height: 1.35; }
.ph-card .btn.primary { background: #0d1526; color: #fff; margin-top: auto; }

/* ---------- drawer ---------- */
.drawer-wrap, .modal-wrap { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-wrap.open, .modal-wrap.open { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: rgba(8, 12, 24, .42); opacity: 0; transition: opacity .3s; backdrop-filter: blur(2px); }
.open > .scrim { opacity: 1; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); display: flex; flex-direction: column; }
.drawer-wrap.open .drawer { transform: none; }
.grab { display: none; }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 12px; border-bottom: 1px solid var(--line-2); }
.dr-titles { flex: 1; min-width: 0; }
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-3); min-height: 14px; overflow: hidden; white-space: nowrap; }
.dr-head h2 { font-size: 18px; }
.dr-body { overflow-y: auto; padding: 16px 20px 40px; flex: 1; overscroll-behavior: contain; }
.dr-body.dr-in { animation: rise .35s ease; }
.dr-hero { padding: 4px 0 12px; }
.dr-big { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.dr-big .chip { font-size: 12.5px; }
.dr-hero p { margin: 0; font-size: 12.5px; }
.sec { font-size: 13px; font-weight: 700; margin: 20px 0 8px; }
.sec .muted { font-weight: 500; font-size: 12px; }
.ents { list-style: none; margin: 0; padding: 0; }
.ents.clipped li.more { display: none; }
.ent { display: flex; gap: 12px; padding: 10px 8px; border-bottom: 1px solid var(--line-2); align-items: flex-start; border-radius: 8px; }
.ent.hot { background: var(--critical-bg); border-bottom-color: transparent; margin-bottom: 2px; }
.ent-d { width: 58px; flex: none; font-size: 12px; color: var(--ink-3); padding-top: 1px; }
.ent-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.ent-m b { font-weight: 650; font-size: 13px; }
.ent-m small { color: var(--ink-2); font-size: 12px; }
.ent-a { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ent-a b { font-size: 13.5px; }
.ent-a small { font-size: 11px; }
.src-note { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-top: 16px; }
.wf { list-style: none; padding: 0; margin: 0; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.wf li { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.wf li:last-child { border-bottom: 0; }
.wf li.in b { color: var(--good-ink); }
.wf li.out b { color: var(--ink); }
.wf li.start, .wf li.end { font-weight: 700; background: var(--surface-2); }
.wf li.end.neg { background: var(--critical-bg); color: var(--critical-ink); }
.wf li.end.low { background: var(--warning-bg); color: var(--warning-ink); }
.wf li span { display: inline-flex; align-items: center; gap: 6px; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; padding: 9px 12px; border-radius: 10px; margin: 10px 0 0; }
.note.warn { background: var(--warning-bg); color: var(--warning-ink); }
.note.bad { background: var(--critical-bg); color: var(--critical-ink); }
.note .ic { margin-top: 3px; }
.tip { margin-top: 14px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.tip p { margin: 4px 0 10px; color: var(--ink-2); font-size: 13px; }
.mv { list-style: none; margin: 0; padding: 0; }
.mv li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.mv li > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mv li > span:nth-child(2) b { font-weight: 600; }
.mv .pos { color: var(--good-ink); white-space: nowrap; }
.mv .neg { white-space: nowrap; }
.inv { padding: 10px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- modal ---------- */
.modal { position: absolute; left: 50%; top: 50%; width: min(440px, calc(100% - 32px)); background: var(--surface); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-lg); transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: .28s cubic-bezier(.2, .8, .2, 1); }
.modal-wrap.open .modal { transform: translate(-50%, -50%); opacity: 1; }
.modal h2 { font-size: 20px; margin: 6px 0 8px; }
.modal p { color: var(--ink-2); margin: 0 0 18px; }
.md-ic { width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); display: grid; place-items: center; margin-bottom: 12px; }
.custom-f { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.custom-f .quick, .custom-f .form-err, .custom-f .md-actions { grid-column: 1 / -1; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { padding: 5px 11px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chip-btn:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink-3); }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; gap: 8px; align-items: center; background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 550; opacity: 0; transform: translateY(12px); transition: .3s cubic-bezier(.2, .8, .2, 1); }
.toast.in { opacity: 1; transform: none; }
.toast.ok .ic { color: #5fd35f; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .m-brand { display: block; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--ink-3); padding: 4px 0; border-radius: 10px; transition: color .2s; text-align: center; }
  .tab.on { color: var(--brand); }
  .tab .ic { width: 21px; height: 21px; }
  .main { padding-bottom: 72px; }
  .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > :last-child { grid-column: 1 / -1; }
  .sum-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: left; }
}
@media (max-width: 760px) {
  body { font-size: 13.5px; }
  .top { padding: 10px 16px 8px; }
  .top-row { gap: 10px; }
  .title-block h1 { font-size: 18px; }
  .live { font-size: 11px; }
  .top-actions .btn.subtle span { display: none; }
  .top-actions .btn.subtle { padding: 8px; }
  .top-actions .btn.cta { padding: 8px 12px; font-size: 12.5px; }
  .hide-sm { display: none; }
  .periods { margin: 10px -16px 0; padding: 0 16px; }
  .per { padding: 6px 11px; font-size: 12.5px; }
  .per-range { display: none; }
  .view { padding: 14px 16px 28px; gap: 14px; }
  .foot { padding: 16px; }
  .hero { padding: 16px; gap: 12px; border-radius: 16px; flex-direction: column; }
  .hero-ic { width: 36px; height: 36px; border-radius: 11px; }
  .hero h2 { font-size: 17px; }
  .hero p { font-size: 13.5px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 13px 10px; }
  .kpi-val { font-size: 21px; }
  .kpi-label { font-size: 12px; }
  .kpi-top { flex-wrap: wrap; gap: 4px; }
  .grid-3, .grid-3b { grid-template-columns: minmax(0, 1fr); }
  .grid-3 > :last-child { grid-column: auto; }
  .card { padding: 15px 14px 13px; }
  .tgt { gap: 14px; }
  .tgt-ring svg { width: 100px; height: 100px; }
  .br-kpis b { font-size: 16px; }
  .src-grid { grid-template-columns: minmax(0, 1fr); }
  .sum-copy h2 { font-size: 24px; }
  .phone { transform: scale(.92); transform-origin: top center; margin-bottom: -50px; }
  .drawer { top: auto; height: 92vh; height: 92dvh; width: 100%; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; }
  .dr-head { padding: 6px 10px 10px 8px; }
  .dr-body { padding: 12px 16px calc(32px + env(safe-area-inset-bottom)); }
  .dr-big { font-size: 26px; }
  .ent { gap: 8px; padding: 10px 6px; }
  .ent-d { width: 46px; font-size: 11px; }
  .custom-f { grid-template-columns: 1fr; }
  .toasts { bottom: 84px; width: calc(100% - 32px); }
  .fd-ago { display: none; }
}
@media (max-width: 380px) {
  .kpi-val { font-size: 19px; }
  .top-actions .btn.cta { font-size: 12px; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
