/* =======================================================================
   dashboard.css — Boa Gestão Salarial Analytics
   ======================================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue: #1e40af;
  --blue-light: #3b82f6;
  --blue-dark: #1e3a8a;
  --ocean: #0c4a6e;
  --ocean-light: #0e7490;
  --ocean-mid: #075985;
  --ocean-deep: #082f49;
  --ocean-accent: #06b6d4;
  --red: #dc2626;
  --red-light: #ef4444;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --green: #10b981;
  --green-light: #34d399;
  --yellow: #f59e0b;
  --purple: #8b5cf6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --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 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --sidebar-w: 260px;
  --header-h: 64px;
  --transition: 0.2s ease;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- Layout ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar — Azul Oceano com efeitos ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--ocean-deep) 0%, var(--ocean) 40%, var(--ocean-mid) 100%);
  color: var(--gray-300);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  box-shadow: 4px 0 24px rgba(8,47,73,0.3);
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 80% 10%, rgba(6,182,212,0.08) 0%, transparent 50%),
              radial-gradient(circle at 20% 90%, rgba(14,116,144,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.sidebar-brand {
  padding: 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.sidebar-brand .logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--ocean-accent), var(--ocean-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6,182,212,0.3);
}

.sidebar-brand .brand-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}

.sidebar-brand .brand-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-nav .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 16px 22px 6px;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 22px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(6,182,212,0.15) 0%, transparent 100%);
  transition: width 0.3s ease;
}

.sidebar-nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.sidebar-nav a:hover::before {
  width: 100%;
}

.sidebar-nav a.active {
  background: rgba(6,182,212,0.1);
  color: var(--white);
  border-left-color: var(--ocean-accent);
  box-shadow: inset 0 0 20px rgba(6,182,212,0.05);
}

.sidebar-nav a.active::before {
  width: 100%;
  background: linear-gradient(90deg, rgba(6,182,212,0.12) 0%, transparent 100%);
}

.sidebar-nav a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.sidebar-nav a .nav-text {
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 1;
}

.sidebar-footer .btn-sair {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(220,38,38,0.15);
  color: var(--red-light);
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-footer .btn-sair:hover {
  background: rgba(220,38,38,0.25);
}

/* ---------- Main ---------- */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.header-left .menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-700);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.period-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.period-selector select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  outline: none;
}

.period-selector select:hover {
  background: var(--gray-200);
}

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: var(--transition);
}

.header-icon-btn:hover {
  background: var(--gray-200);
}

.header-icon-btn .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header-profile:hover {
  background: var(--gray-100);
}

.header-profile .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ocean-light), var(--ocean));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.header-profile .profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.header-profile .profile-role {
  font-size: 11px;
  color: var(--gray-400);
}

/* ---------- Content ---------- */
.content {
  padding: 28px 32px;
  flex: 1;
  max-width: 100%;
  overflow-y: auto;
}

.content-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ---------- Page System ---------- */
.page {
  display: none;
  animation: pageIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--gray-500);
}

/* ---------- Cards ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
  max-width: 100%;
}

.cards-grid.centered {
  justify-content: center;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

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

.card.active {
  border-color: var(--ocean-light);
  box-shadow: 0 0 0 2px rgba(14,116,144,0.15);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-icon.blue { background: rgba(59,130,246,0.12); color: var(--blue-light); }
.card-icon.green { background: rgba(16,185,129,0.12); color: var(--green); }
.card-icon.red { background: rgba(239,68,68,0.12); color: var(--red-light); }
.card-icon.yellow { background: rgba(245,158,11,0.12); color: var(--yellow); }
.card-icon.purple { background: rgba(139,92,246,0.12); color: var(--purple); }
.card-icon.gray { background: rgba(100,116,139,0.12); color: var(--gray-500); }
.card-icon.ocean { background: rgba(14,116,144,0.12); color: var(--ocean-light); }

.card-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.card-change {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-change.up { color: var(--green); }
.card-change.down { color: var(--red); }
.card-change.neutral { color: var(--gray-500); }

/* ---------- Section ---------- */
.section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.section-subtitle {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

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

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* ---------- Funnel ---------- */
.funnel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.funnel-step {
  text-align: center;
  padding: 18px 28px;
  border-radius: var(--radius);
  color: var(--white);
  font-weight: 600;
  position: relative;
  transition: var(--transition);
}

.funnel-step:hover {
  transform: scale(1.02);
}

.funnel-step .funnel-value {
  font-size: 24px;
  font-weight: 700;
}

.funnel-step .funnel-label {
  font-size: 13px;
  opacity: 0.9;
}

.funnel-step.s1 {
  background: linear-gradient(135deg, var(--ocean-light), var(--ocean));
  width: 100%;
}

.funnel-step.s2 {
  background: linear-gradient(135deg, var(--purple), #7c3aed);
  width: 75%;
}

.funnel-step.s3 {
  background: linear-gradient(135deg, var(--green), #059669);
  width: 50%;
}

.funnel-arrow {
  font-size: 20px;
  color: var(--gray-400);
  padding: 8px 0;
}

.funnel-rates {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.funnel-rate {
  text-align: center;
  padding: 14px 24px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

.funnel-rate .rate-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ocean);
}

.funnel-rate .rate-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ---------- Chart toggles ---------- */
.chart-toggle {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.chart-toggle button {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.chart-toggle button.active {
  background: var(--white);
  color: var(--ocean);
  box-shadow: var(--shadow-sm);
}

.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  max-height: 320px;
}

/* ---------- Origin legend ---------- */
.origin-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.origin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.origin-item .origin-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.origin-item .origin-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.origin-item .origin-count {
  font-weight: 700;
  color: var(--gray-700);
}

.origin-item .origin-pct {
  font-size: 11px;
  color: var(--gray-400);
}

/* ---------- Plans list ---------- */
.plans-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-item .plan-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.plan-item .plan-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  transition: width 0.6s ease;
}

.plan-item .plan-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  width: 100px;
  flex-shrink: 0;
}

.plan-item .plan-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-900);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

/* ---------- Status grid ---------- */
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.status-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-item .status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-item .status-info .status-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.status-item .status-info .status-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

/* ---------- Opportunities ---------- */
.opportunity-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 12px;
}

