:root {
  color-scheme: light;

  /* Mekfeya Brand & Status Tokens */
  --mek-green: #62c600;
  --mek-green-hover: #54aa00;
  --mek-green-light: #eefad9;
  --mek-green-dark: #275200;
  --mek-emerald: #10b981;
  --mek-emerald-dark: #059669;

  /* Slates & Surfaces */
  --slate-950: #09100d;
  --slate-900: #0f1c16;
  --slate-850: #14241d;
  --slate-800: #1b2f26;
  --slate-750: #223a2f;
  --slate-700: #294237;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --surface-body: #f6f8f7;
  --surface-card: #ffffff;

  /* Semantic Status */
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --amber-900: #78350f;

  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --red-900: #7f1d1d;

  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-900: #1e3a8a;

  --purple-600: #7c3aed;
  --purple-100: #f3e8ff;
  --purple-900: #581c87;

  /* Telebirr Brand Colors */
  --telebirr-blue: #0077c8;
  --telebirr-light: #e0f2fe;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 0 3px rgba(98, 198, 0, 0.22);
  --shadow-modal: 0 25px 50px -12px rgba(15, 28, 22, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--slate-900);
  background-color: var(--surface-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* App Layout Shell */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px 1fr;
  width: 100%;
}

/* SIDEBAR BACKDROP FOR MOBILE */
.sidebar-backdrop {
  display: none;
}

/* SIDEBAR */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, var(--slate-950) 0%, var(--slate-900) 100%);
  color: var(--slate-100);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.14);
  z-index: 50;
}

.sidebar-header {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--slate-400);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  background: rgba(98, 198, 0, 0.12);
  border: 1px solid rgba(98, 198, 0, 0.32);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.brand:hover .brand-mark {
  transform: scale(1.04);
  background: rgba(98, 198, 0, 0.18);
}

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

.brand-title {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mek-green);
}

/* Nav Menu */
.nav-menu {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-400);
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--slate-300);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-icon {
  flex-shrink: 0;
  color: var(--slate-400);
  transition: color 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item:hover .nav-icon {
  color: var(--mek-green);
}

.nav-item.active {
  background: rgba(98, 198, 0, 0.14);
  color: #ffffff;
  border: 1px solid rgba(98, 198, 0, 0.3);
}

.nav-item.active .nav-icon {
  color: var(--mek-green);
}

.nav-badge-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 750;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--slate-200);
  white-space: nowrap;
}

.nav-badge-count.warn {
  background: var(--amber-500);
  color: #000000;
  font-weight: 850;
}

.badge-soon {
  margin-left: auto;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--slate-400);
}

/* Sidebar Environment Card */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.environment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease;
}

.environment-card:hover {
  border-color: rgba(98, 198, 0, 0.3);
}

.status-indicator {
  position: relative;
  width: 9px;
  height: 9px;
  flex-shrink: 0;
}

.status-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mek-green);
}

.status-pulse {
  position: absolute;
  top: -3px;
  left: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(98, 198, 0, 0.4);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.7); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.7); opacity: 0; }
}

.env-info {
  min-width: 0;
  flex: 1;
}

.env-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.env-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.env-shield {
  font-size: 8.5px;
  font-weight: 750;
  text-transform: uppercase;
  color: var(--mek-green);
  background: rgba(98, 198, 0, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

.env-ref {
  display: block;
  font-size: 10.5px;
  color: var(--slate-400);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}

/* MAIN CONTENT */
.main-content {
  min-width: 0;
  padding: 24px clamp(16px, 2.5vw, 40px) 60px;
  max-width: 1340px;
  width: 100%;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--slate-200);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* HAMBURGER TOGGLE BUTTON */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--slate-300);
  align-items: center;
  justify-content: center;
  color: var(--slate-800);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}

.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--slate-500);
  font-weight: 500;
}

.crumb-separator {
  color: var(--slate-300);
}

.crumb.current {
  color: var(--mek-green-dark);
  font-weight: 700;
}

.page-title {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--slate-900);
}

.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.identity-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--slate-850);
  color: var(--mek-green);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.identity-details {
  display: flex;
  flex-direction: column;
}

