/* =============================================================
   Trường Cao đẳng Y tế Huế - Đăng ký xét tuyển + Dashboard
   Tuỳ biến trên Bootstrap 5
   ============================================================= */

:root {
    --bs-primary-rgb: 46, 49, 146;
    --c-primary: #1860a3;
    --c-primary-2: #2d5da6;
    --c-primary-dark: #1e4482;
    --c-accent: #1649f1;
    --c-success: #16a34a;
    --c-warning: #f59e0b;
    --c-danger: #dc2626;
    --c-info: #0ea5e9;
    --c-purple: #7c3aed;
    --c-pink: #db2777;
    --c-teal: #14b8a6;

    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow:    0 2px 8px rgba(15,23,42,.08);
    --shadow-lg: 0 8px 24px rgba(15,23,42,.10);
}

body {
    font-family: -apple-system, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    background: #f3f5f9;
}

a { color: var(--c-primary); }
.btn-primary, .bg-primary { background-color: var(--c-primary) !important; border-color: var(--c-primary) !important; }
.btn-primary:hover { background-color: var(--c-primary-dark) !important; border-color: var(--c-primary-dark) !important; }
.btn-outline-primary { color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline-primary:hover { background-color: var(--c-primary); border-color: var(--c-primary); }
.text-primary { color: var(--c-primary) !important; }

/* ===== Form đăng ký ===== */
.section-title {
    display: flex; align-items: center;
    color: var(--c-primary);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 1rem;
    margin: 1.25rem 0 .5rem;
    padding-bottom: .5rem;
    border-bottom: 1px dashed #e5e7eb;
}
.section-title::before {
    content: "";
    display: inline-block;
    width: 18px; height: 18px;
    background: var(--c-accent);
    margin-right: .625rem;
    border-radius: 3px;
}
.form-label { font-weight: 600; color: #374151; }
.form-control:focus, .form-select:focus {
    border-color: rgba(46,49,146,.5);
    box-shadow: 0 0 0 .25rem rgba(46,49,146,.18);
}

/* ===== Guide card (hướng dẫn từ mota năm tuyển sinh) ===== */
.guide-card {
    border: 1px solid #fde68a;
    border-radius: 12px;
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.guide-card .guide-header {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: rgba(245, 158, 11, .15);
    color: #b45309;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid #fde68a;
}
.guide-card .guide-header i { font-size: 20px; }
.guide-card .guide-body {
    padding: 18px 20px;
    color: #78350f;
    line-height: 1.7;
    font-size: 14.5px;
    white-space: normal;
}
.guide-card .guide-body strong { color: #7c2d12; }
.guide-card .guide-period {
    color: #92400e;
    background: #fde68a;
    padding: 8px 12px;
    border-radius: 8px;
    display: inline-block;
    font-size: 13px;
}
.guide-card .guide-period i { margin-right: 6px; }
.guide-card .guide-footer {
    padding: 14px 20px;
    background: rgba(255,255,255,.55);
    border-top: 1px solid #fde68a;
}
.guide-card .form-check-input {
    width: 1.25em; height: 1.25em; margin-top: .15em;
}
.guide-card .form-check-input:checked {
    background-color: var(--c-primary);
    border-color: var(--c-primary);
}
.guide-card .form-check-label { cursor: pointer; user-select: none; }

/* ===== Form lock overlay ===== */
.form-lock-wrapper {
    position: relative;
    border-radius: 12px;
    transition: opacity .25s, filter .25s;
}
.form-lock-wrapper.locked > form {
    pointer-events: none;
    opacity: .55;
    filter: grayscale(.4);
    user-select: none;
}
.form-lock-wrapper.unlocked > form {
    pointer-events: auto;
    opacity: 1;
    filter: none;
}
.form-lock-wrapper .form-lock-overlay {
    position: absolute; inset: 0;
    z-index: 50;
    background: rgba(255,255,255,.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: grid; place-items: center;
    border-radius: 12px;
    padding: 16px;
    transition: opacity .25s;
}
.form-lock-wrapper.unlocked .form-lock-overlay {
    opacity: 0;
    pointer-events: none;
}
.form-lock-wrapper .form-lock-overlay i.bi-lock-fill {
    font-size: 56px;
    color: #94a3b8;
}

/* Loading overlay */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.7);
    display: none; place-items: center; z-index: 1080;
}
.loading-overlay.show { display: grid; }

#captcha-img { background:#f3f4f6; object-fit:contain; }

/* =============================================================
   DASHBOARD
   ============================================================= */
.dash-body {
    background: linear-gradient(180deg, #eef2f7 0%, #f3f5f9 220px);
}

/* ----- Top navbar ----- */
.dash-navbar {
    background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary) 100%) !important;
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: var(--shadow);
}
.dash-navbar .navbar-brand {
    font-size: 17px;
    letter-spacing: .3px;
}
.dash-navbar .navbar-brand .brand-icon {
    width: 34px; height: 34px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    display: inline-grid; place-items: center;
    margin-right: 10px;
}

/* ----- Sidebar ----- */
.dash-sidebar {
    min-height: calc(100vh - 60px);
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 1px 0 2px rgba(15,23,42,.04);
    padding-top: 12px;
    max-width: 240px !important;
}
.dash-sidebar .nav-link {
    color: #4b5563;
    font-weight: 500;
    border-radius: 8px;
    margin: 2px 8px;
    padding: 10px 14px !important;
    display: flex; align-items: center; gap: 10px;
    transition: background .15s, color .15s;
}
.dash-sidebar .nav-link i { font-size: 18px; opacity: .85; }
.dash-sidebar .nav-link:hover {
    background: #eef2ff;
    color: var(--c-primary);
}
.dash-sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-2) 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(46,49,146,.25);
}
.dash-sidebar .nav-link.active i { opacity: 1; }
.dash-sidebar-section {
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 14px 18px 6px;
    font-weight: 700;
}

