﻿/* ═══════════════════════════════════════════
   HỆ THỐNG BIỂU QUYẾT ĐIỆN TỬ – XÃ NÚA NGAM
   UI 4.0 — Cyber-Gov Design System
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800&family=Rajdhani:wght@400;500;600;700&family=Noto+Serif:ital,wght@0,400;1,400&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --red:        #e53935;
  --red2:       #b71c1c;
  --red-glow:   rgba(229, 57, 53, 0.35);
  --red-soft:   rgba(229, 57, 53, 0.12);
  --gold:       #ffd740;
  --gold2:      #ffab00;
  --gold-glow:  rgba(255, 215, 64, 0.3);
  --gold-soft:  rgba(255, 215, 64, 0.1);
  --cyan:       #00e5ff;
  --cyan-glow:  rgba(0, 229, 255, 0.25);
  --cyan-soft:  rgba(0, 229, 255, 0.08);
  --green:      #00e676;
  --green-glow: rgba(0, 230, 118, 0.25);
  --green-soft: rgba(0, 230, 118, 0.1);

  --bg:         #060a10;
  --bg2:        #0c1220;
  --bg3:        #111827;
  --panel:      rgba(12, 18, 32, 0.85);
  --sidebar-bg: rgba(5, 8, 14, 0.97);
  --glass:      rgba(255, 255, 255, 0.06);
  --glass2:     rgba(255, 255, 255, 0.10);
  --border:     rgba(255, 255, 255, 0.10);
  --border2:    rgba(0, 229, 255, 0.2);
  --text:       #e8eaf6;
  --text1:      #c8d0e0;
  --text2:      #b0bec5;
  --muted:      #7a8fa6;
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  
  --sidebar-w:  210px;
  
  --font-body:  'Exo 2', sans-serif;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;

  /* ── Sidebar tokens (dark mode) ── */
  --sidebar-bg:       rgba(5, 8, 14, 0.97);
  --sidebar-border:   rgba(0, 229, 255, 0.13);
  --sidebar-hover:    rgba(0, 229, 255, 0.07);
  --sidebar-active-bg:rgba(0, 229, 255, 0.12);
  --sidebar-scroll:   rgba(0, 229, 255, 0.2);
  --sidebar-bq-bg:    rgba(229, 57, 53, 0.1);
  --sidebar-gb-bg:    rgba(100, 160, 255, 0.1);
  --sidebar-hs-bg:    rgba(80, 200, 140, 0.1);
  --sidebar-tt-bg:    rgba(180, 130, 255, 0.1);
  --sidebar-ql-bg:    rgba(255, 215, 64, 0.1);

  /* ── Topbar tokens (dark mode) ── */
  --topbar-bg:        rgba(6, 10, 16, 0.92);
  --topbar-border:    rgba(0, 229, 255, 0.12);

  /* ── Panel tokens ── */
  --panel-title:       var(--cyan);
  --panel-badge-color: var(--cyan);
  --panel-badge-border:rgba(0, 229, 255, 0.2);
  --stat-border:       var(--border);
  --stat-label:        var(--muted);
  --ktxh-title:        var(--gold);
  --ktxh-kpi-color:    var(--gold);
}

/* ── LIGHT MODE OVERRIDES ── */
.light-mode {
  --bg:         #edf0f5;
  --bg2:        #ffffff;
  --bg3:        #dde3ee;
  --panel:      rgba(255, 255, 255, 0.98);
  --glass:      rgba(0, 0, 0, 0.04);
  --glass2:     rgba(0, 0, 0, 0.08);
  --border:     rgba(0, 0, 0, 0.15);
  --border2:    rgba(196, 30, 58, 0.35);
  --text:       #111827;
  --text1:      #1e3a5f;
  --text2:      #374151;
  --muted:      #4b5563;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.12);

  /* ── Sidebar tokens (light mode) ── */
  --sidebar-bg:        #ffffff;
  --sidebar-border:    rgba(0, 0, 0, 0.12);
  --sidebar-hover:     rgba(229, 57, 53, 0.07);
  --sidebar-active-bg: rgba(229, 57, 53, 0.10);
  --sidebar-scroll:    rgba(229, 57, 53, 0.25);
  --sidebar-bq-bg:     rgba(229, 57, 53, 0.10);
  --sidebar-gb-bg:     rgba(100, 160, 255, 0.08);
  --sidebar-hs-bg:     rgba(80, 200, 140, 0.08);
  --sidebar-tt-bg:     rgba(180, 130, 255, 0.08);
  --sidebar-ql-bg:     rgba(180, 120, 0, 0.08);

  /* ── Topbar tokens (light mode) ── */
  --topbar-bg:        rgba(255, 255, 255, 0.97);
  --topbar-border:    rgba(229, 57, 53, 0.20);

  /* ── Panel tokens (light mode – high contrast) ── */
  --panel-title:        #b71c1c;
  --panel-badge-color:  #1565c0;
  --panel-badge-border: rgba(21, 101, 192, 0.3);
  --stat-border:        rgba(0, 0, 0, 0.18);
  --stat-label:         #374151;
  --ktxh-title:         #b45309;
  --ktxh-kpi-color:     #b45309;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ── SIDEBAR ── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
}

.sidebar-logo {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.sidebar-logo img { height: 60px; filter: drop-shadow(0 0 8px var(--red-glow)); }

.sidebar-logo-text {
  margin-top: 0.5rem; font-family: var(--font-head);
  font-weight: 700; color: var(--text); font-size: 0.9rem;
}

.side-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.75rem 1.25rem; margin: 0.2rem 0.6rem;
  border-radius: 10px; border: none; background: transparent;
  color: var(--text2); font-family: var(--font-head);
  font-weight: 600; cursor: pointer; transition: all 0.2s;
}

.side-item:hover { background: var(--glass2); color: var(--text); }

.side-item.active {
  background: var(--red-soft); color: var(--red);
  box-shadow: inset 3px 0 0 var(--red);
}

#topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 100;
  height: 52px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; backdrop-filter: blur(16px);
  transition: left 0.3s;
  
}

/* ── DASHBOARD GRID ── */
.dash-root {
  margin-left: var(--sidebar-w);
  margin-top: 52px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.5rem;
}

.panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-head {
  padding: 1rem; background: var(--glass);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between;
}

.stat-mini-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1rem; border-radius: 12px;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-card);
}

.smv { font-size: 1.5rem; font-weight: 800; font-family: var(--font-head); }

/* ── UI UTILS ── */
.theme-switch {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  width: 45px; height: 45px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border2);
  cursor: pointer; box-shadow: var(--shadow-card);
}

