/* Compact application density and proportions. */
:root {
  --simh-topbar-height: 58px;
  --simh-sidebar-width: 236px;
  --simh-radius-xs: 7px;
  --simh-radius-sm: 9px;
  --simh-radius-md: 12px;
  --simh-radius-lg: 15px;
  --simh-fixed-footer-height: 44px;
}

body.simh-app:not(.auth-page) {
  font-size: 13px !important;
}

/* Shell */
body.simh-app:not(.auth-page) .topbar {
  height: 58px !important;
  min-height: 58px !important;
  padding: 0 14px !important;
  gap: 10px !important;
}
body.simh-app:not(.auth-page) .topbar-brand,
body.simh-app:not(.auth-page) .brand { gap: 8px !important; }
body.simh-app:not(.auth-page) .topbar-brand img,
body.simh-app:not(.auth-page) .brand img,
body.simh-app:not(.auth-page) .brand-mark,
body.simh-app:not(.auth-page) .topbar-logo {
  max-width: 40px !important;
  max-height: 34px !important;
}
body.simh-app:not(.auth-page) .topbar-brand strong,
body.simh-app:not(.auth-page) .brand strong,
body.simh-app:not(.auth-page) .topbar-title {
  font-size: 14px !important;
  line-height: 1.2 !important;
}
body.simh-app:not(.auth-page) .menu-button,
body.simh-app:not(.auth-page) .account-button,
body.simh-app:not(.auth-page) .topbar-action {
  width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 8px !important;
}
body.simh-app:not(.auth-page) .app-sidebar { width: 236px !important; }
body.simh-app:not(.auth-page) .side-nav { padding: 6px 8px 14px !important; }
body.simh-app:not(.auth-page) .sidebar-hero {
  margin: 8px !important;
  padding: 10px 11px !important;
  border-radius: 10px !important;
}
body.simh-app:not(.auth-page) .sidebar-hero strong { font-size: 12px !important; }
body.simh-app:not(.auth-page) .sidebar-hero span { font-size: 9.5px !important; }
body.simh-app:not(.auth-page) .nav-section-label {
  margin: 10px 8px 4px !important;
  font-size: 9px !important;
}
body.simh-app:not(.auth-page) .side-link,
body.simh-app:not(.auth-page) .side-nav-tree-toggle {
  min-height: 32px !important;
  padding-top: 5px !important;
  padding-bottom: 5px !important;
  font-size: 12px !important;
  gap: 8px !important;
}
body.simh-app:not(.auth-page) .side-nav-tree-nested > .side-nav-tree-toggle,
body.simh-app:not(.auth-page) .side-link.side-tree-link {
  min-height: 29px !important;
  font-size: 11.5px !important;
}
body.simh-app:not(.auth-page) .content-area {
  max-width: 1540px !important;
  padding: 14px 16px calc(var(--simh-fixed-footer-height) + 24px) !important;
}

/* Page heading */
body.simh-app:not(.auth-page) .page-title {
  min-height: 0 !important;
  margin-bottom: 10px !important;
  padding: 9px 12px !important;
  border-radius: 9px !important;
}
body.simh-app:not(.auth-page) .page-title h1 {
  margin: 0 0 2px !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
}
body.simh-app:not(.auth-page) .page-title p,
body.simh-app:not(.auth-page) .page-title .page-context {
  margin: 0 !important;
  font-size: 10.5px !important;
  line-height: 1.4 !important;
}
body.simh-app:not(.auth-page) h2 { font-size: 15.5px !important; }
body.simh-app:not(.auth-page) h3 { font-size: 14px !important; }
body.simh-app:not(.auth-page) p,
body.simh-app:not(.auth-page) .muted { line-height: 1.45 !important; }

/* Common containers */
body.simh-app:not(.auth-page) .card,
body.simh-app:not(.auth-page) .panel,
body.simh-app:not(.auth-page) .native-panel,
body.simh-app:not(.auth-page) .fintech-table-panel,
body.simh-app:not(.auth-page) .fintech-table-toolbar,
body.simh-app:not(.auth-page) .customer-action-section,
body.simh-app:not(.auth-page) .customer-developer-snapshot,
body.simh-app:not(.auth-page) .customer-recent-panel {
  padding: 12px !important;
  border-radius: 10px !important;
}
body.simh-app:not(.auth-page) .grid { gap: 9px !important; }
body.simh-app:not(.auth-page) .section-head,
body.simh-app:not(.auth-page) [class*="-section-head"] {
  margin-bottom: 9px !important;
  gap: 9px !important;
}

