@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&display=swap');

:root {
  /* Giữ nguyên các màu của bạn */
  --red: #c0392b; --red-light: #fadbd8; --red-dark: #922b21;
  --gold: #d4a017; --gold-light: #fef9e7; --gold-dark: #9a7213;
  --green: #1a7a4a; --green-light: #d5f5e3; --green-dark: #145a35;
  --blue: #1a5276; --blue-light: #d6eaf8; --blue-dark: #0e3460;
  --gray: #6b7280; --gray-light: #f3f4f6; --gray-dark: #374151;
  --border: #e5e7eb; --bg: #f9fafb; --white: #ffffff;
  --text: #111827; --text-muted: #6b7280;
  
  /* Bổ sung 2 màu chuẩn nhận diện Đoàn thanh niên cho Header */
  --doan-blue: #00529c; 
  --doan-red: #da251d;

  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 8px; --radius-lg: 12px;
  --font: 'Be Vietnam Pro', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* Layout cơ bản */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; max-width: 1200px; margin: 0 auto; width: 100%; padding: 32px 24px; }
.container { max-width: 800px; margin: 0 auto; }

/* =========================================
   HEADER CHUẨN HÀNH CHÍNH (NEW)
========================================= */
.site-header { 
  background-color: var(--white); 
  box-shadow: var(--shadow-md); 
  position: sticky; 
  top: 0; 
  z-index: 100; 
}

