@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --navy: #0B1D3A;
  --deep-blue: #065A82;
  --teal: #028090;
  --seafoam: #00A896;
  --mint: #02C39A;
  --white: #FFFFFF;
  --off-white: #F0F5F7;
  --light-gray: #E8EDF0;
  --med-gray: #8FA3B0;
  --dark-text: #1A2332;
  --body-text: #2D3E50;
  --accent: #E8634A;
  --accent-light: #FCF0ED;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --purple: #8B5CF6;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--dark-text);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation */
.nav {
  background: var(--navy);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  color: var(--seafoam);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 32px;
  white-space: nowrap;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-tab {
  color: var(--med-gray);
  background: none;
  border: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  color: var(--white);
  background: var(--deep-blue);
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--med-gray);
  margin-top: -12px;
  margin-bottom: 16px;
}

/* Metrics row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border-left: 4px solid var(--teal);
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  font-family: 'JetBrains Mono', monospace;
}

.metric-label {
  font-size: 12px;
  color: var(--med-gray);
  margin-top: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card.accent {
  border-left-color: var(--accent);
}

.metric-card.success {
  border-left-color: var(--success);
}

.metric-card.warning {
  border-left-color: var(--warning);
}

.metric-card.danger {
  border-left-color: var(--danger);
}

.metric-card.purple {
  border-left-color: var(--purple);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  cursor: pointer;
}

th:hover {
  background: var(--deep-blue);
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--light-gray);
}

tr:hover td {
  background: rgba(2, 192, 154, 0.04);
}

tr:nth-child(even) td {
  background: var(--off-white);
}

tr:nth-child(even):hover td {
  background: rgba(2, 192, 154, 0.08);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-purple {
  background: #EDE9FE;
  color: #5B21B6;
}

/* Funnel */
.funnel-bar {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.funnel-label {
  width: 280px;
  font-size: 12px;
  font-weight: 500;
  color: var(--body-text);
  text-align: right;
  padding-right: 12px;
  flex-shrink: 0;
}

.funnel-track {
  flex: 1;
  height: 32px;
  background: var(--light-gray);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  font-family: 'JetBrains Mono', monospace;
  transition: width 0.8s ease;
}

.funnel-count {
  width: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  padding-left: 12px;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

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

/* Chart containers */
.chart-container {
  position: relative;
  height: 300px;
}

/* Search */
.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}

.search-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(2, 128, 144, 0.1);
}

/* SVI gauge */
.svi-bar {
  width: 60px;
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.svi-fill {
  height: 100%;
  border-radius: 4px;
}

/* Section header */
.section-header {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--med-gray);
  margin-bottom: 20px;
}

/* Callout */
.callout {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.callout-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 4px;
}

.callout-text {
  font-size: 13px;
  color: var(--body-text);
  line-height: 1.5;
}

.callout.info {
  background: #EFF6FF;
  border-left-color: var(--deep-blue);
}

.callout.info .callout-title {
  color: var(--deep-blue);
}

/* Login overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0B3D61 0%, #065A82 40%, #028090 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo span {
  font-size: 22px;
  font-weight: 800;
  color: #0B3D61;
  letter-spacing: -0.5px;
}

.login-logo .dot {
  color: #E8634A;
}

.login-title {
  font-size: 14px;
  color: #8FA3B0;
  text-align: center;
  margin-bottom: 24px;
  font-weight: 500;
}

.login-field {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #2D3E50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E8EDF0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #FFFFFF;
}

.login-input:focus {
  border-color: #028090;
  box-shadow: 0 0 0 3px rgba(2, 128, 144, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: #0B3D61;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.login-btn:hover {
  background: #065A82;
}

.login-error {
  color: #EF4444;
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: #8FA3B0;
}
