:root {
    --blue-950: #073763;
    --blue-900: #0a4778;
    --blue-800: #075ca8;
    --blue-700: #0b69bd;
    --red-800: #b40000;
    --red-900: #8f0000;
    --gold: #f2b705;
    --bg: #dfecea;
    --panel: #ffffff;
    --panel-soft: #f4f8fc;
    --line: #d7e2ea;
    --text: #1d2a35;
    --muted: #647383;
    --danger: #b00020;
    --success: #126124;
    --warning: #835000;
    --shadow: 0 8px 24px rgba(7, 55, 99, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { display: block; max-width: 100%; }
p { margin: 0 0 10px; }
ul, ol { margin-top: 0; }
button, input, select, textarea { font-family: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
    background: var(--blue-950);
    color: #fff;
    font-size: 13px;
}
.topbar-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.topbar-links {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}
.topbar a { opacity: .95; }
.topbar a:hover { color: #fff; text-decoration: underline; }

.site-header {
    background: #f7fbff;
    border-bottom: 1px solid #c9dbe8;
}
.header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 300px;
}
.brand img {
    width: 62px;
    height: 62px;
    object-fit: contain;
}
.brand-text strong {
    display: block;
    color: var(--blue-950);
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: .3px;
}
.brand-text em {
    display: block;
    margin-top: 3px;
    color: var(--blue-800);
    font-size: 16px;
    font-style: normal;
    font-weight: 800;
}
.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
}
.search-box {
    display: flex;
    width: min(420px, 100%);
    height: 38px;
}
.search-box input {
    flex: 1;
    border: 1px solid #c9d9e7;
    border-right: 0;
    border-radius: 4px 0 0 4px;
    padding: 0 12px;
    outline: none;
    color: #4a5965;
    background: #fff;
}
.search-box button {
    width: 56px;
    border: 0;
    border-radius: 0 4px 4px 0;
    background: var(--gold);
    color: #533500;
    font-weight: 900;
    cursor: pointer;
}
.staff-login {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;
    border-radius: 4px;
    background: var(--blue-900);
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
}
.staff-login:hover { background: var(--blue-950); color: #fff; }

.main-nav {
    background: var(--red-800);
    border-bottom: 4px solid var(--blue-950);
}
.nav-inner {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
}
.nav-inner > a,
.logout-form button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.16);
    background: transparent;
    cursor: pointer;
}
.nav-inner > a:hover,
.logout-form button:hover { background: var(--red-900); }
.logout-form { margin-left: auto; display: flex; }

.page-shell {
    background: var(--panel);
    min-height: 560px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.hero-home {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 18px;
    margin-bottom: 18px;
}
.hero-banner {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: #e8f0f7;
}
.hero-banner img {
    width: 100%;
    height: 320px;
    object-fit: cover;
}
.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7,55,99,.78), rgba(7,55,99,.20), rgba(255,255,255,.08));
}
.hero-copy {
    position: absolute;
    left: 26px;
    bottom: 26px;
    width: min(590px, calc(100% - 52px));
    color: #fff;
    z-index: 1;
}
.section-label {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    background: rgba(255,255,255,.92);
    color: var(--blue-950);
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    letter-spacing: .3px;
    text-transform: uppercase;
}
.hero-copy h1,
.page-title h1,
.hero-card h1 {
    margin: 10px 0 10px;
    font-size: 32px;
    line-height: 1.18;
    color: inherit;
}
.hero-copy p { font-size: 16px; color: rgba(255,255,255,.94); }
.info-panel {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    padding: 18px;
}
.info-panel h2,
.portal-card h2,
.section-box h2,
.admin-section h2 {
    margin: 0 0 12px;
    color: var(--blue-950);
    font-size: 20px;
    line-height: 1.25;
}
.workflow-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.workflow-list li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: start;
    color: #354958;
}
.workflow-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-900);
    color: #fff;
    font-weight: 900;
}