/* Tầng 1: Logo & Nút Đăng nhập */
.header-main { 
  padding: 12px 0; 
  border-bottom: 1px solid var(--border); 
}
.header-flex { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 24px; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.brand-group { 
  display: flex; 
  align-items: center; 
  text-decoration: none; 
  gap: 16px; 
}
.brand-logo { 
  width: 55px; 
  height: auto; 
}
.brand-text { 
  display: flex; 
  flex-direction: column; 
}
.brand-title { 
  font-size: 14px; 
  font-weight: 700; 
  color: var(--doan-red); 
  margin: 0 0 2px 0; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}
.brand-subtitle { 
  font-size: 13px; 
  font-weight: 600; 
  color: var(--doan-blue); 
  margin: 0; 
  text-transform: uppercase; 
}

/* Tầng 2: Navigation Menu */
.header-nav { 
  background-color: var(--doan-blue); 
}
.header-nav-container {
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 24px;
}
.nav-menu { 
  list-style: none; 
  display: flex; 
}
.nav-menu li { margin: 0; }
.nav-menu a { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 12px 20px; 
  color: var(--white); 
  text-decoration: none; 
  font-size: 14px; 
  font-weight: 500; 
  transition: background-color 0.2s; 
}
.nav-menu a:hover, 
.nav-menu a.active { 
  background-color: var(--doan-red); 
}

/* =========================================
   CÁC COMPONENT CÒN LẠI (GIỮ NGUYÊN)
========================================= */

/* Hero Specific */
.hero-home { background: white; border-radius: var(--radius-lg); padding: 40px; text-align: center; box-shadow: var(--shadow); margin-bottom: 30px; }
.hero-home h2 { font-size: 24px; color: var(--red); margin-bottom: 12px; }
.hero-home p { color: var(--text-muted); font-size: 15px; margin-bottom: 24px; }

/* Cards */
.card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px;}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; color: var(--gray-dark); }
label .required { color: var(--red); margin-left: 2px; }
input, select, textarea { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-family: var(--font); font-size: 14px; color: var(--text); transition: all 0.2s; outline: none; background: white; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(192,57,43,0.08); }
input:disabled, select:disabled { background: var(--gray-light); color: var(--gray); cursor: not-allowed; }
textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: inline-block;}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); border: none; font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: white; color: var(--gray-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--gray-light); }
.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: var(--green-dark); }
.btn-warning { background: var(--gold); color: white; }
.btn-warning:hover { background: var(--gold-dark); }
.btn-blue { background: var(--blue); color: white; }
.btn-blue:hover { background: var(--blue-dark); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: var(--green-light); color: var(--green-dark); }
.badge-paid { background: var(--blue-light); color: var(--blue-dark); }
.badge-done { background: #e0e7ff; color: #3730a3; }
.badge-rejected { background: var(--red-light); color: var(--red-dark); }

/* Steps */
.steps { display: flex; align-items: center; margin-bottom: 28px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step:not(:last-child)::after { content: ''; position: absolute; top: 16px; left: 60%; width: 80%; height: 2px; background: var(--border); z-index: 0; }
.step.active:not(:last-child)::after,
.step.done:not(:last-child)::after { background: var(--red); }
.step-circle { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 2px solid var(--border); background: white; color: var(--gray); position: relative; z-index: 1; transition: all 0.3s; }
.step.active .step-circle { border-color: var(--red); background: var(--red); color: white; }
.step.done .step-circle { border-color: var(--red); background: var(--red); color: white; }
.step-label { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--gray); text-align: center; }
.step.active .step-label { color: var(--red); }
.step.done .step-label { color: var(--red); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px; background: var(--gray-light); text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* Alert / Info box */
.alert { padding: 14px 20px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.alert-info { background: var(--blue-light); border: 1px solid #93c5fd; color: var(--blue-dark); }
.alert-success { background: var(--green-light); border: 1px solid #6ee7b7; color: var(--green-dark); }
.alert-warning { background: var(--gold-light); border: 1px solid #fcd34d; color: var(--gold-dark); }
.alert-error { background: var(--red-light); border: 1px solid #fca5a5; color: var(--red-dark); }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--gray); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-card.red .stat-value { color: var(--red); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.gold .stat-value { color: var(--gold-dark); }

/* Helpers */
.text-center { text-align: center; }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 16px; }

/* Admin sidebar layout (Giữ nguyên không bị ảnh hưởng bởi header mới) */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 250px; background: #1f2937; color: white; display: flex; flex-direction: column; flex-shrink: 0;}
.admin-sidebar .logo { padding: 20px; border-bottom: 1px solid #374151; }
.admin-menu { padding: 20px 0; flex: 1; }
.admin-menu a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #d1d5db; text-decoration: none; transition: 0.2s; font-weight: 500;}
.admin-menu a:hover, .admin-menu a.active { background: #374151; color: white; border-left: 4px solid var(--red); }
.admin-content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.admin-header { background: white; padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.admin-main { padding: 24px; flex: 1; }

.footer { background: #fff; padding: 20px; text-align: center; border-top: 1px solid var(--border); color: var(--gray); font-size: 13px; margin-top: auto; }

/* Screen responsive (Đã cập nhật cho Header mới) */
@media (max-width: 768px) {
  .form-grid, .form-grid-3, .stat-grid { grid-template-columns: 1fr; }
  
  /* Cập nhật Responsive Header */
  .header-flex { flex-direction: column; gap: 16px; padding: 16px 24px; text-align: center; }
  .brand-group { flex-direction: column; text-align: center; gap: 10px; }
  .nav-menu { flex-wrap: wrap; justify-content: center; }
  
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}

/* =========================================
   FOOTER CHUẨN HÀNH CHÍNH (NEW)
========================================= */
.site-footer {
    background-color: var(--doan-blue); /* Màu nền xanh đặc trưng của Đoàn */
    color: rgba(255, 255, 255, 0.85); /* Chữ màu trắng ngà dễ đọc */
    margin-top: auto;
    font-size: 14px;
    line-height: 1.6;
}

.footer-main {
    padding: 40px 24px;
    border-top: 4px solid var(--doan-red); /* Đường viền đỏ phân cách */
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* Chia 3 cột: Cột 1 to gấp đôi 2 cột kia */
    gap: 40px;
}

/* Cột 1: Thông tin cơ quan */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.footer-logo {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.footer-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.4;
}

.footer-title small {
    display: block;
    font-size: 13px;
    color: #ffd700; /* Màu vàng ngôi sao */
    font-weight: 600;
    margin-top: 4px;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.footer-contact i {
    margin-top: 4px;
    color: #ffd700; /* Icon màu vàng để tạo điểm nhấn */
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* Cột 2 & 3: Liên kết nhanh */
.footer-heading {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--doan-red);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: #ffffff;
    transform: translateX(5px); /* Hiệu ứng đẩy nhẹ sang phải khi di chuột */
}

.footer-links i {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Dải bản quyền dưới cùng */
.footer-bottom {
    background-color: #003d75; /* Xanh đậm hơn nền một tông */
    padding: 16px 24px;
    font-size: 13px;
}

.footer-bottom-flex {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom a {
    color: #ffd700;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Responsive cho Footer */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột dọc trên Mobile */
        gap: 30px;
    }
    .footer-bottom-flex {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================================
   CSS THANH THÔNG BÁO CHẠY (TICKER)
======================================================== */
.gov-alert-ticker {
    background-color: #fff3cd; /* Màu nền vàng nhạt cảnh báo */
    color: #856404; /* Chữ màu nâu trầm dễ đọc */
    border-bottom: 1px solid #ffeeba;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    font-size: 14px;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,0.05);
}

.gov-alert-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 16px;
    background-color: #fff3cd;
    position: relative;
    z-index: 2; /* Giữ icon đè lên chữ đang chạy */
    border-right: 2px solid #f8d7da;
}

.gov-alert-icon i {
    color: #da251d;
    font-size: 16px;
    animation: ring 2s ease infinite; /* Hiệu ứng rung loa nhẹ */
}

.ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    padding-left: 15px;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%; /* Bắt đầu chạy từ tít mép phải */
    animation: ticker-scroll 30s linear infinite; /* Điều chỉnh số 30s để chỉnh tốc độ nhanh/chậm */
}

/* Tạm dừng chạy khi rê chuột vào */
.ticker-content:hover {
    animation-play-state: paused;
    cursor: default;
}

/* Keyframes cho chữ chạy ngang */
@keyframes ticker-scroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Keyframes cho hiệu ứng rung loa */
@keyframes ring {
    0% { transform: rotate(0); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-10deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

/* Chỉnh lại khoảng cách cho mobile */
@media (max-width: 768px) {
    .gov-alert-ticker { padding: 8px 15px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .gov-alert-icon { border-right: none; padding-right: 0; width: 100%; }
    .ticker-wrap { padding-left: 0; width: 100%; }
}