.identity-email {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--slate-900);
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-role-badge {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mek-green-dark);
}

/* HORIZONTAL MOBILE QUICK-TABS */
.mobile-quick-nav {
  display: none;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 14px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-quick-nav::-webkit-scrollbar {
  display: none;
}

.quick-tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.quick-tab-btn.active {
  background: var(--slate-900);
  color: #ffffff;
  border-color: var(--slate-900);
}

.quick-tab-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.1);
}

.quick-tab-btn.active .quick-tab-badge {
  background: var(--mek-green);
  color: var(--slate-950);
}

/* BUTTONS */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.button.primary {
  background: var(--mek-green);
  color: var(--slate-950);
  box-shadow: 0 2px 6px rgba(98, 198, 0, 0.28);
}

.button.primary:hover:not(:disabled) {
  background: var(--mek-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(98, 198, 0, 0.38);
}

.button.secondary {
  background: #ffffff;
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--slate-400);
  color: var(--slate-900);
}

.button.danger {
  background: #ffffff;
  color: var(--red-900);
  border: 1px solid rgba(239, 68, 68, 0.45);
  box-shadow: var(--shadow-xs);
}

.button.danger:hover:not(:disabled) {
  background: var(--red-100);
  border-color: rgba(239, 68, 68, 0.75);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.payment-review-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proof-link {
  color: var(--mek-green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.empty-table-cell {
  padding: 32px 20px !important;
  color: var(--slate-500);
  text-align: center;
}

.icon-btn {
  padding: 7px 12px;
  font-size: 12px;
}

/* NOTICES */
.notice {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  background: var(--mek-green-light);
  color: var(--mek-green-dark);
  border: 1px solid rgba(98, 198, 0, 0.35);
  box-shadow: var(--shadow-xs);
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.notice.warning {
  background: var(--amber-100);
  color: var(--amber-900);
  border-color: rgba(245, 158, 11, 0.4);
}

.notice.error {
  background: var(--red-100);
  color: var(--red-900);
  border-color: rgba(239, 68, 68, 0.4);
}

/* TAB VIEWS */
.tab-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.16s ease-in-out;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

/* METRICS GRIDS */
.metrics-grid {
  display: grid;
  gap: 14px;
  width: 100%;
}

.metrics-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.metrics-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.metric-card {
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-width: 0;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card.highlight {
  background: linear-gradient(145deg, #ffffff 0%, var(--mek-green-light) 100%);
  border-color: rgba(98, 198, 0, 0.35);
}

.metric-card.alert-card {
  background: linear-gradient(145deg, #ffffff 0%, #fff7ed 100%);
  border-color: rgba(245, 158, 11, 0.35);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-icon-box {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-box.green {
  background: rgba(98, 198, 0, 0.18);
  color: var(--mek-green-dark);
}

.metric-icon-box.amber {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-900);
}

.metric-icon-box.blue {
  background: rgba(37, 99, 235, 0.14);
  color: var(--blue-600);
}

.metric-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-value {
  font-size: clamp(22px, 2.2vw, 26px);
  font-weight: 850;
  color: var(--slate-900);
  letter-spacing: -0.03em;
  word-break: break-all;
}

.metric-value.green {
  color: var(--mek-green-dark);
}

.metric-value.amber {
  color: var(--amber-900);
}

.trend-badge {
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.trend-up {
  background: #dcfce7;
  color: #15803d;
}

.trend-down {
  background: #fee2e2;
  color: #b91c1c;
}

.trend-warn {
  background: var(--amber-100);
  color: var(--amber-900);
}

.metric-subtext {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.35;
}

/* DISTRIBUTION & CHART CARDS */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
}

.analytics-card {
  padding: 20px 22px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}

.card-title-row h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--slate-900);
}

.card-subtitle {
  font-size: 11.5px;
  color: var(--slate-500);
  display: block;
  margin-top: 2px;
}

.stacked-bar-wrap {
  margin-bottom: 14px;
}

.stacked-bar {
  height: 14px;
  border-radius: 999px;
  background: var(--slate-200);
  display: flex;
  overflow: hidden;
  width: 100%;
}

.stacked-bar-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.stacked-bar-segment.seg-primary { background: var(--mek-green); }
.stacked-bar-segment.seg-secondary { background: var(--blue-600); }
.stacked-bar-segment.seg-accent { background: var(--purple-600); }
.stacked-bar-segment.seg-amber { background: var(--amber-500); }
.stacked-bar-segment.seg-gray { background: var(--slate-400); }

.legend-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.seg-primary { background: var(--mek-green); }
.legend-dot.seg-secondary { background: var(--blue-600); }
.legend-dot.seg-accent { background: var(--purple-600); }
.legend-dot.seg-amber { background: var(--amber-500); }

.legend-label {
  color: var(--slate-600);
  font-weight: 500;
  white-space: nowrap;
}

.legend-val {
  margin-left: auto;
  font-weight: 800;
  color: var(--slate-900);
  white-space: nowrap;
}

/* DATA TABLES & TOOLBAR */
.admin-table-card {
  overflow: hidden;
  width: 100%;
}

.table-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #ffffff;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 300px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  font-size: 12.5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-300);
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-pills-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-chip:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.filter-chip.active {
  background: var(--slate-900);
  color: #ffffff;
  border-color: var(--slate-900);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-counter-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-500);
  padding: 4px 10px;
  background: var(--slate-100);
  border-radius: 999px;
  white-space: nowrap;
}

.table-counter-tag.warn {
  background: var(--amber-100);
  color: var(--amber-900);
}

/* RESPONSIVE TABLE WRAPPER */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.admin-table th {
  padding: 11px 16px;
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 750;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--slate-200);
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background-color 0.14s ease;
}

.admin-table tbody tr:hover {
  background-color: #fbfdfc;
}

/* User & Business Cell Layouts */
.user-cell, .business-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--slate-800);
  color: var(--mek-green);
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-initials.blue {
  background: var(--blue-100);
  color: var(--blue-900);
}

.avatar-initials.amber {
  background: var(--amber-100);
  color: var(--amber-900);
}

.avatar-initials.purple {
  background: var(--purple-100);
  color: var(--purple-900);
}

.cell-info {
  display: flex;
  flex-direction: column;
}

.cell-title {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--slate-900);
}

.cell-subtitle {
  font-size: 11px;
  color: var(--slate-500);
  font-family: var(--font-mono);
}

/* STATUS PILLS */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill-active, .pill-completed, .pill-published {
  background: #dcfce7;
  color: #166534;
  border: 1px solid rgba(22, 101, 52, 0.2);
}

.pill-expired, .pill-failed {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid rgba(153, 27, 27, 0.2);
}

.pill-trialing {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid rgba(3, 105, 161, 0.2);
}

.pill-past-due, .pill-draft, .pill-warning {
  background: var(--amber-100);
  color: var(--amber-900);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.pill-readonly {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.3);
}

.pill-role {
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  font-weight: 750;
  text-transform: uppercase;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.gateway-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.gateway-chip.telebirr {
  color: var(--telebirr-blue);
}

.gateway-chip.cbe {
  color: #832729;
}

.amount-tag {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--slate-900);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* EXPIRED POLICY BANNER */
.read-only-policy-card {
  padding: 16px 20px;
  background: linear-gradient(145deg, #ffffff 0%, #fff7ed 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.policy-icon-shield {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--amber-100);
  color: var(--amber-900);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.policy-content h3 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 850;
  color: var(--slate-900);
}

.policy-content p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--slate-600);
}

.policy-content code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* FORM STYLING FOR PLAN STUDIO */
.studio-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section {
  display: grid;
  grid-template-columns: 60px 1fr;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-section:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-md);
}

.section-badge-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
  background: var(--slate-50);
  border-right: 1px solid var(--slate-200);
}