.portal-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.compact-grid {
    margin-top: 14px;
}
.compact-grid .info-panel {
    margin: 0;
}
.portal-card,
.hero-card,
.admin-section,
.clean-card {
    border: 1px solid var(--line);
    background: #fff;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(7,55,99,.04);
}
.portal-card img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border: 1px solid #e6eef5;
    margin-bottom: 14px;
}
.card-kicker {
    color: var(--red-800);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.feature-list {
    padding-left: 20px;
    margin-bottom: 0;
}
.feature-list li { margin: 7px 0; }

.page-title {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(90deg, #eef7ff, #fff);
}
.page-title p { color: #435567; max-width: 820px; }
.subpage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
}
.main-column,
.side-column { display: grid; gap: 18px; align-content: start; }
.ktx-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.mini-news {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dotted #cfd9e4;
}
.mini-news img {
    width: 96px;
    height: 58px;
    object-fit: cover;
}
.mini-news strong { color: var(--blue-950); }
.notice-list {
    padding-left: 0;
    list-style: none;
    margin: 0;
}
.notice-list li {
    padding: 8px 0 8px 16px;
    border-bottom: 1px dotted #d6e1ea;
    position: relative;
}
.notice-list li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--red-800);
    font-weight: 900;
}
.video-box {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #202020;
    color: #fff;
    padding: 18px;
    font-weight: 800;
}
.video-box small { display: block; color: #bfbfbf; font-weight: 400; margin-top: 6px; }
.partner-logos {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    align-items: center;
}
.partner-logos img {
    max-height: 44px;
    object-fit: contain;
    margin: 0 auto;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 15px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}
.btn-primary { background: var(--blue-900); color: #fff; }
.btn-primary:hover { background: var(--blue-950); color: #fff; }
.btn-secondary { background: #eef6ff; color: var(--blue-950); border-color: #b9d2e8; }
.btn-secondary:hover { background: #dceeff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--gold); color: #3a2700; }
.btn-small { min-height: 31px; padding: 6px 10px; font-size: 12px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-weight: 900; color: var(--blue-950); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #c5d6e6;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--blue-700);
    box-shadow: 0 0 0 3px rgba(11,105,189,.12);
}
.form-group textarea { min-height: 90px; resize: vertical; }
.validation-summary-errors,
.field-validation-error { color: var(--danger); font-weight: 800; }
.notice-box,
.warning-box {
    border: 1px solid #f0c97b;
    background: #fff7e8;
    color: var(--warning);
    padding: 12px 14px;
    margin: 12px 0;
}
.success-box {
    border: 1px solid #9ad0a2;
    background: #eefaf0;
    color: var(--success);
    padding: 14px;
    margin: 16px 0;
}

.status-filter { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.admin-table th,
.admin-table td {
    border: 1px solid #d7e2ef;
    padding: 8px;
    vertical-align: top;
}
.admin-table th {
    background: #edf5ff;
    color: var(--blue-950);
    text-align: left;
    white-space: nowrap;
}
.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 900;
    background: #e9f2fb;
    color: var(--blue-950);
}
.badge-warning { background: #fff2cc; color: #7a4b00; }
.badge-ok { background: #e7f8ec; color: #10622d; }
.badge-danger { background: #ffe5e9; color: #8d0018; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.inline-form input { padding: 6px 8px; border: 1px solid #c8d8ea; border-radius: 4px; max-width: 180px; }

.site-footer {
    background: #f2f5f7;
    border-top: 1px solid #ccd8e2;
    color: #3b4d5d;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr .8fr;
    gap: 28px;
    padding: 20px 0 26px;
}
.site-footer h4 {
    margin: 0 0 8px;
    color: var(--blue-950);
    font-size: 16px;
}
.site-footer a { color: var(--blue-800); font-weight: 900; }

@media (max-width: 980px) {
    .header-inner { flex-direction: column; align-items: stretch; padding: 16px 0; }
    .brand { min-width: 0; }
    .header-tools { justify-content: flex-start; flex-wrap: wrap; }
    .hero-home,
    .subpage-layout,
    .portal-card-grid { grid-template-columns: 1fr; }
    .page-title { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .container { width: min(100% - 20px, 1180px); }
    .topbar-inner { flex-direction: column; align-items: flex-start; padding: 8px 0; }
    .topbar-links { flex-wrap: wrap; }
    .nav-inner > a { flex: 1 1 50%; padding: 0 10px; }
    .logout-form { margin-left: 0; width: 100%; }
    .logout-form button { width: 100%; }
    .page-shell { padding: 10px; }
    .hero-banner,
    .hero-banner img { min-height: 260px; height: 260px; }
    .hero-copy h1,
    .page-title h1,
    .hero-card h1 { font-size: 25px; }
    .ktx-news-grid,
    .form-grid,
    .partner-logos { grid-template-columns: 1fr; }
    .admin-table { font-size: 12px; }
}

/* v13 - Đăng ký tập thể / import file mẫu */
.btn-outline {
    background: #fff;
    color: var(--blue-950);
    border-color: var(--blue-800);
}
.btn-outline:hover { background: #eef6ff; }

.import-note { margin-bottom: 18px; }
.compact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}
.import-card {
    border: 1px solid var(--line);
    background: #fff;
    padding: 18px;
    box-shadow: var(--shadow);
}
.import-card h2 {
    margin: 6px 0 10px;
    color: var(--blue-950);
    font-size: 22px;
}
.upload-box {
    display: grid;
    gap: 9px;
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.upload-box label {
    font-weight: 900;
    color: var(--blue-950);
}
.upload-box input[type="file"],
.upload-box textarea {
    width: 100%;
    border: 1px solid #c9d9e7;
    border-radius: 4px;
    padding: 10px;
    background: #fff;
    color: var(--text);
}
.result-panel {
    border: 1px solid var(--line);
    background: #fff;
    padding: 20px;
    box-shadow: var(--shadow);
}
.result-panel.has-errors { border-color: #f1b0b7; }
.result-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}
.result-summary div {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    padding: 14px;
}
.result-summary span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.result-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--blue-950);
    font-size: 22px;
}
.message-list,
.error-list {
    margin: 0 0 16px;
    padding-left: 20px;
}
.message-list li { color: var(--success); }
.error-list li { color: var(--danger); }

@media (max-width: 860px) {
    .import-grid,
    .compact-list,
    .result-summary {
        grid-template-columns: 1fr;
    }
}
.muted-small {
    display: inline-block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
/* --- TỐI ƯU CỐ ĐỊNH TIÊU ĐỀ BẢNG KHI CUỘN (STICKY HEADER) --- */
.admin-section {
    position: relative;
    margin-bottom: 24px;
}

    /* Tạo khung cuộn độc lập cho bảng dữ liệu */
    .admin-section > div[style*="overflow-x: auto"] {
        max-height: 550px; /* Giới hạn chiều cao bảng để không bị kéo trang quá dài */
        overflow-y: auto !important;
        border: 1px solid var(--line);
        border-radius: 4px;
    }

/* Đóng đinh thanh tiêu đề đứng yên khi cuộn chuột */
.admin-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(7, 55, 99, 0.15); /* Tạo vệt đổ bóng nhẹ dưới tiêu đề */
}

/* Định dạng ô tìm kiếm trực quan động được tạo từ Javascript */
.live-search-input:focus {
    border-color: var(--blue-700) !important;
    box-shadow: 0 0 0 3px rgba(11, 105, 189, .12) !important;
}
/* ==========================================================================
   MÃ NÂNG CẤP GIAO DIỆN CHUYÊN NGHIỆP HEPC - CHỈ BỔ SUNG (KHÔNG XÓA CSS CŨ)
   ========================================================================== */

/* 1. Khối thông số ấn tượng (Stats Grid) dàn hàng ngang */
.hepc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 20px 0;
}
.hepc-stat-card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(7, 55, 99, 0.03);
    transition: transform 0.2s ease;
}
.hepc-stat-card:hover {
    transform: translateY(-2px);
}
.hepc-stat-card .stat-num {
    font-size: 26px;
    font-weight: 900;
    color: var(--blue-950);
    margin-bottom: 4px;
    display: block;
}
.hepc-stat-card .stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
}

/* 2. Lưới tiện ích dịch vụ (Amenities Grid) */
.amenities-container {
    margin-top: 20px;
}
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 12px;
}
.amenity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.amenity-item i {
    font-size: 20px;
    color: var(--blue-800);
    background: #eef6ff;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.amenity-item span {
    font-weight: bold;
    color: var(--text);
}

/* 3. Bảng báo giá / thông tin cấu hình phòng (Pricing Table) */
.room-pricing-table {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
}
.room-pricing-table th {
    background: var(--blue-950);
    color: #fff;
    padding: 12px;
    font-weight: 900;
    text-align: left;
}
.room-pricing-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.room-pricing-table tr:hover {
    background: var(--panel-soft);
}

/* 4. Tối ưu bảng Admin - Đóng đinh thanh tiêu đề (Sticky Header) */
.admin-section {
    position: relative;
    margin-bottom: 24px;
}
.admin-section > div[style*="overflow-x: auto"] {
    max-height: 550px;
    overflow-y: auto !important;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.admin-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(7, 55, 99, 0.15);
}

/* 5. Khung ô tìm kiếm nhanh tự động tạo từ Javascript */
.live-search-input:focus {
    border-color: var(--blue-700) !important;
    box-shadow: 0 0 0 3px rgba(11, 105, 189, .12) !important;
}

/* --- Hỗ trợ Responsive hiển thị trên di động mượt mà --- */
@media (max-width: 860px) {
    .hepc-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .amenities-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .hepc-stats-grid { grid-template-columns: 1fr; }
    .amenities-grid { grid-template-columns: 1fr; }
}