/* Giao diện chung trang sinh viên & quản trị — Khoa Giáo dục Thể chất */
:root {
    --brand: #0e7c66;
    --brand-600: #0b6653;
    --brand-50: #e7f5f1;
    --bg: #f3f5f7;
    --surface: #ffffff;
    --border: #e4e8ec;
    --text: #1d2733;
    --muted: #6a7684;
    --success: #1a8f5a;
    --success-50: #e6f5ec;
    --warning: #b7791f;
    --warning-50: #fdf3e1;
    --danger: #c53030;
    --danger-50: #fbeaea;
    --info: #2b6cb0;
    --info-50: #e8f0fa;
    --neutral-50: #eef1f4;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --topbar-h: 60px;
    --sidebar-w: 248px;
}

html, body { background: var(--bg); }
body {
    font-family: "Be Vietnam Pro", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: .9rem;
    color: var(--text);
}
a { color: var(--brand); }
a:hover { color: var(--brand-600); }

/* ---------- Topbar ---------- */
.app-topbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
    height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.app-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.app-brand:hover { color: var(--text); text-decoration: none; }
.app-brand img { width: 34px; height: 34px; }
.app-brand small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; line-height: 1.1; }
.app-user { display: flex; align-items: center; gap: 12px; }
.app-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-50); color: var(--brand); font-weight: 600;
}
.app-user-name { font-weight: 500; line-height: 1.15; }
.app-user-name small { display: block; color: var(--muted); font-weight: 400; font-size: .72rem; }
.btn-logout { color: var(--muted); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: .82rem; }
.btn-logout:hover { color: var(--danger); border-color: var(--danger); text-decoration: none; }

/* ---------- Sidebar ---------- */
.app-sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 1020;
    width: var(--sidebar-w);
    padding: 16px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.app-sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 12px 6px; }