.section-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--slate-850);
  color: var(--mek-green);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-step-line {
  flex: 1;
  width: 2px;
  background: var(--slate-200);
  margin: 10px 0 16px;
}

.section-content {
  padding: 22px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.row-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.draft-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-100);
  color: var(--amber-900);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
}

.required-star {
  color: var(--red-600);
}

.helper-text {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.35;
}

.input-currency-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-tag {
  position: absolute;
  left: 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--slate-500);
  pointer-events: none;
}

.input-currency-wrap input {
  padding-left: 46px;
  font-weight: 600;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--slate-900);
  background: #ffffff;
  transition: all 0.15s ease;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--mek-green);
  box-shadow: var(--shadow-glow);
}

/* PRICE PREVIEW COMPONENT */
.price-preview {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
}

.preview-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--slate-500);
  font-size: 12px;
}

.preview-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-result.positive {
  background: var(--mek-green-light);
  border: 1px solid rgba(98, 198, 0, 0.4);
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

.preview-result.positive .preview-icon-box {
  background: var(--mek-green);
  color: var(--slate-950);
}

.preview-icon-box {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-details {
  flex: 1 1 200px;
}

.preview-headline {
  font-size: 13px;
  font-weight: 750;
  color: var(--slate-900);
}

.preview-math {
  font-size: 11.5px;
  color: var(--slate-600);
  margin-top: 1px;
}

.preview-badge {
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: 999px;
}

.savings-badge {
  background: var(--mek-green);
  color: var(--slate-950);
}

/* CHOICE GRID & FEATURES */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.16s ease;
}

.feature-option:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.feature-checkbox-wrap {
  margin-top: 2px;
  position: relative;
}

.feature-checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--slate-400);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s ease;
}

