/* ══════════════════════════════════════════════════════════════════════════════
   ECONOMIC ATLAS — Stylesheet
   Covers: atlas/index.php · atlas/country.php · atlas/product.php · atlas/wasde.php
   Widgets: product.php · company.php · categories.php
   Relies on CSS variables from the page's <style> block (defined per-page via CLAUDE.md).
══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. PAGE HERO ─────────────────────────────────────────────────────────── */

.atlas-hero {
  background: -webkit-linear-gradient(315deg, #0F172A 0%, #1e3a5f 100%);
  background:          linear-gradient(135deg, #0F172A 0%, #1e3a5f 100%);
  padding: 52px 24px 48px;
  min-height: 320px;
  text-align: center;
  position: relative;
  overflow: hidden;
  -webkit-border-radius: 0 !important;
  border-radius: 0 !important;
}
.atlas-hero canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  z-index: 0;
  pointer-events: none;
}
.atlas-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.atlas-hero-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.38);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.atlas-hero-breadcrumb a {
  color: rgba(255,255,255,.38);
  text-decoration: none;
  transition: color .15s;
}
.atlas-hero-breadcrumb a:hover { color: rgba(255,255,255,.65); }
.atlas-hero-breadcrumb i { font-size: 8px; }
.atlas-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(37,99,235,.4);
  color: #93C5FD;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: .04em;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.atlas-hero h1 {
  color: #fff;
  font-size: clamp(26px, 4.5vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -.02em;
}
.atlas-hero h1 em { color: #93C5FD; font-style: normal; }
.atlas-hero p {
  color: rgba(255,255,255,.6);
  font-size: 16px;
  margin-bottom: 28px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

/* ── 2. LAYOUT WRAPPER ───────────────────────────────────────────────────── */

.atlas-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.atlas-section {
  padding: 32px 0;
}
.atlas-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.atlas-section-title span {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  margin-left: auto;
}

/* ── 3. TAB SWITCHER ─────────────────────────────────────────────────────── */

.atlas-tabs {
  display: flex;
  gap: 6px;
  background: #F3F4F6;
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  margin-bottom: 24px;
}
.atlas-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.atlas-tab:hover { color: #2563EB; }
.atlas-tab.active {
  background: #fff;
  color: #2563EB;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.atlas-tab-panel { display: none; }
.atlas-tab-panel.active { display: block; }

/* Commodity tabs (WASDE) */
.atlas-commodity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.atlas-commodity-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.atlas-commodity-tab:hover { border-color: #2563EB; color: #2563EB; }
.atlas-commodity-tab.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}

/* ── 4. MAP CONTAINER (Leaflet) ──────────────────────────────────────────── */

.atlas-map-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border: 1px solid #E5E7EB;
  position: relative;
  z-index: 1;
}
#atlas-map {
  height: 480px;
  width: 100%;
  background: #EFF6FF;
}
.atlas-map-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255,255,255,.95);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #374151;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  z-index: 500;
  min-width: 130px;
}
.atlas-map-legend-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6B7280;
  margin-bottom: 8px;
}
.atlas-map-legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.atlas-map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── 5. STATS CARDS GRID ─────────────────────────────────────────────────── */

