/* ===== GLOBAL RESET & VARIABLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-body: #EEF3F8;
  --card-radius: 18px;
  --card-shadow: 0px 8px 24px rgba(0, 0, 0, 0.08);
  --btn-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  --font: 'Inter', 'Segoe UI', Arial, sans-serif;
  --transition: 0.25s ease;
  --header-height: 72px;
  --outer-margin: 20px;
  --card-gap: 18px;
  --inner-padding: 20px;
}

body {
  font-family: var(--font);
  background: var(--bg-body);
  padding: var(--outer-margin);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.dashboard {
  max-width: 1920px;
  width: 100%;
  background: transparent;
}

/* ===== TOP HEADER ===== */
.navbar {
  height: var(--header-height);
  background: linear-gradient(90deg, #0D4EA6 0%, #144E9B 100%);
  border-radius: 0 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box {
  width: 54px;
  height: 54px;
  background: #08A5E8;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-box svg {
  stroke: white;
}

.title-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.main-title {
  font-size: 36px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
}

.sub-title {
  font-size: 16px;
  font-weight: 500;
  color: #2E8ACD;
  letter-spacing: 0.5px;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
}

.nav-pill {
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  cursor: default;
  transition: var(--transition);
  background: transparent;
}

.nav-pill.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  width: 160px;
  text-align: center;
}

.nav-pill:not(.active) {
  background: transparent;
}

.nav-right {
  display: flex;
  align-items: center;
}

.setup-btn {
  background: white;
  color: #0D4EA6;
  border: none;
  padding: 12px 34px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: var(--transition);
  font-family: var(--font);
}

.setup-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

/* ===== MAIN GRID ===== */
.main-grid {
  display: grid;
  grid-template-columns: 78% 22%;
  gap: var(--card-gap);
}

/* ===== LEFT CONTENT ===== */
.left-content {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

/* ===== KPI ROWS ===== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--card-gap);
}

.kpi-card {
  height: 132px;
  border-radius: var(--card-radius);
  padding: var(--inner-padding);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: var(--transition);
  color: white;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.kpi-label {
  font-size: 22px;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0.2px;
}

.kpi-value {
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  margin-top: 4px;
  letter-spacing: -0.5px;
}

/* ===== THREE CHART CARDS ===== */
.row-three-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--card-gap);
}

.chart-card {
  background: white;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--inner-padding);
  height: 340px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

.chart-title {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.chart-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  position: relative;
}

.chart-wrapper canvas {
  max-width: 100%;
  max-height: 100%;
}

/* ===== TABLES ROW ===== */
.tables-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--card-gap);
}

.table-card {
  background: white;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--inner-padding);
  height: 390px;
  overflow-y: auto;
  transition: var(--transition);
}

.table-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

.table-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #1e293b;
}

.table-card thead th {
  text-align: left;
  padding: 8px 6px;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e9edf2;
  font-size: 13px;
  letter-spacing: 0.3px;
}

.table-card tbody td {
  padding: 8px 6px;
  border-bottom: 1px solid #f0f3f7;
}

.table-card tbody tr:nth-child(even) {
  background: #f9fbfd;
}

.table-card tbody tr:hover {
  background: #F5F9FF;
}

/* colored numeric cells */
.table-card tbody td:nth-child(2),
.table-card tbody td:nth-child(3),
.table-card tbody td:nth-child(4),
.table-card tbody td:nth-child(5),
.table-card tbody td:nth-child(6) {
  font-weight: 500;
}

/* ===== RIGHT SIDEBAR ===== */
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
}

.filter-panel {
  background: white;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: var(--inner-padding);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: var(--transition);
}

.filter-panel:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  letter-spacing: 0.2px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-range input[type="date"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #E3E8EF;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  background: white;
  color: #1e293b;
  height: 54px;
}

.date-range span {
  color: #94a3b8;
}

.filter-item select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E3E8EF;
  border-radius: 8px;
  height: 54px;
  font-family: var(--font);
  font-size: 14px;
  background: white;
  color: #1e293b;
  appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" stroke="%2394a3b8" stroke-width="1.5" fill="none"/></svg>');
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.help-card {
  background: #f8faff;
  border-radius: 16px;
  padding: 16px 14px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid #e9edf4;
}

.help-avatar {
  width: 44px;
  height: 44px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #475569;
  flex-shrink: 0;
}

.help-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.help-links a {
  color: #0D4EA6;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.help-links a:hover {
  color: #0b3d82;
  text-decoration: underline;
}

/* ===== FOOTER ===== */
.footer-bar {
  margin-top: var(--card-gap);
  height: 44px;
  background: linear-gradient(145deg, #5D3DE5, #4F6AF8);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: var(--card-shadow);
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 1440px) {
  .dashboard { max-width: 1440px; }
  .main-title { font-size: 32px; }
  .kpi-value { font-size: 44px; }
  .kpi-card { height: 120px; }
  .chart-card { height: 300px; }
}

@media screen and (max-width: 1366px) {
  .dashboard { max-width: 1366px; }
  .main-title { font-size: 30px; }
  .kpi-value { font-size: 38px; }
  .kpi-card { height: 110px; padding: 16px; }
  .chart-card { height: 280px; }
}

@media screen and (max-width: 1280px) {
  .dashboard { max-width: 1280px; }
  .main-title { font-size: 28px; }
  .sub-title { font-size: 14px; }
  .kpi-value { font-size: 34px; }
  .kpi-card { height: 100px; padding: 14px; }
  .chart-card { height: 260px; }
}

/* ===== SCROLLBAR ===== */
.table-card::-webkit-scrollbar {
  width: 6px;
}
.table-card::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}
.table-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}