.feature-option input[type="checkbox"]:checked ~ .custom-checkbox {
  background: var(--mek-green);
  border-color: var(--mek-green);
  color: var(--slate-950);
}

.feature-option:has(input:checked) {
  border-color: rgba(98, 198, 0, 0.55);
  background: var(--mek-green-light);
}

.feature-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.feature-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.feature-name {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--slate-900);
}

.category-pill {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--slate-100);
  color: var(--slate-600);
}

.feature-desc {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 2px;
  line-height: 1.35;
}

.feature-key {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--slate-400);
  margin-top: 3px;
  display: block;
}

/* LIMITS LIST */
.limit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.limit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  transition: all 0.16s ease;
}

.limit-row:hover {
  border-color: var(--slate-300);
  background: var(--slate-50);
}

.limit-row.is-unlimited {
  background: rgba(98, 198, 0, 0.04);
  border-color: rgba(98, 198, 0, 0.3);
}

.limit-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.limit-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.limit-name {
  font-size: 13px;
  font-weight: 750;
  color: var(--slate-900);
}

.limit-unit-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--slate-100);
  color: var(--slate-600);
}

.limit-desc {
  font-size: 11px;
  color: var(--slate-500);
}

.limit-key-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--slate-400);
  margin-top: 1px;
  display: inline-block;
}

.limit-inputs-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.limit-qty-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 120px;
}

.field-label-mini {
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-600);
  text-transform: uppercase;
}

.limit-quantity {
  padding: 6px 9px;
  font-size: 12.5px;
  font-weight: 700;
}

/* UNLIMITED TOGGLE */
.unlimited-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding-top: 14px;
}

.unlimited-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 32px;
  height: 18px;
  background: var(--slate-300);
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s ease;
}

.toggle-thumb {
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xs);
}

.unlimited-toggle input:checked ~ .toggle-track {
  background: var(--mek-green-dark);
}

.unlimited-toggle input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(14px);
}

.toggle-text {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate-700);
}

/* STICKY SUBMIT BAR */
.submit-bar {
  position: sticky;
  bottom: 20px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--slate-950) 0%, var(--slate-900) 100%);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(9, 16, 13, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.submit-safety-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.safety-icon-shield {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: rgba(98, 198, 0, 0.18);
  color: var(--mek-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.submit-title {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
}

.submit-desc {
  display: block;
  font-size: 11px;
  color: var(--slate-400);
  margin-top: 1px;
}

.submit-desc code {
  color: var(--mek-green);
  font-family: var(--font-mono);
}

.cta-button {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 800;
}

/* EXISTING PLANS */
.existing-plans {
  padding: 22px 24px 24px;
}

.catalog-snapshot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
}

.badge-counter {
  font-size: 11px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--slate-100);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-row-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  transition: all 0.16s ease;
}

.plan-row-card:hover {
  border-color: var(--slate-300);
  box-shadow: var(--shadow-sm);
  background: var(--slate-50);
}

.plan-header-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.plan-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-name-display {
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900);
}

