@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@400;600;700&family=Noto+Serif:ital,wght@0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Habitat for Humanity Bangladesh — Official Design System Tokens */
:root {
  --hfh-deep-green: #003a1f;
  --hfh-primary-green: #00723f;
  --hfh-mid-green: #009245;
  --hfh-cyan-accent: #007b85;
  --hfh-leaf: #8dc63f;
  --hfh-orange: #f7941d;
  --hfh-alert-red: #b3261e;
  --hfh-ink: #1c2621;
  --hfh-muted: #5e6b63;
  --hfh-surface: #f4f8f5;
  --hfh-card-bg: #ffffff;
  --hfh-border: #d4e5da;
  --hfh-shadow: 0 4px 18px rgba(0, 58, 31, 0.06);
  --hfh-shadow-lg: 0 10px 30px rgba(0, 58, 31, 0.10);
  
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-bengali: 'Noto Sans Bengali', sans-serif;
  --font-serif: 'Noto Serif', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  color: var(--hfh-ink);
  background-color: var(--hfh-surface);
  display: flex;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Left Rail Navigation */
.left-rail {
  width: 275px;
  background: linear-gradient(180deg, #002c17 0%, var(--hfh-deep-green) 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.left-rail .brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand-logo-card {
  background: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.official-hfh-logo {
  max-width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
}

.brand-title h1 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-title p {
  font-size: 0.75rem;
  color: #a0d8b9;
  margin-top: 2px;
  font-weight: 600;
}

.left-rail nav {
  flex: 1;
  padding: 20px 12px;
}

.left-rail nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #d0e8db;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.left-rail nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.left-rail nav a.active {
  background: var(--hfh-primary-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 114, 63, 0.35);
}

.left-rail nav a .badge {
  margin-left: auto;
  background-color: var(--hfh-orange);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.left-rail .rail-footer {
  padding: 18px 20px;
  font-size: 0.76rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #a0d8b9;
  background: rgba(0, 0, 0, 0.1);
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header Bar */
.top-bar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--hfh-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.disclaimer-banner {
  background: linear-gradient(90deg, #fff8e1 0%, #fff3cd 100%);
  border: 1px solid #ffe082;
  color: #7a5c00;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hfh-surface);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--hfh-border);
}

.lang-toggle form button {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--hfh-muted);
  transition: all 0.2s ease;
}

.lang-toggle form button.active {
  background-color: #ffffff;
  color: var(--hfh-deep-green);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Main Content Area */
.content-area {
  padding: 28px 32px;
  flex: 1;
}

/* Typography & Display Headers */
.headline-question {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--hfh-deep-green);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--hfh-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-number {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--hfh-deep-green);
  line-height: 1;
}

/* KPI Top Grid */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background-color: var(--hfh-card-bg);
  border: 1px solid var(--hfh-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--hfh-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hfh-shadow-lg);
}

.kpi-card .kpi-label {
  font-size: 0.82rem;
  color: var(--hfh-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.kpi-card .denominator {
  font-size: 0.84rem;
  color: var(--hfh-muted);
  margin-top: 6px;
  font-weight: 600;
}

/* Progress Bars */
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e5efe9;
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--hfh-primary-green) 0%, var(--hfh-leaf) 100%);
  border-radius: 4px;
}

/* Status Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.chip.on-track {
  background-color: #e6f5ec;
  color: var(--hfh-mid-green);
  border: 1px solid #c2e5d1;
}

.chip.exception {
  background-color: #fff3e0;
  color: #d97706;
  border: 1px solid #fde68a;
}

.chip.pending {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.chip.critical {
  background-color: #fee2e2;
  color: var(--hfh-alert-red);
  border: 1px solid #fca5a5;
}

/* UI Panels & Cards */
.panel {
  background-color: var(--hfh-card-bg);
  border: 1px solid var(--hfh-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--hfh-shadow);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--hfh-deep-green);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.data-table th {
  background-color: #f7faf8;
  color: var(--hfh-deep-green);
  text-align: left;
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 2px solid var(--hfh-border);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hfh-border);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background-color: #f8fcf9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background-color: var(--hfh-primary-green);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 114, 63, 0.2);
}

.btn-primary:hover {
  background-color: var(--hfh-deep-green);
  box-shadow: 0 6px 16px rgba(0, 58, 31, 0.3);
  transform: translateY(-1px);
}

.btn-orange {
  background-color: var(--hfh-orange);
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--hfh-ink);
  border: 1px solid var(--hfh-border);
}

.btn-secondary:hover {
  background-color: var(--hfh-surface);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

/* Alerts & Messages */
.alert-messages {
  margin-bottom: 20px;
}

.alert-item {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.alert-item.success {
  background-color: #e6f5ec;
  color: var(--hfh-mid-green);
  border: 1px solid #b7e1cd;
}

.alert-item.info, .alert-item.warning {
  background-color: #fff3e0;
  color: #d97706;
  border: 1px solid #fde68a;
}