.app-sidebar .nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin-bottom: 2px;
    border-radius: 8px;
    color: var(--text); font-weight: 500;
}
.app-sidebar .nav-link .feather { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.app-sidebar .nav-link:hover { background: var(--neutral-50); text-decoration: none; }
.app-sidebar .nav-link.active { background: var(--brand-50); color: var(--brand); }
.app-sidebar .nav-link.active .feather { color: var(--brand); }

/* ---------- Main ---------- */
.app-main {
    margin-left: var(--sidebar-w);
    padding: calc(var(--topbar-h) + 24px) 28px 24px;
    min-height: 100vh;
}
.app-main.no-sidebar { margin-left: 0; max-width: 960px; margin-right: auto; margin-left: auto; }
.app-footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 32px 0 8px; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.page-header h1 { font-size: 1.45rem; font-weight: 600; margin: 0; }
.page-header p { color: var(--muted); margin: 4px 0 0; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 20px; font-weight: 600; border-radius: var(--radius) var(--radius) 0 0 !important; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-header .card-sub { font-weight: 400; color: var(--muted); font-size: .8rem; }
.card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat-card .stat-label { color: var(--muted); font-size: .8rem; display: flex; align-items: center; gap: 6px; }
.stat-card .stat-label .feather { width: 15px; height: 15px; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-card .stat-note { color: var(--muted); font-size: .75rem; }
.stat-card.is-success .stat-value { color: var(--success); }
.stat-card.is-danger .stat-value { color: var(--danger); }
.stat-card.is-warning .stat-value { color: var(--warning); }
.stat-card.is-brand .stat-value { color: var(--brand); }

/* ---------- Tables ---------- */
.table-modern { margin-bottom: 0; font-size: .84rem; }
.table-modern th, .table-modern td { vertical-align: middle; border-top: 1px solid var(--border); padding: .6rem .75rem; }
.table-modern thead th, .table-modern tr:first-child th {
    background: #f8fafb; color: var(--muted); font-weight: 600; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); border-top: 0; white-space: nowrap;
}
.table-modern tbody tr:hover td { background: #fafbfc; }
.table-modern .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-modern .mono, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: .82rem; }
.table-modern .empty { text-align: center; color: var(--muted); padding: 28px; }
.table-pager td { border: 0 !important; padding-top: 12px; }
.table-pager table { margin: 0 auto; }
.table-pager a, .table-pager span { display: inline-block; min-width: 30px; padding: 4px 8px; margin: 0 2px; border-radius: 6px; text-align: center; }
.table-pager span { background: var(--brand); color: #fff; }
.table-pager a:hover { background: var(--neutral-50); text-decoration: none; }

.info-table th { width: 170px; color: var(--muted); font-weight: 500; padding: 6px 0; vertical-align: top; }
.info-table td { padding: 6px 0; }

/* ---------- Badges ---------- */
.badge { font-weight: 500; padding: .35em .65em; border-radius: 999px; font-size: .74rem; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info, .badge-primary { background: var(--info-50); color: var(--info); }
.badge-secondary { background: var(--neutral-50); color: var(--muted); }
.badge-brand { background: var(--brand-50); color: var(--brand); }

/* ---------- Buttons & forms ---------- */
.btn { border-radius: 8px; font-weight: 500; font-size: .86rem; padding: .45rem .95rem; }
.btn-sm { padding: .28rem .65rem; font-size: .78rem; }
.btn-primary, .btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-brand:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-light { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn .feather { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.form-control, .custom-select { border-radius: 8px; border-color: var(--border); font-size: .88rem; }
.form-control:focus, .custom-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 124, 102, .15); }
label { font-weight: 500; }

.alert { border-radius: 10px; border: 1px solid transparent; }
.alert-success { background: var(--success-50); color: #14532d; border-color: #bfe3cf; }
.alert-danger { background: var(--danger-50); color: #7f1d1d; border-color: #f1c4c4; }
.alert-warning { background: var(--warning-50); color: #744210; border-color: #f1dcb4; }
.alert-info { background: var(--info-50); color: #1e3a5f; border-color: #c4d8f0; }

.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-50); border-radius: 10px; padding: 14px 16px; color: #0b4a3d; }
.callout .feather { flex-shrink: 0; color: var(--brand); margin-top: 2px; }

/* ---------- Chọn ngân hàng (RadioButtonList dạng UnorderedList) ---------- */
.bank-options { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.bank-options li { position: relative; }
.bank-options input[type=radio] { position: absolute; opacity: 0; }
.bank-options label {
    display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 0;
    padding: 12px 18px; min-width: 240px;
    border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface);
}
.bank-options label::before {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #b8c1cb; flex-shrink: 0;
}
.bank-options input[type=radio]:checked + label { border-color: var(--brand); background: var(--brand-50); }
.bank-options input[type=radio]:checked + label::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.bank-options input[type=radio]:focus + label { box-shadow: 0 0 0 3px rgba(14, 124, 102, .15); }

/* ---------- Đối soát tự động ---------- */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #b8c1cb; }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 4px var(--success-50); }
.status-dot.busy { background: var(--info); box-shadow: 0 0 0 4px var(--info-50); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.monitor-status { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 600; }
.monitor-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.monitor-meta div { background: #f8fafb; border-radius: 8px; padding: 10px 12px; }
.monitor-meta span { display: block; color: var(--muted); font-size: .74rem; }
.monitor-meta strong { font-weight: 600; font-variant-numeric: tabular-nums; }

.log-list { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.log-list li { display: flex; gap: 12px; padding: 9px 20px; border-top: 1px solid var(--border); font-size: .83rem; }
.log-list li:first-child { border-top: 0; }
.log-list .log-time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-list .log-mark { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: #b8c1cb; }
.log-list .log-success .log-mark { background: var(--success); }
.log-list .log-danger .log-mark { background: var(--danger); }
.log-list .log-warning .log-mark { background: var(--warning); }
.log-list .log-info .log-mark { background: var(--info); }
.queue-list { display: flex; flex-wrap: wrap; gap: 6px; }
.queue-list .mono { background: var(--neutral-50); border-radius: 6px; padding: 3px 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .app-sidebar { position: fixed; top: var(--topbar-h); bottom: auto; width: 100%; height: auto; padding: 8px 12px; display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .app-sidebar .nav-section { display: none; }
    .app-sidebar .nav-link { white-space: nowrap; margin: 0; }
    .app-main { margin-left: 0; padding: calc(var(--topbar-h) + 76px) 16px 16px; }
    .app-user-name, .btn-logout span { display: none; }
}

/* ---------- Phân trang ---------- */
.pager-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border); }
.pager-buttons { display: flex; align-items: center; gap: 6px; }
.pager-buttons .btn.disabled { pointer-events: none; opacity: .45; }
.filter-bar label { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }

/* ---------- Trang xác thực (đăng nhập, quên mật khẩu) ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-hero {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(145deg, #0b6653 0%, #0e7c66 45%, #16a085 100%);
}
.auth-hero::after {
    content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 70%);
}
.auth-hero .brand { display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 1.05rem; }
.auth-hero .brand img { width: 52px; height: 52px; background: #fff; border-radius: 50%; padding: 4px; }
.auth-hero .brand small { display: block; font-weight: 400; opacity: .8; font-size: .8rem; }
.auth-hero h2 { font-size: 2rem; font-weight: 600; line-height: 1.25; margin: 0 0 14px; max-width: 460px; }
.auth-hero p { opacity: .85; max-width: 440px; margin: 0; }
.auth-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; opacity: .95; }
.auth-hero li .feather { width: 18px; height: 18px; flex-shrink: 0; }
.auth-hero .foot { font-size: .78rem; opacity: .7; position: relative; z-index: 1; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 10px 30px rgba(16, 24, 40, .06); padding: 32px; }
.auth-card h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.auth-card .form-control { height: 44px; }
.auth-card .btn-block { height: 44px; font-size: .95rem; }
.auth-card .mobile-brand { display: none; text-align: center; margin-bottom: 16px; }
.auth-card .mobile-brand img { width: 64px; height: 64px; }
.input-icon { position: relative; }
.input-icon .feather { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #9aa5b1; pointer-events: none; }
.input-icon .form-control { padding-left: 40px; }
.input-icon .btn-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px 8px; cursor: pointer; }
.input-icon .btn-eye .feather { position: static; transform: none; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; font-size: .85rem; }
.auth-row label { font-weight: 400; margin: 0; display: flex; align-items: center; gap: 6px; }
.auth-notice:empty, .auth-error:empty { display: none; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: .85rem; }
.auth-back .feather { width: 15px; height: 15px; }

@media (max-width: 860px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .auth-card .mobile-brand { display: block; }
}

/* ---------- Tab lọc tình trạng ---------- */
.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.status-tab { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-weight: 500; font-size: .84rem; background: var(--surface); }
.status-tab:hover { background: var(--neutral-50); color: var(--text); text-decoration: none; }
.status-tab .count { background: var(--neutral-50); color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: .75rem; font-variant-numeric: tabular-nums; }
.status-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.status-tab.active .count { background: rgba(255,255,255,.2); color: #fff; }

/* Dòng đang sửa trong bảng */
.table-modern tr.row-editing td { background: var(--brand-50); }
