﻿/* Icon color & effects */
i[data-lucide] { stroke-width: 2.5; transition: color 0.15s, filter 0.15s; filter: drop-shadow(0 0 1px rgba(0,0,0,0.05)); }
i[data-lucide]:hover { filter: drop-shadow(0 0 3px currentColor); }
.card-icon[data-lucide], .nav-icon[data-lucide] { stroke-width: 2.5; }
[data-theme="dark"] .status-active, [data-theme="dark"] .sector-mixed { color: #34d399 !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --primary-light: #dbeafe;
  --bg: #f1f5f9; --surface: #ffffff; --border: #e2e8f0;
  --text: #0f172a; --text-muted: #64748b; --text-light: #94a3b8;
  --success: #16a34a; --warning: #d97706; --danger: #dc2626;
  --radius: 10px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.12);
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hide { display: none !important; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; border: 1px solid transparent; cursor: pointer;
  transition: all .2s; background: var(--primary); color: #fff;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-full { width: 100%; justify-content: center; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

.navbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 32px;
}
.nav-brand { flex: 0 0 auto; font-weight: 700; font-size: 18px; color: var(--text) !important; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-brand i { color: var(--primary); }
.nav-brand > span:last-child { font-size: 12px; color: var(--text-muted); }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--text-muted) !important; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { background: var(--primary-light); color: var(--primary) !important; text-decoration: none; }
.nav-auth { display: flex; align-items: center; gap: 12px; }
.nav-auth span { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.page { display: none; max-width: 1280px; margin: 0 auto; padding: 0 24px 40px; }
.page.active { display: block; }

.hero {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff; padding: 48px 0; margin: 0 -24px 24px; text-align: center;
}
.hero-inner { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.hero p { font-size: 16px; opacity: .85; margin-bottom: 24px; }
.hero-stats { display: flex; gap: 32px; justify-content: center; margin-top: 20px; font-size: 14px; opacity: .9; }
.hero-stats strong { font-size: 20px; display: block; }
.search-bar {
  display: flex; align-items: center; background: rgba(255,255,255,.15); border-radius: 12px;
  padding: 0 16px; border: 1px solid rgba(255,255,255,.25); max-width: 560px; margin: 0 auto;
}
.search-bar i { color: rgba(255,255,255,.6); }
.search-bar input {
  flex: 1; padding: 14px 12px; background: transparent; border: none; outline: none;
  color: #fff; font-size: 16px;
}
.search-bar input::placeholder { color: rgba(255,255,255,.5); }

.browse-layout { display: flex; gap: 24px; align-items: flex-start; }
.sidebar {
  width: 220px; flex-shrink: 0; background: var(--surface); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border); position: sticky; top: 80px;
}
.sidebar h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.sidebar ul { list-style: none; }
.sidebar li {
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  color: var(--text); transition: all .15s; margin-bottom: 4px; position: relative;
}
.sidebar li:hover { background: var(--bg); }
.sidebar li.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar li .count { float: right; font-size: 11px; color: var(--text-light); }
.suite-filter { min-height: 56px; }
.suite-filter-title { display: block; max-width: 145px; line-height: 1.25; }
.suite-filter-meta { display: block; margin-top: 3px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.suite-filter .count { position: absolute; top: 9px; right: 10px; }
.sidebar-extra { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.sidebar-extra h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.sidebar-extra a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--text-muted) !important; }
.sidebar-extra a:hover { background: var(--bg); color: var(--primary) !important; text-decoration: none; }

.content { flex: 1; min-width: 0; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--text-muted); }
.content-header select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--surface); }