.plan-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--slate-400);
}

.plan-key-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate-500);
  background: var(--slate-100);
  padding: 1px 5px;
  border-radius: 4px;
}

.plan-pricing-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-chip-tag {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 4px 9px;
  background: var(--slate-100);
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-200);
}

.period-sub {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
}

.price-amount {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--slate-900);
}

/* PROMOTIONS STAGE 2 CARDS */
.promo-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.promo-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.promo-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.promo-code-box {
  padding: 8px 10px;
  background: var(--slate-100);
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: 0.08em;
  display: inline-block;
}

.promo-desc {
  font-size: 11.5px;
  color: var(--slate-600);
  line-height: 1.45;
}

.promo-stats-row {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--slate-100);
  font-size: 11px;
  color: var(--slate-500);
}

.promo-stats-row strong {
  color: var(--slate-900);
}

/* MODAL DIALOG */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 16, 13, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--slate-200);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--slate-50);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--mek-green-light);
  color: var(--mek-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-heading {
  font-size: 16px;
  font-weight: 850;
  color: var(--slate-900);
  margin: 0;
}

.modal-subheading {
  font-size: 11px;
  color: var(--slate-500);
  display: block;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate-400);
}

.modal-close-btn:hover {
  background: var(--slate-200);
  color: var(--slate-800);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.spec-section h3 {
  font-size: 13.5px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--slate-900);
}

.spec-section p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--slate-600);
  margin: 0 0 8px;
}

.role-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.role-pill-card {
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
}

.role-pill-card strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--slate-800);
  margin-bottom: 2px;
}

.role-pill-card span {
  font-size: 10px;
  color: var(--slate-500);
  line-height: 1.3;
  display: block;
}

.role-pill-card.active {
  border-color: rgba(98, 198, 0, 0.5);
  background: var(--mek-green-light);
}

.role-pill-card.active strong {
  color: var(--mek-green-dark);
}

.spec-callout {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--amber-100);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--amber-900);
  font-size: 11.5px;
  line-height: 1.45;
}

.modal-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--slate-200);
  background: var(--slate-50);
  display: flex;
  justify-content: flex-end;
}

/* =========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN MEDIA QUERIES
   ========================================================================= */

