/* ============================================================
   Tonle Sap SWOT dashboard styles
   ============================================================ */
.dash-page {
  background: linear-gradient(180deg, #02101f 0%, #061a2e 60%, #02101f 100%);
  color: #e6effa;
  min-height: 100dvh;
  padding-top: 110px;
}

.dash-page .site-header {
  background: rgba(2, 16, 31, 0.8);
  backdrop-filter: blur(14px);
}

.dash-hero {
  position: relative;
  padding: var(--space-8) 0 var(--space-10);
  overflow: hidden;
  isolation: isolate;
}

.dash-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/tonle-sap-satellite.png') center/cover;
  opacity: 0.18;
  z-index: -1;
  filter: saturate(1.4);
}

.dash-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, #02101f 100%);
  z-index: -1;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--space-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crumb a {
  color: var(--color-accent);
}

.dash-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  background: linear-gradient(90deg, #fff 0%, #62d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-subtitle {
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--text-base);
  max-width: 70ch;
}

.dash-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.dash-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 200, 255, 0.12);
  border: 1px solid rgba(56, 200, 255, 0.32);
  color: #c9e9ff;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.dash-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-block: var(--space-8);
}

@media (max-width: 900px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi {
  background: rgba(8, 30, 70, 0.5);
  border: 1px solid rgba(56, 200, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  opacity: 0.5;
}

.kpi__label {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.kpi__value {
  font-size: clamp(1.5rem, 1rem + 1.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
}

.kpi__unit {
  font-size: 0.6em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}

.kpi__delta {
  margin-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
}

.kpi__delta.up { color: #2bb673; }
.kpi__delta.down { color: #ff6b6b; }
.kpi__delta.neutral { color: var(--color-accent); }

/* Two column layout */
.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

@media (max-width: 1000px) {
  .dash-grid { grid-template-columns: 1fr; }
}

.panel {
  background: rgba(8, 30, 70, 0.5);
  border: 1px solid rgba(56, 200, 255, 0.18);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.panel__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.panel__subtitle {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.panel__filter {
  display: inline-flex;
  background: rgba(56, 200, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.panel__filter button {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.panel__filter button.is-active {
  background: var(--color-accent);
  color: #02101f;
}

/* Map panel */
.map-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 380px;
  background: #02132e;
  border: 1px solid rgba(56, 200, 255, 0.22);
}

.map-card svg { width: 100%; height: 100%; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.7);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Charts */
.chart {
  width: 100%;
  height: 240px;
}

.chart text {
  fill: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-family: var(--font-body);
}

.chart .grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.chart .axis {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

/* SWOT 2x2 */
.swot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.swot__card {
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid;
  position: relative;
  overflow: hidden;
}

.swot__card h4 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.swot__card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.swot__card li {
  position: relative;
  padding-left: 1rem;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
}

.swot__card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.swot--strengths {
  border-color: rgba(43, 182, 115, 0.4);
  background: linear-gradient(160deg, rgba(43, 182, 115, 0.18), rgba(43, 182, 115, 0.04));
  color: #6cd9a3;
}

.swot--weaknesses {
  border-color: rgba(255, 107, 107, 0.4);
  background: linear-gradient(160deg, rgba(255, 107, 107, 0.18), rgba(255, 107, 107, 0.04));
  color: #ff9b9b;
}

.swot--opportunities {
  border-color: rgba(56, 200, 255, 0.4);
  background: linear-gradient(160deg, rgba(56, 200, 255, 0.18), rgba(56, 200, 255, 0.04));
  color: #62d4ff;
}

.swot--threats {
  border-color: rgba(217, 119, 6, 0.4);
  background: linear-gradient(160deg, rgba(217, 119, 6, 0.18), rgba(217, 119, 6, 0.04));
  color: #fbbf24;
}

.swot__card li {
  color: rgba(255, 255, 255, 0.85);
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th, .data-table td {
  text-align: left;
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table th {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.data-table td {
  color: rgba(255, 255, 255, 0.85);
}

.tag {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.tag--good { background: rgba(43, 182, 115, 0.18); color: #6cd9a3; }
.tag--warn { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.tag--bad { background: rgba(255, 107, 107, 0.18); color: #ff9b9b; }

/* footer attribution */
.dash-footnote {
  margin: var(--space-10) 0 var(--space-12);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
}

.dash-footnote a { color: var(--color-accent); }

/* Generic page wrapper for placeholder tech pages */
.tech-page {
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100dvh;
}

.tech-page__hero {
  position: relative;
  padding: 160px 0 var(--space-12);
  background: linear-gradient(135deg, #02132e 0%, #103a82 100%);
  color: #fff;
  overflow: hidden;
}

.tech-page__hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(56, 200, 255, 0.25), transparent 50%),
    radial-gradient(circle at 85% 70%, rgba(17, 99, 216, 0.3), transparent 50%);
}

.tech-page__hero > * { position: relative; }

.tech-page__title {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--space-3) 0 var(--space-3);
  background: linear-gradient(90deg, #fff 0%, #62d4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tech-page__lede {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.85);
  max-width: 64ch;
}

.tech-page__body {
  padding-block: var(--space-12);
}

.tech-page__body h2 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--space-8) 0 var(--space-3);
}

.tech-page__body p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-block: var(--space-6);
}

@media (max-width: 800px) {
  .feature-grid { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================================
   Embedded sub-project frame (used by pages built from
   _embed-template.html — see ONEMEKONG_PROJECT_REGISTRY.md)
   ============================================================ */
.embed-section {
  margin: 32px auto 56px;
  padding: 0 var(--container-pad, 24px);
}

.embed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.embed-toolbar__label {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.embed-toolbar__actions {
  display: flex;
  gap: 8px;
}

.embed-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #cfeaff;
  background: rgba(56, 200, 255, 0.08);
  border: 1px solid rgba(56, 200, 255, 0.28);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s ease;
}

.embed-toolbar__btn:hover,
.embed-toolbar__btn:focus-visible {
  background: rgba(56, 200, 255, 0.16);
  border-color: rgba(56, 200, 255, 0.55);
  color: #ffffff;
  outline: none;
}

.embed-frame {
  width: 100%;
  height: 82vh;
  min-height: 640px;
  max-height: 1100px;
  border-radius: 14px;
  overflow: hidden;
  background: #02132e;
  border: 1px solid rgba(56, 200, 255, 0.22);
  box-shadow:
    0 24px 60px -24px rgba(2, 19, 46, 0.8),
    0 0 0 1px rgba(56, 200, 255, 0.08);
}

.embed-frame:fullscreen {
  border-radius: 0;
  border: none;
  height: 100vh;
  max-height: 100vh;
}

.embed-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 720px) {
  .embed-frame {
    height: 70vh;
    min-height: 480px;
    border-radius: 10px;
  }
}
