:root {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-color: rgba(226, 232, 240, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --secondary: #0284c7;
  --secondary-light: #f0f9ff;
  --accent: #f59e0b;
  --accent-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 28px -6px rgba(5, 150, 105, 0.18);
  --transition: all 0.22s ease;
}

[data-theme="dark"] {
  --bg-main: #041a12;
  --bg-surface: #07271c;
  --bg-card: rgba(7, 39, 28, 0.92);
  --border-color: rgba(16, 85, 61, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #34d399;
  --primary-hover: #6ee7b7;
  --primary-light: rgba(52, 211, 153, 0.15);
  --secondary: #38bdf8;
  --secondary-light: rgba(56, 189, 248, 0.15);
  --accent: #fbbf24;
  --accent-light: rgba(251, 191, 36, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 28px -6px rgba(0,0,0,0.6);
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}
.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: var(--transition);
}
.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-2px);
}
.nav-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}
.nav-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}
.theme-btn:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

/* HERO */
.hero {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12) 0%, rgba(2, 132, 199, 0.08) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem 2rem;
}
.hero-container {
  max-width: 1200px;
  margin: 0 auto;
}
.hero-pill {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 820px;
}

/* TABS */
.tabs-nav-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 57px;
  z-index: 40;
}
.tabs-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-main);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

/* MAIN CONTENT */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARDS */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* INTERACTIVE TABLE & SHEET */
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.sheet-table th, .sheet-table td {
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  text-align: left;
}
.sheet-table th {
  background: var(--bg-main);
  font-weight: 700;
}
.sheet-input {
  width: 90px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-main);
  font-weight: 600;
}

/* STATS BOXES */
.stat-kpi {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}
.stat-kpi-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  margin-top: 0.2rem;
}
.stat-kpi-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* DOCS LIST */
.doc-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.92rem;
  transition: var(--transition);
}
.doc-pill:hover {
  border-color: var(--primary);
  transform: translateX(3px);
}
.doc-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.badge-doc { background: #dbeafe; color: #1e40af; }
.badge-xls { background: #d1fae5; color: #065f46; }
.badge-pdf { background: #fee2e2; color: #991b1b; }

/* CANVAS CHART */
.chart-container {
  width: 100%;
  height: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}
