/* Cockpit readability — loads last, harmonizes all modules */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-size: var(--text-base, 1rem);
  line-height: var(--leading, 1.55);
}

/* Headings */
h1 { font-size: var(--text-3xl, 1.75rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-xl, 1.25rem); font-weight: 600; }
h3 { font-size: var(--text-lg, 1.125rem); font-weight: 600; }
h4 { font-size: var(--text-md, 1.0625rem); font-weight: 600; }

.page-header h1,
.ei-header h1,
.herman-shell.hm-neo .herman-hero h1 {
  font-size: 1.75rem !important;
}

.page-header .subtitle,
.ei-subtitle,
.ei-header .ei-subtitle {
  font-size: 0.9375rem !important;
  line-height: 1.5;
}

.ei-tab-panel-head h2,
.panel-inner h2,
.briefing-card h3 {
  font-size: 1.125rem !important;
}

/* Body text minimum */
p, li, td, label, .page-tip {
  font-size: max(0.9375rem, 1em);
}

/* Tables */
.ei-table,
.data-table,
.voice-results-table,
.clients-table,
.deals-table {
  font-size: 0.9375rem !important;
}

.ei-table th,
.data-table th {
  font-size: 0.8125rem !important;
  font-weight: 600;
}

.ei-table td,
.data-table td {
  padding: 0.6rem 0.75rem !important;
}

/* Buttons & inputs */
.btn {
  font-size: 0.9375rem !important;
  font-weight: 500;
}

.btn-sm {
  font-size: 0.875rem !important;
}

.form-input,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  font-size: 0.9375rem !important;
}

/* Sidebar nav */
.app-sidebar a.nav-pill {
  font-size: 0.9375rem !important;
}

.app-sidebar-label {
  font-size: 0.75rem !important;
  font-weight: 600;
}

.app-topbar,
.app-clock {
  font-size: 0.875rem !important;
}

/* KPI cards */
.ei-neo-kpi-label,
.hm-neo-kpi-label,
.briefing-stat-label,
.stat-label {
  font-size: 0.8125rem !important;
}

.ei-neo-kpi-value,
.hm-neo-kpi-value,
.briefing-stat-value {
  font-size: 1.65rem !important;
}

/* Tabs & filters */
.vtab-btn,
.vtab-btn-rich,
.ei-filter-label,
.ei-type-chip {
  font-size: 0.9375rem !important;
}

.ei-filter-group input,
.ei-filter-group select {
  font-size: 0.9375rem !important;
}

/* Badges & pills — readable but compact */
.ei-type-pill,
.ei-halal-pill,
.badge,
.ei-crm-badge,
.live-badge {
  font-size: 0.8125rem !important;
}

/* Herman dashboard micro-labels */
.hm-neo-kpi-label,
.hm-section-label,
.herman-shell.hm-neo .hm-card-label {
  font-size: 0.8125rem !important;
  letter-spacing: 0.06em !important;
}

/* Export intel */
.ei-sync-msg,
.ei-selection-hint,
.ei-map-truncated {
  font-size: 0.875rem !important;
}

.ei-drawer-title {
  font-size: 1.35rem !important;
}

.ei-drawer-kv,
.ei-popup-row {
  font-size: 0.875rem !important;
}

/* Mobile — never shrink below readable */
@media (max-width: 768px) {
  html { font-size: 16px; }
  .app-sidebar a.nav-pill { font-size: 0.9375rem !important; }
  .page-header h1 { font-size: 1.5rem !important; }
}
