:root{--navy:#17365D;--navy2:#0F2A49;--blue:#2E75B6;--green:#70AD47;--green2:#5D963A;--bg:#F3F7FB;--card:#FFFFFF;--border:#DDE7F1;--text:#102033;--muted:#607086;--red:#C00000;--amber:#C55A11;--purple:#7030A0;--soft:#F8FBFF}*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,Tahoma,sans-serif;background:linear-gradient(135deg,#EDF4FA 0%,#F9FBFE 55%,#F3F7FB 100%);color:var(--text)}.wrap,.dash-wrap{max-width:1240px;margin:0 auto;padding:24px}.dashboard-page .dash-wrap{max-width:1280px}.app-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px}.brand-block{display:flex;align-items:center;gap:12px;color:var(--navy)}.brand-block strong{display:block;font-size:18px}.brand-block small{display:block;color:var(--muted);font-weight:700}.brand-dot{width:42px;height:42px;border-radius:16px;background:linear-gradient(135deg,var(--navy),var(--blue));box-shadow:0 10px 24px rgba(23,54,93,.22)}.action-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.btn,button,.download,.secondary,.print,.lang-btn{display:inline-flex;align-items:center;justify-content:center;border:0;text-decoration:none;border-radius:14px;padding:12px 16px;font-weight:900;cursor:pointer;white-space:nowrap}.btn.primary,.print{background:var(--navy);color:#fff}.btn.success,.download{background:var(--green);color:#fff}.btn.secondary,.secondary{background:#EEF3F8;color:var(--navy)}.lang-switch{display:flex;gap:4px;border:1px solid var(--border);background:#fff;border-radius:14px;padding:4px}.lang-switch button,.lang-btn{background:#fff;border:0;color:var(--navy);padding:8px 11px;border-radius:10px}.hero,.dash-hero{background:linear-gradient(135deg,var(--navy),#2E75B6);color:#fff;border-radius:28px;padding:36px;box-shadow:0 16px 38px rgba(23,54,93,.18);margin-bottom:22px}.compact-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:22px;padding:30px 34px}.badge{display:inline-block;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.28);border-radius:999px;padding:7px 13px;font-weight:800;font-size:12px;margin-bottom:10px}.hero h1,.dash-hero h1{font-size:40px;line-height:1.05;margin:4px 0 10px;letter-spacing:-.02em}.hero p,.dash-hero p{font-size:17px;max-width:820px;opacity:.92;margin:0;line-height:1.55}.hero-side{min-width:210px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);border-radius:22px;padding:18px}.hero-side span{display:block;opacity:.85;font-weight:700}.hero-side b{display:block;font-size:20px;margin-top:4px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}.card,.panel,.chart-card{background:var(--card);border:1px solid var(--border);border-radius:24px;padding:22px;box-shadow:0 10px 30px rgba(23,54,93,.07)}.card.wide{grid-column:1/-1}.num{display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;border-radius:14px;background:#EAF3F8;color:var(--navy);font-weight:900}.card h2{margin:14px 0 6px;color:var(--navy)}.card p{color:var(--muted);line-height:1.55}.alert{background:#FCE4D6;color:#9C0006;border:1px solid #F4B183;border-radius:16px;padding:14px;margin-bottom:18px}.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:18px}.kpi-grid.polished{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.kpi-card{position:relative;overflow:hidden;background:#fff;border:1px solid var(--border);border-radius:22px;padding:20px 22px;box-shadow:0 10px 24px rgba(23,54,93,.07)}.kpi-card:before{content:"";position:absolute;left:0;top:0;width:6px;height:100%;background:var(--navy)}[dir="rtl"] .kpi-card:before{left:auto;right:0}.kpi-card.metric-2:before,.kpi-card.metric-5:before{background:var(--green)}.kpi-card.metric-3:before{background:var(--blue)}.kpi-card.metric-4:before{background:var(--purple)}.kpi-card.metric-6:before{background:var(--amber)}.kpi-card span{display:block;color:var(--muted);font-weight:900;margin-bottom:10px}.kpi-card strong{font-size:28px;color:var(--navy);letter-spacing:-.02em}.insight-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0 0 18px}.insight-chip{border-radius:18px;padding:14px 16px;background:#fff;border:1px solid var(--border);font-weight:800;box-shadow:0 8px 20px rgba(23,54,93,.06)}.insight-chip.success{background:#EEF7E9;border-color:#B7D9A4}.insight-chip.warning{background:#FFF7DC;border-color:#FFD966}.insight-chip.info{background:#EFF6FC;border-color:#9DC3E6}.section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:16px}.section-head h2,.chart-card h2,.panel h2{margin:0;color:var(--navy);font-size:22px;letter-spacing:-.01em}.section-head span{color:var(--muted);font-weight:800;font-size:13px}.charts-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:18px 0}.executive-grid .wide-chart{grid-column:auto}.chart-card{min-height:410px}.chart-card canvas{width:100%!important;height:320px!important;min-height:320px;max-height:320px}.mini-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.mini-grid div{background:#F8FBFF;border:1px solid var(--border);border-radius:18px;padding:16px}.mini-grid span{display:block;color:var(--muted);font-weight:800}.mini-grid b{font-size:22px;color:var(--navy)}.insights{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.insight{padding:15px 16px;border-radius:16px;border:1px solid var(--border);background:#F8FBFF;font-weight:800}.insight.success{border-color:#A9D18E;background:#EEF7E9}.insight.warning{border-color:#FFD966;background:#FFF7DC}.insight.danger{border-color:#F4B183;background:#FCE4D6;color:#9C0006}.insight.info{border-color:#9DC3E6;background:#EFF6FC}.tables-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:18px}.table-wrap{overflow:auto}table{width:100%;border-collapse:separate;border-spacing:0}th{background:var(--navy);color:#fff;text-align:left}th:first-child{border-radius:10px 0 0 10px}th:last-child{border-radius:0 10px 10px 0}th,td{padding:10px;border-bottom:1px solid var(--border);font-size:14px}tr:nth-child(even) td{background:#FAFCFE}[dir="rtl"] th,[dir="rtl"] td{text-align:right}label{display:block;font-size:13px;font-weight:800;margin:13px 0 6px;color:var(--navy)}input,select{width:100%;border:1px solid var(--border);border-radius:14px;padding:12px 14px;background:#fff;font-size:14px}.split{display:grid;grid-template-columns:1fr 1fr;gap:12px}.card button,.download{margin-top:16px}@media(max-width:1000px){.app-header,.compact-hero{display:block}.action-bar{margin-top:14px}.grid,.charts-grid,.tables-grid,.kpi-grid,.kpi-grid.polished,.insight-strip{grid-template-columns:1fr}.split,.mini-grid,.insights{grid-template-columns:1fr}.hero h1,.dash-hero h1{font-size:30px}.chart-card canvas{height:280px!important}}@media print{body{background:#fff}.no-print{display:none!important}.dash-wrap{max-width:100%;padding:0}.dash-hero{box-shadow:none;border-radius:0;margin-bottom:12px}.panel,.chart-card,.kpi-card,.insight-chip{box-shadow:none;break-inside:avoid}.charts-grid,.tables-grid{grid-template-columns:1fr 1fr;gap:12px}.chart-card{min-height:340px}.chart-card canvas{height:250px!important}.kpi-grid.polished{grid-template-columns:repeat(3,1fr)}a{color:inherit}}

/* V5.3 RTL + CLV cleanup */
[dir="rtl"] .section-head{direction:rtl}
[dir="rtl"] table{direction:rtl}
[dir="rtl"] th,[dir="rtl"] td{text-align:right}
[dir="rtl"] th:first-child{border-radius:0 10px 10px 0}
[dir="rtl"] th:last-child{border-radius:10px 0 0 10px}
.bilingual-table td:first-child,.bilingual-table th:first-child{min-width:180px}

/* V5.13.5 UI cleanup: all services use full-width horizontal cards */
.grid{grid-template-columns:1fr!important;gap:22px}
.card,.card.wide{grid-column:1/-1!important;width:100%;padding:24px}
.card form{width:100%}
.card .split{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.card h2{display:inline-block;margin-left:12px;vertical-align:middle}
[dir="rtl"] .card h2{margin-left:0;margin-right:12px}
.card p{max-width:980px}
@media(max-width:800px){.card .split{grid-template-columns:1fr}.card h2{display:block;margin-left:0;margin-right:0}}

.dashboard-switcher{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#fff;border:1px solid var(--border);border-radius:22px;padding:16px 18px;margin:0 0 18px;box-shadow:0 10px 24px rgba(23,54,93,.06)}.switch-copy strong{display:block;color:var(--navy);font-size:18px}.switch-copy span{display:block;color:var(--muted);font-weight:800;margin-top:4px}.switch-actions{display:flex;gap:10px;flex-wrap:wrap}.detailed-dashboard{display:none}.detailed-title-row{align-items:center}.detailed-title-row>div span{display:block;margin-top:4px}
@media(max-width:1000px){.dashboard-switcher{display:block}.switch-actions{margin-top:12px}}

/* V5.15.9 Detailed Dashboard Expansion */
.dashboard-page .dash-wrap{max-width:1380px}.detailed-dashboard{padding:26px}.detailed-dashboard .mini-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.detailed-dashboard .mini-grid div{min-height:96px}.detailed-tables{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}.detailed-tables .inner-panel{min-height:360px;overflow:hidden}.detailed-tables .table-wrap,.branch-detail-panel .table-wrap{max-height:520px;overflow:auto}.detailed-tables table,.branch-detail-panel table{min-width:760px}.branch-detail-stack{display:grid;grid-template-columns:1fr;gap:22px;margin-top:16px}.branch-detail-panel{border:2px solid #D7E6F5;background:linear-gradient(180deg,#FFFFFF 0%,#FAFCFF 100%)}.branch-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;margin-bottom:18px}.branch-inner-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.branch-table-panel{box-shadow:none;min-height:320px}.branch-detail-title{margin-top:26px}.table-wrap::-webkit-scrollbar{height:10px;width:10px}.table-wrap::-webkit-scrollbar-thumb{background:#9AA8B7;border-radius:999px}.table-wrap::-webkit-scrollbar-track{background:#EEF3F8;border-radius:999px}@media(max-width:1000px){.detailed-dashboard .mini-grid,.branch-mini-grid,.branch-inner-grid,.detailed-tables{grid-template-columns:1fr!important}.detailed-tables table,.branch-detail-panel table{min-width:680px}}


/* V5.15.11 infographic refinement */
.dashboard-page .dash-wrap{max-width:1500px}
.dashboard-page table{table-layout:fixed;width:100%}
.dashboard-page th,.dashboard-page td{white-space:normal;word-break:break-word;line-height:1.35;vertical-align:top}
.detailed-dashboard{padding:28px 28px 34px}
.infographic-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:18px 0 8px}
.infographic-card{min-height:360px;background:linear-gradient(180deg,#FFFFFF 0%,#F8FBFF 100%)}
.infographic-card canvas{width:100%!important;height:280px!important;min-height:280px;max-height:280px}
.detailed-tables{grid-template-columns:1fr;gap:20px}
.detailed-tables .inner-panel{min-height:auto}
.detailed-dashboard .table-wrap,.branch-detail-panel .table-wrap{overflow:visible;max-height:none}
.detailed-dashboard table,.branch-detail-panel table{min-width:0!important}
.branch-detail-panel{position:relative;border:1px solid var(--border);border-top:6px solid var(--branch-accent,#2E75B6);background:linear-gradient(180deg,#FFFFFF 0%,#FAFCFF 100%)}
.branch-detail-header{align-items:center}
.branch-badge{display:inline-flex;align-items:center;gap:6px;background:rgba(46,117,182,.08);color:var(--branch-accent,#2E75B6);border:1px solid rgba(46,117,182,.18);border-radius:999px;padding:6px 11px;font-size:12px;font-weight:900;margin-bottom:8px}
.branch-name{margin:0;color:var(--branch-accent,#2E75B6);font-size:28px;line-height:1.1}
.branch-mini-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;margin-bottom:18px}
.branch-mini-grid div{background:#fff}
.branch-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:0 0 18px}
.branch-chart-card{min-height:320px;padding:18px;box-shadow:none;background:linear-gradient(180deg,#FFFFFF 0%,#F8FBFF 100%)}
.branch-chart-card canvas{width:100%!important;height:240px!important;min-height:240px;max-height:240px}
.branch-inner-grid{grid-template-columns:1fr;gap:16px}
.branch-tone-1{--branch-accent:#2E75B6}.branch-tone-2{--branch-accent:#7030A0}.branch-tone-3{--branch-accent:#70AD47}.branch-tone-4{--branch-accent:#C55A11}.branch-tone-5{--branch-accent:#17365D}.branch-tone-6{--branch-accent:#E15759}
.table-wrap{overflow:visible}
@media(max-width:1200px){
  .infographic-grid,.branch-chart-grid{grid-template-columns:1fr}
  .branch-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}
@media(max-width:900px){
  .dashboard-page table{font-size:13px}
  .branch-mini-grid,.detailed-dashboard .mini-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:700px){
  .branch-mini-grid,.detailed-dashboard .mini-grid,.infographic-grid,.branch-chart-grid,.branch-inner-grid,.detailed-tables{grid-template-columns:1fr!important}
  .detailed-dashboard{padding:18px}
  .branch-name{font-size:24px}
}


/* V5.15.12 daily sales trend indicators */
.daily-sales-panel .table-wrap{overflow:visible}
.trend-pill{display:inline-flex;align-items:center;gap:8px;font-weight:800;border-radius:999px;padding:5px 10px;min-width:112px;justify-content:flex-start}
.trend-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;font-size:12px;font-weight:900}
.trend-up{background:#EEF7E9;color:#2F7D32;border:1px solid #B7D9A4}
.trend-down{background:#FCE4D6;color:#C00000;border:1px solid #F4B183}
.trend-flat{background:#FFF7DC;color:#B07A00;border:1px solid #FFD966}

/* V5.15.13 weekly trend + dashboard cleanup */
.infographic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}


/* V5.15.14 executive infographic style */
.executive-infographic{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;
  margin:18px 0 18px;
}
.info-tile{
  background:linear-gradient(180deg,#fff 0%,#F8FBFF 100%);
  border:1px solid var(--border);
  border-radius:22px;
  padding:18px;
  min-height:150px;
  box-shadow:0 12px 28px rgba(23,54,93,.07);
  position:relative;
  overflow:hidden;
}
.info-tile:before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:5px;
  background:var(--blue);
}
[dir="rtl"] .info-tile:before{left:auto;right:0}
.info-tile.hero-tile{grid-column:span 2;background:linear-gradient(135deg,#17365D 0%,#2E75B6 100%);color:#fff}
.info-tile.hero-tile span,.info-tile.hero-tile small,.info-tile.hero-tile strong{color:#fff}
.info-tile span{display:block;color:var(--muted);font-weight:900;font-size:13px;margin-bottom:9px}
.info-tile strong{display:block;color:var(--navy);font-size:24px;line-height:1.1;letter-spacing:-.02em}
.info-tile small{display:block;margin-top:10px;color:var(--muted);font-weight:800;line-height:1.35}
.mini-progress{
  height:10px;
  background:#EAF1F7;
  border-radius:999px;
  margin-top:14px;
  overflow:hidden;
}
.mini-progress i{
  display:block;
  height:100%;
  max-width:100%;
  min-width:4px;
  border-radius:999px;
  background:var(--blue);
}
.mini-progress.purple i{background:var(--purple)}
.mini-progress.amber i{background:var(--amber)}
.mini-progress.green i{background:var(--green)}
.mini-progress.red i{background:var(--red)}
.story-strip{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin:0 0 22px;
}
.story-strip div{
  border:1px solid var(--border);
  border-radius:20px;
  background:#fff;
  padding:16px 18px;
  box-shadow:0 10px 24px rgba(23,54,93,.06);
}
.story-strip b{display:block;color:var(--muted);font-size:13px}
.story-strip span{display:block;color:var(--navy);font-size:22px;font-weight:900;margin-top:4px}
.story-strip small{display:block;color:var(--muted);font-weight:800;margin-top:3px}
.infographic-card{
  border-top:4px solid var(--blue);
}
.infographic-card:nth-child(2){border-top-color:var(--navy)}
.infographic-card:nth-child(3){border-top-color:var(--green)}
.infographic-card:nth-child(4){border-top-color:var(--purple)}
.infographic-card:nth-child(5){border-top-color:var(--amber)}
.infographic-card:nth-child(6){border-top-color:var(--red)}
.infographic-card:nth-child(7){border-top-color:#5B9BD5}
@media(max-width:1200px){
  .executive-infographic{grid-template-columns:repeat(3,minmax(0,1fr))}
  .info-tile.hero-tile{grid-column:span 3}
}
@media(max-width:760px){
  .executive-infographic,.story-strip{grid-template-columns:1fr}
  .info-tile.hero-tile{grid-column:auto}
}


/* V5.15.15 full chart coverage */
.section-mini-chart{margin:8px 0 14px;background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);border:1px solid var(--border);border-radius:18px;padding:10px 12px}
.section-mini-chart canvas{width:100%!important;height:220px!important;min-height:220px;max-height:220px}
.branch-table-panel .section-mini-chart canvas{height:200px!important;min-height:200px;max-height:200px}
.daily-sales-panel .section-mini-chart canvas{height:260px!important;min-height:260px;max-height:260px}
.inner-panel .section-head{margin-bottom:8px}


/* V5.15.18 complete infographic analytics */
.advanced-infographic-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:18px;
  margin:18px 0 22px;
}
.waterfall-card canvas{width:100%!important;height:330px!important;min-height:330px;max-height:330px}
.gauge-panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:24px;
  padding:20px;
  box-shadow:0 10px 28px rgba(23,54,93,.07);
}
.gauge-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.gauge-card{
  background:linear-gradient(180deg,#FFFFFF 0%,#F8FBFF 100%);
  border:1px solid var(--border);
  border-radius:20px;
  padding:14px;
  text-align:center;
  min-height:190px;
}
.gauge-card canvas{width:100%!important;height:130px!important;min-height:130px;max-height:130px}
.gauge-card b{display:block;color:var(--navy);font-size:14px;margin-top:4px}
.branch-card-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:0 0 22px;
}
.branch-mini-card{
  background:#fff;
  border:1px solid var(--border);
  border-top:5px solid var(--blue);
  border-radius:22px;
  padding:16px;
  box-shadow:0 10px 24px rgba(23,54,93,.06);
}
.branch-mini-card.best{border-top-color:var(--green)}
.branch-mini-card.watch{border-top-color:var(--purple)}
.branch-mini-card.risk{border-top-color:var(--red)}
.branch-mini-card.stable{border-top-color:var(--blue)}
.branch-mini-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:12px}
.branch-mini-head b{color:var(--navy);font-size:17px;line-height:1.2}
.branch-mini-head span{
  display:inline-flex;
  background:#EEF3F8;
  color:var(--navy);
  border-radius:999px;
  padding:5px 9px;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.branch-mini-metrics{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.branch-mini-metrics small{display:block;color:var(--muted);font-size:11px;font-weight:800}
.branch-mini-metrics strong{display:block;color:var(--navy);font-size:16px;margin-top:3px}
.branch-mini-note{display:block;margin-top:9px;color:var(--muted);font-weight:800}
.insight-action-panel{min-height:360px}
.action-card-grid{display:grid;grid-template-columns:1fr;gap:12px}
.action-card{
  border:1px solid var(--border);
  border-radius:18px;
  padding:14px 15px;
  background:#F8FBFF;
}
.action-card b{display:block;color:var(--navy);margin-bottom:5px}
.action-card span{display:block;color:var(--text);font-weight:700;line-height:1.4}
.action-card.success{background:#EEF7E9;border-color:#B7D9A4}
.action-card.warning{background:#FFF7DC;border-color:#FFD966}
.action-card.danger{background:#FCE4D6;border-color:#F4B183}
.action-card.info{background:#EFF6FC;border-color:#9DC3E6}
#customerMatrixChart,#refundHeatChart,#cashbackEfficiencyChart,#commissionPaymentChart,#productBubbleChart{
  width:100%!important;height:300px!important;min-height:300px;max-height:300px
}
@media(max-width:1200px){
  .advanced-infographic-grid{grid-template-columns:1fr}
  .branch-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .gauge-grid,.branch-card-grid{grid-template-columns:1fr}
}


/* V5.16.0 final decision analytics */
.real-heatmap-panel{margin:18px 0 22px}
.real-heatmap{overflow-x:auto;padding-bottom:6px}
.heatmap-row{
  display:grid;
  grid-template-columns:90px repeat(24,minmax(38px,1fr));
  gap:4px;
  align-items:center;
  margin-bottom:4px;
}
.heatmap-row b{
  color:var(--navy);
  font-size:12px;
  white-space:nowrap;
}
.heatmap-row span{
  min-height:30px;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:800;
  color:#102033;
  border:1px solid rgba(23,54,93,.08);
}
.heatmap-head span{
  background:#EEF3F8;
  color:var(--navy);
}
.heat-cell{
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.25);
}
.table-wrap table th,
.table-wrap table td{
  max-width:240px;
}
.action-card-grid .action-card.danger b{color:#9C0006}
.action-card-grid .action-card.warning b{color:#A05A00}


/* V5.16.5 Print Service Upgrade */
.print-only{display:none!important}

@media print{
  @page{
    size:A4 landscape;
    margin:10mm;
  }

  *{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  html,body{
    background:#fff!important;
    color:#102033!important;
    font-size:10.5px!important;
  }

  body.dashboard-page{
    background:#fff!important;
  }

  .no-print,
  .dashboard-switcher,
  .app-header,
  .hero-side{
    display:none!important;
  }

  .print-only{
    display:block!important;
  }

  .dash-wrap,
  .dashboard-page .dash-wrap{
    max-width:none!important;
    width:100%!important;
    padding:0!important;
    margin:0!important;
  }

  .print-cover{
    min-height:170mm;
    page-break-after:always;
    break-after:page;
    display:flex!important;
    flex-direction:column;
    justify-content:center;
    border:2px solid #17365D;
    border-radius:18px;
    padding:24mm 20mm;
    background:linear-gradient(135deg,#17365D 0%,#2E75B6 100%)!important;
    color:#fff!important;
  }

  .print-cover-brand{
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
    opacity:.9;
    margin-bottom:18px;
  }

  .print-cover h1{
    color:#fff!important;
    font-size:34px!important;
    line-height:1.1!important;
    margin:0 0 12px!important;
  }

  .print-cover p{
    color:#EFF6FC!important;
    font-size:16px!important;
    line-height:1.5!important;
    max-width:850px;
    margin:0 0 24px!important;
  }

  .print-formula-box{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
    background:rgba(255,255,255,.12)!important;
    border:1px solid rgba(255,255,255,.35);
    border-radius:18px;
    padding:16px;
    max-width:900px;
  }

  .print-formula-box strong{
    grid-column:1/-1;
    color:#fff!important;
    font-size:16px;
  }

  .print-formula-box span{
    color:#fff!important;
    font-weight:800;
  }

  .dash-hero{
    box-shadow:none!important;
    border-radius:18px!important;
    padding:18px!important;
    margin:0 0 10mm!important;
    page-break-inside:avoid;
    break-inside:avoid;
  }

  .dash-hero h1{
    font-size:24px!important;
  }

  .panel,
  .chart-card,
  .kpi-card,
  .insight-chip,
  .info-tile,
  .branch-mini-card,
  .action-card,
  .gauge-panel,
  .story-strip div{
    box-shadow:none!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }

  .panel,
  .chart-card{
    border:1px solid #DDE7F1!important;
  }

  .kpi-grid.polished,
  .mini-grid,
  .detailed-dashboard .mini-grid{
    grid-template-columns:repeat(4,1fr)!important;
    gap:8px!important;
  }

  .kpi-card,
  .mini-grid div,
  .info-tile{
    min-height:auto!important;
    padding:10px!important;
    border-radius:12px!important;
  }

  .kpi-card strong,
  .mini-grid b,
  .info-tile strong{
    font-size:17px!important;
  }

  .charts-grid,
  .tables-grid,
  .detailed-tables,
  .infographic-grid,
  .advanced-infographic-grid,
  .branch-chart-grid,
  .branch-inner-grid{
    grid-template-columns:1fr 1fr!important;
    gap:9mm!important;
    align-items:start!important;
  }

  .executive-infographic{
    grid-template-columns:repeat(3,1fr)!important;
    gap:8px!important;
  }

  .info-tile.hero-tile{
    grid-column:span 1!important;
  }

  .story-strip,
  .branch-card-grid{
    grid-template-columns:repeat(3,1fr)!important;
    gap:8px!important;
  }

  .gauge-grid{
    grid-template-columns:repeat(2,1fr)!important;
    gap:8px!important;
  }

  .chart-card,
  .infographic-card,
  .branch-chart-card,
  .gauge-panel,
  .inner-panel{
    min-height:auto!important;
    padding:12px!important;
    border-radius:14px!important;
  }

  canvas{
    max-width:100%!important;
  }

  .chart-card canvas,
  .infographic-card canvas,
  .branch-chart-card canvas,
  .section-mini-chart canvas{
    height:180px!important;
    min-height:180px!important;
    max-height:180px!important;
  }

  .waterfall-card canvas,
  #customerMatrixChart,
  #refundHeatChart,
  #cashbackEfficiencyChart,
  #commissionPaymentChart,
  #productBubbleChart{
    height:210px!important;
    min-height:210px!important;
    max-height:210px!important;
  }

  .gauge-card{
    min-height:145px!important;
    padding:9px!important;
  }

  .gauge-card canvas{
    height:90px!important;
    min-height:90px!important;
    max-height:90px!important;
  }

  .table-wrap,
  .detailed-dashboard .table-wrap,
  .branch-detail-panel .table-wrap{
    overflow:visible!important;
    max-height:none!important;
  }

  table{
    width:100%!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    font-size:9px!important;
  }

  th,td{
    padding:5px 6px!important;
    word-break:break-word!important;
    white-space:normal!important;
    line-height:1.25!important;
  }

  th{
    background:#17365D!important;
    color:#fff!important;
  }

  .trend-pill{
    min-width:0!important;
    padding:3px 7px!important;
    gap:4px!important;
  }

  .section-head{
    margin-bottom:7px!important;
    page-break-after:avoid!important;
    break-after:avoid!important;
  }

  .section-head h3{
    font-size:15px!important;
  }

  .detailed-dashboard{
    display:block!important;
    padding:0!important;
  }

  body.print-compact .detailed-dashboard{
    display:none!important;
  }

  body.print-detailed main.dash-wrap > section:not(.detailed-dashboard):not(.dash-hero):not(.print-cover):not(.print-footer){
    display:none!important;
  }

  body.print-full main.dash-wrap > section{
    display:block!important;
  }

  body.print-full .detailed-dashboard{
    display:block!important;
  }

  .branch-detail-panel{
    page-break-before:always;
    break-before:page;
    border-top-width:4px!important;
  }

  .branch-detail-panel:first-of-type{
    page-break-before:auto;
    break-before:auto;
  }

  .real-heatmap{
    overflow:visible!important;
  }

  .heatmap-row{
    grid-template-columns:60px repeat(24,1fr)!important;
    gap:2px!important;
  }

  .heatmap-row span{
    min-height:18px!important;
    font-size:7px!important;
    border-radius:4px!important;
  }

  .print-footer{
    margin-top:8mm;
    padding-top:3mm;
    border-top:1px solid #DDE7F1;
    display:flex!important;
    justify-content:space-between;
    color:#607086!important;
    font-weight:800;
    font-size:9px!important;
  }

  a{
    color:inherit!important;
    text-decoration:none!important;
  }
}


/* V5.17.0 Saved Dashboards */
.saved-quick-card{
  margin:22px 0;
  background:#fff;
  border:1px solid #D9E2F3;
  border-radius:24px;
  padding:24px;
  box-shadow:0 12px 28px rgba(23,54,93,.08);
}
.btn-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:#17365D;
  color:#fff!important;
  padding:12px 18px;
  font-weight:900;
  text-decoration:none;
  border:0;
}
.btn-link.small{padding:8px 12px;border-radius:12px}
.secondary-link{background:#2E75B6}
.danger-btn{
  border:0;
  border-radius:14px;
  background:#FCE4D6;
  color:#9C0006;
  padding:11px 15px;
  font-weight:900;
  cursor:pointer;
}
.saved-list-card{
  background:#fff;
  border:1px solid #D9E2F3;
  border-radius:24px;
  padding:24px;
}
.saved-report-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}
.saved-report-card{
  border:1px solid #D9E2F3;
  border-radius:22px;
  padding:18px;
  background:linear-gradient(180deg,#fff 0%,#F8FBFF 100%);
  box-shadow:0 10px 24px rgba(23,54,93,.06);
}
.saved-report-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:14px;
}
.saved-report-head b{
  display:block;
  color:#17365D;
  font-size:20px;
}
.saved-report-head span{
  display:block;
  color:#607086;
  font-weight:700;
  margin-top:4px;
}
.saved-report-head em{
  font-style:normal;
  background:#EAF3F8;
  color:#17365D;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
}
.saved-report-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin-bottom:12px;
}
.saved-report-kpis div{
  background:#fff;
  border:1px solid #D9E2F3;
  border-radius:16px;
  padding:10px;
}
.saved-report-kpis small{
  display:block;
  color:#607086;
  font-weight:900;
}
.saved-report-kpis strong{
  display:block;
  color:#17365D;
  margin-top:4px;
  font-size:16px;
}
.saved-report-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.empty-state{
  text-align:center;
  padding:60px 20px;
}
.empty-state h2{color:#17365D}
@media(max-width:900px){
  .saved-report-grid{grid-template-columns:1fr}
  .saved-report-kpis{grid-template-columns:1fr}
}


/* V5.17.1 Print layout fix */
@media print{
  @page{
    size:A4 landscape;
    margin:8mm;
  }

  /* Remove browser-like empty cover problem: keep report content first */
  .print-cover{
    display:none!important;
    page-break-after:auto!important;
    break-after:auto!important;
    min-height:0!important;
  }

  .print-footer{
    display:none!important;
  }

  .dash-hero{
    min-height:auto!important;
    margin:0 0 6mm!important;
    padding:10mm!important;
    page-break-after:auto!important;
  }

  .dash-hero h1{
    font-size:20px!important;
    margin:0 0 4mm!important;
  }

  .dash-hero p{
    font-size:11px!important;
    margin:0!important;
  }

  .print-canvas-hidden{
    display:none!important;
  }

  .print-canvas-img{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    object-fit:contain!important;
    margin:4px 0!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }

  /* Avoid large blank chart cards */
  .chart-card,
  .infographic-card,
  .branch-chart-card,
  .gauge-panel,
  .inner-panel{
    min-height:0!important;
    padding:8px!important;
    border-radius:10px!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }

  .chart-card:has(canvas.print-canvas-hidden) canvas,
  .infographic-card:has(canvas.print-canvas-hidden) canvas,
  .branch-chart-card:has(canvas.print-canvas-hidden) canvas{
    display:none!important;
  }

  .section-head{
    display:flex!important;
    justify-content:space-between!important;
    align-items:flex-start!important;
    gap:8px!important;
  }

  .section-head h3{
    font-size:13px!important;
    line-height:1.15!important;
    margin:0!important;
  }

  .section-head span{
    font-size:9px!important;
    line-height:1.2!important;
  }

  .charts-grid,
  .tables-grid,
  .detailed-tables,
  .infographic-grid,
  .advanced-infographic-grid,
  .branch-chart-grid,
  .branch-inner-grid{
    grid-template-columns:1fr 1fr!important;
    gap:5mm!important;
  }

  .daily-sales-panel,
  .daily-sales-panel .table-wrap{
    page-break-inside:auto!important;
    break-inside:auto!important;
  }

  .daily-sales-panel table{
    table-layout:auto!important;
    font-size:8px!important;
  }

  .daily-sales-panel th,
  .daily-sales-panel td{
    padding:3px 4px!important;
    white-space:nowrap!important;
    word-break:normal!important;
  }

  /* keep trend badge readable but not huge */
  .daily-sales-panel .trend-pill,
  .trend-pill{
    display:inline-flex!important;
    min-width:56px!important;
    padding:2px 5px!important;
    font-size:8px!important;
    line-height:1.05!important;
    border-radius:12px!important;
  }

  .daily-sales-panel .trend-icon,
  .trend-icon{
    width:auto!important;
    height:auto!important;
    font-size:8px!important;
  }

  table{
    table-layout:auto!important;
    font-size:8px!important;
  }

  th,td{
    padding:3px 4px!important;
    line-height:1.15!important;
    vertical-align:top!important;
  }

  th{
    white-space:normal!important;
  }

  td{
    white-space:nowrap!important;
  }

  .table-wrap{
    overflow:visible!important;
    max-height:none!important;
  }

  /* Print detailed report section by section, without orphan titles or huge white spaces */
  .panel,
  .chart-card,
  .branch-detail-panel{
    margin-bottom:5mm!important;
  }

  .branch-detail-panel{
    page-break-before:auto!important;
    break-before:auto!important;
  }

  /* Browser header/footer is controlled by print dialog; this keeps app footer out */
  a[href]:after{
    content:""!important;
  }
}


.heatmap-empty{
  padding:24px;
  text-align:center;
  color:#607086;
  font-weight:800;
}


/* V5.17.3 reliable print charts */
.print-static-chart{display:none}
@media print{
  canvas.print-canvas-hidden,
  .real-heatmap.print-canvas-hidden{
    display:none!important;
  }
  .print-static-chart{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-height:150px!important;
    page-break-inside:avoid!important;
    break-inside:avoid!important;
  }
  .print-static-svg{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:175px!important;
  }
  .gauge-static{
    height:125px!important;
  }
  .gauge-card .print-static-chart{
    min-height:125px!important;
  }
  .chart-card .print-static-chart,
  .infographic-card .print-static-chart,
  .branch-chart-card .print-static-chart{
    min-height:175px!important;
  }
  .print-static-heatmap{
    overflow:visible!important;
    min-height:auto!important;
  }
  .print-static-heatmap .heatmap-row{
    grid-template-columns:62px repeat(24,1fr)!important;
  }
  .print-static-heatmap .heat-cell,
  .print-static-heatmap span{
    min-height:16px!important;
    font-size:6.5px!important;
  }
  .chart-card,
  .infographic-card,
  .branch-chart-card{
    min-height:215px!important;
  }
  .gauge-card{
    min-height:145px!important;
  }
}