.api-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.suite-section { margin-bottom: 28px; }
.suite-heading {
  display: flex; justify-content: space-between; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 14px;
}
.suite-heading h2 { margin: 2px 0 6px; font-size: 18px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.suite-heading h2 svg { width: 20px; height: 20px; color: var(--primary); }
.suite-heading p { margin: 0; font-size: 13px; color: var(--text-muted); max-width: 760px; line-height: 1.45; }
.suite-heading strong {
  flex-shrink: 0; background: var(--primary-light); color: var(--primary);
  border-radius: 999px; padding: 6px 12px; font-size: 13px;
}
.suite-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; }
.suite-category-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.suite-category-row span {
  font-size: 11px; color: var(--text-muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px;
}
.api-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: all .2s; cursor: pointer; position: relative;
}
.api-card:hover { box-shadow: var(--shadow-lg); border-color: var(--primary); transform: translateY(-2px); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.suite-badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px;
  border-radius: 20px; background: #e0f2fe; color: #0369a1;
}
.api-card .cat-badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 20px; background: var(--primary-light); color: var(--primary);
}
.vendor-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 9px;
  border-radius: 20px; background: #f1f5f9; color: #475569;
}
.vendor-badge i { font-size: 12px; }
.vendor-fhir { background: #e8f4fd; color: #005a9c; }
.vendor-hl7 { background: #f3e8ff; color: #7a4e9a; }
.vendor-whatsapp { background: #e8faf0; color: #1da851; }
.vendor-rxsolutions { background: #ecfdf5; color: #059669; }
.vendor-servicenow { background: #fef2f2; color: #dc2626; }
.vendor-salesforce { background: #e8f7fe; color: #00A1E0; }
.vendor-metabase { background: #e8f3fc; color: #509EE3; }
.vendor-tableau { background: #fef3ec; color: #E97627; }
.vendor-powerbi { background: #fefce8; color: #b8960c; }
.vendor-sap { background: #e5f4ff; color: #0FAAFF; }
.vendor-openmrs { background: #ecfdf5; color: #1a7a5a; }
.vendor-dhis2 { background: #eaf4fb; color: #246B95; }
.api-card h3 { font-size: 16px; margin-bottom: 6px; }
.api-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.api-card .endpoint {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px;
  background: var(--bg); padding: 6px 10px; border-radius: 6px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 8px;
}
.api-card .methods { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.api-card .method {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; color: #fff;
}
.method-GET { background: #16a34a; }
.method-POST { background: #2563eb; }
.method-PUT { background: #d97706; }
.method-PATCH { background: #9333ea; }
.method-DELETE { background: #dc2626; }
.api-card .card-actions { display: flex; gap: 8px; margin-top: 12px; }

.dash-hero { padding: 32px 0; }
.dash-hero h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.dash-hero p { color: var(--text-muted); }
.dash-grid { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.dash-grid > .card:first-child { grid-column: 1 / -1; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

.usage-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-box { text-align: center; padding: 16px; background: var(--bg); border-radius: 8px; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--primary); display: block; }
.stat-label { font-size: 12px; color: var(--text-muted); }

.key-list { margin-top: 16px; }
.key-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; font-size: 13px;
}
.key-item .key-value {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; background: var(--bg);
  padding: 4px 8px; border-radius: 4px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.key-item .key-actions { display: flex; gap: 4px; flex-shrink: 0; }

.empty-state { text-align: center; padding: 32px; color: var(--text-light); font-size: 14px; }

.sub-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
}
.sub-item .sub-info h4 { font-size: 14px; }
.sub-item .sub-info p { font-size: 12px; color: var(--text-muted); }
.sub-item .sub-status {
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 20px;
}
.sub-status.active { background: #dcfce7; color: #16a34a; }
.sub-status.trial { background: #fef9c3; color: #a16207; }

.usage-chart { margin-top: 8px; }
.chart-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.chart-bar-row .bar-label { width: 120px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.chart-bar-row .bar-track { flex: 1; height: 18px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.chart-bar-row .bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .4s; }
.chart-bar-row .bar-count { width: 36px; text-align: right; font-weight: 600; flex-shrink: 0; }

.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 24px 0; }
.pricing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; text-align: center; transition: all .2s; position: relative;
}
.pricing-card.featured { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.pricing-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 14px; border-radius: 20px;
}
.pricing-card h3 { font-size: 18px; margin-bottom: 4px; }
.pricing-card .price { font-size: 36px; font-weight: 800; color: var(--primary); margin: 12px 0; }
.pricing-card .price span { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; text-align: left; margin: 16px 0; }
.pricing-card li { padding: 6px 0; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.pricing-card li i { color: var(--success); width: 16px; }
.pricing-card li svg { color: var(--text-light); }

.vendor-badge svg {
  width: 14px;
  height: 14px;
  color: var(--vendor-color, currentColor);
}

.faq-section { margin: 32px 0; }
.faq-section h2 { font-size: 20px; margin-bottom: 16px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 8px; }
.faq-item strong { display: block; margin-bottom: 4px; }
.faq-item p { font-size: 13px; color: var(--text-muted); }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal-content {
  position: relative; background: var(--surface); border-radius: var(--radius);
  max-height: 90vh; overflow-y: auto; padding: 0; box-shadow: var(--shadow-lg);
}
.modal-narrow { width: 420px; padding: 32px; }
.modal-wide { width: 800px; max-width: 100%; }
.modal-close {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--text-muted); z-index: 10; padding: 4px;
}
.modal-close:hover { color: var(--text); }

#modalBody { padding: 32px; }
#modalBody .modal-api-header { margin-bottom: 24px; }
#modalBody .modal-api-header h2 { font-size: 24px; margin-bottom: 4px; }
.modal-suite-context { margin: 8px 0 0; color: var(--text-muted); font-size: 13px; line-height: 1.45; }
#modalBody .modal-api-header .endpoint-big {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 14px;
  background: var(--bg); padding: 8px 14px; border-radius: 8px; display: inline-block; margin-top: 8px;
}
#modalBody section { margin-bottom: 28px; }
#modalBody section h3 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
#modalBody section h3 i { color: var(--primary); }
#modalBody .desc-text { font-size: 14px; color: var(--text); line-height: 1.7; }

.playground .pg-row { display: flex; gap: 12px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.playground .pg-row label { font-size: 12px; font-weight: 600; width: 60px; flex-shrink: 0; }
.playground .pg-row input, .playground .pg-row select, .playground .pg-row textarea {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: var(--surface);
}
.playground .pg-row textarea { min-height: 80px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; resize: vertical; }
.playground .pg-response {
  background: #1e293b; color: #e2e8f0; border-radius: 8px; padding: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; max-height: 300px; overflow: auto; margin-top: 10px;
  white-space: pre-wrap;
}
.playground .pg-response .pg-placeholder { color: #64748b; }

.snippet-tabs { display: flex; gap: 2px; margin-bottom: 10px; }
.snippet-tabs button {
  padding: 6px 14px; font-size: 12px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; border-radius: 6px 6px 0 0; font-weight: 500; color: var(--text-muted);
}
.snippet-tabs button.active { background: #1e293b; color: #e2e8f0; border-color: #1e293b; }
.snippet-code {
  background: #1e293b; color: #e2e8f0; border-radius: 0 8px 8px; padding: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; overflow-x: auto; white-space: pre;
}
.contract-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: rgba(14, 165, 233, .12); color: #0369a1; font-size: 11px; font-weight: 700;
}
.offering-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: rgba(22, 163, 74, .12); color: #15803d; font-size: 11px; font-weight: 700;
}
.policy-row,
.modal-context-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px;
}
.policy-row span,
.modal-context-row span {
  display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--bg); color: var(--text-muted); font-size: 11px; font-weight: 700;
}
.modal-context-row { margin-top: 10px; }
.contract-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.contract-summary div { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.contract-summary span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.contract-summary strong { font-size: 13px; color: var(--text); }
.contract-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contract-grid h4, .contract-compliance h4 { font-size: 13px; margin: 0 0 8px; color: var(--text); }
.schema-table { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 12px; }
.schema-table th, .schema-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.schema-table th { background: var(--bg); color: var(--text-muted); font-weight: 700; }
.schema-table tr:last-child td { border-bottom: 0; }
.schema-table code { white-space: pre-wrap; word-break: break-word; }
.schema-table span { color: var(--text-muted); font-size: 11px; }
.contract-compliance { margin-top: 14px; }
.contract-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.contract-chip { padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; }
.test-data-block {
  margin: 0; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 14px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; overflow-x: auto; white-space: pre-wrap;
}
.muted-small { color: var(--text-muted); font-size: 12px; }

@media (max-width: 900px) {
  .nav-brand > span:last-child { display: none; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .browse-layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
  .suite-filter-title { max-width: none; padding-right: 48px; }
  .contract-grid, .contract-summary { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { gap: 0; }
  .nav-links a { padding: 6px 8px; font-size: 12px; }
  .api-grid { grid-template-columns: 1fr; }
  .suite-heading { flex-direction: column; }
  .pricing-grid { grid-template-columns: 1fr; }
  .usage-stats { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #94a3b8;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.5);
}
.status-badge {
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
}

.status-available { color: #166534; background: #dcfce7; border-color: #86efac; }
.status-preview { color: #854d0e; background: #fef9c3; border-color: #fde047; }
.status-planned { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
.status-retired { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