/* Responsive */
@media (max-width: 700px) {
  :root { --sidebar-w: 60px; }
  .si-label, .sidebar-logo-text { display: none; }
  #topbar, .dash-root { left: 60px; margin-left: 60px; }
}


body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.6;
}

/* ── ANIMATED BACKGROUND ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(229,57,53,0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(0,229,255,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(255,215,64,0.04) 0%, transparent 60%);
}

/* Grid pattern overlay */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,229,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 8s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

body > * { position: relative; z-index: 1; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--red2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ── LOADING OVERLAY ── */
#loadingOverlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6, 10, 16, 0.96);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s;
}
#loadingOverlay.fade-out { opacity: 0; pointer-events: none; }

.spinner-ring {
  width: 64px; height: 64px;
  border: 2px solid rgba(229,57,53,0.15);
  border-top-color: var(--red);
  border-right-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loadingMsg {
  margin-top: 1.25rem;
  font-family: var(--font-head);
  font-size: .8rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cyan);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:.4;} }

/* ── THEME TOGGLE ── */
.theme-switch {
  position: fixed; bottom: 9px; left: 127px; z-index: 1000;
  width: 44px; height: 44px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 0 16px rgba(0,229,255,0.2);
  transition: all .3s;
}
.theme-switch:hover {
  box-shadow: 0 0 24px rgba(0,229,255,0.4);
  transform: scale(1.1);
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; right: 20px; z-index: 9500;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-md);
  padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: .65rem;
  font-size: .82rem; font-family: var(--font-head); letter-spacing: .05em;
  transform: translateY(60px); opacity: 0;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  box-shadow: var(--shadow-glow);
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { font-size: 1.1rem; }

/* ════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════ */
#loginPage {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
/* 1. Khung chứa chính */
.login-card {
  width: 100%; 
  max-width: 420px;
  background: var(--bg2); 
  border-radius: var(--r-xl);
  padding: 3rem 2.5rem;
  backdrop-filter: blur(24px);
  
  position: relative;  /* Gốc tọa độ cho 2 lớp giả */
  overflow: hidden;    /* BẮT BUỘC: Để ánh sáng không tràn ra ngoài form */
  z-index: 1;
  border: none; 
}

/* 2. Lớp tạo dải màu xoay (Nằm dưới cùng) */
.login-card::before {
  content: '';
  position: absolute;
  width: 200%; /* Tăng lên 200% để phủ kín mọi góc khi xoay */
  height: 200%;
  top: 50%;
  left: 50%;
  /* Quan trọng: Phải có animation ở đây */
  animation: rotateBorder 4s linear infinite;
  background: conic-gradient(
    transparent, 
    var(--cyan), 
    var(--red), 
    var(--gold), 
    transparent 40%
  );
  z-index: -2; /* Nằm dưới lớp after */
}

/* 3. Lớp mặt nạ (Che phần giữa, chỉ chừa lại viền) */
.login-card::after {
  content: '';
  position: absolute;
  inset: 2px; /* Độ dày viền ánh sáng là 2px */
  background: var(--bg2); /* Trùng màu nền form */
  border-radius: calc(var(--r-xl) - 2px);
  z-index: -1; /* Nằm trên lớp before nhưng dưới nội dung form */
}

/* 4. Định nghĩa chuyển động xoay */
@keyframes rotateBorder {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(40px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes scanLine {
  0%  { background-position: -200% 0; }
  100%{ background-position: 200% 0; }
}



.login-emblem { text-align: center; margin-bottom: 2.5rem; }
.login-emblem img {
  width: 80px; height: 80px; object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(229,57,53,0.5));
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.login-emblem h1 {
  font-family: var(--font-head);
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: .25em; text-transform: uppercase;
  color: var(--text); margin-top: 1rem;
}
.login-emblem h2 {
  font-size: .72rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
  margin-top: .3rem;
}

.divider-gold {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto 0;
}

/* Login fields */
.field { position: relative; margin-bottom: 1rem; }
.field input {
  width: 100%; padding: .9rem 1.1rem .9rem 3.2rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  transition: all .25s;
}
.field input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft), inset 0 0 12px rgba(229,57,53,0.05);
  background: var(--glass);
}
.field input::placeholder { color: var(--text2); font-size: .85rem; }
.inp::placeholder { color: var(--text2); }
.field-icon {
  position: absolute; left: 1.1rem; top: 50%;
  transform: translateY(-50%); color: var(--muted); font-size: 1rem;
  pointer-events: none;
}

.btn-login {
  width: 100%; padding: 1rem;
  background: linear-gradient(135deg, var(--red2) 0%, var(--red) 50%, #f44336 100%);
  color: #fff; border: none;
  border-radius: var(--r-md);
  font-family: var(--font-head);
  font-size: .95rem; font-weight: 700;
  letter-spacing: .25em; text-transform: uppercase;
  cursor: pointer;
  transition: all .3s;
  position: relative; overflow: hidden;
  margin-top: .5rem;
  box-shadow: 0 4px 20px var(--red-glow);
}
.btn-login::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform .5s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 6px 30px var(--red-glow); }
.btn-login:hover::after { transform: translateX(100%); }
.btn-login:active { transform: translateY(0); }

/* ════════════════════════════════════════
   TOP BAR
   ════════════════════════════════════════ */
#topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(229,57,53,0.3);
  padding: .75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

/* Red accent line at top */
#topbar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--red2), var(--red), var(--gold), var(--red), var(--red2));
  background-size: 200% 100%;
  animation: topbarFlow 4s linear infinite;
}
@keyframes topbarFlow {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.topbar-brand {
  display: flex; align-items: center; gap: .85rem;
  min-width: 0; flex: 1;
}
.topbar-brand img {
  width: 38px; height: 38px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(229,57,53,0.5));
}
.topbar-brand span {
  font-family: var(--font-head);
  font-size: .85rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-right {
  display: flex; align-items: center; gap: .65rem; flex-shrink: 0;
}

#userBadge {
  font-family: var(--font-head);
  font-size: .75rem; letter-spacing: .08em;
  color: var(--cyan); padding: .35rem .75rem;
  background: var(--cyan-soft);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 20px;
  white-space: nowrap;
}

/* ════════════════════════════════════════
   MAIN LAYOUT
   ════════════════════════════════════════ */
.main-wrap {
  max-width: 1200px;
margin-top: -43px;
  
  padding: 2rem 1.25rem 5rem;
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex; gap: .4rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: .35rem;
  border-radius: var(--r-lg);
  width: fit-content;
  margin-bottom: 2rem;
  margin-top: 75px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.tab-btn {
  padding: .6rem 1.3rem;
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  transition: all .25s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: var(--glass2); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--red2), var(--red));
  color: #fff;
  box-shadow: 0 2px 12px var(--red-glow);
}

