*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0F1C2E;
  --navy-light: #1a2d45;
  --teal: #1D9E75;
  --teal-light: #E1F5EE;
  --teal-mid: #5DCAA5;
  --blue: #378ADD;
  --coral: #D85A30;
  --purple: #7F77DD;
  --red: #E24B4A;
  --amber: #EF9F27;
  --gray: #888780;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --border: rgba(15,28,46,0.08);
  --text: #0F1C2E;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
}

:root.dark {
  --navy: #E5E7EB;
  --navy-light: #D1D5DB;
  --teal: #34D399;
  --teal-light: rgba(52,211,153,0.15);
  --teal-mid: #6EE7B7;
  --bg: #111827;
  --card: #1F2937;
  --border: rgba(255,255,255,0.08);
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-light: #6B7280;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* TOP NAV */
.topnav {
  background: var(--navy);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.topnav-brand-dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
}
.topnav-meta {
  display: flex;
  align-items: center;
  gap: 20px;
}
.topnav-hotel {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}
.topnav-date {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  font-family: 'DM Mono', monospace;
}
.topnav-badge {
  background: rgba(29,158,117,0.2);
  color: var(--teal-mid);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

/* REPORT HEADER */
.report-header {
  background: var(--card);
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
}
.report-header-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.report-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.report-header-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.screenshot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-light);
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  transition: color 0.15s;
  font-family: inherit;
  line-height: 1;
}
.screenshot-btn:hover { color: var(--text); }
.screenshot-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.screenshot-btn svg { flex-shrink: 0; }
.report-header-type {
  font-size: 12px;
  font-weight: 500;
  color: var(--teal);
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.report-header-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'DM Mono', monospace;
}

/* TAB NAV */
.tabnav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.tabnav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  width: 100%;
}
.tab {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  user-select: none;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--navy);
  border-bottom-color: var(--teal);
}

/* LAYOUT */
.page { display: none; padding: 28px 0 64px; }
.page.active { display: block; }
.page-preload { display: block; visibility: hidden; height: 0; overflow: hidden; pointer-events: none; }
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* METRIC CARDS */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.metric {
  background: var(--card);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
}
.metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.metric-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1;
}
.metric-value span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
}
.metric-sub {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 6px;
}
.metric-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.platform-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* GRID LAYOUTS */
.grid-2-1 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (min-width: 720px) {
  .grid-2-1 { grid-template-columns: 2fr 1fr; }
}