/* 1. Large Laptops / Desktops (< 1200px) */
@media (max-width: 1200px) {
  .metrics-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .promo-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 2. Tablets & Small Screens (< 960px) - CONVERT SIDEBAR TO MOBILE OFFCANVAS DRAWER */
@media (max-width: 960px) {
  .shell {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  /* Offcanvas Slide-in Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1500;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.45);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: flex;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(9, 16, 13, 0.65);
    backdrop-filter: blur(3px);
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-quick-nav {
    display: flex;
  }

  .main-content {
    padding: 16px 16px 50px;
    width: 100%;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .legend-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 3. Small Tablets & Phablets (< 768px) */
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .topbar-left {
    justify-content: space-between;
    width: 100%;
  }

  .breadcrumb {
    display: none;
  }

  .session-actions {
    width: 100%;
    justify-content: space-between;
  }

  .identity {
    padding: 4px 8px;
    max-width: calc(100% - 90px);
  }

  .identity-email {
    max-width: 130px;
  }

  .metrics-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .toolbar-left {
    width: 100%;
  }

  .search-input-wrap {
    width: 100%;
  }

  .filter-pills-row {
    width: 100%;
  }

  .toolbar-right {
    justify-content: space-between;
    width: 100%;
  }

  /* Studio Form Responsiveness */
  .form-section {
    grid-template-columns: 1fr;
  }

  .section-badge-column {
    display: none;
  }

  .section-content {
    padding: 18px 16px;
  }

  .grid.two {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .limit-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .limit-inputs-cluster {
    width: 100%;
    justify-content: space-between;
  }

  .submit-bar {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .cta-button {
    width: 100%;
  }

  .role-pills-row {
    grid-template-columns: 1fr;
  }

  .plan-row-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .plan-pricing-col {
    width: 100%;
    justify-content: space-between;
  }
}

/* 4. Mobile Phones (< 520px) */
@media (max-width: 520px) {
  .metrics-grid.cols-4 {
    grid-template-columns: 1fr;
  }

  .metric-card {
    padding: 14px;
  }

  .legend-list {
    grid-template-columns: 1fr;
  }

  .promo-cards-grid {
    grid-template-columns: 1fr;
  }

  .read-only-policy-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .policy-icon-shield {
    margin-bottom: 4px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  .preview-result {
    flex-direction: column;
    align-items: flex-start;
  }

  .preview-badge {
    align-self: flex-start;
  }
}

/* ==========================================================================
   MULTI-ENVIRONMENT & AUTHENTICATION STYLES
   ========================================================================== */

/* Auth Layout */
.auth-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(80vh - 120px);
  padding: 40px 16px;
  max-width: 520px;
  margin: 0 auto;
}

.auth-copy {
  text-align: center;
  margin-bottom: 24px;
}

.auth-copy h2 {
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--slate-900);
  margin: 12px 0 8px;
}

.auth-lead {
  font-size: 13.5px;
  color: var(--slate-600);
  line-height: 1.5;
  margin: 0;
}

.badge-security {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(98, 198, 0, 0.14);
  border: 1px solid rgba(98, 198, 0, 0.35);
  color: var(--mek-green-dark);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-card {
  width: 100%;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.auth-card .card-heading {
  margin-bottom: 4px;
}

.auth-card .card-heading h2 {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--slate-900);
}

/* Environment Selector & Callout */
.env-callout {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 500;
  transition: all 0.2s ease;
}

.env-callout.info {
  background: var(--mek-green-light);
  border: 1px solid rgba(98, 198, 0, 0.4);
  color: var(--mek-green-dark);
}

.env-callout.telecloud {
  background: var(--telebirr-light);
  border: 1px solid rgba(0, 119, 200, 0.35);
  color: #034b7a;
}

.env-callout.warning {
  background: #fff7ed;
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: var(--amber-900);
}

.env-callout.production {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1.5px solid var(--red-500);
  color: var(--red-900);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}

.env-callout.danger {
  background: var(--red-100);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: var(--red-900);
}

/* Header Environment Badge */
.header-env-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 750;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

.header-env-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mek-green);
  flex-shrink: 0;
}

.header-env-name {
  color: var(--slate-800);
  font-weight: 800;
}

.header-env-tag {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(98, 198, 0, 0.15);
  color: var(--mek-green-dark);
}

/* Header Badge - Development */
.header-env-badge.is-development {
  background: var(--mek-green-light);
  border-color: rgba(98, 198, 0, 0.4);
}
.header-env-badge.is-development .header-env-dot {
  background: var(--mek-green);
}

/* Header Badge - Telecloud */
.header-env-badge.is-telecloud {
  background: var(--telebirr-light);
  border-color: rgba(0, 119, 200, 0.4);
}
.header-env-badge.is-telecloud .header-env-dot {
  background: var(--telebirr-blue);
}
.header-env-badge.is-telecloud .header-env-tag {
  background: rgba(0, 119, 200, 0.15);
  color: var(--telebirr-blue);
}

/* Header Badge - Production (PROMINENT WARNING INDICATOR) */
.header-env-badge.is-production {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 2px solid var(--red-600);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22), var(--shadow-sm);
  color: var(--red-900);
  animation: pulse-border-red 2.5s infinite;
}

.header-env-badge.is-production .header-env-name {
  color: var(--red-900);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.header-env-badge.is-production .header-env-dot {
  background: var(--red-600);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.8);
  animation: pulse-dot-red 1.2s infinite;
}

.header-env-badge.is-production .header-env-tag {
  background: var(--red-600);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.08em;
}

@keyframes pulse-border-red {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4), var(--shadow-sm); }
  70% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0), var(--shadow-sm); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0), var(--shadow-sm); }
}

@keyframes pulse-dot-red {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

/* Sidebar Environment Card - Production Override */
.environment-card.is-production {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.5);
}

.environment-card.is-production .status-dot {
  background: var(--red-500);
}