.tab-panel { display: none; animation: fadeSlide .35s ease; }
.tab-panel.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════
   GLASS CARD
   ════════════════════════════════════════ */
.glass-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: box-shadow .3s;
  position: relative;
	height: 78vh;
}
.glass-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}
.glass-card:hover { box-shadow: var(--shadow-card), 0 0 0 1px rgba(229,57,53,0.15); }

.card-head {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--glass);
}
.card-head h3 {
  font-family: var(--font-head);
  font-size: .78rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold);
}
.card-body { padding: 1.5rem; }

/* ════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════ */
.inp {
  width: 100%;
  padding: .78rem 1rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);

  font-family: var(--font-body);
  font-size: .88rem;
  margin-bottom: .85rem;
  outline: none;
  transition: all .25s;
}

.inp:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
  background: var(--glass);
}
.inp::placeholder { color: var(--text2); }

textarea.inp { resize: vertical; min-height: 80px; }

.label {
  font-family: var(--font-head);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text2);
  margin-bottom: .4rem; display: block;
}

/* ── GRIDS ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

@media (max-width: 700px) {
  .g2, .g3 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.btn {
  padding: .75rem 1.5rem;
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  font-family: var(--font-head);
  font-size: .82rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  transition: all .25s;
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s;
}
.btn:hover::after { transform: scaleX(1); }
.btn:active { transform: scale(.98); }

.btn-red {
  background: linear-gradient(135deg, var(--red2), var(--red));
  color: #fff;
  box-shadow: 0 4px 16px var(--red-glow);
}
.btn-red:hover { box-shadow: 0 6px 24px var(--red-glow); transform: translateY(-1px); }

.btn-green {
  background: linear-gradient(135deg, #1b5e20, var(--green));
  color: #e8f5e9;
  box-shadow: 0 4px 16px var(--green-glow);
}
.btn-green:hover { box-shadow: 0 6px 24px var(--green-glow); transform: translateY(-1px); }

.btn-gold {
  background: linear-gradient(135deg, #e65100, var(--gold));
  color: #1a0f00;
  box-shadow: 0 4px 16px var(--gold-glow);
}
.btn-gold:hover { box-shadow: 0 6px 24px var(--gold-glow); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-outline:hover { background: var(--glass2); color: var(--text); }

.btn-full { width: 100%; display: block; }
.btn-xs   { padding: .3rem .65rem; font-size: .65rem; }

.btn-sm-out {
  padding: .38rem .9rem;
  border-radius: var(--r-sm);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-head);
  transition: all .2s; border: 1px solid;
}
.btn-ghost {
  background: rgba(255,215,64,0.1);
  color: var(--gold2);
  border-color: rgba(255,215,64,0.3);
}
.btn-ghost:hover { background: rgba(255,215,64,0.2); }

.btn-danger-out {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(229,57,53,0.35);
}
.btn-danger-out:hover { background: var(--red); color: #fff; }
/* Thiết kế nút bấm hiện đại UI 4.0 */
.btn-cyber {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-family: var(--font-head); /* Sử dụng font Rajdhani đã có của anh */
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red2) 0%, var(--red) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
  text-decoration: none;
  outline: none;
}

/* Hiệu ứng quét tia sáng khi Hover */
.btn-cyber::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn-cyber:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--red-glow);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-cyber:hover::before {
  left: 100%;
}

.btn-cyber:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(229, 57, 53, 0.5);
}

/* Biến thể màu Xanh Cyan cho các chức năng khác */
.btn-cyber-cyan {
  background: linear-gradient(135deg, #00b8d4 0%, #00e5ff 100%);
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.btn-cyber-cyan:hover {
  box-shadow: 0 8px 25px rgba(0, 229, 255, 0.4);
}

/* ── PULSE animation ── */
.pulse { animation: pulseGlow 2.5s infinite; }
@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 var(--red-glow); }
  60%  { box-shadow: 0 0 0 12px rgba(229,57,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(229,57,53,0); }
}

/* ════════════════════════════════════════
   BADGES
   ════════════════════════════════════════ */
.badge {
  display: inline-block;
  padding: .22rem .65rem;
  border-radius: 20px;
  font-family: var(--font-head);
  font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}
.badge-red   { background: var(--red-soft); color: #ef9a9a; border: 1px solid rgba(229,57,53,0.3); }
.badge-green { background: var(--green-soft); color: #a5d6a7; border: 1px solid rgba(0,230,118,0.3); }
.badge-gold  { background: var(--gold-soft); color: #ffe082; border: 1px solid rgba(255,215,64,0.3); }
.badge-blue  { background: var(--cyan-soft); color: #80deea; border: 1px solid rgba(0,229,255,0.3); }

/* ════════════════════════════════════════
   TABLE
   ════════════════════════════════════════ */
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: .82rem; font-family: var(--font-body);
}
.tbl th {
  padding: .75rem 1rem;
  font-family: var(--font-head);
  font-size: .65rem; text-transform: uppercase; letter-spacing: .15em;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  text-align: left;
  background: var(--glass);
}
.tbl td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  transition: background .15s;
}
.tbl tr:hover td { background: var(--glass); color: var(--text); }
.tbl tr:last-child td { border-bottom: none; }

.scroll-box { max-height: 300px; overflow-y: auto; }

/* ════════════════════════════════════════
   STAT CARDS
   ════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 600px;max-height:400px) {
  .stat-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  position: relative; overflow: hidden;
  transition: all .3s;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}
.stat-card::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transform: scaleX(0);
  transition: transform .4s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card:hover::before { transform: scaleX(1); }

.stat-card .num {
  font-family: var(--font-head);
  font-size: 2.5rem; font-weight: 800;
  line-height: 1;
  background: linear-gradient(180deg, #fff 20%, rgba(255,255,255,0.5) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-card .lbl {
  font-family: var(--font-head);
  font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text2);
  margin-top: .5rem;
}

/* ════════════════════════════════════════
   CHECKLIST / FILE ZONE
   ════════════════════════════════════════ */
.checklist-wrap {
  max-height: 220px; overflow-y: auto;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .4rem;
}
.check-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem; border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s;
  font-size: .85rem;
}
.check-item:hover { background: var(--glass2); }
.check-item input[type=checkbox] { accent-color: var(--red); width: 14px; height: 14px; }

.file-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--r-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  margin-bottom: 1rem;
  font-size: .8rem; color: var(--text2);
  background: var(--glass);
}
.file-zone:hover {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--text);
}
.file-zone input { display: none; }
#file-names { font-size: .72rem; color: var(--gold); margin-top: .5rem; }

