/* KG Business Hub V3 — tested premium visual layer. Demo/sample data remains unchanged.
   Loaded after existing inline styles and light-os.css. No data or API behaviour changes. */
:root{--bg:#f3f7fd;--surface:#fff;--ink:#15334d;--muted:#56718a;--line:#d9e5f0;--green:#0d4975;--green2:#176fb3;--lime:#b7e1fa;--gold:#5ba4d9;--shadow:0 14px 38px #123f690d;--radius:20px}
body{background:radial-gradient(ellipse 65% 32% at 90% -5%,#e4f2ff 0%,transparent 85%),#f3f7fd;color:var(--ink)}
.prototype-banner{height:auto;min-height:35px;padding:8px 14px;background:#e8f4ff;color:#18527b;border-bottom:1px solid #c9e1f2;font-size:11px;line-height:1.5}
.sidebar{background:linear-gradient(160deg,#0b2d4d 0%,#103f65 72%,#0a3153 100%);border-right:1px solid #285c7c}
.brand-mark{background:linear-gradient(135deg,#e1f5ff,#7fc2ef);color:#12456a;box-shadow:0 5px 18px #0002}
.brand span,.sidebar-links a,.nav-item{color:#c9dfed}
.nav-item{min-height:44px;border:1px solid transparent;border-radius:12px;transition:background .18s,border-color .18s}
.nav-item:hover,.nav-item.active{background:#ffffff17;color:#fff;border-color:#ffffff23}
.nav-item.active{box-shadow:inset 3px 0 #89d5ff}
.sidebar-links{border-top-color:#ffffff28}
.user-card{border-top-color:#ffffff28}
.main{min-width:0}
.topbar{border-radius:20px;background:linear-gradient(130deg,#103e66,#155b87);padding:clamp(18px,2.7vw,30px);box-shadow:0 14px 32px #123f691c}
.topbar :is(h1,h2),.topbar .eyebrow,.topbar #pageSubtitle{color:#fff}
.topbar #pageSubtitle{opacity:.85}
.top-actions{gap:10px}
.btn.primary{background:#176eb2;border-color:#176eb2;color:#fff;border-radius:11px;min-height:45px;font-weight:800}
.btn.primary:hover{background:#0e558f;border-color:#0e558f}
.btn.secondary{border-radius:11px;min-height:45px}
.kpi-grid>*,.analytics-kpis>*,.card,.integration-card,.safety-card{border:1px solid #d5e4f0;border-radius:18px;box-shadow:0 9px 24px #154d780b;background:#fff}
.kpi-grid strong,.analytics-kpis strong{font-variant-numeric:tabular-nums;letter-spacing:-.04em}
.card-head{gap:12px}
.card-head h2,.section-tools h2{letter-spacing:-.035em;color:#153c5c}
.section-label{color:#17699f;letter-spacing:.1em;font-weight:850}
.table-wrap{max-width:100%;overflow-x:auto}
.table-wrap table{min-width:560px}
:where(button,a,input,select,textarea):focus-visible{outline:3px solid #57a8eb;outline-offset:3px}
.modal{border-radius:22px;box-shadow:0 28px 90px #092b4d40}
.modal :is(input,select,textarea){min-height:46px;border:1px solid #bfd5e6;border-radius:10px;background:#fff;color:#173b59;font-size:16px}
.modal :is(input,select,textarea):focus-visible{outline:3px solid #8ed0ff;outline-offset:1px}
.nav-more-items,.top-more-panel{border-radius:14px;box-shadow:0 16px 32px #123f6920}
@media(max-width:900px){.sidebar{height:auto}.topbar{border-radius:16px}.kpi-grid{gap:10px}}
@media(max-width:600px){.topbar{padding:18px}.card{padding:16px}.prototype-banner{font-size:10px}.btn.primary,.btn.secondary{min-height:46px}.modal{max-width:calc(100vw - 24px)}}
@media(prefers-reduced-motion:reduce){.nav-item{transition:none}}

/* V3 launch extension: guided demo journeys rather than inert dashboard decoration. */
.demo-tour{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,2fr);gap:15px;align-items:stretch;margin:0 0 20px}
.demo-tour-lead{padding:clamp(19px,2.4vw,25px);border-radius:19px;background:#245ac9 radial-gradient(ellipse at 90% 0,#618fef,transparent 68%);color:#fff;box-shadow:0 14px 32px #2354b32e}
.demo-tour-lead .section-label{color:#c8dfff;font-size:12px}
.demo-tour-lead h2{color:#fff;font-size:clamp(20px,2.5vw,27px);letter-spacing:-.04em;margin:7px 0 7px}
.demo-tour-lead p{color:#e4edff;margin:0;font-size:14px;line-height:1.6}
.demo-tour-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}
.demo-tour-step{border:1px solid #d8e3f4;background:#fff;border-radius:16px;padding:16px;text-align:left;display:flex;flex-direction:column;gap:10px;min-width:0;cursor:pointer;box-shadow:0 8px 20px #174c9510}
.demo-tour-step:hover{background:#f0f5ff;border-color:#abc6f4;transform:translateY(-1px)}
.demo-tour-step span{display:grid;place-items:center;width:37px;height:37px;background:#e8efff;color:#2254be;border-radius:11px;font-size:12px;font-weight:850}
.demo-tour-step strong{font-size:16px;line-height:1.35;color:#163969;overflow-wrap:anywhere}
.demo-tour-step small{font-size:12px;line-height:1.5;color:#526a87}
.demo-tour-step:focus-visible{outline:3px solid #5e9cef;outline-offset:3px}
.dashboard-guide{background:#edf3ff;border-color:#cadcf8;color:#294e81}
.dashboard-guide strong{color:#1b56a5}
.kpi-card .label{color:#486889;font-size:14px}
.kpi-value{font-size:clamp(25px,3vw,33px);color:#173f71}
.kpi-note{color:#56728c;font-size:13px}
.chart-card{overflow:hidden}
.chart-card canvas{display:block;max-width:100%}
.status,.pill,.delta{font-size:12px}
.card h2{font-size:clamp(19px,2vw,23px)}
@media(max-width:1100px){.demo-tour{grid-template-columns:1fr}}
@media(max-width:700px){.demo-tour-steps{grid-template-columns:1fr}.demo-tour-step{display:grid;grid-template-columns:38px 1fr;align-items:center;gap:4px 11px}.demo-tour-step span{grid-row:1 / 3}.demo-tour-step small{grid-column:2}.demo-tour-lead{padding:18px}}
@media(prefers-reduced-motion:reduce){.demo-tour-step{transition:none}.demo-tour-step:hover{transform:none}}

/* Prevent demo finance tables from making grid tracks wider than phones. */
.card,.grid-2>*,.grid-3>*,.view{min-width:0}
.table-wrap{min-width:0;max-width:100%;width:100%;overflow-x:auto}
@media(max-width:1100px){.grid-2,.grid-3{grid-template-columns:minmax(0,1fr)}}

/* The finance and report canvases must shrink with their parent cards on 320px phones.
   The chart renderer keeps a high-resolution bitmap internally; CSS limits visual width. */
.view canvas{display:block;width:100%;max-width:100%;height:auto}

/* Finance + report headers must stack action buttons instead of widening mobile sections. */
.section-tools{gap:14px;flex-wrap:wrap;min-width:0}
.section-tools>div{min-width:0;flex:1 1 210px}
@media(max-width:600px){.section-tools{display:grid;grid-template-columns:minmax(0,1fr)}.section-tools>.btn{width:100%;max-width:100%}.section-tools h2{overflow-wrap:anywhere}}

/* Confirmed by browser diagnostics: long financial figures widened the min-content
   two-column KPI grid at 320px. Stack cards and retain the full figures visibly. */
.kpi-grid,.analytics-kpis{min-width:0;grid-template-columns:repeat(4,minmax(0,1fr))}
.kpi-card{min-width:0;overflow-wrap:anywhere}
.kpi-value{min-width:0;overflow-wrap:anywhere}
@media(max-width:1100px){.kpi-grid,.analytics-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.kpi-grid,.analytics-kpis{grid-template-columns:minmax(0,1fr)}}
