/* =========================================================
   🎨 BIẾN MÀU & CÀI ĐẶT CƠ BẢN
   ========================================================= */
:root {
  --primary-color: #2c7a7b;
  --secondary-color: #f6ad55;
  --accent-color: #fbd38d;
  --light-color: #f7fafc;
  --dark-color: #2d3748;
  --text-color: #333333;
  --transition: all 0.3s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-color);
  line-height: 1.5;
  overflow-x: hidden;
}

/* =========================================================
   🏗️ LAYOUT CHÍNH
   ========================================================= */
.header {
  background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.7)), url('/uploads/slide/hinh5.jpg') center/cover fixed;
  color: #fff;
  padding: 15px 0;
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.content-section { padding: 80px 0; }

.section-title {
  position: relative;
  margin-bottom: 50px;
  font-weight: 700;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px; left: 0;
  width: 70px; height: 4px;
  background: var(--accent-color);
}

.section-title.center::after {
  left: 50%; transform: translateX(-50%);
}

.footer {
  background: var(--dark-color);
  color: var(--light-color);
  padding: 70px 0 30px;
  text-align: left;
}

.footer h5 {
  color: var(--accent-color);
  margin-bottom: 25px;
  font-weight: 600;
  padding-bottom: 10px;
  position: relative;
}

.footer h5::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--accent-color);
}

.copyright {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 50px;
  padding-top: 25px;
  text-align: center;
  font-size: .9rem;
  color: rgba(255,255,255,.7);
}

/* =========================================================
   🧩 COMPONENTS
   ========================================================= */
/* Cards */
.service-card, .card-app {
  border: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  overflow: hidden;
  margin-bottom: 30px;
  transition: var(--transition);
}

