/* CSS FOR TRANG THÔNG TIN ĐIỆN TỬ MTTQ VIỆT NAM PHƯỜNG BÌNH ĐÔNG */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  --primary-red: #cc0d12;
  --dark-red: #990000;
  --bright-red: #e61919;
  --gold: #ffcc00;
  --gold-dark: #d4a017;
  --bg-light: #f4f6f9;
  --bg-white: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --accent-pink: #ec4899;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE & Edge */
}

/* Ẩn thanh cuộn trên Chrome, Safari, Opera, Edge */
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* TOP TOOLBAR & ADMIN BADGE */
.top-bar {
  background: #1e293b;
  color: #f8fafc;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--gold);
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-bar-info span {
  margin-right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-toggle-btn {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.admin-toggle-btn.active {
  background: linear-gradient(135deg, #10b981, #047857);
}

.admin-toggle-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* HEADER BANNER */
.header-banner {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 50%, #7f1d1d 100%);
  color: white;
  padding: 20px 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.header-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,204,0,0.15) 0%, rgba(255,204,0,0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.logo-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  border-radius: 50%;
  background: white;
  padding: 4px;
}

.header-titles h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  line-height: 1.3;
}

.header-titles h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

/* NAVIGATION MENU */
.main-nav {
  background: var(--dark-red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 3px solid var(--gold);
  overflow: visible;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-item {
  position: relative;
  flex-shrink: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.nav-item:first-child .nav-link {
  background: rgba(0,0,0,0.15);
}

.nav-link:hover, .nav-item.active > .nav-link {
  background: var(--gold);
  color: var(--dark-red);
}

.dropdown-icon {
  font-size: 0.75rem;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-white);
  min-width: 250px;
  box-shadow: var(--shadow-lg);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border-top: 3px solid var(--primary-red);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 110;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-item:hover .dropdown-icon {
  transform: rotate(180deg);
}

.dropdown-menu li a {
  display: block;
  padding: 12px 18px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.dropdown-menu li a:hover {
  background: #fef2f2;
  color: var(--primary-red);
  padding-left: 24px;
}

/* MARQUEE BANNER */
.news-ticker {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 8px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.ticker-title {
  background: var(--primary-red);
  color: var(--gold);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  white-space: nowrap;
  margin-right: 12px;
}

.ticker-content {
  overflow: hidden;
  white-space: nowrap;
  color: #92400e;
  font-weight: 600;
}

/* MAIN CONTENT AREA */
.main-wrapper {
  padding: 24px 0 48px;
  min-height: calc(100vh - 350px);
}

.page-section {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.page-section.active {
  display: block;
}

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

/* BREADCRUMB & SECTION TITLE */
.section-header {
  background: var(--bg-white);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary-red);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title-group h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-red);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* LAYOUT GRIDS */
.grid-2col {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 24px;
}

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

/* CARD STYLES */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 24px;
}

.card-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-red);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* HOME FEATURED SLIDER */
.featured-news {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.featured-img-container {
  position: relative;
  height: 380px;
  width: 100%;
}

.featured-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 70%, rgba(0,0,0,0) 100%);
  padding: 24px 20px 16px;
  color: white;
}

.featured-badge {
  background: var(--primary-red);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 8px;
}

.featured-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: #ffffff;
}

.featured-date {
  font-size: 0.8rem;
  color: #d1d5db;
}

/* SIDEBAR NEWS LIST */
.news-mini-list {
  list-style: none;
}

.news-mini-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-color);
}

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

.news-mini-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 4px;
  display: block;
  transition: color 0.2s;
  cursor: pointer;
}

.news-mini-title:hover,
.news-mini-title:active {
  color: var(--primary-red);
}

.news-mini-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* STATS DASHBOARD ROW */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-box {
  background: var(--bg-white);
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.green { background: #dcfce7; color: #16a34a; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-icon.pink { background: #fce7f3; color: #db2777; }
.stat-icon.yellow { background: #fef9c3; color: #ca8a04; }
.stat-icon.red { background: #fee2e2; color: #dc2626; }
.stat-icon.purple { background: #f3e8ff; color: #7e22ce; }

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* MAP STYLES */
.map-container {
  height: 540px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.custom-map-icon {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-map-icon:hover {
  transform: scale(1.22);
  z-index: 9999 !important;
}

/* MAP SEARCH TOOLBAR & KP CONTROL */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  align-items: center;
}

.map-search-group {
  display: flex;
  flex: 1;
  min-width: 280px;
  gap: 8px;
}

.map-search-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.map-search-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.map-kp-select {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: white;
  color: var(--text-dark);
  cursor: pointer;
  outline: none;
  flex: 1;
  min-width: 220px;
}

.map-kp-select:focus {
  border-color: var(--primary-red);
}

/* PULSE ANIMATION FOR MAP SEARCH MARKER */
@keyframes mapPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    transform: scale(0.95);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(220, 38, 38, 0);
    transform: scale(1.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    transform: scale(0.95);
  }
}

.search-pulse-marker {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  animation: mapPulse 1.8s infinite;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.search-house-pulse-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #cc0d12, #990000);
  color: #ffcc00;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  animation: mapPulse 1.8s infinite;
  box-shadow: 0 4px 14px rgba(204, 13, 18, 0.5);
  font-size: 22px;
  cursor: pointer;
}

.flower-search-pulse-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #db2777, #be185d);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  animation: mapPulse 1.8s infinite;
  box-shadow: 0 4px 14px rgba(219, 39, 119, 0.5);
  font-size: 22px;
  cursor: pointer;
}

.kp-center-marker {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 20px;
  padding: 4px 10px;
  border: 2px solid white;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  cursor: pointer;
}


/* TABLES FOR MEMBERS */
.table-responsive {
  overflow-x: auto;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: var(--dark-red);
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 14px 16px;
  text-transform: uppercase;
  border: 1px solid #7f1d1d;
}

.custom-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}

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

.custom-table tbody tr:hover {
  background: #fef2f2;
}

.avatar-frame {
  width: 90px;
  height: 135px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #e2e8f0;
  display: block;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
}

.avatar-frame:hover {
  transform: scale(1.05);
}

.avatar-frame-3x4 {
  width: 75px;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  background: #e2e8f0;
  display: block;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
  transition: transform 0.2s ease;
}

.avatar-frame-3x4:hover {
  transform: scale(1.05);
}

/* ONLINE FEEDBOX FORM */
.feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .feedback-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group label .required {
  color: var(--primary-red);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #ffffff;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(204, 13, 18, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 180px;
}

.btn-submit {
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: white;
  font-weight: 700;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.1);
}

/* BUTTON UTILITIES */
.btn-primary {
  background: var(--primary-red);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--dark-red);
}

.btn-outline {
  background: transparent;
  color: var(--primary-red);
  border: 1.5px solid var(--primary-red);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-outline:hover {
  background: #fef2f2;
}

/* CATEGORY TABS */
.category-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: #e2e8f0;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary-red);
  color: white;
}

/* MODAL POPUP */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

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

@keyframes modalScale {
  from { transform: scale(0.9); }
  to { transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  background: var(--dark-red);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}

.close-modal-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

/* FOOTER */
.site-footer {
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 100%);
  color: white;
  padding: 36px 0 20px;
  border-top: 4px solid var(--gold);
}

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

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-info h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.footer-info p {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: #f3f4f6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1877f2;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-top: 10px;
  transition: transform 0.2s;
}

.social-link:hover {
  transform: translateY(-2px);
}

.footer-copyright {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.8rem;
  color: #9ca3af;
}

/* SEARCH INPUT */
.search-box {
  position: relative;
  width: 250px;
}

.search-box input {
  padding-right: 32px;
}

.search-box i {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ==========================================================================
   AUTHENTICATION & ROLE-BASED ACCESS CONTROL (RBAC) STYLES
   ========================================================================== */

.top-bar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.auth-badge-viewer {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.auth-badge-admin {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.btn-auth-login {
  background: linear-gradient(135deg, #eab308, #ca8a04);
  color: #1e293b;
  border: none;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-auth-login:hover {
  background: linear-gradient(135deg, #fde047, #eab308);
  transform: translateY(-1px);
}

.btn-auth-logout {
  background: rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-auth-logout:hover {
  background: rgba(239, 68, 68, 0.8);
  color: white;
  border-color: #ef4444;
}

/* SIMPLE LOGIN MODAL MATCHING WEBSITE PRIMARY COLOR SCHEME (ĐỎ & VÀNG MTTQ) */
.login-modal-card {
  max-width: 440px !important;
  border-radius: 24px !important;
  background: #ffffff;
  padding: 32px 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  border: 1px solid #fee2e2;
  text-align: center;
  position: relative;
}

.login-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-red);
  line-height: 1.35;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.login-card-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 500;
}

.simple-input {
  border-radius: 12px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  padding: 12px 16px !important;
  font-size: 0.95rem !important;
  color: #1e293b !important;
}

.simple-input:focus {
  border-color: var(--primary-red) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(204, 13, 18, 0.15) !important;
}

.btn-simple-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
  color: white;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(204, 13, 18, 0.3);
}

.btn-simple-login:hover {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(204, 13, 18, 0.4);
}

.simple-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.simple-divider::before, .simple-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.simple-divider span {
  padding: 0 12px;
}

.btn-simple-guest {
  width: 100%;
  background: #f8fafc;
  color: #334155;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-simple-guest:hover {
  background: #fef2f2;
  color: var(--primary-red);
  border-color: #fecdd3;
}

.login-modal-header {
  background: linear-gradient(135deg, var(--primary-red), #991b1b);
  color: white;
  padding: 16px 20px;
}

.login-modal-body {
  padding: 20px;
}

.login-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
  gap: 4px;
}

.login-tab-btn {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.login-tab-btn.active {
  background: white;
  color: var(--primary-red);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.login-tab-content {
  display: none;
}

.login-tab-content.active {
  display: block;
}

.login-tab-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 16px;
  background: #f8fafc;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--primary-red);
}

.viewer-submit-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1);
}

.viewer-submit-btn:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
}

.admin-submit-btn {
  background: linear-gradient(135deg, var(--primary-red), #991b1b);
}

.admin-submit-btn:hover {
  background: linear-gradient(135deg, #991b1b, #7f1d1d);
}

.login-error-msg {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecdd3;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 10px;
}

.credential-hint-box {
  margin-top: 20px;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  color: #92400e;
  line-height: 1.5;
}

.credential-hint-box i {
  font-size: 1.3rem;
  color: #f59e0b;
  margin-top: 2px;
}

.credential-hint-box code {
  background: #fef3c7;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: #78350f;
}

/* ADMIN CARD EDIT / DELETE CONTROLS */
.admin-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.btn-edit-news, .btn-delete-news {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.btn-edit-news {
  background: #0284c7;
  color: white;
}

.btn-delete-news {
  background: #dc2626;
  color: white;
}

.btn-edit-news:hover, .btn-delete-news:hover {
  opacity: 0.85;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE OPTIMIZATIONS (ĐIỆN THOẠI & MÁY TÍNH BẢNG)
   ========================================================================== */

/* MOBILE NAV TOGGLE & BACKDROP OVERLAY */
.mobile-nav-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--dark-red);
  color: white;
  border-bottom: 2px solid var(--gold);
}

.mobile-nav-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav-toggle {
  background: var(--gold);
  color: var(--dark-red);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.mobile-nav-toggle:active {
  transform: scale(0.96);
}

.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 992px) {
  .mobile-nav-header {
    display: flex;
  }

  .main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
  }

  .nav-container {
    padding: 0 !important;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    background: #7f1d1d;
    transition: max-height 0.35s cubic-bezier(0, 1, 0, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
  }

  .main-nav.nav-open .nav-list {
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 3px solid var(--gold);
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-link {
    padding: 14px 18px;
    font-size: 0.9rem;
    justify-content: space-between;
    width: 100%;
    border-right: none;
  }

  .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 100% !important;
    max-height: 0;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    background: #5c1414;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2) !important;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
  }

  .nav-item.open-mobile .dropdown-menu {
    max-height: 400px;
    padding: 6px 0;
  }

  .dropdown-menu li a {
    color: #fef2f2;
    padding: 12px 24px 12px 36px;
    font-size: 0.88rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  }

  .dropdown-menu li a:hover {
    background: rgba(255, 204, 0, 0.15);
    color: var(--gold);
    padding-left: 40px;
  }

  .nav-item.open-mobile .dropdown-icon {
    transform: rotate(180deg);
  }
}

@media (max-width: 768px) {
  /* Top Utility Bar on Mobile */
  .top-bar-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 4px 0;
  }

  .top-bar-info {
    font-size: 0.78rem;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .top-bar-info span {
    margin-right: 0;
  }

  .admin-toggle-btn {
    font-size: 0.8rem;
    padding: 6px 14px;
  }

  /* Header Banner */
  .header-banner {
    padding: 16px 0;
  }

  .banner-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .logo-img {
    width: 68px;
    height: 68px;
  }

  .header-titles h1 {
    font-size: 1.1rem;
    line-height: 1.35;
  }

  .header-titles h2 {
    font-size: 0.92rem;
  }

  /* Marquee Ticker on Mobile */
  .news-ticker .container {
    flex-wrap: wrap;
    gap: 6px !important;
  }

  .ticker-title {
    font-size: 0.75rem;
    padding: 3px 8px;
    margin-right: 4px;
  }

  .ticker-content {
    font-size: 0.82rem;
  }

  /* Main Wrapper Padding */
  .main-wrapper {
    padding: 16px 0 36px;
  }

  /* Section Header */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 10px;
  }

  .section-title-group h2 {
    font-size: 1.1rem;
  }

  .section-subtitle {
    font-size: 0.82rem;
  }

  .search-box {
    width: 100%;
  }

  /* Map Container & Map Toolbar */
  .map-container {
    height: 360px;
  }

  .map-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .map-search-group {
    width: 100%;
    min-width: 0;
    flex-direction: column;
  }

  .map-search-input, .map-kp-select {
    width: 100%;
    font-size: 16px !important;
  }

  /* 2-Column Grid to Single Column */
  .grid-2col {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Prevent auto-zoom on iOS Safari input focus */
  .form-control, input[type="text"], input[type="password"], input[type="number"], select, textarea {
    font-size: 16px !important;
  }

  /* Category Filter Tabs */
  .category-tabs {
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  /* Mobile Grid Containers */
  #news-grid-container,
  #kdc-grid-container,
  #ansinh-grid-container {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Table Touch Scroll & Responsive Padding */
  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y;
    border-radius: var(--radius-md);
  }

  .custom-table th, .custom-table td {
    padding: 10px 10px !important;
    font-size: 0.84rem !important;
  }

  .avatar-frame {
    width: 70px;
    height: 105px;
  }

  .avatar-frame-3x4 {
    width: 60px;
    height: 90px;
  }

  /* Modals Mobile Sizing & Touch Scroll */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  .modal-body {
    padding: 12px 4px !important;
    max-height: calc(90vh - 75px);
    overflow-y: auto;
  }

  /* Stack modal form grid fields vertically */
  .modal-body form div[style*="grid-template-columns"],
  .modal-body div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .login-modal-card {
    padding: 24px 16px;
    width: 92vw;
  }

  /* Stat Boxes on Mobile: 2-column compact grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat-box {
    padding: 12px 10px !important;
    gap: 10px !important;
  }

  .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    border-radius: 10px !important;
  }

  .stat-num {
    font-size: 1.15rem !important;
  }

  .stat-label {
    font-size: 0.72rem !important;
    line-height: 1.2;
  }

  /* Leaflet Map Popups on Mobile */
  .leaflet-popup-content-wrapper {
    padding: 4px !important;
  }
  .leaflet-popup-content div[style*="width: 250px"],
  .leaflet-popup-content div[style*="width: 230px"] {
    width: 210px !important;
  }
}

@media (max-width: 480px) {
  .map-container {
    height: 310px;
  }

  #modal-preview-map {
    height: 220px !important;
  }

  .header-titles h1 {
    font-size: 0.96rem;
  }

  .header-titles h2 {
    font-size: 0.8rem;
  }

  .btn-submit, .btn-primary {
    font-size: 0.82rem;
    padding: 10px 14px;
    width: 100%;
    justify-content: center;
  }

  .top-bar-auth {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Featured Article Overlay text on small screens */
  .featured-img-container {
    height: 280px;
  }

  .featured-overlay {
    padding: 16px 12px 12px;
  }

  .featured-title {
    font-size: 1.05rem;
    line-height: 1.35;
  }
}

/* Touch & Smooth Mobile Scroll Enhancements */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  overflow-x: hidden;
}

/* ARTICLE DETAIL CONTENT & VISUAL WYSIWYG EDITOR STYLING */
#article-detail-content p,
.article-detail-body p,
.page-section p {
  margin-bottom: 16px;
  text-indent: 2em;
  text-align: justify;
  line-height: 1.8;
}

.rich-editor-visual {
  min-height: 180px;
  max-height: 450px;
  overflow-y: auto;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 6px 6px;
  background: #ffffff;
  font-size: 0.98rem;
  line-height: 1.8;
  color: #1e293b;
  outline: none;
}

.rich-editor-visual:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(204, 13, 18, 0.15);
}

/* UNIFIED WYSIWYG EDITOR & ARTICLE DETAIL BODY STYLES */
.rich-editor-visual,
.article-body-content,
.article-detail-body {
  font-size: 1.02rem;
  line-height: 1.85;
  color: #334155;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.rich-editor-visual::after,
.article-body-content::after,
.article-detail-body::after {
  content: "";
  display: table;
  clear: both;
}

.rich-editor-visual p,
.article-body-content p,
.article-detail-body p {
  margin-bottom: 14px;
  line-height: 1.85;
}

/* FIGURE & IMAGE ALIGNMENT STANDARDS */
#article-detail-content figure,
.article-body-content figure,
.article-detail-body figure,
.rich-editor-visual figure {
  margin: 20px 0;
  clear: both;
}

/* Center aligned figure */
#article-detail-content figure.align-center,
.article-body-content figure.align-center,
.article-detail-body figure.align-center,
.rich-editor-visual figure.align-center {
  margin: 24px auto;
  text-align: center;
  width: 100%;
  clear: both;
}

/* Left floated figure */
#article-detail-content figure.align-left,
.article-body-content figure.align-left,
.article-detail-body figure.align-left,
.rich-editor-visual figure.align-left {
  float: left;
  max-width: 48%;
  margin: 8px 20px 14px 0;
  text-align: center;
}

/* Right floated figure */
#article-detail-content figure.align-right,
.article-body-content figure.align-right,
.article-detail-body figure.align-right,
.rich-editor-visual figure.align-right {
  float: right;
  max-width: 48%;
  margin: 8px 0 14px 20px;
  text-align: center;
}

/* RESET FIGURE FLOATS ON MOBILE SCREENS */
@media (max-width: 768px) {
  #article-detail-content figure.align-left,
  #article-detail-content figure.align-right,
  .article-body-content figure.align-left,
  .article-body-content figure.align-right,
  .article-detail-body figure.align-left,
  .article-detail-body figure.align-right {
    float: none !important;
    max-width: 100% !important;
    margin: 16px 0 !important;
    display: block !important;
  }
}

/* Unified image styling */
#article-detail-content figure img,
#article-detail-content img.article-cover-img,
.article-body-content figure img,
.article-body-content img,
.article-detail-body img,
.rich-editor-visual figure img,
.rich-editor-visual img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#article-detail-content figure img:hover,
#article-detail-content img.article-cover-img:hover,
.article-body-content figure img:hover,
.article-detail-body img:hover,
.rich-editor-visual figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Caption styling */
#article-detail-content figcaption,
.article-body-content figcaption,
.article-detail-body figcaption,
.rich-editor-visual figcaption {
  font-size: 0.88rem;
  color: #64748b;
  margin-top: 8px;
  font-style: italic;
  text-align: center;
  font-weight: 500;
}

/* LEAFLET MAP LAYER CONTROL STYLING */
.leaflet-control-layers {
  border-radius: 8px !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
  border: 1px solid #cbd5e1 !important;
  padding: 6px 10px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(4px);
  font-family: inherit !important;
}

.leaflet-control-layers-expanded {
  padding: 10px 14px !important;
}

.leaflet-control-layers-base label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin-bottom: 6px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.leaflet-control-layers-base label input {
  cursor: pointer;
}

/* MOBILE PERFORMANCE & TOUCH OPTIMIZATIONS FOR LEAFLET MAPS */
@media (max-width: 768px) {
  .map-container {
    height: 400px !important;
    border-radius: 10px;
    touch-action: pan-x pan-y;
  }
  
  .map-toolbar {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }
  
  .map-search-group {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  
  .map-search-input {
    width: 100%;
    min-height: 42px;
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .map-kp-select {
    width: 100%;
    min-height: 42px;
    font-size: 0.85rem;
    padding: 8px 12px;
  }

  .map-toolbar .btn-primary {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    font-size: 0.85rem;
  }

  .kp-boundary-badge-icon div {
    font-size: 0.65rem !important;
    padding: 2px 5px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25) !important;
  }
}
}

/* Live Address Autocomplete Dropdown (Google Maps style) */
.address-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 2px;
}

.address-suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  transition: background 0.15s ease;
}

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

.address-suggestion-item:hover, .address-suggestion-item:active {
  background: #f0f9ff;
  color: #0284c7;
}

.address-suggestion-item i {
  color: #0284c7;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}