/* ════════════════════════════════════════
   POLL CARD (user view)
   ════════════════════════════════════════ */
.poll-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--r-md);
  padding: 1.5rem;
  animation: fadeSlide .35s ease;
}
.poll-card h4 {
  font-family: var(--font-head);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text);
  margin-bottom: .4rem;
}
.poll-card .meta {
  font-size: .75rem; color: var(--text2);
  font-family: var(--font-head); letter-spacing: .05em;
  margin-bottom: .75rem;
}

.file-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--cyan-soft);
  border: 1px solid rgba(0,229,255,0.2);
  color: var(--cyan);
  padding: .3rem .85rem;
  border-radius: 20px;
  font-family: var(--font-head);
  font-size: .7rem; font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  margin: .25rem .15rem;
}
.file-chip:hover { background: rgba(0,229,255,0.2); transform: translateY(-1px); }

/* ════════════════════════════════════════
   VOTE OPTIONS
   ════════════════════════════════════════ */
.vote-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: .75rem;
  margin: .85rem 0;
}
@media (max-width: 480px) {
  .vote-group { grid-template-columns: 1fr; }
}

.vote-opt { display: none; }

.vote-label {
  display: flex; flex-direction: column;
  align-items: center; gap: .5rem;
  padding: 1.25rem .75rem;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all .25s;
  text-align: center;
  font-family: var(--font-head);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text2);
  background: var(--glass);
}
.vote-label:hover {
  border-color: rgba(255,255,255,0.2);
  background: var(--glass2);
  color: var(--text);
  transform: translateY(-2px);
}
.vote-label .icon { font-size: 1.75rem; }

#opt1:checked + .vote-label {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
  box-shadow: 0 0 20px var(--green-glow), inset 0 0 12px rgba(0,230,118,0.05);
}
#opt2:checked + .vote-label {
  border-color: var(--red);
  background: var(--red-soft);
  color: #ef9a9a;
  box-shadow: 0 0 20px var(--red-glow), inset 0 0 12px rgba(229,57,53,0.05);
}
#opt3:checked + .vote-label {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: 0 0 20px var(--gold-glow), inset 0 0 12px rgba(255,215,64,0.05);
}

/* ════════════════════════════════════════
   MODAL
   ════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal-bg.open { display: flex; }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl);
  padding: 2rem;
  width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  animation: modalPop .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(.9); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-box h4 {
  font-family: var(--font-head);
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: .1em; margin-bottom: 1.25rem;
  color: var(--gold);
}
.modal-actions {
  display: flex; gap: .75rem; margin-top: 1rem;
}

/* ════════════════════════════════════════
   REPORT PRINT AREA
   ════════════════════════════════════════ */
#report-content {
  background: white; color: #111;
  padding: 2.5rem; border-radius: var(--r-lg);
  display: none;
  font-family: var(--font-serif);
}
#report-content.show { display: block; }

/* ════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════ */
@media print {
  body { background: white !important; }
  body::before, body::after { display: none; }
  #topbar, #loadingOverlay, .no-print, button, .theme-switch { display: none !important; }
  body * { visibility: hidden; }
  #printable-area, #printable-area * { visibility: visible; }
  #printable-area {
    position: absolute; left: 0; top: 0;
    width: 100%; margin: 0; padding: 0;
  }
  .no-print { display: none !important; }
}

/* ════════════════════════════════════════
   RESPONSIVE TOPBAR
   ════════════════════════════════════════ */
@media (max-width: 600px) {
  .topbar-brand span { font-size: .72rem; letter-spacing: .06em; }
  #userBadge { display: none; }
  .btn-sm-out { padding: .32rem .65rem; font-size: .65rem; }
  .main-wrap { padding: 1.25rem .85rem 5rem; }
  .card-body { padding: 1.1rem; }
  .card-head { padding: .85rem 1.1rem; }
  .login-card { padding: 2rem 1.5rem; }
  .login-emblem img { width: 64px; height: 64px; }
  .stat-card .num { font-size: 2rem; }
  .tab-bar { 
    width: 100%;
    overflow-x: auto;
    border-radius: var(--r-md);
    flex-wrap: nowrap;
  }
  .tab-btn { font-size: .72rem; padding: .5rem .9rem; }
  .glass-card { border-radius: var(--r-md); }
}

/* ════════════════════════════════════════
   MICRO DETAILS
   ════════════════════════════════════════ */

/* Animated number highlight */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.stat-card .num { animation: countUp .5s ease forwards; }

/* Glowing border on hover for table rows */
.tbl tbody tr:hover td:first-child {
  border-left: 2px solid var(--red);
}