.service-card { height: 100%; }
.service-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,.15); }
.card-app { border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.card-app .card-header { background: #fff; border-bottom: 1px solid #eee; font-weight: 600; }

.service-icon {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  display: inline-block;
  padding: 15px;
  border-radius: 50%;
  background: rgba(26,95,122,.1);
}

/* Buttons */
.btn-accent, .btn-accent-outline, .login-btn {
  font-weight: 600;
  border: none;
  transition: var(--transition);
}

.btn-accent {
  background: var(--accent-color);
  color: var(--dark-color);
}

.btn-accent:hover { background: #ffc043; }

.btn-accent-outline {
  border: 2px solid var(--accent-color);
  color: var(--dark-color);
  background: transparent;
}

.btn-accent-outline:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

.login-btn {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--accent-color);
  color: var(--dark-color);
  padding: 10px 20px;
  border-radius: 30px;
  z-index: 100;
}

.login-btn:hover {
  background: #ffc043;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,.2);
}

/* Tables */
.table.table-compact th, .table.table-compact td {
  padding: .5rem .6rem;
  vertical-align: middle;
}

/* Tabs & Navigation */
.tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--bs-body-bg, #fff);
  padding-top: .25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-tabs.nav-scrollable, .nav-pills.nav-scrollable {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav-tabs.nav-scrollable::-webkit-scrollbar, .nav-pills.nav-scrollable::-webkit-scrollbar { height: 6px; }
.nav-tabs.nav-scrollable::-webkit-scrollbar-thumb, .nav-pills.nav-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .15);
  border-radius: 4px;
}

.nav-tabs .nav-link {
  transition: all .15s ease-in-out;
  border: 1px solid transparent;
}

.nav-tabs .nav-link.active {
  color: var(--bs-primary, #0d6efd);
  border-color: var(--bs-primary, #0d6efd) var(--bs-primary, #0d6efd) transparent;
  font-weight: 700;
}

.nav-tabs .nav-link:hover {
  border-color: transparent transparent var(--bs-secondary, #6c757d) transparent;
}

.nav-tabs.nav-compact .nav-link {
  padding: .4rem .6rem;
  font-size: .9rem;
  line-height: 1.2;
}

/* Slideshow */
.slideshow-container {
  position: relative;
  height: 500px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0,0,0,.15);
}

.slide {
  display: none;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
}

.slide.active { display: block; animation: fadeIn 1s; }

.slide-controls {
  position: absolute;
  bottom: 20px; left: 0; right: 0;
  text-align: center;
}

.slide-dot {
  width: 12px; height: 12px;
  display: inline-block;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  margin: 0 5px;
  cursor: pointer;
  transition: var(--transition);
}

.slide-dot.active { background: #fff; transform: scale(1.2); }

.slide-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.slide-nav:hover { background: rgba(0,0,0,.8); }
.slide-prev { left: 20px; }
.slide-next { right: 20px; }

/* Footer Elements */
.footer a {
  color: var(--light-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover { color: var(--accent-color); padding-left: 5px; }

.contact-info p { margin-bottom: .5rem; }
.contact-info i { width: 20px; margin-right: 10px; color: var(--accent-color); }

.social-links a {
  display: inline-block;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
  line-height: 40px;
  margin-right: 10px;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--accent-color);
  color: var(--dark-color);
  transform: translateY(-5px);
}

.map-container {
  border-radius: 8px;
  overflow: hidden;
  height: 250px;
  box-shadow: 0 4px 15px rgba(0,0,0,.3);
}

.footer ul { list-style: none; padding: 0; }
.footer ul li { margin-bottom: .6rem; }
.footer ul li a i { color: var(--accent-color); }

/* =========================================================
   🛠️ UTILITIES
   ========================================================= */
.back-to-top {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 50px; height: 50px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0; visibility: hidden;
  z-index: 999;
}

.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--secondary-color); transform: translateY(-5px); }

.loader {
  position: fixed;
  inset: 0;
  background: #fff;
  display: flex;
  align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .5s, visibility .5s;
}

.loader.hidden { opacity: 0; visibility: hidden; }

.spinner {
  width: 70px; height: 70px;
  border: 7px solid #f3f3f3;
  border-top: 7px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .55rem;
  border-radius: 999px;
  background: rgba(26,95,122,.08);
  color: var(--primary-color);
  font-weight: 600;
  font-size: .85rem;
}

.placeholder-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #6c757d;
  border: 2px dashed #e9ecef;
  border-radius: 12px;
  background: #fff;
}

.app-subheader {
  background: linear-gradient(90deg, rgba(26,95,122,.08), rgba(87,204,153,.08));
  border: 1px solid rgba(0,0,0,.05);
  border-radius: 12px;
  padding: .6rem .8rem;
}

/* Avatar & Images */
.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e9ecef;
  background-color: #f8f9fa;
}

.avatar-default {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Clickable rows */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clickable-row:hover { background-color: rgba(44, 122, 123, 0.05); }
.clickable-row td { user-select: none; }

/* Badges */
.badge {
  font-size: 0.75rem;
  white-space: nowrap;
  padding: 0.35em 0.65em;
}

/* Tab Switcher */
.tab-switcher {
  display: none;
  width: 100%;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: .55rem .75rem;
  font-weight: 600;
  color: #212529;
}

.tab-switcher:focus {
  outline: none;
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

/* =========================================================
   📱 RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 992px) {
  .footer { text-align: center; }
  .footer h5::after { left: 50%; transform: translateX(-50%); }
  .map-container { margin: 0 auto; height: 200px; }
}

@media (max-width: 768px) {
  .header {
    background-attachment: scroll;
    min-height: 60vh;
    text-align: center;
  }
  
  .slideshow-container { height: 350px; }
  
  .table-responsive { font-size: 0.875rem; }
  .table td, .table th { padding: 0.5rem 0.3rem; }
  .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.775rem; }
  .mobile-hidden { display: none !important; }
  .clickable-row:hover { background-color: inherit; }
  .avatar-sm { width: 28px; height: 28px; }
}

@media (max-width: 576px) {
  .nav-tabs.nav-responsive, .nav-pills.nav-responsive { display: none !important; }
  .tab-switcher { display: block !important; }
  .container-fluid.app-container { padding-left: .75rem; padding-right: .75rem; }
  .container-box { margin: 5px; padding: 10px; }
  .filter-section { padding: 10px; }
  .kpi-chip { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
  h4 { font-size: 1.1rem; margin-bottom: 1rem; }
  .form-control, .form-select { font-size: 0.875rem; padding: 0.375rem 0.75rem; }
  .filter-section .row > div { margin-bottom: 8px; }
}

@media (max-width: 375px) {
  .container-box { padding: 8px; margin: 2px; }
  .badge { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
  .avatar-sm { width: 24px; height: 24px; }
  .btn-sm { min-width: 32px; }
}

/* =========================================================
   🎬 ANIMATIONS
   ========================================================= */
@keyframes fadeIn { from { opacity: .4; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }