/* Jewel Field CRM UI 2026 Phase B1: Home, Dashboard, Reports. Loads after design.css; uses its tokens. Logical properties only. */
/*KPI strip + grid*/
.kpi-strip{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(min-width:761px){.kpi-strip{grid-template-columns:repeat(4,minmax(0,1fr))}.kpi-strip .kpi-value{font-size:26px}}
html:root .kpi{display:flex;flex-direction:column;gap:2px;min-height:96px;padding:14px 16px;text-align:start;font:inherit;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-1);transition:box-shadow var(--t),transform var(--t),border-color var(--t)}
html:root button.kpi{cursor:pointer}
html:root button.kpi:hover{box-shadow:var(--sh-2);transform:translateY(-1px);border-color:var(--line-strong)}
html:root button.kpi:active{transform:scale(.98)}
.kpi-label{font-size:13px;font-weight:600;color:var(--muted)}
.kpi-value{font-size:26px;font-weight:650;letter-spacing:-.02em;line-height:1.15;font-variant-numeric:tabular-nums;overflow-wrap:anywhere;margin-top:2px}
.kpi-sub{font-size:13px;color:var(--muted);margin-top:auto}
.kpi.ok .kpi-sub{color:var(--success-ink)}.kpi.warn .kpi-sub{color:var(--warning-ink)}.kpi.bad .kpi-sub{color:var(--danger-ink)}
.kpi.bad .kpi-value{color:var(--danger-ink)}
.kpi-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
html:root .kpi-grid.metric-grid{gap:12px}
.kpi-grid>*{min-width:0}
html:root .kpi-grid .metric{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:16px;min-height:104px}
html:root .kpi-grid .metric small{font-size:13px;font-weight:600;color:var(--muted);line-height:1.3}
html:root .kpi-grid .metric .num{font-size:26px;overflow-wrap:anywhere;margin-top:0}
html:root .kpi-grid .metric .tag{margin-top:auto;max-width:100%;white-space:normal}
.kpi-grid:not([class*=kpi-n]){grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
@media(max-width:960px){html:root .home-kpis{order:2;margin:0}html:root .home-pipeline{order:3}}
@media(max-width:760px){.kpi-strip .kpi-value{font-size:22px}.kpi-strip .kpi-sub{display:none}html:root .kpi-strip .kpi{min-height:0;padding:10px 14px}.home-date{display:none}html:root .kpi-grid[class*=kpi-n]{grid-template-columns:repeat(2,minmax(0,1fr))}
.kpi-grid[class*=kpi-n]>:last-child:nth-child(odd){grid-column:1/-1}
html:root .kpi-grid .metric .num{font-size:22px}}
@media(min-width:761px){.kpi-n3{grid-template-columns:repeat(3,minmax(0,1fr))}
.kpi-n4,.kpi-n5,.kpi-n6{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(min-width:761px) and (max-width:899px){.kpi-n5>:last-child:nth-child(odd){grid-column:1/-1}}
@media(min-width:900px){.kpi-n6{grid-template-columns:repeat(3,minmax(0,1fr))}
.kpi-n5{grid-template-columns:repeat(6,minmax(0,1fr))}.kpi-n5>*{grid-column:span 2}.kpi-n5>:nth-child(n+4){grid-column:span 3}}
@media(min-width:1000px){.kpi-n4{grid-template-columns:repeat(4,minmax(0,1fr))}}
/*HOME*/
html:root .home-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;align-items:start}
@media(min-width:961px){html:root .home-grid{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr)}}
.home-hero{align-items:flex-start;gap:8px 16px;margin-bottom:4px}
.home-hero h2{font-size:20px;margin:0}
.home-date{margin:2px 0 0;font-size:14px}
.home-hero-meta{font-size:13px;font-weight:600;padding:4px 10px;background:var(--surface-2);border-radius:999px;white-space:nowrap}
html:root .home-today .home-primary{width:100%;min-height:52px;margin:14px 0 12px;font-size:17px;border-radius:var(--r);box-shadow:0 1px 2px rgba(15,118,110,.35),0 6px 16px rgba(15,118,110,.18)}
html:root.dark .home-today .home-primary{box-shadow:var(--hl)}
@media(min-width:961px){html:root .home-today .home-primary{width:auto;min-width:240px}}
html:root .home-today button.home-next{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 16px;align-items:center;width:100%;margin:0 0 16px;padding:14px 16px;background:var(--accent-soft);border:1px solid var(--accent);border-radius:var(--r);text-align:start}
html:root .home-today button.home-next:hover{background:var(--accent-soft);box-shadow:var(--sh-2)}
.home-next .time{color:var(--accent-ink);font-weight:650;font-size:15px;line-height:1.35;padding-inline-end:16px;border-inline-end:1px solid var(--accent)}
.home-next small:first-child{color:var(--accent-ink);font-weight:600;letter-spacing:.05em;font-size:12px}
.home-next b{display:block;font-size:16px}
p.home-next{margin:0 0 16px;padding:12px 14px;background:var(--surface-2);border-radius:var(--r)}
html:root .home-today h3{margin:8px 0 0;font-size:13px;font-weight:650;letter-spacing:.04em;color:var(--muted)}
.home-actions{margin-top:4px}
html:root .home-today .appointment-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0;border-bottom:1px solid var(--line)}
html:root .home-today .appointment-row:last-child{border-bottom:0}
html:root .home-today .appointment-row .appointment{display:grid;grid-template-columns:64px minmax(0,1fr) auto;align-items:center;gap:2px 12px;padding:10px 12px 10px 8px;margin-inline:-8px;width:auto}
html:root .home-today .appointment .time{font-size:13px;font-weight:650;color:var(--ink-2);white-space:nowrap}
html:root .home-today .appointment-row .appointment b{display:flex;align-items:center;gap:8px;font-size:15px;overflow-wrap:anywhere}
html:root .home-today .appointment small{display:block;color:var(--muted);overflow-wrap:anywhere}
html:root .home-today .appointment>.tag{display:inline-flex;white-space:nowrap}
html:root .rtl .home-today .appointment-row .appointment{grid-template-columns:84px minmax(0,1fr) auto}
.act-ico{display:inline-grid!important;place-items:center;flex:none;width:24px;height:24px;margin:0!important;border-radius:7px;background:var(--surface-2);color:var(--ink-2);opacity:1!important}
.act-ico svg{width:14px;height:14px}
html:root .home-today .action-done-btn{width:44px;height:44px;min-height:44px;margin:0;padding:0;border-radius:999px;font-size:16px}
@media(max-width:520px){html:root .home-today .appointment-row .appointment{grid-template-columns:56px minmax(0,1fr);gap:4px 10px}
html:root .home-today .appointment>.tag{grid-column:2;justify-self:start;font-size:12px;white-space:normal}}
.home-secondary-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;padding-top:16px;border-top:1px solid var(--line)}
.home-secondary-actions .text-button{margin-inline-start:auto}
.home-pipeline-total{margin:8px 0 4px;font-size:20px;font-weight:650;letter-spacing:-.01em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.home-pipeline-total b{font-weight:650}
.home-pipeline .row{align-items:center}
.home-pipeline h2{margin:0}
.home-offline{margin-bottom:16px}
html:root .setup-checklist{border:1px solid var(--line);margin-top:16px}
.setup-checklist>summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;cursor:pointer;list-style:none;min-height:44px}
.setup-checklist>summary::-webkit-details-marker{display:none}
.setup-checklist .setup-progress{flex:1 0 100%;order:3;display:block;height:8px;margin:2px 0 6px}
.setup-checklist .setup-steps{margin-top:14px}
@media(min-width:761px){.setup-checklist .setup-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
html:root .setup-step{padding:12px;background:var(--surface-2);border-radius:var(--r)}
html:root .setup-dot{width:24px;height:24px;background:var(--surface);border:1px solid var(--line-strong)}
html:root .setup-dot.done{border-color:transparent}
/*DASHBOARD*/
.dashboard-scope-note{margin:0 0 12px}
html:root .stage-card h2,html:root .target-card h2{margin:0 0 14px}
.insights-split{align-items:start}
.funnel{display:flex;flex-direction:column;gap:16px}
.funnel-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;align-items:baseline;margin-bottom:6px}
.funnel-head b{font-size:14px;font-weight:600}
.funnel-count{font-size:15px;font-weight:650;font-variant-numeric:tabular-nums;text-align:end}
.funnel-amt{grid-column:1/-1;font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.funnel-amt:empty{display:none}
@media(min-width:521px){.funnel-head{grid-template-columns:minmax(0,1fr) 32px auto}.funnel-amt{grid-column:auto;text-align:end;min-width:110px}}
.funnel-track{height:12px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.funnel-bar{height:100%;border-radius:999px;background:var(--accent);opacity:calc(.55 + var(--i,0)*.11);transform-origin:left center}
.rtl .funnel-bar{transform-origin:right center}
.empty-mini{display:flex;flex-direction:column;align-items:center;gap:6px;margin-top:12px;color:var(--muted);text-align:center}
.empty-mini p{margin:0}
.target-none button{margin-top:12px}
.target-card .empty-ill{display:block;color:var(--muted);margin-bottom:8px}
.target-row{display:grid;grid-template-columns:88px minmax(0,1fr);gap:16px;align-items:center}
.target-row+.target-row,.target-card>div+div .target-row:first-child{margin-top:16px}
.target-row+.target-row{padding-top:16px;border-top:1px solid var(--line)}
.ring{--p:0;position:relative;display:grid;place-items:center;width:88px;height:88px;border-radius:50%;background:conic-gradient(var(--accent) calc(var(--p)*1%),var(--surface-2) 0)}
.ring::before{content:"";position:absolute;inset:10px;border-radius:50%;background:var(--surface)}
.ring span{position:relative;font-size:17px;font-weight:650;font-variant-numeric:tabular-nums}
html:root .target-row .target{margin:0;font-size:15px;font-weight:650;color:var(--ink);display:block;overflow-wrap:anywhere}
.target-left{font-size:13px;color:var(--muted);margin-top:2px}
.target-left b{color:var(--ink);font-weight:600}
html:root .target-row .progress{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.target-card>.sub{margin-top:14px}
/*REPORTS*/
.reports>.card,.reports>.grid,.reports>.kpi-grid{margin-top:0;margin-bottom:16px}
.reports h3{font-size:17px;margin:0 0 4px}
.reports .report-heading{margin-bottom:16px}
html:root .report-toolbar{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 16px;padding:16px;align-items:end}
html:root .report-toolbar .report-presets{grid-column:1/-1}
.seg{display:inline-flex;flex-wrap:wrap;gap:2px;padding:3px;background:var(--surface-2);border-radius:var(--r);border:1px solid var(--line);max-width:100%}
html:root .seg .secondary{min-height:36px;padding:0 14px;background:transparent;border:1px solid transparent;box-shadow:none;border-radius:9px;color:var(--ink-2);white-space:nowrap}
html:root .seg .secondary:hover{background:transparent;color:var(--ink)}
html:root .seg .secondary.active{background:var(--surface);border-color:var(--line-strong);box-shadow:var(--sh-1);color:var(--accent-ink);font-weight:700}
@media(max-width:760px){html:root .report-toolbar{grid-template-columns:repeat(2,minmax(0,1fr))}
html:root .report-toolbar>.field:nth-child(n+4){grid-column:1/-1}
.seg{display:flex}.seg .secondary{flex:1 1 auto}html:root .seg .secondary{min-height:44px}}
@media(max-width:400px){html:root .report-toolbar{grid-template-columns:minmax(0,1fr)}html:root .report-toolbar>.field:nth-child(n){grid-column:auto}}
.chart-legend{display:flex;gap:16px;margin:12px 0 4px;font-size:13px;font-weight:600;color:var(--ink-2)}
.chart-legend span{display:inline-flex;align-items:center;gap:6px}
.lg{display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--accent)}
.lg.v,.bar.v{background:var(--info-ink)}.lg.m,.bar.m{background:var(--success-ink)}
.rep-bars{display:flex;flex-direction:column}
.rep-row{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:12px 0;border-top:1px solid var(--line)}
.rep-row:first-child{border-top:0}
.rep-name b{display:block;font-size:15px}
.rep-name small{display:block;color:var(--muted)}
@media(min-width:761px){.rep-row{grid-template-columns:minmax(0,260px) minmax(0,1fr);align-items:center;gap:20px}}
.rep-track{display:flex;flex-direction:column;gap:6px}
.bar-line{display:flex;align-items:center;gap:10px}
.bar-wrap{flex:1;height:10px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.bar{height:100%;border-radius:999px;background:var(--accent);transform-origin:left center}
.rtl .bar{transform-origin:right center}
.bar-val{width:36px;text-align:end;font-size:13px;font-weight:650;font-variant-numeric:tabular-nums}
html:root .reports .report-table-wrap{background:none;max-height:min(62vh,540px);overflow:auto;margin-top:8px;border:1px solid var(--line);border-radius:var(--r)}
html:root .reports .report-table-wrap .table{display:table;width:100%;min-width:640px;border-collapse:separate;border-spacing:0}
html:root .reports .report-table-wrap .table th{position:sticky;top:0;z-index:2;white-space:nowrap}
html:root .reports .report-table-wrap .table th:first-child{z-index:3}
html:root .reports .report-table-wrap .table td{height:52px;padding:12px 14px}
html:root .reports .report-table-wrap .table th{padding:12px 14px}
html:root .reports .report-table-wrap .table tbody tr:last-child td{border-bottom:0}
html:root .reports .report-breakdown>div{padding:14px 16px}
/*Motion: only on page entry, first 8 items, transform+opacity*/
@keyframes ins-up{from{opacity:0;transform:translateY(6px)}}
@keyframes ins-grow{from{transform:scaleX(0)}}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>*{animation:ins-up 140ms var(--ease) both}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(2){animation-delay:35ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(3){animation-delay:70ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(4){animation-delay:105ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(5){animation-delay:140ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(6){animation-delay:175ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(7){animation-delay:210ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(8){animation-delay:245ms}
main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>:nth-child(n+9){animation:none}
main.view-enter :is(.funnel-bar,.bar){animation:ins-grow 220ms var(--ease) 60ms both}
@media(prefers-reduced-motion:reduce){main.view-enter :is(.kpi-grid,.kpi-strip,.home-actions,.funnel,.rep-bars)>*{animation:none}
main.view-enter :is(.funnel-bar,.bar){animation:none}
html:root button.kpi:hover{transform:none}}
@media print{html:root .reports .report-table-wrap{max-height:none;overflow:visible}
html:root .reports .report-table-wrap .table th{position:static}
.kpi-grid>*,.kpi-strip>*,.funnel-bar,.bar{animation:none!important}
.seg{display:none}}
/*Currency stack (KPI values): one currency per line, secondary lines smaller*/
.cur-stack{display:flex;flex-direction:column;gap:2px;align-items:flex-start;max-width:100%}
.cur-line{display:block;line-height:1.15}
.cur-line.sec{font-size:.64em;font-weight:600;color:var(--ink-2);letter-spacing:0}
.home-pipeline-total{display:flex;flex-wrap:wrap;align-items:flex-end;gap:4px 12px;margin:6px 0}
.home-pipeline-total>b{font-size:22px;font-weight:650;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.cur-count{font-size:14px;color:var(--muted);padding-bottom:2px}
/*Reports drill-in*/
html:root .reports tr.report-row{cursor:pointer}
html:root .reports tr.report-row:hover td{background:var(--surface-2)}
html:root .reports tr.report-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.drill-sheet{max-height:min(62vh,520px);overflow:auto;margin:8px 0 4px;overscroll-behavior:contain}
.drill-kv>div{align-items:flex-start}
.drill-kv dd{overflow-wrap:anywhere;min-width:0}
.drill-kv .cur-stack{align-items:flex-end}
.drill-kv .cur-line.sec{font-size:.85em}
.drill-h{margin:16px 0 8px;font-size:13px;font-weight:650;letter-spacing:.04em;color:var(--muted)}
.drill-note{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px 14px;background:var(--surface-2);border-radius:var(--r);color:var(--ink);font-size:15px;line-height:1.5}
.drill-sheet .gps-badge+small{display:inline-block;margin-top:4px}