/* Input select styling */
select.inp {
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23546e7a'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Checkbox accent */
input[type="checkbox"] { accent-color: var(--red); }

/* ── LIGHT MODE OVERRIDES ── */
body.light-mode::before {
  background:
    radial-gradient(ellipse 70% 50% at 15% 0%, rgba(229,57,53,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(0,120,180,0.04) 0%, transparent 55%);
}
body.light-mode::after {
  background-image:
    linear-gradient(rgba(229,57,53,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229,57,53,0.04) 1px, transparent 1px);
}
.light-mode .login-card { box-shadow: 0 8px 48px rgba(229,57,53,0.12), 0 2px 16px rgba(0,0,0,0.08); }
.light-mode #topbar { background: var(--topbar-bg); border-color: var(--topbar-border); }
.light-mode .mode-tabs { background: rgba(255,255,255,0.97); border-bottom-color: rgba(229,57,53,0.15); }
.light-mode .mode-tab { color: #374151; }
.light-mode .mode-tab.active { color: var(--red2); border-bottom-color: var(--red2); }
.light-mode .topbar-brand span { color: #111827; font-weight: 800; }
.light-mode #userBadge { color: #b45309; }
.light-mode .card-head h3 { color: var(--red2); }
.light-mode .stat-card .num {
  background: linear-gradient(180deg, var(--red2) 0%, var(--red) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.light-mode .theme-switch { box-shadow: 0 0 16px rgba(229,57,53,0.15); }
.light-mode .theme-switch:hover { box-shadow: 0 0 24px rgba(229,57,53,0.3); }
.light-mode #loadingOverlay { background: rgba(237,240,245,0.97); }
.light-mode #loadingMsg { color: var(--red2); }
.light-mode .toast { background: #fff; border-color: rgba(229,57,53,0.25); }
.light-mode #gb-panel { background: var(--bg); }

/* Sidebar light mode */
.light-mode #sidebar { box-shadow: 2px 0 16px rgba(0,0,0,0.08); }
.light-mode .side-item { color: #374151; }
.light-mode .side-item:hover { color: #111827; }
.light-mode .side-item.active { color: var(--red2); background: rgba(229,57,53,0.10); box-shadow: inset 3px 0 0 var(--red2); }
.light-mode .side-item.si-bq:hover, .light-mode .side-item.si-bq.active { color: var(--red2); }
.light-mode .sidebar-logo-text { color: #111827; }

/* Stat mini cards light mode */
.light-mode .stat-mini-card { background: #fff; border: 1px solid rgba(0,0,0,0.15); }
.light-mode .stat-mini-card .sml { color: #4b5563; }
.light-mode .smv.total-c { color: #1565c0; }
.light-mode .smv.done-c  { color: #15803d; }
.light-mode .smv.partial-c { color: #b45309; }
.light-mode .smv.overdue-c { color: #b91c1c; }

/* Panel light mode */
.light-mode .panel { background: #fff; border-color: rgba(0,0,0,0.12); }
.light-mode .panel-head { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.10); }
.light-mode .panel-head h3 { color: #b71c1c; }
.light-mode .panel-badge { background: rgba(21,101,192,0.10); color: #1565c0; border-color: rgba(21,101,192,0.25); }
.light-mode .meeting-day { color: #b45309; }
.light-mode .task-name, .light-mode .meeting-title { color: #111827; }
.light-mode .task-meta, .light-mode .meeting-meta { color: #4b5563; }
.light-mode .meeting-date-box { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.12); }
.light-mode .progress-bar { background: rgba(0,0,0,0.10); }

/* KT-XH panel light mode */
.light-mode .ktxh-panel { background: #fff; border-color: rgba(0,0,0,0.12); }
.light-mode .ktxh-head { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.10); }
.light-mode .ktxh-head h3 { color: #b45309; }
.light-mode .ktxh-kpi { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.10); }
.light-mode .ktxh-kpi-val { color: #b45309; }
.light-mode .ktxh-kpi-lbl { color: #4b5563; }
.light-mode .ktxh-tab { color: #4b5563; border-color: rgba(0,0,0,0.15); }
.light-mode .ktxh-tab.active { background: rgba(180,83,9,0.10); color: #b45309; border-color: rgba(180,83,9,0.30); }
.light-mode .ktxh-row-lbl { color: #111827; }
.light-mode .ktxh-row-bar { background: rgba(0,0,0,0.10); }

/* Fn buttons light mode */
.light-mode .fn-btn { background: #fff; border-color: rgba(0,0,0,0.14); }
.light-mode .fn-label { color: #111827; }
.light-mode .fn-sub { color: #4b5563; }
.light-mode .fn-btn:hover { background: #f8fafc; }

/* Map section light mode */
.light-mode .map-section { background: #f1f5f9; border-color: rgba(0,0,0,0.15); }


/* ════════════════════════════════════════
   DASHBOARD LAYOUT (chuyển từ dashboard.html)
   ════════════════════════════════════════ */

/* ── TOPBAR (dashboard) ── */
#topbar {
    position: fixed;
	top: 0; left: var(--sidebar-w); right: 0; z-index: 100;
    height: 52px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.25rem;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    backdrop-filter: blur(16px);
}
.topbar-brand { display: flex; align-items: center; gap: .65rem; }
.topbar-brand img { height: 28px; filter: drop-shadow(0 0 6px rgba(229,57,53,.5)); }
.topbar-brand span {
    font-family: var(--font-head); font-size: .78rem; font-weight: 700;
    letter-spacing: .10em; text-transform: uppercase; color: var(--text);
}
.topbar-right { display: flex; align-items: center; gap: .75rem; }
#userBadge {
    font-family: var(--font-head); font-size: .72rem; color: var(--gold);
    letter-spacing: .05em; white-space: nowrap;
}

/* ── SIDEBAR (dashboard) ── */
#sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    backdrop-filter: blur(20px);
    transition: background 0.3s, border-color 0.3s;
}
.sidebar-logo {
    display: flex; flex-direction: column; align-items: center;
    padding: 1.2rem .75rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    gap: .5rem;
}
.sidebar-logo img {
    height: 79px; filter: drop-shadow(0 0 8px rgba(229,57,53,.55));
}
.sidebar-logo-text {
    font-family: var(--font-head); font-size: .8rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--text); text-align: center; line-height: 1.5;
}
.sidebar-nav {
    flex: 1; overflow-y: auto; padding: .6rem 0;
    display: flex; flex-direction: column; gap: .2rem;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-scroll); border-radius: 4px; }

.side-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .65rem 1rem;
    margin: 0 .5rem; border-radius: 10px;
    cursor: pointer; background: transparent; border: none;
    color: var(--text2); text-align: left; width: calc(100% - 1rem);
    font-family: var(--font-head); font-size: .76rem; font-weight: 600;
    letter-spacing: .07em; text-transform: uppercase;
    transition: background .2s, color .2s, box-shadow .2s;
    text-decoration: none;
}
.side-item .si-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1; }
.side-item:hover { background: var(--sidebar-hover); color: var(--text); }
.side-item.active {
    background: var(--sidebar-active-bg);
    color: var(--cyan);
    box-shadow: inset 3px 0 0 var(--cyan);
}

/* Các mục sidebar màu riêng */
.side-item.si-bq:hover, .side-item.si-bq.active {
    color: var(--red); background: var(--sidebar-bq-bg);
    box-shadow: inset 3px 0 0 var(--red);
}
.side-item.si-gb:hover, .side-item.si-gb.active {
    color: #64a0ff; background: var(--sidebar-gb-bg);
    box-shadow: inset 3px 0 0 #64a0ff;
}
.side-item.si-hs:hover, .side-item.si-hs.active {
    color: #50c88c; background: var(--sidebar-hs-bg);
    box-shadow: inset 3px 0 0 #50c88c;
}
.side-item.si-tt:hover, .side-item.si-tt.active {
    color: #b482ff; background: var(--sidebar-tt-bg);
    box-shadow: inset 3px 0 0 #b482ff;
}
.side-item.si-ql:hover, .side-item.si-ql.active {
    color: var(--gold); background: var(--sidebar-ql-bg);
    box-shadow: inset 3px 0 0 var(--gold);
}

.side-divider {
    height: 1px; background: var(--sidebar-border);
    margin: .4rem .75rem;
}
.sidebar-foot {
    padding: .75rem .75rem;
    border-top: 1px solid var(--sidebar-border);
}

/* ── MAIN LAYOUT ── */
.dash-root {
    margin-left: var(--sidebar-w);
    margin-top: 52px;
    min-height: calc(100vh - 52px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 1.25rem 1.25rem 2rem;
    gap: 1.25rem;
    max-width: 1400px;
}

/* ══ ROW 1: FUNCTION BUTTONS ══ */
.fn-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fn-btn {
    display: flex; align-items: center; gap: .85rem;
    padding: .9rem 1.25rem;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(12px);
    cursor: pointer; text-decoration: none;
    color: var(--text);
    transition: transform .2s, box-shadow .2s, border-color .2s, background .2s;
    position: relative; overflow: hidden;
    font-family: var(--font-head);
}
.fn-btn::before {
    content: '';
    position: absolute; inset: 0;
    opacity: 0; transition: opacity .25s;
}
.fn-btn:hover { transform: translateY(-3px); }
.fn-btn:active { transform: scale(.97); }

.fn-btn.bq { border-color: rgba(229,57,53,.45); }
.fn-btn.bq::before { background: radial-gradient(ellipse at 30% 0%, rgba(229,57,53,.12), transparent 65%); }
.fn-btn.bq:hover { box-shadow: 0 8px 30px rgba(229,57,53,.25); border-color: var(--red); }
.fn-btn.bq:hover::before { opacity: 1; }
.fn-btn.bq .fn-icon { color: var(--red); text-shadow: 0 0 12px rgba(229,57,53,.6); }

.fn-btn.gb { border-color: rgba(100,160,255,.35); }
.fn-btn.gb::before { background: radial-gradient(ellipse at 30% 0%, rgba(100,160,255,.1), transparent 65%); }
.fn-btn.gb:hover { box-shadow: 0 8px 30px rgba(100,160,255,.2); border-color: rgba(100,160,255,.7); }
.fn-btn.gb:hover::before { opacity: 1; }
.fn-btn.gb .fn-icon { color: #64a0ff; text-shadow: 0 0 12px rgba(100,160,255,.5); }

.fn-btn.hs { border-color: rgba(80,200,140,.35); }
.fn-btn.hs::before { background: radial-gradient(ellipse at 30% 0%, rgba(80,200,140,.1), transparent 65%); }
.fn-btn.hs:hover { box-shadow: 0 8px 30px rgba(80,200,140,.2); border-color: rgba(80,200,140,.7); }
.fn-btn.hs:hover::before { opacity: 1; }
.fn-btn.hs .fn-icon { color: #50c88c; text-shadow: 0 0 12px rgba(80,200,140,.5); }

.fn-btn.tt { border-color: rgba(180,130,255,.35); }
.fn-btn.tt::before { background: radial-gradient(ellipse at 30% 0%, rgba(180,130,255,.1), transparent 65%); }
.fn-btn.tt:hover { box-shadow: 0 8px 30px rgba(180,130,255,.2); border-color: rgba(180,130,255,.7); }
.fn-btn.tt:hover::before { opacity: 1; }
.fn-btn.tt .fn-icon { color: #b482ff; text-shadow: 0 0 12px rgba(180,130,255,.5); }

.fn-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }
.fn-text { display: flex; flex-direction: column; gap: .1rem; }
.fn-label {
    font-size: .88rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    color: var(--text);
}
.fn-sub {
    font-size: .6rem; color: var(--muted);
    letter-spacing: .08em; text-transform: uppercase;
}
.fn-btn::after {
    content: '';
    position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
    transition: left .5s;
}
.fn-btn:hover::after { left: 150%; }

/* ══ MAP + KT-XH ROW ══ */
.map-ktxh-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-height: 397px;
}

.map-section {
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--border2);
    overflow: hidden;
    background: var(--bg2);
    box-shadow: 0 0 40px rgba(0,229,255,.07), var(--shadow-card);
    min-height: 320px;
    display: flex; align-items: stretch;
}

.map-overlay-header {
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
    padding: .85rem 1.25rem;
    background: linear-gradient(180deg, rgba(6,10,16,.85) 0%, transparent 100%);
    display: flex; align-items: center; justify-content: space-between;
}
.map-title {
    display: flex; align-items: center; gap: .65rem;
    font-family: var(--font-head); font-size: .88rem; font-weight: 700;
    letter-spacing: .15em; text-transform: uppercase; color: var(--cyan);
}
.map-title img { height: 26px; filter: drop-shadow(0 0 8px rgba(229,57,53,.6)); }
.map-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px var(--green-glow);
    animation: mapPulse 2s infinite;
}
@keyframes mapPulse { 0%,100%{transform:scale(1);opacity:1;} 50%{transform:scale(1.5);opacity:.6;} }

.map-overlay-footer {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 5;
    padding: .75rem 1.25rem;
    background: linear-gradient(0deg, rgba(6,10,16,.85) 0%, transparent 100%);
    display: flex; align-items: center; gap: 1.5rem;
}
.map-stat {
    font-family: var(--font-head); font-size: .7rem;
    letter-spacing: .08em; text-transform: uppercase;
}
.map-stat span { color: var(--gold); font-weight: 700; font-size: .85rem; }

.map-img-wrap { flex: 1; position: relative; }
.map-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    filter: saturate(0.7) brightness(0.85) hue-rotate(180deg);
    mix-blend-mode: luminosity;
}
.map-img-wrap::after {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 60% 60% at 50% 50%, rgba(0,229,255,.08), transparent 70%),
        linear-gradient(180deg, rgba(6,10,16,.35) 0%, transparent 30%, transparent 70%, rgba(6,10,16,.35) 100%);
    pointer-events: none;
}
.map-scan {
    position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden;
}
.map-scan::before {
    content: '';
    position: absolute; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,229,255,.6) 50%, transparent 100%);
    animation: scanVert 4s linear infinite;
    top: -2px;
}
@keyframes scanVert { 0%{top:-2px;} 100%{top:100%;} }

.map-corner {
    position: absolute; z-index: 6; width: 20px; height: 20px; pointer-events: none;
}
.map-corner.tl { top: 8px; left: 8px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.map-corner.tr { top: 8px; right: 8px; border-top: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }
.map-corner.bl { bottom: 8px; left: 8px; border-bottom: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.map-corner.br { bottom: 8px; right: 8px; border-bottom: 2px solid var(--cyan); border-right: 2px solid var(--cyan); }

.map-marker {
    position: absolute; z-index: 7;
    top: 48%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.marker-pin {
    width: 14px; height: 14px; border-radius: 50% 50% 50% 0;
    background: var(--red);
    border: 2px solid #fff;
    transform: rotate(-45deg);
    box-shadow: 0 0 12px rgba(229,57,53,.8);
    animation: markerPulse 2s ease-in-out infinite;
}
@keyframes markerPulse {
    0%,100%{ box-shadow: 0 0 12px rgba(229,57,53,.8); }
    50%{ box-shadow: 0 0 24px rgba(229,57,53,1), 0 0 40px rgba(229,57,53,.4); }
}
.marker-ring {
    position: absolute; top: -8px; left: -8px;
    width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid rgba(229,57,53,.5);
    animation: markerRing 2s ease-in-out infinite;
}
@keyframes markerRing { 0%{transform:scale(0);opacity:1;} 100%{transform:scale(2.5);opacity:0;} }
.marker-label {
    font-family: var(--font-head); font-size: .62rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: #fff; background: rgba(6,10,16,.8);
    border: 1px solid rgba(229,57,53,.5);
    padding: 2px 8px; border-radius: 4px;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* ══ ROW 3: BOTTOM PANELS ══ */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    max-height: 270px;
}

.panel {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    overflow: hidden;
    display: flex; flex-direction: column;
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--glass2);
}
.panel-head h3 {
    font-family: var(--font-head); font-size: .82rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--panel-title); margin: 0;
    display: flex; align-items: center; gap: .5rem;
}
.panel-badge {
    font-size: .58rem; font-family: var(--font-head); letter-spacing: .1em;
    background: var(--cyan-soft); color: var(--panel-badge-color);
    border: 1px solid var(--panel-badge-border);
    padding: .15rem .55rem; border-radius: 20px;
}
.panel-body { padding: .75rem 1rem; flex: 1; overflow-y: auto; max-height: 320px; }
.panel-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 2rem; color: var(--muted); font-size: .75rem;
    font-family: var(--font-head); letter-spacing: .08em;
}
.panel-empty .empty-icon { font-size: 1.8rem; margin-bottom: .5rem; opacity: .5; }

/* ── TASK ITEMS ── */
.task-item {
    display: flex; align-items: center; gap: .85rem;
    padding: .65rem .5rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    border-radius: 8px;
    margin-bottom: 2px;
}
.task-item:hover { background: var(--glass2); }
.task-item:last-child { border-bottom: none; }

.task-status {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.task-status.done { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.task-status.partial { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }
.task-status.todo { background: var(--muted); }
.task-status.overdue { background: var(--red); box-shadow: 0 0 6px var(--red-glow); animation: blink 1.4s infinite; }

.task-info { flex: 1; min-width: 0; }
.task-name {
    font-size: .78rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .15rem;
}
.task-meta {
    font-size: .62rem; color: var(--muted);
    font-family: var(--font-head); letter-spacing: .05em;
}
.task-progress {
    display: flex; flex-direction: column; align-items: flex-end; gap: .2rem;
    flex-shrink: 0; min-width: 60px;
}
.progress-bar {
    width: 56px; height: 4px; background: var(--border);
    border-radius: 4px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 4px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    transition: width .6s ease;
}
.progress-fill.overdue { background: linear-gradient(90deg, var(--red), #ff6b6b); }
.progress-pct {
    font-family: var(--font-head); font-size: .6rem;
    color: var(--muted); letter-spacing: .05em;
}

/* ── MEETING ITEMS ── */
.meeting-item {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .65rem .5rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
    border-radius: 8px; margin-bottom: 2px;
}
.meeting-item:hover { background: var(--glass2); }
.meeting-item:last-child { border-bottom: none; }

.meeting-date-box {
    display: flex; flex-direction: column; align-items: center;
    background: var(--glass2); border: 1px solid var(--border);
    border-radius: 8px; padding: .3rem .55rem;
    min-width: 44px; flex-shrink: 0;
}
.meeting-day {
    font-family: var(--font-head); font-size: 1.1rem; font-weight: 700;
    color: var(--gold); line-height: 1;
}
.meeting-month {
    font-size: .55rem; color: var(--muted); text-transform: uppercase;
    font-family: var(--font-head); letter-spacing: .05em;
}
.meeting-info { flex: 1; min-width: 0; }
.meeting-title {
    font-size: .78rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .2rem; font-weight: 600;
}
.meeting-meta {
    font-size: .72rem; color: var(--muted);
    font-family: var(--font-head); letter-spacing: .04em;
    display: flex; align-items: center; gap: .5rem;
}
.meeting-type-chip {
    font-size: .55rem; font-family: var(--font-head); font-weight: 700;
    letter-spacing: .08em; padding: 1px 6px;
    border-radius: 4px; text-transform: uppercase; flex-shrink: 0;
}
.chip-upcoming {
    background: rgba(0,230,118,.12); color: var(--green);
    border: 1px solid rgba(0,230,118,.25);
}
.chip-past {
    background: var(--glass2); color: var(--muted);
    border: 1px solid var(--border);
}
.chip-today {
    background: rgba(255,215,64,.15); color: var(--gold);
    border: 1px solid rgba(255,215,64,.3);
}

/* ── STAT MINI ── */
.stats-mini {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: .75rem; margin-bottom: 0.25rem; max-height: 50px;
}
.stat-mini-card {
    background: var(--glass); border: 1px solid var(--stat-border);
    border-radius: 12px; padding: .75rem .85rem;
    backdrop-filter: blur(8px);
    display: flex; align-items: baseline; gap: 0.75rem;
    transition: transform .2s, box-shadow .2s;
}
.stat-mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stat-mini-card .smv {
    font-family: var(--font-head); font-size: 1.5rem; font-weight: 800;
    line-height: 1;
}
.stat-mini-card .sml {
    font-size: .9rem; color: var(--stat-label);
    font-family: var(--font-head); letter-spacing: .08em; text-transform: uppercase;
}
.smv.done-c { color: var(--green); }
.smv.partial-c { color: var(--gold); }
.smv.overdue-c { color: var(--red); }
.smv.total-c { color: var(--cyan); }

/* ── KT-XH PANEL ── */
.ktxh-panel {
    background: var(--glass);
    border: 1px solid var(--border2);
    border-radius: 18px;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(0,229,255,.05), var(--shadow-card);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.ktxh-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--glass2);
    flex-shrink: 0;
}
.ktxh-head h3 {
    font-family: var(--font-head); font-size: .82rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: var(--ktxh-title); margin: 0;
    display: flex; align-items: center; gap: .5rem;
}
.ktxh-tabs { display: flex; gap: .35rem; }
.ktxh-tab {
    font-family: var(--font-head); font-size: .6rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
    padding: .2rem .6rem; border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent; color: var(--muted);
    cursor: pointer; transition: all .2s;
}
.ktxh-tab.active {
    background: rgba(255,215,64,.12); color: var(--gold);
    border-color: rgba(255,215,64,.35);
}
.ktxh-tab:hover:not(.active) { color: var(--text); border-color: var(--border2); }

.ktxh-body {
    flex: 1; padding: .85rem 1rem 1rem;
    overflow: hidden; display: flex; flex-direction: column; gap: .65rem;
}
.ktxh-chart-wrap { position: relative; flex: 1; min-height: 0; }
.ktxh-chart-wrap canvas { width: 100% !important; height: 100% !important; }

.ktxh-kpi-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
    flex-shrink: 0;
}
.ktxh-kpi {
    background: var(--glass2); border: 1px solid var(--border);
    border-radius: 10px; padding: .5rem .65rem;
    display: flex; flex-direction: column; gap: .12rem;
}
.ktxh-kpi-val {
    font-family: var(--font-head); font-size: 1.05rem; font-weight: 800;
    line-height: 1; color: var(--ktxh-kpi-color);
}
.ktxh-kpi-lbl {
    font-size: .58rem; color: var(--muted);
    font-family: var(--font-head); letter-spacing: .07em; text-transform: uppercase;
    line-height: 1.25;
}
.ktxh-kpi-pct {
    font-size: .62rem; font-family: var(--font-head); font-weight: 700;
    letter-spacing: .05em;
}
.pct-up { color: var(--green); }
.pct-dn { color: var(--red); }

.ktxh-row {
    display: flex; align-items: center; gap: .65rem;
    padding: .35rem 0; border-bottom: 1px solid var(--border);
    font-size: .72rem;
}
.ktxh-row:last-child { border-bottom: none; }
.ktxh-row-lbl { flex: 1; color: var(--text); line-height: 1.3; }
.ktxh-row-bar { width: 80px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.ktxh-row-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--green)); }
.ktxh-row-pct { width: 36px; text-align: right; font-family: var(--font-head); font-size: .62rem; color: var(--muted); flex-shrink: 0; }

/* ── DASH ANIMATIONS ── */
.fn-btn { animation: fadeSlideUp .4s ease both; }
.fn-btn:nth-child(1) { animation-delay: .05s; }
.fn-btn:nth-child(2) { animation-delay: .12s; }
.fn-btn:nth-child(3) { animation-delay: .19s; }
.map-section { animation: fadeSlideUp .4s .25s ease both; }
.stat-mini-card { animation: fadeSlideUp .35s ease both; }
.stat-mini-card:nth-child(1) { animation-delay: .32s; }
.stat-mini-card:nth-child(2) { animation-delay: .38s; }
.stat-mini-card:nth-child(3) { animation-delay: .44s; }
.stat-mini-card:nth-child(4) { animation-delay: .50s; }
.panel { animation: fadeSlideUp .4s ease both; }
.panel:nth-child(1) { animation-delay: .55s; }
.panel:nth-child(2) { animation-delay: .62s; }
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── SKELETON LOADING ── */
.skeleton {
    background: linear-gradient(90deg, var(--glass) 0%, var(--glass2) 50%, var(--glass) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
.skel-row { height: 48px; margin-bottom: .5rem; }

/* ── DASH FOOTER ── */
.dash-foot {
    text-align: center; padding: .5rem 0;
    font-size: .75rem; color: var(--muted);
    letter-spacing: .12em; font-family: var(--font-head); text-transform: uppercase;
}

/* ── GB PANEL ── */
#gb-panel {
    display: none; position: fixed;
    top: 52px; left: var(--sidebar-w); right: 0; bottom: 0;
    z-index: 50; overflow-y: auto; background: var(--bg);
}
#gb-panel.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
    :root { --sidebar-w: 56px; }
    .fn-row { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
    .bottom-row { grid-template-columns: 1fr; }
    .stats-mini { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .map-ktxh-row { grid-template-columns: 1fr; }
    .map-section { min-height: 220px; }
    .fn-label { font-size: .78rem; }
    #userBadge { display: none; }
    .topbar-brand span { font-size: .68rem; }
    .sidebar-logo-text, .side-item span.si-label { display: none; }
    .sidebar-logo img { height: 32px; }
    .side-item { padding: .65rem; justify-content: center; margin: 0 .25rem; }
    .side-item .si-icon { font-size: 1.2rem; }
}
@media (min-width: 701px) and (max-width: 980px) {
    :root { --sidebar-w: 56px; }
    .fn-row { grid-template-columns: repeat(2, 1fr); }
    .map-ktxh-row { grid-template-columns: 1fr 1fr; }
    .sidebar-logo-text, .side-item span.si-label { display: none; }
    .sidebar-logo img { height: 32px; }
    .side-item { padding: .65rem; justify-content: center; margin: 0 .25rem; }
    .side-item .si-icon { font-size: 1.2rem; }
}


/* ════════════════════════════════════════
   HOP_DU / GB-PANEL SPECIFIC
   ════════════════════════════════════════ */

@media(max-width:680px){
  .dash-grid-2{grid-template-columns:1fr!important}
  .mgmt-grid{grid-template-columns:1fr!important}
  .form-grid-2,.form-grid-3{grid-template-columns:1fr!important}
  .top-bar-brand small,.clock-display{display:none}
  .login-card{padding:28px 22px}
}

/* ── KÝ SỐ ── */
#modal-signature{position:fixed;inset:0;z-index:9999;display:none}
#modal-signature .sig-overlay{position:absolute;inset:0;background:rgba(13,43,78,.55);display:flex;align-items:center;justify-content:center;padding:16px}
#modal-signature .sig-box{background:#fff;border-radius:16px;padding:28px 28px 22px;width:100%;max-width:520px;box-shadow:0 8px 40px rgba(13,43,78,.25)}
#modal-signature .sig-title{font-size:17px;font-weight:700;color:var(--navy);margin-bottom:16px;display:flex;align-items:center;gap:8px}
#sig-canvas{border:2px dashed var(--border);border-radius:10px;background:#f8fafc;cursor:crosshair;display:block;width:100%;touch-action:none}
#sig-canvas.drawing{border-color:var(--navy3);background:#fff}
.sig-preview-wrap{border:1.5px solid var(--border);border-radius:8px;background:#f8fafc;padding:10px;text-align:center;min-height:72px;display:flex;align-items:center;justify-content:center}
.sig-preview-wrap img{max-height:60px;max-width:100%}
.sig-stamp{display:inline-block;font-size:10px;color:var(--muted);font-style:italic;margin-top:2px}
/* Hiển thị chữ ký trong vùng in */
.sig-img-print{display:block;margin:2px auto}
.sig-timestamp{font-size:9.5px;color:#555;font-style:italic;text-align:center}
/* Vùng upload kéo thả */
#sig-upload-zone{border:2px dashed var(--border);border-radius:12px;background:#f8fafc;padding:28px 20px;text-align:center;cursor:pointer;transition:border-color .2s,background .2s}
#sig-upload-zone:hover,#sig-upload-zone.drag-over{border-color:var(--navy3);background:#eef4ff}