.environment-card.is-production .status-pulse {
  background: rgba(239, 68, 68, 0.4);
}

.environment-card.is-production .env-shield {
  background: var(--red-600);
  color: #ffffff;
}

.environment-card.is-telecloud .status-dot {
  background: var(--telebirr-blue);
}
.environment-card.is-telecloud .status-pulse {
  background: rgba(0, 119, 200, 0.4);
}
.environment-card.is-telecloud .env-shield {
  background: rgba(0, 119, 200, 0.2);
  color: #7dd3fc;
}

/* ==========================================================================
   NEUTRAL SESSION LOADER (Zero flashing of dashboard content)
   ========================================================================== */
.app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--slate-950);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  max-width: 340px;
  padding: 32px 24px;
}

.loading-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.loading-brand-title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.loading-brand-badge {
  color: var(--mek-green);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spinner-ring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--mek-green);
  animation: spinner-spin 0.8s linear infinite;
}

@keyframes spinner-spin {
  to { transform: rotate(360deg); }
}

.loading-subtext {
  color: var(--slate-400);
  font-size: 13px;
  margin: 0;
  font-weight: 500;
}

/* ==========================================================================
   STANDALONE LOGIN VIEW (Clean unauthenticated surface outside dashboard shell)
   ========================================================================== */
.login-view-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #152720 0%, #0a130f 100%);
  padding: 32px 16px;
  position: relative;
  z-index: 100;
}

.login-card-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.login-brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.brand-mark-lg {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-title-lg {
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-badge-lg {
  color: var(--mek-green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-welcome-text {
  text-align: center;
  margin-bottom: 4px;
}

.login-welcome-text h2 {
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.login-welcome-text .auth-lead {
  color: var(--slate-400);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.login-card-container .auth-card {
  width: 100%;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  background: #ffffff;
  padding: 28px;
}

.login-footer-notes {
  text-align: center;
  margin-top: 6px;
}

.login-security-notice {
  color: var(--slate-400);
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   REPORTING CONTROL BAR & DATE FILTERING
   ========================================================================== */
.reporting-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-card);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.date-filter-group {
  display: inline-flex;
  align-items: center;
  background: var(--slate-100);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.date-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.date-pill:hover {
  color: var(--slate-900);
  background: rgba(255, 255, 255, 0.6);
}

.date-pill.active {
  background: #ffffff;
  color: var(--slate-900);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-date-input {
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--slate-800);
}

.scope-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--slate-500);
  flex-wrap: wrap;
}

.scope-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.2;
}

.scope-tag.period {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.scope-tag.snapshot {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.reporting-refresh-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.last-refreshed-text {
  font-size: 11px;
  color: var(--slate-500);
  white-space: nowrap;
}

.refresh-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-750);
  border: 1px solid var(--slate-300);
  transition: all 0.15s ease;
}

.refresh-action-btn:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

/* ==========================================================================
   OPERATIONAL DASHBOARD SECTIONS
   ========================================================================== */
.operational-section {
  margin-bottom: 32px;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--slate-900);
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

.attention-badge-counter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--amber-100);
  color: var(--amber-900);
  border: 1px solid var(--amber-500);
}

.definition-callout-card {
  background: #f8fafc;
  border-left: 3px solid var(--mek-green);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.5;
  margin: 12px 0 16px;
  border-top: 1px solid var(--slate-200);
  border-right: 1px solid var(--slate-200);
  border-bottom: 1px solid var(--slate-200);
}

.definition-callout-card strong {
  color: var(--slate-800);
}

.separation-notice-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.separation-notice-icon {
  font-size: 16px;
  line-height: 1;
}

.feature-adoption-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.adoption-card {
  background: var(--surface-card);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
}

.adoption-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.adoption-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
}

.adoption-pct {
  font-size: 14px;
  font-weight: 900;
  color: var(--slate-900);
}

.adoption-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--slate-100);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.adoption-bar-fill {
  height: 100%;
  background: var(--mek-green);
  border-radius: 3px;
}

.adoption-subtext {
  font-size: 11px;
  color: var(--slate-500);
}

.cursor-pointer {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cursor-pointer:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}