.opportunity-card .opp-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.opportunity-card .opp-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin: 4px 0 12px;
}

.opportunity-card .opp-btn {
  padding: 6px 16px;
  background: var(--ocean);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.opportunity-card .opp-btn:hover {
  background: var(--ocean-deep);
}

/* ---------- Activity feed ---------- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item .act-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.activity-item .act-content .act-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.activity-item .act-content .act-desc {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.activity-item .act-content .act-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ---------- Filters ---------- */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.filter-search {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.filter-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.filter-search input:focus {
  border-color: var(--ocean-light);
  box-shadow: 0 0 0 3px rgba(14,116,144,0.1);
}

.filter-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
}

.filter-select {
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--ocean-light);
  box-shadow: 0 0 0 3px rgba(14,116,144,0.1);
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
}

table.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

table.users-table thead {
  background: var(--gray-50);
}

table.users-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--gray-200);
}

table.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

table.users-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}

table.users-table tbody tr:hover {
  background: var(--gray-50);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: rgba(16,185,129,0.12); color: var(--green); }
.badge-yellow { background: rgba(245,158,11,0.12); color: var(--yellow); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.12); color: var(--blue-light); }
.badge-gray { background: rgba(100,116,139,0.12); color: var(--gray-500); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--gray-500);
}

.table-footer .result-count {
  font-weight: 600;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-100);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--gray-200);
}

.modal-body {
  padding: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item .detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-400);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-item .detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.detail-item .detail-value.yes { color: var(--green); }
.detail-item .detail-value.no { color: var(--gray-400); }

.timeline {
  margin-top: 8px;
}

.timeline h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item .tl-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 3px solid;
  z-index: 1;
}

.timeline-item .tl-content .tl-event {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.timeline-item .tl-content .tl-date {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ---------- Stat row (sub pages) ---------- */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-mini {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
  flex: 1;
  min-width: 180px;
}

.stat-mini .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.stat-mini .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-mini .stat-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ---------- Placeholder page ---------- */
.placeholder-page {
  text-align: center;
  padding: 80px 20px;
}

.placeholder-page .ph-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.placeholder-page h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.placeholder-page p {
  color: var(--gray-500);
  max-width: 440px;
  margin: 0 auto 24px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Overlay for mobile sidebar ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8,47,73,0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .header-left .menu-toggle {
    display: block;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }

  .header-right .header-profile .profile-info {
    display: none;
  }

  .period-selector {
    padding: 2px;
  }

  .period-selector select {
    font-size: 12px;
    padding: 4px 6px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-select {
    width: 100%;
  }

  .funnel-step.s2 { width: 85%; }
  .funnel-step.s3 { width: 65%; }
}

@media (max-width: 480px) {
  .header-left h1 {
    font-size: 16px;
  }

  .card-value {
    font-size: 22px;
  }

  .section {
    padding: 16px;
  }

  .funnel-rates {
    flex-direction: column;
    align-items: center;
  }

  .funnel-rate {
    width: 100%;
    max-width: 280px;
  }
}
