:root {
  --primary: #c8102e;
  --primary-dark: #9b0c24;
  --gold: #f0b51d;
  --ink: #1f2a44;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f7f8fb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.site-header { background: #fff; border-bottom: 4px solid var(--primary); }

.top-strip {
  background: linear-gradient(90deg, #1f2a44, #2c3a5e);
  color: #fff;
  padding: 6px 0;
  font-size: 13px;
}
.brand-line i { color: var(--gold); margin-right: 6px; }
.brand-line strong { letter-spacing: 0.5px; }
.brand-line .brand-sub { color: rgba(255,255,255,0.7); margin-left: 4px; }
.top-strip a { color: rgba(255,255,255,0.9); text-decoration: none; }

.hero-band {
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
  border-bottom: 1px solid var(--line);
}

.site-crest {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(200,16,46,0.3);
}
.site-title { font-size: 22px; font-weight: 700; margin: 0; color: var(--ink); }
.site-slogan { color: var(--muted); font-size: 14px; }

.site-nav {
  background: var(--primary) !important;
  padding: 0;
}
.site-nav .nav-link {
  color: rgba(255,255,255,0.92) !important;
  font-weight: 500;
  padding: 12px 16px !important;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.site-nav .nav-link:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.08);
  border-bottom-color: var(--gold);
}
.site-nav .nav-link.active {
  color: #fff !important;
  border-bottom-color: var(--gold);
  background: rgba(0,0,0,0.1);
}
.site-nav .dropdown-menu {
  border-top: 3px solid var(--gold);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  max-height: 420px;
  overflow-y: auto;
}
.site-nav .dropdown-item.active,
.site-nav .dropdown-item:active {
  background-color: var(--primary);
  color: #fff;
}
.site-nav .dropdown-item.active .text-muted { color: rgba(255,255,255,0.85) !important; }

.page-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 22px 28px;
  border-radius: 12px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 6px 20px rgba(200,16,46,0.2);
  margin-bottom: 20px;
}
.page-banner h2 { margin: 0; font-size: 22px; }
.page-banner p { margin: 4px 0 0; opacity: 0.9; font-size: 14px; }

.banner-stats { display: flex; gap: 24px; }
.banner-stats .stat {
  text-align: center;
}
.banner-stats .stat strong {
  display: block;
  font-size: 26px;
  color: var(--gold);
}
.banner-stats .stat span { font-size: 12px; opacity: 0.9; }

.section-card { border: none; border-radius: 12px; overflow: hidden; }
.section-card-head {
  padding: 14px 20px;
  background: linear-gradient(180deg, #fafbfd, #f4f6fa);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.section-card-head h3 { font-size: 16px; font-weight: 600; color: var(--ink); }

.table-wrap { overflow-x: auto; }
.table-documents {
  font-size: 14px;
  margin: 0;
}
.table-documents thead th {
  background: #f8f9fb;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid var(--line);
  padding: 12px 14px;
  white-space: nowrap;
}
.table-documents tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.table-documents tbody tr:hover {
  background: #fff8f8;
}
.table-documents tbody tr:last-child td { border-bottom: none; }

.doc-title {
  color: var(--ink);
  font-weight: 500;
}
.doc-title:hover { color: var(--primary); text-decoration: none; }

.type-chip, .type-chip-sm {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: #ecf2ff;
  color: #2741a4;
  border: 1px solid #cfdaff;
}
.type-chip-sm { padding: 2px 8px; font-size: 11px; }

.status-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.status-chip.status-cong_khai { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.status-chip.status-sap_dien_ra { background: #e3f2fd; color: #0277bd; border-color: #81d4fa; }
.status-chip.status-dang_dien_ra { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.status-chip.status-da_be_goc { background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8; }
.status-chip.status-cho_dang { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.status-chip.status-an { background: #f5f5f5; color: #616161; border-color: #d0d0d0; }

.bg-primary-soft { background: rgba(13,110,253,0.1); color: #0d6efd; }
.bg-info-soft { background: rgba(13,202,240,0.15); color: #055160; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state i { font-size: 48px; opacity: 0.3; margin-bottom: 12px; display: block; }
.empty-state p { margin: 0; }

.type-stats { list-style: none; padding: 16px 20px; margin: 0; }
.type-stats li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.type-stats li:last-child { border-bottom: none; }
.type-stats .count { font-weight: 600; color: var(--primary); }

.help-list { padding: 14px 28px 14px 24px; font-size: 14px; }
.help-list li { margin-bottom: 8px; }

.detail-table th, .detail-table td { padding: 10px 12px; font-size: 14px; }
.detail-table th { background: #f8f9fb; font-weight: 600; color: var(--muted); }

.qr-card .qr-image {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
  border: 1px solid var(--line);
  padding: 6px;
  background: #fff;
}
.qr-thumb {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  background: #fff;
  transition: transform 0.15s ease;
}
.qr-thumb:hover { transform: scale(1.08); }

.qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.qr-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.qr-grid-item:hover {
  border-color: var(--primary, #0d6efd);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}
.qr-thumb-lg {
  width: 96px; height: 96px;
  border-radius: 4px;
}
.qr-grid-label {
  font-size: 12px;
  text-align: center;
  color: var(--muted, #6c757d);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-detail-head {
  background: linear-gradient(180deg, #fafbfd, #f4f6fa);
  border-bottom: 1px solid var(--line);
  padding: 20px;
}
.doc-icon-lg {
  width: 60px; height: 60px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--primary);
}

.site-footer {
  background: #1f2a44;
  color: rgba(255,255,255,0.85);
  margin-top: 60px;
}
.site-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-title {
  color: #fff;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  display: inline-block;
}
.site-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
}

.error-page {
  text-align: center;
  padding: 80px 20px;
}
.error-page i {
  font-size: 80px;
  color: var(--primary);
  opacity: 0.7;
}
.error-page h1 {
  font-size: 80px;
  font-weight: 800;
  color: var(--ink);
  margin: 10px 0;
}
.error-page p { color: var(--muted); }

@media (max-width: 768px) {
  .site-title { font-size: 16px; }
  .site-slogan { font-size: 12px; }
  .page-banner { flex-direction: column; gap: 12px; }
  .banner-stats { gap: 16px; }
}
