/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: #f0f2f5;
  color: #1a2a4a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, #0d2461 0%, #1a3a8f 60%, #1a5276 100%);
  color: white;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  min-height: 70px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.6);
}

.header-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
}

.header-org {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.header-sub {
  font-size: 12px;
  font-weight: 600;
  color: #ffc10c;
  letter-spacing: 1px;
  margin-top: 2px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-datetime {
  text-align: right;
}

.header-time {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
}

.header-date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 6px 14px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255, 193, 12, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info span {
  font-size: 14px;
  font-weight: 700;
}

.user-actions {
  display: flex;
  gap: 4px;
  margin-top: 2px;
}

.user-actions a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.user-actions a:hover {
  color: #ffc10c;
}

.sep {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== TICKER ===== */
.ticker-wrap {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8, #0ea5e9);
  padding: 8px 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.ticker-label {
  padding: 0 12px;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-content {
  flex: 1;
  overflow: hidden;
}

.ticker-inner {
  display: inline-block;
  white-space: nowrap;
  animation: ticker-scroll 90s linear infinite;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

@keyframes ticker-scroll {
  0% {
    transform: translateX(100vw);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 16px 20px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ===== YEAR BANNER ===== */
.year-banner {
  background: linear-gradient(135deg, #e8f4fd, #d6eaf8);
  border: 1px solid #a9cce3;
  border-radius: 10px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #1a5276;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.year-switcher-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== TAB NAVIGATION ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 9px 18px;
  border: 2px solid #e0e5ef;
  background: white;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  border-color: #1a3a8f;
  color: #1a3a8f;
  background: #f0f4ff;
}

.tab-btn.active {
  background: linear-gradient(135deg, #1a3a8f, #0d2461);
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(26, 58, 143, 0.35);
}

/* ===== TAB CONTENT ===== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.stats-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stats-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== STAT CARD ===== */
.stat-card {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  border: 1px solid #e8ecf4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1a3a8f, #0a5c8a);
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.highlight-green {
  background: linear-gradient(135deg, #e8f8f0, #d5f0df);
  border-color: #9ae0b5;
}

.stat-card.highlight-green::before {
  background: linear-gradient(90deg, #1dbe6a, #0ea85a);
  opacity: 1;
}

.stat-card.highlight-yellow {
  background: linear-gradient(135deg, #fef9ec, #fef0c9);
  border-color: #f9c74f;
}

.stat-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-value.primary {
  color: #1a3a8f;
}

.stat-value.green {
  color: #0ea85a;
}

.stat-value.orange {
  color: #d97706;
}

.stat-value.red {
  color: #dc2626;
}

.stat-sub {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.stat-extra {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
  color: #374151;
}

.stat-extra.green {
  color: #0ea85a;
}

.stat-extra.orange {
  color: #d97706;
}

.stat-extra.blue {
  color: #1a3a8f;
}

/* ===== PROGRESS BARS ===== */
.progress-bar-wrap {
  height: 8px;
  background: #e8ecf4;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar-wrap.big {
  height: 14px;
  border-radius: 7px;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #f9a825, #ffc10c);
  transition: width 1s ease;
}

.progress-bar.green {
  background: linear-gradient(90deg, #0ea85a, #1dbe6a);
}

.progress-bar.big {
  border-radius: 7px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

/* ===== TWO COL GRID ===== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===== DETAIL CARD ===== */
.detail-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #e8ecf4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a2a4a;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f2f5;
}

/* ===== BIẾN ĐỘNG ĐẢNG VIÊN ===== */
.bien-dong-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bien-dong-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.15s;
}

.bien-dong-row:hover {
  background: #f8f9fc;
}

.bien-dong-row.total {
  background: #eef2ff;
  font-weight: 700;
  border-radius: 8px;
  margin-top: 4px;
}

.bd-label {
  font-size: 13.5px;
  color: #374151;
  font-weight: 500;
}

.bd-value {
  font-size: 15px;
  font-weight: 700;
}

.bd-value.blue {
  color: #1a3a8f;
}

.bd-value.green {
  color: #0ea85a;
}

.bd-value.red {
  color: #dc2626;
}

/* ===== NGUỒN PHÁT TRIỂN ===== */
.nguon-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nguon-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nguon-label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  width: 160px;
  flex-shrink: 0;
}

.nguon-bar-wrap {
  flex: 1;
  height: 10px;
  background: #e8ecf4;
  border-radius: 5px;
  overflow: hidden;
}

.nguon-bar {
  height: 100%;
  border-radius: 5px;
  background: #1a3a8f;
  transition: width 1s ease;
}

.nguon-bar.green {
  background: #0ea85a;
}

.nguon-num {
  font-size: 14px;
  font-weight: 700;
  color: #1a2a4a;
  width: 40px;
  text-align: right;
}

/* ===== TUỔI ĐẢNG ===== */
.tuoi-dang-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  text-align: center;
}

.tuoi-item .tuoi-num {
  font-size: 26px;
  font-weight: 800;
  color: #1a3a8f;
}

.tuoi-item .tuoi-label {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  font-weight: 500;
}

/* ===== DATA TABLE ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table th {
  background: #f0f3f8;
  color: #374151;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #e0e5ef;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f2f5;
  color: #374151;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8f9fc;
}

.data-table .pct-green {
  color: #0ea85a;
  font-weight: 700;
}

.data-table .pct-orange {
  color: #d97706;
  font-weight: 700;
}

.data-table .pct-red {
  color: #dc2626;
  font-weight: 700;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-green {
  background: #d1fae5;
  color: #059669;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-red {
  background: #fee2e2;
  color: #dc2626;
}

/* ===== ĐẦU TƯ CÔNG ===== */
.dau-tu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.dau-tu-item {
  padding: 10px 14px;
  background: #f8f9fc;
  border-radius: 8px;
  border-left: 3px solid #1a3a8f;
}

.dau-tu-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a2a4a;
}

.dau-tu-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 3px;
}

/* ===== CDS LIST ===== */
.cds-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cds-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 13.5px;
}

.cds-row:last-child {
  border-bottom: none;
}

.cds-label {
  color: #374151;
  font-weight: 500;
}

.cds-val {
  font-weight: 700;
  color: #1a3a8f;
}

/* ===== KTXH LIST ===== */
.ktxh-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ktxh-item {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  padding: 4px 0;
}

.ktxh-item::before {
  content: '✓ ';
  color: #0ea85a;
  font-weight: 700;
}

/* ===== EVAL CARD ===== */
.eval-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #e8ecf4;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-top: 14px;
}

.eval-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a2a4a;
  margin-bottom: 14px;
}

.eval-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.eval-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eval-item {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  line-height: 1.5;
}

.eval-item.good::before {
  content: '✓ ';
  color: #0ea85a;
  font-weight: 700;
}

.eval-item.warn::before {
  content: '→ ';
  color: #d97706;
  font-weight: 700;
}

.eval-item.note::before {
  content: '⚡ ';
}

/* ===== PHẢN ÁNH ===== */
.pa-detail {
  background: #f8f9fc;
  border-radius: 10px;
  padding: 16px;
  margin-top: 8px;
}

.pa-stat-row {
  display: flex;
  gap: 24px;
}

.pa-stat {
  text-align: center;
}

.pa-stat-num {
  font-size: 32px;
  font-weight: 800;
  color: #1a3a8f;
}

.pa-stat-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-top: 4px;
}

/* ===== FOOTER ===== */
.footer {
  background: #1a2a4a;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 500;
}

.footer-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
}

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar .year-banner {
  margin-bottom: 0;
  flex: 1;
  min-width: 200px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.year-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  border: 1px solid #e0e5ef;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.year-switch-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  margin-right: 4px;
}

.year-btn {
  padding: 5px 12px;
  border: 1.5px solid #e0e5ef;
  background: white;
  color: #374151;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}

.year-btn:hover {
  border-color: #1a3a8f;
  color: #1a3a8f;
}

.year-btn.active {
  background: linear-gradient(135deg, #1a3a8f, #0d2461);
  color: white;
  border-color: transparent;
}

.btn-print {
  padding: 8px 16px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}

.btn-print:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45);
}

/* ===== TUỔI ĐẢNG LEGEND (for chart) ===== */
.tuoi-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.tuoi-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tuoi-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tuoi-num-inline {
  font-size: 15px;
  font-weight: 800;
  color: #1a2a4a;
  min-width: 42px;
}

.tuoi-lbl {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .stats-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-grid {
    grid-template-columns: 1fr;
  }

  .eval-grid {
    grid-template-columns: 1fr;
  }

  .dau-tu-grid {
    grid-template-columns: 1fr;
  }

  .header-time {
    font-size: 18px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 600px) {

  .stats-4,
  .stats-3 {
    grid-template-columns: 1fr;
  }

  .header-org {
    font-size: 13px;
  }

  .tab-btn {
    font-size: 11px;
    padding: 7px 12px;
  }

  .year-switcher {
    display: none;
  }

  .header-datetime {
    display: none;
  }
}

/* ===== PRINT ===== */
@media print {
  .header {
    position: static;
    box-shadow: none;
  }

  .ticker-wrap,
  .toolbar-right,
  .user-actions,
  .btn-print {
    display: none !important;
  }

  .tab-content {
    display: block !important;
    break-inside: avoid;
  }

  .tab-nav {
    display: none;
  }

  .stat-card,
  .detail-card,
  .eval-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body {
    background: white;
  }

  .main-content {
    max-width: 100%;
    padding: 8px;
  }

  canvas {
    max-height: 180px;
  }
}