/* App heroes: keep them informative without turning them into banners. */
html body.simh-app:not(.auth-page) [class*="-hero"] {
  min-height: 0 !important;
  padding: 13px 14px !important;
  border-radius: 11px !important;
  gap: 12px !important;
}
html body.simh-app:not(.auth-page) [class*="-hero"] :is(h1,h2) {
  margin-bottom: 4px !important;
  font-size: 18px !important;
  line-height: 1.2 !important;
}
html body.simh-app:not(.auth-page) [class*="-hero"] p {
  font-size: 10.5px !important;
  line-height: 1.45 !important;
}
html body.simh-app:not(.auth-page) .native-hero-icon,
html body.simh-app:not(.auth-page) [class*="-hero-icon"] {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 10px !important;
  font-size: 20px !important;
}

/* Forms */
body.simh-app:not(.auth-page) label {
  margin-bottom: 4px !important;
  font-size: 11px !important;
}
body.simh-app:not(.auth-page) input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
body.simh-app:not(.auth-page) select,
body.simh-app:not(.auth-page) textarea {
  min-height: 38px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
}
body.simh-app:not(.auth-page) textarea { min-height: 84px !important; }
body.simh-app:not(.auth-page) .btn,
body.simh-app:not(.auth-page) button.btn,
body.simh-app:not(.auth-page) a.btn,
body.simh-app:not(.auth-page) input[type="submit"] {
  min-height: 34px !important;
  padding: 7px 11px !important;
  border-radius: 8px !important;
  font-size: 11.5px !important;
  line-height: 1.2 !important;
}
body.simh-app:not(.auth-page) .btn-sm,
body.simh-app:not(.auth-page) .btn.small,
body.simh-app:not(.auth-page) .small-btn {
  min-height: 30px !important;
  padding: 5px 9px !important;
  font-size: 10.5px !important;
}

/* Tables */
body.simh-app:not(.auth-page) table th,
body.simh-app:not(.auth-page) table td {
  padding: 7px 9px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  vertical-align: middle !important;
}
body.simh-app:not(.auth-page) table th {
  font-size: 10.5px !important;
  letter-spacing: .02em !important;
}
body.simh-app:not(.auth-page) :is(.badge,.pill,.status,.status-badge,.status-pill,.status-tag,.native-pill) {
  padding: 4px 7px !important;
  font-size: 9.5px !important;
  line-height: 1.15 !important;
}
body.simh-app:not(.auth-page) .alert {
  padding: 9px 11px !important;
  border-radius: 8px !important;
  font-size: 11.5px !important;
}

/* Empty states should not consume a large section when there is no data. */
html body.simh-app:not(.auth-page) [class*="empty"] {
  min-height: 86px !important;
  padding: 15px !important;
}

