*{box-sizing:border-box;margin:0;padding:0}
body{font-family:Inter,Segoe UI,Arial,sans-serif;background:#f4f7fb;color:#182033}
:root{
  --navy:#172554;--purple:#7c3aed;--blue:#2563eb;--green:#16a34a;
  --orange:#f97316;--pink:#db2777;--cyan:#0891b2;--red:#dc2626;
  --yellow:#eab308;--white:#fff;--border:#e5e7eb
}
.layout{display:flex;min-height:100vh}
.sidebar{width:255px;background:#172554;color:#fff;position:fixed;left:0;top:0;bottom:0;padding:22px 15px;overflow:auto}
.brand{font-size:19px;font-weight:900;line-height:1.2;padding:8px 10px 22px;border-bottom:1px solid #33447a}
.brand span{display:block;color:#67e8f9;font-size:11px;margin-top:6px;letter-spacing:1px}
.nav-title{font-size:10px;font-weight:800;color:#93a4d1;margin:20px 10px 8px;letter-spacing:1.2px}
.nav a{display:flex;align-items:center;gap:10px;padding:11px 12px;margin:3px 0;border-radius:9px;color:#dbe5ff;text-decoration:none;font-size:13px;font-weight:650}
.nav a:hover{background:#263a7a;color:#fff}
.nav a.active{background:#7c3aed;color:#fff}
.icon{width:25px;height:25px;display:grid;place-items:center;border-radius:7px;background:#33447a;font-size:13px}
.active .icon{background:#5b21b6}
.main{margin-left:255px;width:calc(100% - 255px)}
.topbar{height:70px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}
.search{width:430px;border:1px solid #dbe1ea;border-radius:9px;padding:11px 14px;font-size:13px;outline:none}
.user{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:750}
.avatar{width:38px;height:38px;border-radius:9px;background:#7c3aed;color:#fff;display:grid;place-items:center;font-weight:900}
.content{padding:25px 28px 40px}
.page-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.page-head h1{font-size:27px;font-weight:900;color:#111827}
.page-head p{font-size:12px;color:#64748b;margin-top:5px}
.actions{display:flex;gap:8px}
.btn{border:0;border-radius:8px;padding:10px 15px;font-weight:800;font-size:12px;cursor:pointer}
.btn.export{background:#e0e7ff;color:#3730a3}
.btn.add{background:#16a34a;color:#fff}
.period{background:#fff;border:1px solid var(--border);border-radius:12px;padding:13px;display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:20px}
.period label{font-size:11px;font-weight:800;color:#475569}
.period input,.period select{border:1px solid #d7dee9;border-radius:7px;padding:8px 10px;font-size:12px}
.quick{display:flex;gap:6px;margin-left:auto}
.quick button{border:0;padding:7px 10px;border-radius:7px;font-size:11px;font-weight:800;color:#fff;cursor:pointer}
.q1{background:#7c3aed}.q2{background:#2563eb}.q3{background:#16a34a}.q4{background:#f97316}.q5{background:#db2777}

/* 7 KPI CARDS & CARD JOURNEY STYLES (Matching User Mockup) */
.kpi-grid-7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1.5px solid transparent;
  min-height: 185px;
}

.kpi-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.kpi-clickable {
  cursor: pointer;
}
.kpi-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.16);
  border-color: #60a5fa !important;
}
.kpi-clickable:active {
  transform: translateY(-1px);
}

.kpi-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kpi-name {
  font-size: 11px;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.25;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.kpi-stat {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
  margin: 4px 0 6px;
  letter-spacing: -0.5px;
}

.kpi-desc {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
  margin-top: auto;
}

/* Individual Card Themes (Matching Mockup) */
.kpi-theme-blue {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 65%, #eff6ff 100%);
}
.kpi-theme-blue .kpi-icon-bubble { background: #dbeafe; color: #2563eb; }
.kpi-theme-blue .kpi-stat { color: #2563eb; }

.kpi-theme-purple {
  border-color: #ddd6fe;
  background: linear-gradient(180deg, #ffffff 65%, #f5f3ff 100%);
}
.kpi-theme-purple .kpi-icon-bubble { background: #ede9fe; color: #7c3aed; }
.kpi-theme-purple .kpi-stat { color: #7c3aed; }

.kpi-theme-orange {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #ffffff 65%, #fff7ed 100%);
}
.kpi-theme-orange .kpi-icon-bubble { background: #ffedd5; color: #ea580c; }
.kpi-theme-orange .kpi-stat { color: #ea580c; }

.kpi-theme-green {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #ffffff 65%, #f0fdf4 100%);
}
.kpi-theme-green .kpi-icon-bubble { background: #dcfce7; color: #16a34a; }
.kpi-theme-green .kpi-stat { color: #16a34a; }

.kpi-theme-sky {
  border-color: #bae6fd;
  background: linear-gradient(180deg, #ffffff 65%, #f0f9ff 100%);
}
.kpi-theme-sky .kpi-icon-bubble { background: #e0f2fe; color: #0284c7; }
.kpi-theme-sky .kpi-stat { color: #0284c7; }

.kpi-theme-pink {
  border-color: #fbcfe8;
  background: linear-gradient(180deg, #ffffff 65%, #fdf2f8 100%);
}
.kpi-theme-pink .kpi-icon-bubble { background: #fce7f3; color: #db2777; }
.kpi-theme-pink .kpi-stat { color: #db2777; }

.kpi-theme-indigo {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff 65%, #f5f3ff 100%);
}
.kpi-theme-indigo .kpi-icon-bubble { background: #e0e7ff; color: #4338ca; }
.kpi-theme-indigo .kpi-stat { color: #4338ca; }

/* CARD JOURNEY STRIP */
.journey-flow-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  flex-wrap: wrap;
}

.journey-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 160px;
}

.journey-brand-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey-title {
  font-size: 16px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.journey-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
}

.journey-track {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: space-between;
}

.journey-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  flex: 1;
  min-width: 130px;
  transition: all 0.2s ease;
}

.journey-capsule.kpi-clickable {
  cursor: pointer;
}

.journey-capsule.kpi-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  filter: brightness(0.97);
}

.journey-capsule.kpi-clickable:active {
  transform: translateY(0);
}

.capsule-purple { background: #f5f3ff; border: 1px solid #ddd6fe; color: #7c3aed; }
.capsule-orange { background: #fff7ed; border: 1px solid #fed7aa; color: #ea580c; }
.capsule-green  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
.capsule-sky    { background: #f0f9ff; border: 1px solid #bae6fd; color: #0284c7; }
.capsule-pink   { background: #fdf2f8; border: 1px solid #fbcfe8; color: #db2777; }

.capsule-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.capsule-text {
  display: flex;
  flex-direction: column;
}

.capsule-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.capsule-value {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
}

.journey-separator {
  font-size: 20px;
  font-weight: 900;
  color: #3b82f6;
  display: flex;
  align-items: center;
  user-select: none;
}

.grid2{display:grid;grid-template-columns:2fr 1fr;gap:18px;margin-bottom:20px}
.card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:18px}
.card-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:17px}
.card-head h2{font-size:15px;font-weight:900;color:#172033}
.card-head span{font-size:10px;color:#64748b;font-weight:700}
.chart{height:235px;display:flex;align-items:end;gap:13px;padding:15px 8px 4px;border-top:1px solid #eef1f5}
.bar-wrap{height:100%;flex:1;display:flex;align-items:end;gap:5px}
.bar{width:100%;border-radius:5px 5px 0 0;min-height:12px}
.bar:nth-child(1){background:#7c3aed}.bar:nth-child(2){background:#2563eb}.bar:nth-child(3){background:#16a34a}.bar:nth-child(4){background:#f97316}
.bar-label{font-size:9px;color:#64748b;text-align:center;margin-top:5px}
.bars{display:flex;align-items:end;width:100%;height:100%}

.combo-chart{display:grid;grid-template-columns:43px 1fr 49px;gap:7px;height:260px;margin-top:4px}
.axis-left,.axis-right{display:flex;flex-direction:column;justify-content:space-between;padding:9px 0 36px;font-size:9px;color:#64748b;font-weight:750}
.axis-left{text-align:right}.axis-right{text-align:left}
.chart-main{position:relative;height:260px;border-bottom:1px solid #cbd5e1}
.grid-line{position:absolute;left:0;right:0;height:1px;background:#e5e7eb}
.g1{top:17px}.g2{top:82px}.g3{top:147px}.g4{bottom:36px}
.bars-area{position:absolute;left:12px;right:12px;top:17px;bottom:36px;display:flex;align-items:flex-end;justify-content:space-between;gap:10px}
.bar-col{height:100%;flex:1;display:flex;align-items:flex-end;justify-content:center}
.bar-purchase{width:42px;max-width:72%;background:#16a34a;border-radius:4px 4px 0 0}
.sales-line{position:absolute;left:0;right:0;top:17px;width:100%;height:201px;pointer-events:none}
.x-labels{position:absolute;left:7px;right:7px;bottom:8px;display:flex;justify-content:space-between;font-size:8px;color:#64748b;font-weight:750}
.chart-note{display:flex;align-items:center;gap:22px;margin-top:4px;flex-wrap:wrap;font-size:9px;color:#334155}
.legend-item{display:flex;align-items:center;gap:6px}.legend-bar{width:15px;height:9px;background:#16a34a;border-radius:2px}.legend-line{width:20px;height:4px;background:#2563eb;border-radius:2px}.legend-text{color:#64748b}

.donut-area{display:flex;align-items:center;justify-content:center;gap:25px;min-height:280px}
.donut{width:250px;height:250px;display:block;flex-shrink:0;max-width:100%; padding-top: 12px;}
.legend{display:grid;gap:12px}
.legend div{display:flex;align-items:center;gap:8px;font-size:11px;font-weight:750}
.dot{width:10px;height:10px;border-radius:3px}.green{background:#16a34a}.orange{background:#f97316}.purple{background:#7c3aed}.pink{background:#db2777}

.section-title{font-size:15px;font-weight:900;margin:22px 0 12px;color:#172033}
.activity-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:11px}
.activity{background:#fff;border:1px solid var(--border);border-radius:11px;padding:15px;border-left:5px solid #7c3aed}
.activity:nth-child(2){border-left-color:#2563eb}.activity:nth-child(3){border-left-color:#16a34a}
.activity:nth-child(4){border-left-color:#f97316}.activity:nth-child(5){border-left-color:#db2777}.activity:nth-child(6){border-left-color:#0891b2}
.activity h3{font-size:11px;color:#64748b}.activity strong{display:block;font-size:21px;margin-top:8px}

.payment-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:14px}
.date-select{display:flex;gap:7px;align-items:center}
.date-select select{border:1px solid #d7dee9;border-radius:7px;padding:8px;font-size:11px;font-weight:750}
.payment-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.pay{border-radius:10px;padding:16px;color:#fff;min-height:125px}
.pay h3{font-size:11px}.pay strong{display:block;font-size:22px;margin:10px 0 5px}.pay small{font-size:10px;opacity:.95}
.pay.success{background:#16a34a}.pay.pending{background:#eab308;color:#422006}.pay.failed{background:#dc2626}.pay.refund{background:#7c3aed}
.payment-total{margin-top:12px;display:flex;justify-content:space-between;background:#eef6ff;border-left:5px solid #2563eb;border-radius:8px;padding:12px;font-size:11px;font-weight:800}

.table-card{margin-top:18px}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse;font-size:11px}
th{background:#172554;color:#fff;text-align:left;padding:11px 10px;font-size:10px;text-transform:uppercase}
td{padding:11px 10px;border-bottom:1px solid #edf0f5;color:#334155;font-weight:650}
tr:hover td{background:#f8fafc}
.badge{display:inline-block;padding:5px 8px;border-radius:6px;font-size:9px;font-weight:900}
.success-b{background:#dcfce7;color:#166534}.refund-b{background:#ede9fe;color:#6d28d9}

.ops{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.op{padding:17px;border-radius:10px;background:#fff;border:1px solid var(--border);border-top:5px solid #7c3aed}
.op:nth-child(2){border-top-color:#16a34a}.op:nth-child(3){border-top-color:#f97316}.op:nth-child(4){border-top-color:#dc2626}
.op h3{font-size:11px;color:#64748b}.op strong{font-size:22px;display:block;margin:8px 0}.op a{font-size:10px;color:#2563eb;font-weight:850;text-decoration:none}

.reports{display:grid;grid-template-columns:repeat(7,1fr);gap:10px}
.report{padding:14px 10px;border-radius:9px;text-align:center;font-size:10px;font-weight:850;border:1px solid var(--border)}
.report:nth-child(1){background:#ede9fe;color:#6d28d9}.report:nth-child(2){background:#dbeafe;color:#1d4ed8}
.report:nth-child(3){background:#dcfce7;color:#15803d}.report:nth-child(4){background:#ffedd5;color:#c2410c}
.report:nth-child(5){background:#fce7f3;color:#be185d}.report:nth-child(6){background:#fee2e2;color:#b91c1c}
.report:nth-child(7){background:#cffafe;color:#0e7490}
footer{text-align:center;color:#94a3b8;font-size:10px;margin-top:30px;padding-top:18px;border-top:1px solid #e5e7eb}

@media(max-width:1400px){
  .kpi-grid-7{grid-template-columns:repeat(4,1fr)}
  .journey-track{justify-content:flex-start}
}
@media(max-width:1200px){
  .kpi-grid-7{grid-template-columns:repeat(3,1fr)}
  .activity-grid{grid-template-columns:repeat(3,1fr)}
  .payment-grid{grid-template-columns:repeat(2,1fr)}
  .reports{grid-template-columns:repeat(4,1fr)}
}
@media(max-width:850px){
  .sidebar{width:72px}.brand{font-size:0}.brand span,.nav-title,.nav a span{display:none}.nav a{justify-content:center}
  .main{margin-left:72px;width:calc(100% - 72px)}.topbar{padding:0 15px}.search{width:55%}
  .grid2{grid-template-columns:1fr}
  .kpi-grid-7{grid-template-columns:repeat(2,1fr)}
  .journey-flow-card{flex-direction:column;align-items:flex-start}
  .journey-track{width:100%}
}
@media(max-width:600px){
  .content{padding:16px}.topbar{height:auto;padding:12px;gap:10px}.search{width:100%}.user{display:none}
  .page-head{display:block}.actions{margin-top:12px}.period{align-items:flex-start}.quick{margin-left:0;width:100%;flex-wrap:wrap}
  .kpi-grid-7,.activity-grid,.payment-grid,.ops,.reports{grid-template-columns:1fr}
  .journey-track{flex-direction:column;width:100%}
  .journey-capsule{width:100%}
  .journey-separator{display:none}
  .grid2{grid-template-columns:1fr}
}
/* Business name clickable link in tables */
.business-link {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed #93c5fd;
  transition: all 0.15s ease;
  display: inline-block;
}

.business-link:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  border-bottom-style: solid;
}

.business-link:active {
  color: #1e40af;
}
/* Business name clickable link in tables */
.business-link {
  color: #2563eb;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed #93c5fd;
  transition: all 0.15s ease;
  display: inline-block;
}

.business-link:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  border-bottom-style: solid;
}

.business-link:active {
  color: #1e40af;
}
.quick button.is-active { outline:3px solid #0f172a; outline-offset:3px; box-shadow:0 0 0 5px #fff; transform:translateY(-2px); text-decoration:underline; text-underline-offset:3px; }
.chart-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:12px 0; }
.chart-controls button { border:1px solid #cbd5e1; border-radius:6px; padding:5px 10px; background:#fff; color:#0f172a; cursor:pointer; font-weight:700; }
.chart-controls button:disabled { opacity:.4; cursor:default; }
.chart-controls span { font-size:11px; color:#64748b; }
.chart-controls output { min-width:44px; text-align:center; font-size:12px; }
.combo-chart { grid-template-columns:43px minmax(0,1fr) 49px; height:280px; }
.chart-main { overflow-x:auto; overflow-y:hidden; height:280px; cursor:grab; touch-action:pan-x pan-y; }
.chart-main.is-dragging { cursor:grabbing; user-select:none; }
.chart-plot { position:relative; height:260px; width:100%; min-width:100%; }
.x-labels { left:12px; right:12px; }
.x-labels span { flex:1; min-width:0; text-align:center; overflow:hidden; white-space:nowrap; }
.bars-area { gap:0; }
.bar-col { min-width:0; }
.sales-line circle { pointer-events:auto; }
[data-chart-tip]:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }
.admin-chart-tooltip { position:fixed; z-index:10000; pointer-events:none; max-width:min(300px,calc(100vw - 16px)); padding:9px 12px; background:#0f172a; color:#fff; border-radius:7px; box-shadow:0 4px 16px #0003; font-size:12px; }

/* Compact dashboard charts. */
.combo-chart, .chart-main { height:200px; }
.chart-plot { height:220px; }
.sales-line { height:167px; }
.g2 { top:72px; }
.g3 { top:128px; }
.donut-area { min-height:220px; }
.donut { width:200px; height:200px; }

.payment-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:14px 16px; border-top:1px solid var(--border); font-size:12px; color:#64748b; }
.payment-pagination nav { display:flex; flex-wrap:wrap; gap:5px; }
.payment-pagination button { padding:6px 10px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:#172554; cursor:pointer; }
.payment-pagination button.current { background:#7c3aed; border-color:#7c3aed; color:#fff; }
.payment-pagination button:disabled { opacity:.4; cursor:default; }
.payment-pagination button:focus-visible { outline:2px solid #7c3aed; outline-offset:2px; }