/* CARDS */
.card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* PLATFORM GRID */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.plat-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
}
.plat-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.plat-score {
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1;
}
.plat-score span { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.plat-total { font-size: 11px; color: var(--text-light); margin-top: 3px; }

/* STAR BARS */
.star-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.star-label { font-size: 12px; color: var(--text-muted); min-width: 12px; text-align: right; }
.star-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.star-fill { height: 100%; border-radius: 4px; }
.star-count { font-size: 11px; color: var(--text-light); min-width: 28px; text-align: right; }

/* KEYWORD BARS */
.kw-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.kw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.kw-label { font-size: 12px; color: var(--text); min-width: 85px; }
.kw-track { flex: 1; height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.kw-fill { height: 100%; border-radius: 4px; }
.kw-count { font-size: 11px; color: var(--text-muted); min-width: 26px; text-align: right; font-family: 'DM Mono', monospace; }

/* INSIGHTS */
.insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.insight-card {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.insight-card.warning::before { background: var(--amber); }
.insight-card.negative::before { background: var(--red); }
.insight-card.positive::before { background: var(--teal); }
.insight-card.info::before { background: var(--blue); }
.insight-card.strength::before { background: var(--teal); }
.insight-type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.insight-card.warning .insight-type { color: var(--amber); }
.insight-card.negative .insight-type { color: var(--red); }
.insight-card.positive .insight-type,
.insight-card.strength .insight-type { color: var(--teal); }
.insight-card.info .insight-type { color: var(--blue); }
.insight-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}
.insight-body {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.insight-action {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}
.insight-card.warning .insight-action { background: #FEF3C7; color: #92400E; }
.insight-card.negative .insight-action { background: #FEE2E2; color: #991B1B; }
.insight-card.positive .insight-action,
.insight-card.strength .insight-action { background: var(--teal-light); color: #065F46; }
.insight-card.info .insight-action { background: #DBEAFE; color: #1E40AF; }

/* REVIEWS TABLE */
.reviews-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #FAFAFA; }

.sentiment-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-positive { background: var(--teal-light); color: #065F46; }
.badge-negative { background: #FEE2E2; color: #991B1B; }
.badge-neutral { background: #F3F4F6; color: #6B7280; }

.platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* CHART LEGEND */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.legend-swatch { width: 10px; height: 10px; border-radius: 2px; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.footer-dot { width: 4px; height: 4px; background: var(--teal); border-radius: 50%; }
.footer-demo-link {
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
}
.footer-demo-link:hover { color: var(--teal); }

/* SECTION DIVIDER */
.section-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
  margin-bottom: 12px;
  margin-top: 8px;
}

/* DARK MODE OVERRIDES — hardcoded colors */
:root.dark tbody tr:hover td { background: #374151; }
:root.dark .plat-card { background: #283345; }
:root.dark .star-track,
:root.dark .kw-track { background: #374151; }
:root.dark .badge-neutral { background: #374151; color: #9CA3AF; }
:root.dark .badge-positive { background: rgba(52,211,153,0.15); color: #6EE7B7; }
:root.dark .badge-negative { background: rgba(239,68,68,0.15); color: #FCA5A5; }
:root.dark .insight-card.warning .insight-action { background: rgba(245,158,11,0.15); color: #FCD34D; }
:root.dark .insight-card.negative .insight-action { background: rgba(239,68,68,0.15); color: #FCA5A5; }
:root.dark .insight-card.positive .insight-action,
:root.dark .insight-card.strength .insight-action { background: rgba(52,211,153,0.15); color: #6EE7B7; }
:root.dark .insight-card.info .insight-action { background: rgba(96,165,250,0.15); color: #93C5FD; }
:root.dark .topnav { background: #0F1C2E; }

/* THEME TOGGLE */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}
.theme-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.2s;
}
.theme-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.theme-toggle.active .theme-toggle-track {
  background: var(--teal);
}
.theme-toggle.active .theme-toggle-track::after {
  transform: translateX(16px);
}
.theme-icon {
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
}
.theme-icon-sun { color: rgba(255,255,255,0.7); }
.theme-toggle.active .theme-icon-sun { color: rgba(255,255,255,0.3); }
.theme-toggle.active .theme-icon-moon { color: rgba(255,255,255,0.7); }

/* METRICS ROW VARIANTS */
.metrics-row-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.metrics-row-6 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 24px;
}

/* STATUS BADGE */
.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-badge.urgent { background: #FEE2E2; color: #991B1B; }
.status-badge.watch { background: #FEF3C7; color: #92400E; }
.status-badge.good { background: var(--teal-light); color: #065F46; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: #1D9E75; }
.status-dot.amber { background: #EF9F27; }
.status-dot.red { background: #E24B4A; }

/* HEATMAP CALENDAR */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  min-width: 0;
}
.heatmap-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  padding: 4px 0;
}

/* RANK CELL */
.rank-cell {
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  min-width: 44px;
}
.rank-cell.top3 { background: var(--teal-light); color: #065F46; }
.rank-cell.top10 { background: #DBEAFE; color: #1E40AF; }
.rank-cell.top20 { background: #FEF3C7; color: #92400E; }
.rank-cell.low { background: #FEE2E2; color: #991B1B; }
.rank-cell.na { background: #F3F4F6; color: #9CA3AF; }

/* ALERT ROW */
.alert-row {
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.alert-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.alert-icon.red { background: #FEE2E2; }
.alert-icon.amber { background: #FEF3C7; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.alert-body { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* FILTER BAR */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--text-light); }
.filter-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* URGENCY PILL */
.urgency-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.urgency-pill.high { background: #FEE2E2; color: #991B1B; }
.urgency-pill.medium { background: #FEF3C7; color: #92400E; }
.urgency-pill.low { background: #F3F4F6; color: #6B7280; }

/* PROGRESS BAR */
.progress-bar {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

/* DARK MODE — new components */
:root.dark .status-badge.urgent { background: rgba(239,68,68,0.15); color: #FCA5A5; }
:root.dark .status-badge.watch { background: rgba(245,158,11,0.15); color: #FCD34D; }
:root.dark .status-badge.good { background: rgba(52,211,153,0.15); color: #6EE7B7; }
:root.dark .rank-cell.top3 { background: rgba(52,211,153,0.15); color: #6EE7B7; }
:root.dark .rank-cell.top10 { background: rgba(96,165,250,0.15); color: #93C5FD; }
:root.dark .rank-cell.top20 { background: rgba(245,158,11,0.15); color: #FCD34D; }
:root.dark .rank-cell.low { background: rgba(239,68,68,0.15); color: #FCA5A5; }
:root.dark .rank-cell.na { background: #374151; color: #6B7280; }
:root.dark .alert-icon.red { background: rgba(239,68,68,0.15); }
:root.dark .alert-icon.amber { background: rgba(245,158,11,0.15); }
:root.dark .filter-btn { background: #1F2937; border-color: rgba(255,255,255,0.08); }
:root.dark .filter-btn.active { background: #E5E7EB; color: #111827; border-color: #E5E7EB; }
:root.dark .urgency-pill.high { background: rgba(239,68,68,0.15); color: #FCA5A5; }
:root.dark .urgency-pill.medium { background: rgba(245,158,11,0.15); color: #FCD34D; }
:root.dark .urgency-pill.low { background: #374151; color: #9CA3AF; }
:root.dark .progress-bar { background: #374151; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .metrics-row-4 { grid-template-columns: repeat(2, 1fr); }
  .metrics-row-6 { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .reviews-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .heatmap-cell { font-size: 8px; }
  .tab { padding: 12px 14px; font-size: 12px; }
}