/* Admin dashboard */
html body.simh-app.page-dashboard .admin-overview-hero {
  margin-bottom: 10px !important;
  padding: 14px !important;
  grid-template-columns: minmax(0,1fr) minmax(190px,250px) !important;
  gap: 14px !important;
  border-radius: 12px !important;
}
html body.simh-app.page-dashboard .admin-overview-copy h2 {
  margin-bottom: 5px !important;
  font-size: 20px !important;
}
html body.simh-app.page-dashboard .admin-overview-copy p { font-size: 10.5px !important; }
html body.simh-app.page-dashboard .admin-overview-actions { margin-top: 10px !important; gap: 7px !important; }
html body.simh-app.page-dashboard .dashboard-primary-action,
html body.simh-app.page-dashboard .dashboard-secondary-action {
  min-height: 34px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 10.5px !important;
}
html body.simh-app.page-dashboard .admin-system-focus {
  padding: 13px !important;
  gap: 5px !important;
  border-radius: 11px !important;
}
html body.simh-app.page-dashboard .admin-system-focus > strong { font-size: 21px !important; }
html body.simh-app.page-dashboard .admin-system-focus > span { font-size: 8.5px !important; }
html body.simh-app.page-dashboard .admin-system-focus > div { font-size: 10px !important; }
html body.simh-app.page-dashboard .admin-metric-grid,
html body.simh-app.page-dashboard .admin-health-grid {
  margin-bottom: 10px !important;
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 8px !important;
}
html body.simh-app.page-dashboard .admin-metric-card {
  min-height: 78px !important;
  padding: 10px !important;
  gap: 9px !important;
  border-radius: 10px !important;
}
html body.simh-app.page-dashboard .admin-metric-icon {
  width: 34px !important;
  height: 34px !important;
  flex-basis: 34px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-dashboard .admin-metric-icon svg { width: 16px !important; height: 16px !important; }
html body.simh-app.page-dashboard .admin-metric-card small { font-size: 8.5px !important; }
html body.simh-app.page-dashboard .admin-metric-card strong { font-size: 19px !important; }
html body.simh-app.page-dashboard .admin-metric-card em { font-size: 9px !important; }
html body.simh-app.page-dashboard .admin-health-card {
  min-height: 66px !important;
  padding: 9px !important;
  grid-template-columns: 32px minmax(0,1fr) 18px !important;
  gap: 8px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-dashboard .admin-health-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
}
html body.simh-app.page-dashboard .admin-health-icon svg { width: 15px !important; height: 15px !important; }
html body.simh-app.page-dashboard .admin-dashboard-section,
html body.simh-app.page-dashboard .admin-activity-panel,
html body.simh-app.page-dashboard .admin-attention-panel {
  margin-bottom: 10px !important;
  padding: 12px !important;
  border-radius: 11px !important;
}
html body.simh-app.page-dashboard .admin-section-head { margin-bottom: 9px !important; gap: 10px !important; }
html body.simh-app.page-dashboard .admin-section-head h2 { font-size: 15px !important; }
html body.simh-app.page-dashboard .admin-section-head p { font-size: 10px !important; }
html body.simh-app.page-dashboard .admin-action-grid { grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 7px !important; }
html body.simh-app.page-dashboard .admin-action-card {
  min-height: 62px !important;
  padding: 9px !important;
  grid-template-columns: 31px minmax(0,1fr) 16px !important;
  gap: 2px 8px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-dashboard .admin-action-card > span {
  width: 31px !important;
  height: 31px !important;
  border-radius: 8px !important;
}
html body.simh-app.page-dashboard .admin-action-card svg { width: 15px !important; height: 15px !important; }
html body.simh-app.page-dashboard .admin-action-card strong { font-size: 11px !important; }
html body.simh-app.page-dashboard .admin-action-card small { font-size: 8.5px !important; }
html body.simh-app.page-dashboard .admin-activity-list { gap: 6px !important; }
html body.simh-app.page-dashboard .admin-activity-item {
  min-height: 58px !important;
  padding: 8px 9px !important;
  grid-template-columns: 31px minmax(0,1fr) auto 18px !important;
  gap: 8px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-dashboard .admin-activity-mark {
  width: 31px !important;
  height: 31px !important;
  border-radius: 8px !important;
}
html body.simh-app.page-dashboard .admin-activity-mark svg { width: 15px !important; height: 15px !important; }
html body.simh-app.page-dashboard .admin-activity-main strong,
html body.simh-app.page-dashboard .admin-activity-result > strong { font-size: 10.5px !important; }
html body.simh-app.page-dashboard .admin-activity-main code,
html body.simh-app.page-dashboard .admin-activity-main small { font-size: 8.5px !important; }
html body.simh-app.page-dashboard .admin-attention-grid { grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 7px !important; }
html body.simh-app.page-dashboard .admin-attention-grid > a {
  padding: 9px !important;
  gap: 2px 8px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-dashboard .attention-count {
  width: 30px !important;
  height: 30px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
}

/* Customer dashboard */
html body.simh-app.page-customer_dashboard .content-area { padding-top: 14px !important; }
html body.simh-app.page-customer_dashboard .customer-wallet-hero {
  min-height: 0 !important;
  padding: 14px !important;
  border-radius: 12px !important;
}
html body.simh-app.page-customer_dashboard .dashboard-bank-cards {
  grid-template-columns: repeat(auto-fit,minmax(250px,1fr)) !important;
  gap: 10px !important;
  margin-bottom: 12px !important;
}
html body.simh-app.page-customer_dashboard .dashboard-bank-cards .bank-card {
  min-height: 158px !important;
  padding: 15px !important;
  border-radius: 13px !important;
}
html body.simh-app.page-customer_dashboard .bank-card-brand { gap: 8px !important; }
html body.simh-app.page-customer_dashboard .bank-card-chip {
  width: 36px !important;
  height: 28px !important;
  flex-basis: 36px !important;
  padding: 5px !important;
  border-radius: 7px !important;
}
html body.simh-app.page-customer_dashboard .bank-card-number-row { margin: 12px 0 10px !important; gap: 10px !important; }
html body.simh-app.page-customer_dashboard .bank-card-number {
  font-size: clamp(18px,2.2vw,23px) !important;
  letter-spacing: .055em !important;
}
html body.simh-app.page-customer_dashboard .bank-card-copy {
  min-width: 52px !important;
  min-height: 30px !important;
  padding: 5px 8px !important;
  font-size: 9.5px !important;
}
html body.simh-app.page-customer_dashboard .customer-action-section,
html body.simh-app.page-customer_dashboard .customer-recent-panel,
html body.simh-app.page-customer_dashboard .customer-developer-snapshot {
  padding: 12px !important;
  border-radius: 11px !important;
}
html body.simh-app.page-customer_dashboard .customer-action-grid {
  grid-template-columns: repeat(4,minmax(0,1fr)) !important;
  gap: 8px !important;
}
html body.simh-app.page-customer_dashboard .customer-action-card {
  min-height: 70px !important;
  padding: 9px !important;
  gap: 8px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-customer_dashboard .customer-action-card strong { font-size: 11.5px !important; }
html body.simh-app.page-customer_dashboard .customer-action-card small { font-size: 9px !important; }
html body.simh-app.page-customer_dashboard .customer-action-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
}
html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid {
  margin-top: 10px !important;
  gap: 8px !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
}
html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid > div {
  padding: 10px !important;
  border-radius: 9px !important;
}
html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid strong {
  margin: 3px 0 !important;
  font-size: 18px !important;
}

/* High-traffic operational pages */
html body.simh-app:not(.auth-page) :is(
  .billing-balance-panel,.billing-fund-panel,.funding-card,.funding-history-panel,
  .wallet-history-panel,.purchase-form-card,.purchase-side-panel,.developer-panel,
  .customer-api-card,.customer-api-key-summary,.play-card,.dash-card,.doc-card,
  .service-card-shell,.mtn-ds-debug-page,.commerce-ops-hero
) {
  padding: 12px !important;
  border-radius: 10px !important;
}
html body.simh-app.page-cloud_billing .billing-balance-panel { min-height: 145px !important; }
html body.simh-app.page-cloud_billing .billing-main-balance { font-size: 24px !important; }
html body.simh-app.page-customer_fund .funding-balance strong,
html body.simh-app.page-customer_buy .purchase-balance-head strong,
html body.simh-app.page-customer_api .customer-api-key-summary strong,
html body.simh-app.page-developer_dashboard .metric-card strong { font-size: 21px !important; }

/* Keep control grids dense on tablets rather than turning every card into a full-width block. */
@media (max-width: 1240px) {
  html body.simh-app.page-dashboard .admin-metric-grid,
  html body.simh-app.page-dashboard .admin-health-grid,
  html body.simh-app.page-dashboard .admin-attention-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
  html body.simh-app.page-dashboard .admin-action-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
  html body.simh-app.page-customer_dashboard .customer-action-grid {
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  }
}

@media (min-width: 1161px) {
  body.simh-app:not(.auth-page) .app-main { margin-left: 236px !important; }
  body.simh-app:not(.auth-page) .site-footer { left: 236px !important; }
}

@media (max-width: 900px) {
  html body.simh-app.page-dashboard .admin-overview-hero {
    grid-template-columns: minmax(0,1fr) !important;
  }
  html body.simh-app.page-dashboard .admin-system-focus {
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
  }
  html body.simh-app.page-customer_dashboard .customer-action-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
}

@media (max-width: 720px) {
  :root { --simh-fixed-footer-height: 42px; }
  body.simh-app:not(.auth-page) { font-size: 12.5px !important; }
  body.simh-app:not(.auth-page) .topbar {
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 9px !important;
  }
  body.simh-app:not(.auth-page) .content-area {
    padding: 9px 8px calc(var(--simh-fixed-footer-height) + 18px) !important;
  }
  body.simh-app:not(.auth-page) .page-title {
    margin-bottom: 8px !important;
    padding: 8px 10px !important;
  }
  body.simh-app:not(.auth-page) .page-title h1 { font-size: 16.5px !important; }
  body.simh-app:not(.auth-page) .card,
  body.simh-app:not(.auth-page) .panel,
  body.simh-app:not(.auth-page) .native-panel,
  body.simh-app:not(.auth-page) .fintech-table-panel,
  body.simh-app:not(.auth-page) .customer-action-section,
  body.simh-app:not(.auth-page) .customer-developer-snapshot,
  body.simh-app:not(.auth-page) .customer-recent-panel { padding: 10px !important; }
  body.simh-app:not(.auth-page) table th,
  body.simh-app:not(.auth-page) table td { padding: 6px 7px !important; font-size: 10.8px !important; }

  html body.simh-app.page-dashboard .admin-overview-hero { padding: 11px !important; }
  html body.simh-app.page-dashboard .admin-overview-copy h2 { font-size: 17px !important; }
  html body.simh-app.page-dashboard .admin-overview-actions { margin-top: 8px !important; }
  html body.simh-app.page-dashboard .admin-metric-grid,
  html body.simh-app.page-dashboard .admin-health-grid,
  html body.simh-app.page-dashboard .admin-action-grid,
  html body.simh-app.page-dashboard .admin-attention-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 6px !important;
  }
  html body.simh-app.page-dashboard .admin-metric-card { min-height: 70px !important; padding: 8px !important; }
  html body.simh-app.page-dashboard .admin-metric-card strong { font-size: 17px !important; }
  html body.simh-app.page-dashboard .admin-health-card { min-height: 60px !important; padding: 7px !important; }
  html body.simh-app.page-dashboard .admin-dashboard-section,
  html body.simh-app.page-dashboard .admin-activity-panel,
  html body.simh-app.page-dashboard .admin-attention-panel { padding: 9px !important; }
  html body.simh-app.page-dashboard .admin-action-card {
    min-height: 58px !important;
    grid-template-columns: 28px minmax(0,1fr) !important;
  }
  html body.simh-app.page-dashboard .admin-action-card > span { width: 28px !important; height: 28px !important; }
  html body.simh-app.page-dashboard .admin-action-card small,
  html body.simh-app.page-dashboard .admin-action-card > b { display: none !important; }
  html body.simh-app.page-dashboard .admin-activity-item {
    grid-template-columns: 28px minmax(0,1fr) auto !important;
  }
  html body.simh-app.page-dashboard .admin-activity-item > b { display: none !important; }

  html body.simh-app.page-customer_dashboard .dashboard-bank-cards {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  html body.simh-app.page-customer_dashboard .dashboard-bank-cards .bank-card {
    min-height: 145px !important;
    padding: 13px !important;
  }
  html body.simh-app.page-customer_dashboard .customer-action-grid,
  html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
  html body.simh-app.page-customer_dashboard .customer-action-card {
    min-height: 60px !important;
    padding: 8px !important;
  }
  html body.simh-app.page-customer_dashboard .customer-action-card small,
  html body.simh-app.page-customer_dashboard .customer-action-card em { display: none !important; }
  html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid strong { font-size: 16px !important; }
}

@media (max-width: 390px) {
  html body.simh-app.page-dashboard .admin-metric-grid,
  html body.simh-app.page-dashboard .admin-health-grid,
  html body.simh-app.page-dashboard .admin-action-grid,
  html body.simh-app.page-dashboard .admin-attention-grid,
  html body.simh-app.page-customer_dashboard .customer-action-grid,
  html body.simh-app.page-customer_dashboard .customer-developer-snapshot-grid {
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  }
  html body.simh-app.page-dashboard .admin-metric-card em,
  html body.simh-app.page-dashboard .admin-health-card em { display: none !important; }
}