/* ----- Page heading ----- */
.dash-page-heading {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    margin-bottom: 20px;
}
.dash-page-heading h1 {
    font-size: 22px; font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex; align-items: center; gap: 10px;
}
.dash-page-heading .subtitle {
    color: #64748b; font-size: 13px;
}

/* ----- Stat cards ----- */
.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: grid; place-items: center;
    color: #fff;
    font-size: 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,.10);
}
.stat-card .stat-label { font-size: 12px; color: #64748b; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: #0f172a; margin-top: 2px; line-height: 1.1; }
.stat-card .stat-trend { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.stat-card .stat-trend.up   { color: var(--c-success); }
.stat-card .stat-trend.down { color: var(--c-danger);  }

.stat-icon-primary { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)); }
.stat-icon-success { background: linear-gradient(135deg, #10b981, #16a34a); }
.stat-icon-warning { background: linear-gradient(135deg, #fbbf24, var(--c-warning)); }
.stat-icon-info    { background: linear-gradient(135deg, #38bdf8, var(--c-info)); }
.stat-icon-purple  { background: linear-gradient(135deg, #a78bfa, var(--c-purple)); }
.stat-icon-pink    { background: linear-gradient(135deg, #f472b6, var(--c-pink)); }

/* Watermark icon trên stat card */
.stat-card::after {
    content: "";
    position: absolute; right: -20px; bottom: -20px;
    width: 120px; height: 120px;
    background: currentColor;
    opacity: .04;
    border-radius: 50%;
}

/* ----- Card chung ----- */
.card-clean {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.card-clean > .card-header,
.card-clean .card-toolbar {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.card-clean .card-toolbar h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex; align-items: center; gap: 8px;
}

/* ----- DataTables polishing ----- */
.dataTables_wrapper { color: #475569; }
.dataTables_wrapper .dataTables_filter input {
    border:1px solid #cbd5e1;
    border-radius:.5rem;
    padding:.4rem .8rem;
    min-width: 260px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: rgba(46,49,146,.55);
    outline: none;
    box-shadow: 0 0 0 3px rgba(46,49,146,.15);
}
.dataTables_wrapper .dataTables_length select {
    border:1px solid #cbd5e1;
    border-radius:.5rem;
    padding: 4px 26px 4px 10px;
}
table.dataTable thead th {
    background:#f8fafc;
    color: #334155;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .3px;
    border-bottom: 2px solid #e2e8f0 !important;
    vertical-align: middle;
}
table.dataTable tbody td { vertical-align: middle; font-size: 14px; }
table.dataTable.table-hover > tbody > tr:hover > * { background: #f8fafc; }
table.dataTable .badge { font-weight: 600; padding: 6px 10px; }

/* DataTables Buttons - override mặc định btn-secondary */
.dt-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.dt-buttons .btn {
    border-radius: .5rem !important;
    font-size: 13px;
    font-weight: 600;
    padding: .375rem .75rem !important;
    border-width: 1px !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
    transition: filter .15s, transform .05s;
}
.dt-buttons .btn:hover { filter: brightness(.95); }
.dt-buttons .btn:active { transform: translateY(1px); }
.dt-buttons .btn i { font-size: 14px; }

/* Excel - xanh lá */
.dt-buttons .buttons-excel, .dt-buttons .buttons-excel:focus {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
.dt-buttons .buttons-excel:hover {
    background: #15803d !important;
    border-color: #15803d !important;
    color: #fff !important;
}

/* CSV - xanh dương */
.dt-buttons .buttons-csv, .dt-buttons .buttons-csv:focus {
    background: #fff !important;
    border-color: #0ea5e9 !important;
    color: #0284c7 !important;
}
.dt-buttons .buttons-csv:hover {
    background: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
    color: #fff !important;
}

/* Print - cam */
.dt-buttons .buttons-print, .dt-buttons .buttons-print:focus {
    background: #fff !important;
    border-color: #f59e0b !important;
    color: #b45309 !important;
}
.dt-buttons .buttons-print:hover {
    background: #f59e0b !important;
    border-color: #f59e0b !important;
    color: #fff !important;
}

/* ColVis - tím */
.dt-buttons .buttons-colvis, .dt-buttons .buttons-colvis:focus {
    background: #fff !important;
    border-color: #7c3aed !important;
    color: #6d28d9 !important;
}
.dt-buttons .buttons-colvis:hover {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #fff !important;
}

/* ColVis dropdown items */
.dt-button-collection .dt-button {
    color: #334155 !important;
    background: #fff !important;
}
.dt-button-collection .dt-button.active {
    background: #eef2ff !important;
    color: #2e3192 !important;
    font-weight: 700;
}

/* Tổng điểm badge */
.score-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: #f1f5f9;
    color: #334155;
    min-width: 60px;
    text-align: center;
}
.score-pill.high { background: #dcfce7; color: #166534; }
.score-pill.mid  { background: #dbeafe; color: #1e40af; }
.score-pill.low  { background: #fef3c7; color: #92400e; }

/* ----- Modal chi tiết ----- */
.modal .modal-content { border-radius: 14px; border: none; overflow: hidden; }
.modal .modal-header.bg-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2)) !important;
}
.detail-section-title {
    display: flex; align-items: center; gap: 8px;
    color: var(--c-primary);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: 10px;
}

/* ----- Avatar tròn họ tên ----- */
.avatar-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    display: inline-grid; place-items: center;
    font-weight: 700; font-size: 13px;
    flex: 0 0 auto;
}
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .meta { line-height: 1.25; }
.user-cell .meta strong { color: #0f172a; }
.user-cell .meta small { color: #64748b; font-size: 12px; }

/* ----- Charts container ----- */
.chart-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 20px 22px 18px;
    height: 100%;
    display: flex; flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.chart-card:hover { box-shadow: var(--shadow); }
.chart-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.chart-card-header .chart-title {
    font-size: 13px; color: #475569;
    text-transform: uppercase; letter-spacing: .4px;
    font-weight: 700;
    margin-bottom: 2px;
    display: flex; align-items: center; gap: 8px;
}
.chart-card-header .chart-subtitle { color: #94a3b8; font-size: 12px; margin: 0; }
.chart-card-header .chart-kpi { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1; }
.chart-card-header .chart-kpi-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; text-align: right; }

.chart-canvas-wrap {
    position: relative;
    flex: 1 1 auto;
    height: 280px;
    min-height: 280px;
}
.chart-canvas-wrap.tall { height: 360px; min-height: 360px; }
.chart-canvas-wrap.wide { height: 220px; min-height: 220px; }

/* ----- Responsive collapses sidebar ----- */
@media (max-width: 767.98px) {
    .dash-sidebar { min-height: auto; }
}

/* Brand logo grid fallback */
.brand-logo { letter-spacing: 1px; font-size: 18px; }


.form-switch .form-check-input { 
    margin-left: 1.5em  !important;
}

#section-hoc-ba, #section-bang-tn, #section-mon-tnthpt, #section-mon-hocba {
    padding: 10px 5px;
    background-color: #add8ee;
}