/* Store Bridge - Dashboard Modules Styling */

/* ==========================================================================
   GLOBAL PANEL VISIBILITY: Panels MUST be hidden unless explicitly active
   ========================================================================== */
html body .module-panel[hidden],
html body [data-dashboard-panel][hidden],
html body .module-panel:not(.active),
html body [data-dashboard-panel]:not(.active),
.module-panel[hidden],
[data-dashboard-panel][hidden],
.module-panel:not(.active),
[data-dashboard-panel]:not(.active) {
  display: none !important;
  visibility: hidden !important;
}

/* Top Medicine Stock: ONLY show when active */
html body .module-panel.active[data-dashboard-panel="Top Medicine Stock"],
html body [data-dashboard-panel="Top Medicine Stock"].active:not([hidden]),
.module-panel.active[data-dashboard-panel="Top Medicine Stock"] {
  width: 100% !important;
  display: flex !important;
  visibility: visible !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   UNIFIED DASHBOARD TOOLBAR ON EVERY DASHBOARD TAB
   Matches screenshot media_1793788688173_532ca270.png
   ========================================================================== */
html body .dashboard-filters,
html body .unified-toolbar,
.dashboard-filters,
.unified-toolbar {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 16px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 16px 20px !important;
  margin: 0 0 24px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

html body .dashboard-filters .filter-control,
html body .unified-toolbar .filter-control,
.dashboard-filters .filter-control,
.unified-toolbar .filter-control {
  position: relative !important;
  display: block !important;
  min-width: 180px !important;
  max-width: 250px !important;
  height: 38px !important;
  flex: 1 1 200px !important;
  margin: 0 !important;
}

html body .dashboard-filters .filter-select,
html body .unified-toolbar .filter-select,
html body .dashboard-filters .date-trigger,
html body .unified-toolbar .date-trigger,
.dashboard-filters .filter-select,
.unified-toolbar .filter-select,
.dashboard-filters .date-trigger,
.unified-toolbar .date-trigger {
  width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #1e293b !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

html body .dashboard-filters .filter-select,
html body .unified-toolbar .filter-select,
.dashboard-filters .filter-select,
.unified-toolbar .filter-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 0 34px 0 14px !important;
  cursor: pointer !important;
}

html body .dashboard-filters .select-arrow,
html body .unified-toolbar .select-arrow,
.dashboard-filters .select-arrow,
.unified-toolbar .select-arrow {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  transform: translateY(-50%) !important;
  color: #64748b !important;
  font-size: 12px !important;
  pointer-events: none !important;
}

html body .dashboard-filters .date-filter,
html body .unified-toolbar .date-filter,
.dashboard-filters .date-filter,
.unified-toolbar .date-filter {
  position: relative !important;
  display: block !important;
  min-width: 190px !important;
  height: 38px !important;
  flex: 1 1 210px !important;
  margin: 0 !important;
}

html body .dashboard-filters .date-trigger,
html body .unified-toolbar .date-trigger,
.dashboard-filters .date-trigger,
.unified-toolbar .date-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 14px !important;
  cursor: pointer !important;
}

html body .dashboard-filters .date-trigger i,
html body .unified-toolbar .date-trigger i,
.dashboard-filters .date-trigger i,
.unified-toolbar .date-trigger i {
  color: #64748b !important;
  font-size: 14px !important;
  margin-left: 8px !important;
}

/* Black Screenshoot button from reference */
html body .dashboard-screenshot-btn,
.dashboard-screenshot-btn {
  height: 38px !important;
  min-height: 38px !important;
  background: #10847E !important;
  color: #ffffff !important;
  border: 1px solid #10847E !important;
  border-radius: 6px !important;
  padding: 0 22px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  margin-left: 0 !important;
  flex: 0 0 auto !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
}

html body .dashboard-screenshot-btn:hover,
.dashboard-screenshot-btn:hover {
  background: #0B6B66 !important;
  border-color: #0B6B66 !important;
}

@media (max-width: 768px) {
  html body .dashboard-filters,
  html body .unified-toolbar,
  .dashboard-filters,
  .unified-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  html body .dashboard-filters .filter-control,
  html body .unified-toolbar .filter-control,
  .dashboard-filters .filter-control,
  .unified-toolbar .filter-control,
  html body .dashboard-filters .date-filter,
  html body .unified-toolbar .date-filter,
  .dashboard-filters .date-filter,
  .unified-toolbar .date-filter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    flex: 0 0 38px !important;
    height: 38px !important;
  }

  html body .dashboard-screenshot-btn,
  .dashboard-screenshot-btn {
    width: 100% !important;
    flex: 0 0 38px !important;
    margin-left: 0 !important;
  }
}