.atlas-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.atlas-stat-card {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.atlas-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.atlas-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6B7280;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.atlas-stat-label i { color: #2563EB; font-size: 11px; }
.atlas-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}
.atlas-stat-sub {
  font-size: 12px;
  color: #6B7280;
}

/* ── 6. CHANGE INDICATORS (▲▼) ───────────────────────────────────────────── */

.chg-up {
  color: #16A34A;
  font-weight: 600;
  font-size: 12.5px;
}
.chg-down {
  color: #DC2626;
  font-weight: 600;
  font-size: 12.5px;
}
.chg-flat {
  color: #6B7280;
  font-size: 12.5px;
}
.chg-up::before  { content: '▲ '; font-size: 9px; }
.chg-down::before { content: '▼ '; font-size: 9px; }

/* Price block (product.php) */
.atlas-price-block {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.atlas-price-main {
  font-size: 36px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -1px;
  line-height: 1;
}
.atlas-price-unit {
  font-size: 14px;
  color: #6B7280;
  font-weight: 500;
  margin-bottom: 4px;
}
.atlas-price-changes {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.atlas-price-change-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.atlas-price-change-item .period {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9CA3AF;
  font-weight: 600;
}

/* ── 7. DATA TABLES ───────────────────────────────────────────────────────── */

.atlas-table-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.atlas-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #E5E7EB;
  flex-wrap: wrap;
  gap: 8px;
}
.atlas-table-toolbar-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.atlas-table-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  background: #F9FAFB;
  transition: border-color .15s;
}
.atlas-table-search:focus-within { border-color: #2563EB; }
.atlas-table-search i { font-size: 12px; color: #9CA3AF; }
.atlas-table-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #111827;
  width: 160px;
}
.atlas-table-search input::placeholder { color: #9CA3AF; }

.atlas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.atlas-table thead th {
  background: #F9FAFB;
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6B7280;
  border-bottom: 1px solid #E5E7EB;
  white-space: nowrap;
  user-select: none;
}
.atlas-table thead th.sortable {
  cursor: pointer;
  transition: color .15s;
}
.atlas-table thead th.sortable:hover { color: #2563EB; }
.atlas-table thead th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  opacity: .35;
  font-size: 10px;
}
.atlas-table thead th.sort-asc  .sort-icon,
.atlas-table thead th.sort-desc .sort-icon { opacity: 1; color: #2563EB; }
.atlas-table thead th.sort-asc  .sort-icon::after { content: '▲'; }
.atlas-table thead th.sort-desc .sort-icon::after { content: '▼'; }
.atlas-table thead th:not(.sort-asc):not(.sort-desc) .sort-icon::after { content: '⇅'; }

.atlas-table tbody tr {
  border-bottom: 1px solid #F3F4F6;
  transition: background .12s;
}
.atlas-table tbody tr:last-child { border-bottom: none; }
.atlas-table tbody tr:hover { background: #F9FAFB; }
.atlas-table td {
  padding: 11px 16px;
  color: #374151;
  vertical-align: middle;
}
.atlas-table td.rank {
  font-size: 12px;
  font-weight: 700;
  color: #9CA3AF;
  width: 40px;
  text-align: center;
}
.atlas-table td.country-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
}
.atlas-table td.country-cell a { color: inherit; text-decoration: none; }
.atlas-table td.country-cell a:hover { color: #2563EB; }
.atlas-table td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 500;
}
.atlas-table td.num-bold {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 700;
  color: #111827;
}

/* WASDE-specific: delta column */
.atlas-table td.delta-up   { color: #16A34A; font-weight: 600; text-align: right; }
.atlas-table td.delta-down { color: #DC2626; font-weight: 600; text-align: right; }
.atlas-table td.delta-flat { color: #9CA3AF; text-align: right; }

/* Country flag avatar in table */
.flag-avatar {
  width: 28px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.flag-emoji {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* ECI badge */
.eci-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.eci-high   { background: #DCFCE7; color: #15803D; }
.eci-mid    { background: #FEF9C3; color: #A16207; }
.eci-low    { background: #FEE2E2; color: #B91C1C; }

/* Pagination */
.atlas-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #E5E7EB;
  font-size: 13px;
  color: #6B7280;
  flex-wrap: wrap;
  gap: 8px;
}
.atlas-page-btns {
  display: flex;
  gap: 4px;
}
.atlas-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  background: #fff;
  transition: all .15s;
}
.atlas-page-btn:hover { border-color: #2563EB; color: #2563EB; }
.atlas-page-btn.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}
.atlas-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── 8. TREEMAP (D3.js) ──────────────────────────────────────────────────── */

.atlas-treemap-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.atlas-treemap-wrap h3 {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px;
}
#atlas-treemap,
#country-export-treemap,
#country-import-treemap {
  width: 100%;
  height: 340px;
  overflow: hidden;
}
/* D3 node styling is injected via JS, but set base text */
.atlas-treemap-wrap .node text {
  font-family: 'Inter', sans-serif;
  fill: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

/* ── 9. COMMODITY GRID (Finviz-style) ────────────────────────────────────── */

.atlas-commodity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 3px;
  background: #E5E7EB;
  border-radius: 10px;
  overflow: hidden;
}
.commodity-block {
  background: #fff;
  padding: 12px 10px;
  cursor: pointer;
  transition: filter .15s;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.commodity-block:hover { filter: brightness(.93); }
.commodity-block.up   { background: #DCFCE7; }
.commodity-block.down { background: #FEE2E2; }
.commodity-block.flat { background: #F3F4F6; }
.commodity-block .cb-icon { font-size: 22px; line-height: 1; }
.commodity-block .cb-name {
  font-size: 11.5px;
  font-weight: 700;
  color: #111827;
}
.commodity-block .cb-price {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  font-variant-numeric: tabular-nums;
}
.commodity-block .cb-chg {
  font-size: 11px;
  font-weight: 700;
}
.commodity-block.up   .cb-chg { color: #16A34A; }
.commodity-block.down .cb-chg { color: #DC2626; }
.commodity-block.flat .cb-chg { color: #6B7280; }

/* Category header within commodity grid */
.commodity-category-header {
  grid-column: 1 / -1;
  background: #1E293B;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 10. CHART CONTAINERS ────────────────────────────────────────────────── */

.atlas-chart-wrap {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.atlas-chart-wrap h3 {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.atlas-chart-wrap h3 span {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  margin-left: auto;
}
.atlas-chart-period-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.atlas-period-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  cursor: pointer;
  border: 1.5px solid #E5E7EB;
  background: #fff;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.atlas-period-btn:hover { border-color: #2563EB; color: #2563EB; }
.atlas-period-btn.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}
.atlas-chart-canvas-wrap {
  position: relative;
  height: 240px;
}

/* ── 11. COUNTRY PAGE HEADER ─────────────────────────────────────────────── */

.country-hero {
  background: #0F172A;
  padding: 36px 24px 44px;
  border-radius: 0 0 24px 24px;
}
.country-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.country-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.country-flag-lg {
  font-size: 56px;
  line-height: 1;
}
.country-hero-name {
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  margin: 0;
}
.country-hero-region {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  margin-top: 4px;
}
.country-hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.country-hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.country-hero-stat .c-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.4);
  font-weight: 600;
}
.country-hero-stat .c-val {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* ── 12. PRODUCT PAGE ────────────────────────────────────────────────────── */

.product-hero {
  background: #0F172A;
  padding: 32px 24px 40px;
  border-radius: 0 0 24px 24px;
}
.product-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}
.product-hero-icon {
  font-size: 56px;
  line-height: 1;
}
.product-hero-info { flex: 1; min-width: 240px; }
.product-hero-name {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
  margin: 0 0 6px;
}
.product-hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}
.product-hero-price-area {
  flex-shrink: 0;
  text-align: right;
}
.product-hero-price-area .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.4);
  font-weight: 600;
  margin-bottom: 4px;
}
.product-hero-price {
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1;
}
.product-hero-unit {
  font-size: 14px;
  color: rgba(255,255,255,.45);
  font-weight: 500;
}
.product-hero-changes {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.product-hero-chg-item { text-align: right; }
.product-hero-chg-item .period {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── 13. TWO-COLUMN LAYOUT ───────────────────────────────────────────────── */

.atlas-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.atlas-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

/* ── 14. WASDE REPORT ────────────────────────────────────────────────────── */

.wasde-header {
  background: linear-gradient(135deg, #0F172A, #1E3A5F);
  padding: 36px 24px;
  border-radius: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.wasde-header h2 {
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 800;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: -.3px;
}
.wasde-header p {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  margin: 0;
}
.wasde-dates {
  text-align: right;
  flex-shrink: 0;
}
.wasde-date-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.4);
  margin-bottom: 4px;
}
.wasde-date-val {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}
.wasde-pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #93C5FD;
  text-decoration: none;
  font-weight: 600;
}
.wasde-pdf-link:hover { color: #fff; }

.wasde-table th { min-width: 80px; }
.wasde-table td { font-variant-numeric: tabular-nums; }
.wasde-table td:not(:first-child) { text-align: right; }

/* ── 15. ATLAS WIDGETS (inline on platform pages) ────────────────────────── */

.atlas-widget {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-left: 3px solid #2563EB;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 24px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.atlas-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.atlas-widget-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 6px;
}
.atlas-widget-title i { color: #2563EB; }
.atlas-widget-link {
  font-size: 12px;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.atlas-widget-link:hover { color: #1D4ED8; }

/* Widget stat row */
.atlas-widget-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.atlas-widget-stat { flex: 1; min-width: 80px; }
.atlas-widget-stat .w-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9CA3AF;
  margin-bottom: 2px;
}
.atlas-widget-stat .w-val {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.atlas-widget-stat .w-sub { font-size: 11.5px; color: #6B7280; }

/* Widget tag list (top exports) */
.atlas-widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.atlas-widget-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #EFF6FF;
  color: #2563EB;
}

/* ── 16. LOADING / SKELETON ──────────────────────────────────────────────── */

.atlas-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px;
  color: #6B7280;
  font-size: 14px;
}
.atlas-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid #E5E7EB;
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: atlas-spin .7s linear infinite;
}
@keyframes atlas-spin { to { transform: rotate(360deg); } }

.atlas-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9CA3AF;
  font-size: 14px;
}
.atlas-empty i { font-size: 32px; margin-bottom: 12px; display: block; }

/* ── 17. MISC TAGS & BADGES ──────────────────────────────────────────────── */

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.source-badge.harvard   { background: #DBEAFE; color: #1D4ED8; }
.source-badge.worldbank { background: #D1FAE5; color: #065F46; }
.source-badge.usda      { background: #FEF3C7; color: #92400E; }
.source-badge.fao       { background: #E0E7FF; color: #3730A3; }

.atlas-updated {
  font-size: 11px;
  color: #9CA3AF;
  display: flex;
  align-items: center;
  gap: 4px;
}
.atlas-updated i { font-size: 10px; }

/* ── 18. PLATFORM LINK BLOCK ─────────────────────────────────────────────── */

.atlas-platform-link {
  background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.atlas-platform-link p {
  font-size: 13.5px;
  color: #1D4ED8;
  font-weight: 600;
  margin: 0;
}
.atlas-platform-link small {
  font-size: 12px;
  color: #3B82F6;
  font-weight: 400;
}
.atlas-platform-link-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.btn-atlas-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
}
.btn-atlas-action.primary {
  background: #2563EB;
  color: #fff;
}
.btn-atlas-action.primary:hover { background: #1D4ED8; }
.btn-atlas-action.ghost {
  background: #fff;
  color: #2563EB;
  border: 1.5px solid #2563EB;
}
.btn-atlas-action.ghost:hover { background: #EFF6FF; }

/* ── 19. RESPONSIVE ──────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .atlas-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .atlas-two-col    { grid-template-columns: 1fr; }
  .atlas-three-col  { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .atlas-hero { padding: 28px 16px 36px; }
  #atlas-map  { height: 300px; }
  .atlas-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .atlas-stat-value { font-size: 19px; }
  .atlas-tabs { width: 100%; overflow-x: auto; }
  .atlas-commodity-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .country-hero-stats { gap: 16px; }
  .product-hero-inner { flex-direction: column; }
  .product-hero-price-area { text-align: left; }
  .product-hero-changes { justify-content: flex-start; }
  .wasde-header { flex-direction: column; }
  .wasde-dates { text-align: left; }
  .atlas-three-col { grid-template-columns: 1fr; }
  .atlas-platform-link { flex-direction: column; align-items: flex-start; }
  .atlas-container { padding: 0 16px; }
  .atlas-table-wrap { overflow-x: auto; }
}

@media (max-width: 480px) {
  .atlas-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .atlas-stat-card { padding: 14px; }
  .atlas-stat-value { font-size: 17px; }
  .atlas-stat-label { font-size: 10px; }
  .atlas-tabs { flex-wrap: nowrap; }
  .atlas-tab { padding: 7px 12px; font-size: 12.5px; }
  #atlas-treemap,
  #country-export-treemap,
  #country-import-treemap { height: 240px; }
  .atlas-chart-canvas-wrap { height: 190px; }
  .country-flag-lg { font-size: 40px; }
  .atlas-commodity-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