/* Remove old floating screenshot buttons and view selected notice */
.module-page-action,
.filter-summary,
#filterSummary {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* ==========================================================================
   TOP MEDICINE STOCK: Match Revenue KPI Card (Exact match media_1793789581222_2db60575.png)
   ========================================================================== */
html body:not(#_):not(#__) .module-panel[data-dashboard-panel="Top Medicine Stock"] .card-oos-top-medicines,
html body:not(#_):not(#__) .card-oos-top-medicines,
html body .module-panel[data-dashboard-panel="Top Medicine Stock"] .card-oos-top-medicines,
html body .card-oos-top-medicines,
.card-oos-top-medicines {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 20px 24px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  margin: 0 0 18px 0 !important;
  width: 100% !important;
  max-width: 300px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 6px !important;
  min-height: 114px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

html body .card-oos-top-medicines:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 3px 6px -2px rgba(15, 23, 42, 0.03) !important;
  border-color: #cbd5e1 !important;
}

html body[data-enterprise] .card-oos-top-medicines h2,
html body .card-oos-top-medicines h2,
.card-oos-top-medicines h2 {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  margin: 0 !important;
  padding: 0 !important;
  letter-spacing: 0.01em !important;
  font-family: inherit !important;
  line-height: 1.3 !important;
}

html body[data-enterprise] .card-oos-top-medicines strong,
html body[data-enterprise] .card-oos-top-medicines .value,
html body .card-oos-top-medicines strong,
html body .card-oos-top-medicines .value,
#topMedicineCount {
  font-size: 28px !important;
  font-weight: 700 !important;
  color: #16a34a !important;
  font-family: inherit !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1.15 !important;
  letter-spacing: -0.02em !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

html body .card-oos-top-medicines .kpi-sub,
.card-oos-top-medicines .kpi-sub {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #16a34a !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Excel Button: Black on the left */
.top-medicine-excel-wrap {
  display: flex !important;
  justify-content: flex-start !important;
  margin-bottom: 14px !important;
  width: 100% !important;
}
html body .top-medicine-excel-wrap .export-button,
html body .cc-black-excel {
  background: #252525 !important;
  color: #ffffff !important;
  border: 1px solid #252525 !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  height: 32px !important;
  min-height: 32px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  transition: background 0.15s ease !important;
}
html body .top-medicine-excel-wrap .export-button:hover,
html body .cc-black-excel:hover {
  background: #18181b !important;
}

/* Table Card Wrap */
.top-medicine-card-wrap {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
  width: 100% !important;
  margin-top: 4px !important;
}
.top-medicine-table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
}
.top-medicine-table thead tr {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  height: 48px !important;
}
.top-medicine-table thead th {
  padding: 14px 20px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  color: #64748b !important;
}
.top-medicine-table tbody tr {
  height: 52px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background 0.15s ease !important;
}
.top-medicine-table tbody tr:last-child {
  border-bottom: none !important;
}
.top-medicine-table tbody tr:hover {
  background: #f8fafc !important;
}
.top-medicine-table tbody td {
  padding: 14px 20px !important;
  font-size: 12.5px !important;
  font-family: inherit !important;
}


/* ==========================================================================
   PO to GRN Panel & Visual Analytics Styling
   ========================================================================== */
/* PO to GRN: ONLY show when active */
html body .module-panel.active[data-dashboard-panel="PO to GRN"],
html body [data-dashboard-panel="PO to GRN"].active:not([hidden]),
.module-panel.active[data-dashboard-panel="PO to GRN"] {
  width: 100% !important;
  display: flex !important;
  visibility: visible !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

/* Screenshot Button top left in black */
.module-panel[data-dashboard-panel="PO to GRN"] .module-page-action {
  display: flex !important;
  justify-content: flex-start !important;
  width: 100% !important;
  margin-bottom: 14px !important;
}

/* Filter Card: White rounded box */
html body .module-panel[data-dashboard-panel="PO to GRN"] .po-filter-card,
html body .po-filter-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 16px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin-bottom: 20px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

.module-panel[data-dashboard-panel="PO to GRN"] .po-filter-card .filter-control {
  position: relative !important;
  width: 100% !important;
  margin: 0 !important;
  display: block !important;
}

.module-panel[data-dashboard-panel="PO to GRN"] .po-filter-card .filter-select {
  width: 100% !important;
  height: 42px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 0 36px 0 14px !important;
  font-size: 13px !important;
  color: #334155 !important;
  font-family: inherit !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
}

.module-panel[data-dashboard-panel="PO to GRN"] .po-filter-card .select-arrow {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  color: #64748b !important;
  font-size: 12px !important;
  pointer-events: none !important;
}

.module-panel[data-dashboard-panel="PO to GRN"] .po-date-input-wrap {
  position: relative !important;
  width: 100% !important;
  max-width: 480px !important;
}

.module-panel[data-dashboard-panel="PO to GRN"] .po-date-input {
  width: 100% !important;
  height: 42px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  color: #334155 !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

/* PO to GRN Cards Grid */
.po-grn-container {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.po-grn-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  margin-bottom: 24px !important;
}

@media (max-width: 992px) {
  .po-grn-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  .po-grn-grid {
    grid-template-columns: 1fr !important;
  }
}

/* KPI Card Style matching Franchise Dashboard */
html body .module-panel[data-dashboard-panel="PO to GRN"] .po-card,
html body .po-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  min-height: 110px !important;
  padding: 18px 22px !important;
  border-radius: 12px !important;
  border: 1px solid #edf2f7 !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
  box-sizing: border-box !important;
}

html body .module-panel[data-dashboard-panel="PO to GRN"] .po-card:hover,
html body .po-card:hover {
  transform: translateY(-2px) !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 3px 6px -2px rgba(15, 23, 42, 0.03) !important;
}

.po-card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}

html body[data-enterprise] .po-card h2,
html body .po-card h2 {
  font-family: 'Poppins', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.3 !important;
}

.po-chip {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
}

.po-chip-blue {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
}

.po-chip-green {
  background: #E6F4F3 !important;
  color: #10847E !important;
  border: 1px solid #B8DFDC !important;
}

.po-chip-purple {
  background: #f5f3ff !important;
  color: #7c3aed !important;
  border: 1px solid #ddd6fe !important;
}

html body[data-enterprise] [data-dashboard-panel="PO to GRN"] .po-card .value,
html body [data-dashboard-panel="PO to GRN"] .po-card .value,
html body .module-panel[data-dashboard-panel="PO to GRN"] .po-card .value,
html body [data-dashboard-panel="PO to GRN"] .value,
html body .module-panel[data-dashboard-panel="PO to GRN"] .value,
html body[data-enterprise] .po-card .value,
html body .po-card .value,
html body .po-val-bold,
.po-card .value,
.po-val-bold {
  font-family: 'Poppins', sans-serif !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  color: #10847E !important; /* PharmEasy teal matching Franchise Dashboard & Revenue */
  font-variant-numeric: tabular-nums !important;
  line-height: 1.2 !important;
  margin: 0 0 6px 0 !important;
  display: block !important;
  letter-spacing: -0.02em !important;
}

.po-card-sub {
  font-size: 12px !important;
  color: #64748b !important;
  margin-top: 2px !important;
}

.po-card-sub .badge-accent {
  font-weight: 700 !important;
  color: #10847E !important;
}

/* Mini Progress Bar on Rate Cards */
.po-mini-progress {
  width: 100% !important;
  margin-top: 10px !important;
}

.po-mini-track {
  width: 100% !important;
  height: 6px !important;
  background: #f1f5f9 !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  margin-bottom: 6px !important;
}

.po-mini-fill {
  height: 100% !important;
  border-radius: 999px !important;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fill-emerald {
  background: linear-gradient(90deg, #10847E, #0B6B66) !important;
}
.fill-blue {
  background: linear-gradient(90deg, #3b82f6, #2563eb) !important;
}
.fill-purple {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed) !important;
}

.po-mini-legend {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: #64748b !important;
}

/* Visual Analytics Grid */
.po-visuals-grid {
  display: grid !important;
  grid-template-columns: 1.25fr 1fr !important;
  gap: 20px !important;
  width: 100% !important;
  margin-bottom: 28px !important;
}

@media (max-width: 1080px) {
  .po-visuals-grid {
    grid-template-columns: 1fr !important;
  }
}

html body .module-panel[data-dashboard-panel="PO to GRN"] .po-visual-card,
html body .po-visual-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 22px 24px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
}

.po-visual-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  margin-bottom: 20px !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}

.po-visual-title-wrap h3 {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin: 0 0 4px 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.po-visual-title-wrap h3 i {
  color: #2563eb !important;
  font-size: 16px !important;
}

.po-visual-title-wrap p {
  font-size: 12.5px !important;
  color: #64748b !important;
  margin: 0 !important;
}

.po-visual-legend {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  font-size: 12px !important;
  color: #475569 !important;
}

.po-legend-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.po-legend-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
}

.dot-green { background: #10b981 !important; }
.dot-blue { background: #3b82f6 !important; }
.dot-purple { background: #8b5cf6 !important; }
.dot-slate { background: #cbd5e1 !important; }

/* Visual Bar Rows */
.po-comp-rows {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
}

.po-comp-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.po-comp-meta {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 13px !important;
}

.po-comp-label {
  font-weight: 600 !important;
  color: #334155 !important;
}

.po-comp-values {
  font-size: 12px !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.po-comp-values strong {
  color: #0f172a !important;
  font-weight: 600 !important;
}

.po-pct-badge {
  padding: 2px 7px !important;
  border-radius: 4px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
}

.pct-green { background: #dcfce7 !important; color: #15803d !important; }
.pct-blue { background: #dbeafe !important; color: #1d4ed8 !important; }
.pct-purple { background: #f3e8ff !important; color: #6b21a8 !important; }

.po-stacked-bar {
  display: flex !important;
  width: 100% !important;
  height: 24px !important;
  background: #f1f5f9 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  border: 1px solid #e2e8f0 !important;
}

.po-bar-segment {
  display: flex !important;
  align-items: center !important;
  padding-left: 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  transition: width 0.6s ease !important;
}

.seg-green { background: #10b981 !important; }
.seg-blue { background: #3b82f6 !important; }
.seg-purple { background: #8b5cf6 !important; }
.seg-pending {
  background: #e2e8f0 !important;
  color: #64748b !important;
  justify-content: flex-end !important;
  padding-right: 10px !important;
}

/* Circular Gauges */
.po-gauges-wrap {
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  gap: 24px !important;
  margin-bottom: 20px !important;
  text-align: center !important;
}

.po-gauge-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.po-svg-wrap {
  position: relative !important;
  width: 86px !important;
  height: 86px !important;
  margin-bottom: 8px !important;
}

.po-svg-wrap svg {
  transform: rotate(-90deg) !important;
  width: 100% !important;
  height: 100% !important;
}

.po-svg-bg {
  fill: none !important;
  stroke: #f1f5f9 !important;
  stroke-width: 7 !important;
}

.po-svg-meter {
  fill: none !important;
  stroke-width: 7 !important;
  stroke-linecap: round !important;
  transition: stroke-dashoffset 0.8s ease !important;
}

.meter-green { stroke: #10b981 !important; }
.meter-blue { stroke: #3b82f6 !important; }
.meter-purple { stroke: #8b5cf6 !important; }

.po-gauge-center {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  color: #0f172a !important;
}

.po-gauge-name {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 2px !important;
}

.po-gauge-desc {
  font-size: 10.5px !important;
  color: #64748b !important;
}

/* Channel Split Bar */
.po-channel-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  padding: 12px 14px !important;
}

.po-channel-title {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
}

.po-channel-bar {
  display: flex !important;
  height: 10px !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  margin-bottom: 8px !important;
}

.po-ch-hw { background: #8b5cf6 !important; }
.po-ch-direct { background: #cbd5e1 !important; }

.po-channel-labels {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: #64748b !important;
}

/* Franchise Reconciliation & Gauges Card */
.franchise-reconciliation-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 22px 24px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  margin: 0 0 24px 0 !important;
  box-sizing: border-box !important;
}
.reconciliation-flow-bar {
  display: flex !important;
  height: 16px !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #f1f5f9 !important;
  margin: 16px 0 12px 0 !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06) !important;
}
.flow-segment {
  height: 100% !important;
  transition: width 0.3s ease !important;
}
.flow-segment-cogs { background: #334155 !important; }
.flow-segment-exp { background: #f59e0b !important; }
.flow-segment-profit { background: #10b981 !important; }

.reconciliation-legends {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 24px !important;
  flex-wrap: wrap !important;
  margin-bottom: 20px !important;
}
.reconciliation-legend-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13px !important;
  color: #475569 !important;
}
.reconciliation-dot {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}
.reconciliation-dot.dot-cogs { background: #334155 !important; }
.reconciliation-dot.dot-exp { background: #f59e0b !important; }
.reconciliation-dot.dot-profit { background: #10b981 !important; }

.franchise-gauges-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 16px !important;
  padding-top: 16px !important;
  border-top: 1px solid #f1f5f9 !important;
}
.franchise-gauge-card {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 14px 18px !important;
  border-radius: 10px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
.gauge-svg-wrap {
  width: 54px !important;
  height: 54px !important;
  flex-shrink: 0 !important;
}
.franchise-gauge-info {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
.franchise-gauge-info h4 {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  margin: 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
}
.franchise-gauge-info strong {
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.franchise-gauge-info span {
  font-size: 11px !important;
  font-weight: 500 !important;
}

/* Secondary Operational KPI Grid (8 Cards) */
.franchise-operational-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin: 0 0 24px 0 !important;
}
.operational-kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  min-height: 110px !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}
.operational-kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07) !important;
}
.op-kpi-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
}
.op-kpi-header h3 {
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  margin: 0 !important;
}
.op-kpi-action {
  color: #94a3b8 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: color 0.15s ease !important;
}
.op-kpi-action:hover {
  color: #475569 !important;
}
.op-kpi-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}
.op-kpi-row strong.value {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  letter-spacing: -0.02em !important;
  line-height: 1.1 !important;
}
.op-kpi-sparkline {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-shrink: 0 !important;
}
.op-kpi-sparkline svg {
  width: 72px !important;
  height: 22px !important;
  display: block !important;
}
.kpi-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  padding: 3px 10px !important;
  border-radius: 9999px !important;
  width: fit-content !important;
  line-height: 1.2 !important;
}
.kpi-pill.pill-emerald {
  background: #dcfce7 !important;
  color: #15803d !important;
}
.kpi-pill.pill-rose {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}
.kpi-pill.pill-slate {
  background: #f1f5f9 !important;
  color: #475569 !important;
}
.kpi-pill.pill-amber {
  background: #fef3c7 !important;
  color: #b45309 !important;
}
.operational-kpi-card .kpi-sub {
  font-size: 11.5px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-weight: 500 !important;
}
.operational-kpi-card .kpi-sub.positive {
  color: #16a34a !important;
}
.operational-kpi-card .kpi-sub.negative {
  color: #ef4444 !important;
}
.operational-kpi-card .kpi-sub.neutral {
  color: #64748b !important;
}

@media (max-width: 1200px) {
  .franchise-operational-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .franchise-gauges-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 640px) {
  .franchise-operational-grid,
  .franchise-gauges-grid {
    grid-template-columns: 1fr !important;
  }
  .operational-kpi-card {
    padding: 16px 18px !important;
    min-height: 94px !important;
  }
  .operational-kpi-card strong.value {
    font-size: 22px !important;
  }
}

/* Franchise Team Performance Card & Alignments */
.franchise-team-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 22px 24px !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02) !important;
  margin-top: 24px !important;
  box-sizing: border-box !important;
}

.franchise-team-card .revenue-chart-header {
  margin-bottom: 18px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.franchise-team-table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
}

.franchise-team-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: fixed !important;
}

.franchise-team-table thead tr {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.franchise-team-table th {
  padding: 13px 18px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #475569 !important;
  vertical-align: middle !important;
  border: none !important;
}

.franchise-team-table th.th-user {
  text-align: left !important;
  width: 25% !important;
}

.franchise-team-table th.th-metric {
  text-align: center !important;
  width: 25% !important;
}

.franchise-team-table tbody tr {
  border-bottom: 1px solid #f1f5f9 !important;
  transition: background-color 0.15s ease !important;
}

.franchise-team-table tbody tr:last-child {
  border-bottom: none !important;
}

.franchise-team-table tbody tr:hover {
  background-color: #f8fafc !important;
}

.franchise-team-table td {
  padding: 14px 18px !important;
  font-size: 13px !important;
  color: #1e293b !important;
  vertical-align: middle !important;
  border: none !important;
}

.franchise-team-table td.td-user {
  text-align: left !important;
  font-weight: 600 !important;
  color: #0f172a !important;
}

.franchise-team-table td.td-metric {
  text-align: center !important;
}

.team-cell-stack {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: 100% !important;
}

.team-main-val {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.01em !important;
  line-height: 1.2 !important;
}

.team-main-val.tone-purple {
  color: #6366f1 !important;
}
.team-main-val.tone-green {
  color: #16a34a !important;
}
.team-main-val.tone-cyan {
  color: #0284c7 !important;
}

.team-trend-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 7px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
  line-height: 1.25 !important;
}

.team-trend-badge.trend-up {
  color: #16a34a !important;
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
}

.team-trend-badge.trend-down {
  color: #dc2626 !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
}

/* Category-wise Visualization in 1 Line on Franchise Dashboard: Gross Profit - Expense - Net Profit */
.category-pnl-1line-card {
  width: 100% !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 20px !important;
  margin: 0 0 20px 0 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  box-sizing: border-box !important;
  contain: layout style paint !important;
}

.pnl-1line-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
}

@media (max-width: 1280px) {
  .pnl-1line-row {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
}

.pnl-cat-selector {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.pnl-cat-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: #ecfdf5 !important;
  color: #059669 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
}

.pnl-cat-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}

.pnl-cat-sub {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  font-family: inherit !important;
}

.pnl-cat-select {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  padding: 3px 22px 3px 8px !important;
  background: #f8fafc url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="%2364748b" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/></svg>') no-repeat right 6px center !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
  outline: none !important;
  transition: border-color 0.15s ease !important;
}

.pnl-cat-select:focus {
  border-color: #075598 !important;
  box-shadow: 0 0 0 2px rgba(7, 85, 152, 0.12) !important;
}

.pnl-stat-node {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  flex-shrink: 0 !important;
}

.pnl-node-title {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.pnl-node-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.pnl-node-num {
  font-family: 'Poppins', sans-serif !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1.2 !important;
}

.pnl-node-num.num-green { color: #16a34a !important; }
.pnl-node-num.num-slate { color: #1e293b !important; }
.pnl-node-num.num-emerald { color: #059669 !important; }

.pnl-node-pill {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 1px 6px !important;
  border-radius: 9999px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
}

.pnl-node-pill.pill-green { background: #dcfce7 !important; color: #15803d !important; }
.pnl-node-pill.pill-amber { background: #fef3c7 !important; color: #b45309 !important; }
.pnl-node-pill.pill-emerald { background: #ecfdf5 !important; color: #047857 !important; }

.pnl-op-node {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.pnl-op-circle {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.pnl-op-circle.minus {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.pnl-op-circle.equals {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  transform: rotate(90deg) !important;
}

.pnl-cat-telemetry-strip {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  flex: 1 1 180px !important;
  min-width: 140px !important;
}

.cat-bar-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
}

.cat-bar-title {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  white-space: nowrap !important;
}

.cat-bar-active-tag {
  font-size: 9.5px !important;
  font-weight: 600 !important;
  color: #075598 !important;
  background: #eff6ff !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cat-segments-wrap {
  display: flex !important;
  height: 10px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #f1f5f9 !important;
  gap: 1.5px !important;
}

.cat-seg {
  height: 100% !important;
  transition: opacity 0.2s ease, transform 0.15s ease !important;
  cursor: pointer !important;
}

.cat-seg:hover {
  opacity: 0.8 !important;
  transform: scaleY(1.2) !important;
}

.cat-seg.seg-med { background: #16a34a !important; }
.cat-seg.seg-milk { background: #0284c7 !important; }
.cat-seg.seg-consumer { background: #8b5cf6 !important; }
.cat-seg.seg-vit { background: #f59e0b !important; }
.cat-seg.seg-diag { background: #ec4899 !important; }
.cat-seg.seg-surg { background: #10b981 !important; }
.cat-seg.seg-herb { background: #94a3b8 !important; }


