/* ===========================================================
   Pickleball Member Manager — Sports green theme
   Fonts: Barlow / Barlow Condensed
   =========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=Barlow:wght@400;500;600;700&display=swap');

:root {
    --green:        #16a34a;
    --green-dark:   #15803d;
    --green-soft:   #dcfce7;
    --green-ring:   #22c55e;
    --blue:         #2563eb;
    --blue-soft:    #dbeafe;
    --amber:        #d97706;
    --amber-soft:   #fef3c7;
    --red:          #dc2626;
    --red-soft:     #fee2e2;

    --bg:           #f4f6f5;
    --surface:      #ffffff;
    --ink:          #0f172a;
    --ink-2:        #475569;
    --ink-3:        #94a3b8;
    --border:       #e2e8f0;

    --radius:       14px;
    --radius-sm:    10px;
    --shadow:       0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.05);
    --shadow-sm:    0 1px 2px rgba(15,23,42,.08);
    --maxw:         1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    padding-bottom: 72px; /* chừa chỗ cho bottom nav mobile */
}
h1, h2, h3, .page-title, .brand-text, .stat-value {
    font-family: 'Barlow Condensed', 'Barlow', sans-serif;
    letter-spacing: .2px;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Topbar ---------- */
.topbar {
    background: linear-gradient(120deg, var(--green), var(--green-dark));
    color: #fff;
    position: sticky; top: 0; z-index: 40;
    box-shadow: var(--shadow-sm);
}
.topbar-inner {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; gap: 20px;
    padding: 12px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-badge {
    width: 34px; height: 34px; display: grid; place-items: center;
    background: rgba(255,255,255,.18); border-radius: 10px; font-size: 18px;
}
.brand-text { font-size: 22px; font-weight: 700; }
.brand-dim { opacity: .8; font-weight: 500; }
.topnav { display: flex; gap: 4px; margin-left: auto; }
.topnav-link {
    color: rgba(255,255,255,.88); padding: 8px 14px; border-radius: 8px;
    font-weight: 500; transition: background .18s, color .18s;
}
.topnav-link:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.topnav-link.is-active { background: #fff; color: var(--green-dark); }

/* ---------- Nav dropdown groups ---------- */
.nav-group { position: relative; }
.nav-group-toggle {
    background: none; border: 0; font: inherit; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    color: rgba(255,255,255,.88);
}
.nav-group.is-active > .nav-group-toggle { background: rgba(255,255,255,.14); color: #fff; }
.nav-caret { font-size: 11px; opacity: .8; transition: transform .18s; }
.nav-group.is-open > .nav-group-toggle .nav-caret { transform: rotate(180deg); }
.nav-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
    min-width: 180px; padding: 6px; display: none;
    background: #fff; border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.18); border: 1px solid rgba(0,0,0,.06);
}
.nav-group:hover > .nav-dropdown,
.nav-group.is-open > .nav-dropdown { display: block; }
.nav-dropdown-link {
    display: block; padding: 8px 12px; border-radius: 7px;
    color: var(--ink-1, #1f2937); font-weight: 500; font-size: 14px;
    white-space: nowrap;
}
.nav-dropdown-link:hover { background: rgba(0,0,0,.05); text-decoration: none; }
.nav-dropdown-link.is-active { background: var(--green-dark); color: #fff; }

/* ---------- Container ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 22px 18px 40px; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-title { font-size: 30px; margin: 0; font-weight: 700; }
.page-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.section-title { font-size: 20px; margin: 28px 0 12px; }
.head-stats { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    transition: transform .06s, background .18s, box-shadow .18s, border-color .18s;
    text-decoration: none; line-height: 1.1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; border-color: var(--ink-3); }
.btn-warn { background: var(--amber); color: #fff; }
.btn-warn:hover { background: #b45309; color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:focus-visible { outline: 3px solid var(--green-ring); outline-offset: 2px; }

/* ---------- Stat cards ---------- */
.stat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 8px;
}
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--green);
}
.stat-green::before { background: var(--green); }
.stat-blue::before  { background: var(--blue); }
.stat-amber::before { background: var(--amber); }
.stat-red::before   { background: var(--red); }
.stat-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat-value { font-size: 38px; font-weight: 700; line-height: 1.1; margin-top: 4px; }
.stat-money { font-size: 28px; }
.stat-foot { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* ---------- Shortcuts ---------- */
.shortcut-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.shortcut {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink);
    box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .18s, border-color .18s;
}
.shortcut:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--green-ring); }
.shortcut-icon { font-size: 26px; }
.shortcut-name { font-weight: 700; font-size: 16px; }
.shortcut-desc { color: var(--ink-3); font-size: 13px; }

/* ---------- Cards & forms ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.form-card { max-width: 640px; }
.form-row { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-row label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.req { color: var(--red); }
input[type=text], input[type=tel], input[type=date], input[type=search],
input[type=number], input[type=password], input[type=email], textarea, select {
    font-family: inherit; font-size: 15px; color: var(--ink);
    padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; width: 100%; height: 44px; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--green-ring);
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
textarea { resize: vertical; }
input:read-only, input:disabled, select:disabled {
    background: var(--surface-2, #f3f4f6); color: var(--ink-3);
    cursor: not-allowed; box-shadow: none;
}
input:read-only:focus { border-color: var(--border); box-shadow: none; }
.field-error { color: var(--red); font-size: 13px; margin: 6px 0 0; }
.field-hint { color: var(--ink-3); font-size: 13px; margin: 6px 0 0; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix .suffix {
    display: flex; align-items: center; padding: 0 14px; background: #f1f5f9;
    border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0;
    color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.info-card h3 { margin: 0 0 8px; font-size: 18px; }
.info-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); }
.info-card li { margin: 4px 0; }

/* ---------- Search / filter bars ---------- */
.searchbar, .filterbar {
    display: flex; gap: 12px; align-items: flex-end; margin-bottom: 18px; flex-wrap: wrap;
}
/* Consistent control height so inputs, selects & buttons line up on one baseline */
.filterbar input[type=search], .filterbar input[type=text], .filterbar input[type=date],
.filterbar input[type=month], .filterbar input[type=number], .filterbar select,
.searchbar input[type=search] {
    height: 42px; padding: 0 12px; box-sizing: border-box;
}
.filterbar .btn, .searchbar .btn {
    height: 42px; padding: 0 18px;
}
.searchbar input[type=search] { flex: 1; min-width: 220px; }
/* Search input: fixed control height only — sizing/growth lives on its <label> (see below).
   Do NOT put flex on the input: inside a column-flex label, flex-basis becomes HEIGHT. */
.filterbar input[type=search] { flex: 0 0 auto; }
.filterbar input[type=date], .filterbar input[type=month] { width: 168px; }
.filterbar label {
    display: flex; flex-direction: column; justify-content: flex-end;
    font-size: 12.5px; font-weight: 600; gap: 5px; color: var(--ink-2); white-space: nowrap;
}
.filterbar label select, .filterbar label input { width: 100%; }
.filterbar label:has(input[type=date]), .filterbar label:has(input[type=month]) { flex: 0 0 auto; }
.filterbar label:has(input[type=search]) { flex: 1 1 240px; min-width: 200px; max-width: 360px; }
.filterbar select { min-width: 150px; }
/* Action buttons sit together at the trailing edge, balanced from the fields */
.filterbar > .btn:first-of-type { margin-left: auto; }
.filterbar .btn-ghost { margin-left: 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table thead th { background: #f8fafc; font-weight: 700; color: var(--ink-2); font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.data-table tbody tr:hover { background: #f9fbfa; }
.data-table tfoot td { background: #f8fafc; font-size: 15px; }
.data-table .num { text-align: right; }
.col-actions { text-align: right; white-space: nowrap; }
.cell-name { font-weight: 600; }
.cell-sub { color: var(--ink-3); font-size: 12.5px; display: block; }
.cell-note { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.money-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.money-cell.has-penalty { color: var(--red); }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.inline-form { display: inline; margin: 0; }
.row-absent td { background: #fff9f3; }

/* ---------- Badges & pills ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 12.5px; font-weight: 700; line-height: 1.4;
}
.badge-green { background: var(--green-soft); color: var(--green-dark); }
.badge-blue  { background: var(--blue-soft);  color: #1e40af; }
.badge-amber { background: var(--amber-soft); color: #92400e; }
.badge-red   { background: var(--red-soft);   color: #991b1b; }
.badge-gray  { background: #f1f5f9; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill-green { background: var(--green-soft); color: var(--green-dark); }
.pill-amber { background: var(--amber-soft); color: #92400e; }

/* ---------- Check-in grid ---------- */
.checkin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.checkin-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px;
}
.checkin-card.is-done { border-color: var(--green-ring); background: linear-gradient(180deg,#f6fef9,#fff); }
.checkin-top { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 44px; height: 44px; border-radius: 12px; flex: none;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    color: #fff; font-family: 'Barlow Condensed'; font-weight: 700; font-size: 22px;
    display: grid; place-items: center;
}
.checkin-name .cname { font-weight: 700; font-size: 16px; }
.checkin-name .phone { color: var(--ink-3); font-size: 13px; }
.checkin-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.checkin-time { font-weight: 600; color: var(--green-dark); font-size: 14px; font-variant-numeric: tabular-nums; }
.checkin-form { display: flex; flex-direction: column; gap: 8px; }
.file-input { display: none; }
.file-trigger { border-style: dashed; }
.file-name { font-size: 12.5px; color: var(--ink-2); text-align: center; min-height: 1em; word-break: break-all; }
.thumb { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 150px; object-fit: cover; }
.thumb-sm img { width: 56px; height: 56px; }
.thumb-sm { width: 56px; }

/* ---------- Alerts / empty ---------- */
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); color: var(--green-dark); border-color: #bbf7d0; }
.alert-error   { background: var(--red-soft);   color: #991b1b; border-color: #fecaca; }
.empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--ink-2); }
.empty p { margin: 0 0 14px; }

/* ---------- Bottom nav (mobile) ---------- */
.bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: none; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(15,23,42,.06); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav-link {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 2px 6px; color: var(--ink-3); font-size: 11px; font-weight: 600;
}
.bottomnav-link:hover { text-decoration: none; }
.bottomnav-icon { font-size: 19px; }
.bottomnav-link.is-active { color: var(--green-dark); }

.sitefoot { text-align: center; color: var(--ink-3); font-size: 13px; padding: 20px; }

/* ---------- Install page ---------- */
.install-page { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(135deg,#16a34a,#065f46); padding: 20px; }
.install-card { background: #fff; border-radius: 18px; padding: 34px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.install-logo { font-size: 42px; text-align: center; }
.install-card h1 { text-align: center; margin: 6px 0 18px; }
.install-list { color: var(--ink-2); font-size: 14px; padding-left: 18px; }
.install-list li { margin: 6px 0; }
.install-hint { color: var(--ink-3); font-size: 12.5px; text-align: center; margin-top: 16px; }

/* ---------- Responsive ---------- */
.show-sm { display: none; }
@media (max-width: 900px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .shortcut-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .topnav { display: none; }
    .bottomnav { display: flex; }
    .page-title { font-size: 26px; }
    .stat-value { font-size: 32px; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .stat-grid-3 { grid-template-columns: 1fr; }
    .hide-sm { display: none; }
    .show-sm { display: block; }
    .brand-dim { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ==== Trang đăng nhập / đăng ký ==== */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 24px 0;
}
.auth-card {
    width: 100%;
    max-width: 420px;
}
.auth-card .page-title { margin-bottom: 4px; }
.auth-card .page-sub { margin-bottom: 18px; }
.auth-alt {
    margin-top: 16px;
    text-align: center;
    color: var(--muted, #64748b);
    font-size: 0.95rem;
}
.auth-alt a { font-weight: 600; }

/* ---------- Nâng cấp v2: nghỉ phép, đi trễ, chốt tháng, thanh toán ---------- */
.pill-red { background: var(--red-soft, #fee2e2); color: #991b1b; }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .stat-grid-2 { grid-template-columns: 1fr; } }
.checkin-note {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px; font-size: 13px; margin-top: 4px;
}
.stack-form { display: flex; flex-direction: column; gap: 6px; }
.mini-input {
    padding: 6px 8px; border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px; font-size: 13px; max-width: 180px;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; }

/* ===== v3: notifications, mobile check-in, misc ===== */
.notif-bell {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    margin-left: 8px; text-decoration: none; font-size: 20px; line-height: 1;
    width: 40px; height: 40px; border-radius: 10px;
}
.notif-bell:hover { background: rgba(255,255,255,.12); }
.notif-bell-count {
    position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff;
    font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.notif-list { display: flex; flex-direction: column; gap: 12px; }
.notif-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-unread { background: #fffbeb; }
.card.notif-unread { border-left: 4px solid #f59e0b; }

.mobile-checkin-list { display: flex; flex-direction: column; gap: 10px; }
.mc-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border, #e2e8f0);
    background: #fff;
}
.mc-done { background: #ecfdf5; border-color: #a7f3d0; }
.mc-pending { background: #fff; border-left: 4px solid #ef4444; }
.mc-name { font-weight: 700; font-size: 1.05rem; }
.mc-phone { color: #64748b; font-size: .9rem; }
.mc-action .btn { min-width: 120px; }
.mc-form { margin: 0; }

/* ===========================================================
   v4: Thương hiệu động, flash, phân trang, header user, in ấn
   =========================================================== */

/* Ánh xạ theme sang màu thương hiệu (--primary/--secondary do header nạp).
   color-mix có fallback nhờ --primary luôn có giá trị mặc định. */
:root {
    --green:      var(--primary, #16a34a);
    --green-dark: color-mix(in srgb, var(--primary, #16a34a) 78%, #000);
    --green-ring: var(--primary, #16a34a);
    --green-soft: color-mix(in srgb, var(--primary, #16a34a) 14%, #fff);
}
.topbar { background: linear-gradient(120deg, var(--primary, #16a34a), var(--secondary, #0b7285)); }

/* Brand logo + nút menu mobile */
.brand-logo { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; background: #fff; }
.nav-toggle {
    display: none; background: rgba(255,255,255,.15); color: #fff; border: 0;
    width: 40px; height: 40px; border-radius: 10px; font-size: 20px; cursor: pointer;
}

/* User chip trong header */
.topbar-user { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.user-chip { display: flex; flex-direction: column; line-height: 1.15; color: #fff; text-align: right; }
.user-name { font-weight: 700; font-size: 14px; }
.user-role { font-size: 11px; opacity: .8; }

/* Flash / toast */
.flash-stack { position: fixed; top: 70px; right: 18px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.alert-warning { background: var(--amber-soft); color: #92400e; border-color: #fde68a; }
.alert-info    { background: var(--blue-soft);  color: #1e40af; border-color: #bfdbfe; }
.flash {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: var(--shadow); margin: 0; animation: flashIn .25s ease-out;
}
.flash-close { background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.flash-close:hover { opacity: 1; }
@keyframes flashIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Phân trang */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0 4px; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px;
    padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
    color: var(--ink); font-weight: 600; font-size: 14px;
}
.page-link:hover { text-decoration: none; border-color: var(--green-ring); background: #f8fafc; }
.page-link.is-active { background: var(--primary, #16a34a); color: #fff; border-color: var(--primary, #16a34a); }
.page-link.is-disabled { opacity: .45; pointer-events: none; }
.page-ellipsis { display: inline-flex; align-items: center; padding: 0 4px; color: var(--ink-3); }

/* Preview import CSV */
.import-summary { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.import-chip { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; }
.import-chip.total { background: #f1f5f9; color: var(--ink-2); }
.import-chip.valid { background: var(--green-soft); color: var(--green-dark); }
.import-chip.dup   { background: var(--amber-soft); color: #92400e; }
.import-chip.err   { background: var(--red-soft); color: #991b1b; }
.row-err td { background: #fff5f5; }
.row-dup td { background: #fffbeb; }

/* Cảnh báo restore */
.danger-box { background: var(--red-soft); border: 1px solid #fecaca; color: #991b1b; border-radius: 12px; padding: 16px; margin-bottom: 16px; font-weight: 600; }

/* Hint cài PWA */
.pwa-hint { display: flex; align-items: center; gap: 8px; background: var(--blue-soft); color: #1e40af; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }

/* Ảnh chụp preview camera check-in */
.cam-preview { width: 100%; max-height: 260px; object-fit: contain; border-radius: 12px; border: 1px solid var(--border); background: #f8fafc; margin-top: 8px; display: none; }
.cam-preview.show { display: block; }

@media (max-width: 640px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .user-chip { display: none; }
    .topnav.is-open {
        display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0;
        background: var(--green-dark); padding: 8px; gap: 2px; box-shadow: var(--shadow);
    }
    .topnav.is-open .topnav-link { color: #fff; }
    /* Trên mobile: nhóm hiển thị mở sẵn, dropdown xổ dọc trong panel */
    .topnav.is-open .nav-group { width: 100%; }
    .topnav.is-open .nav-group-toggle { width: 100%; justify-content: space-between; }
    .topnav.is-open .nav-dropdown {
        position: static; display: block; min-width: 0; padding: 2px 0 6px 12px;
        background: transparent; box-shadow: none; border: 0;
    }
    .topnav.is-open .nav-dropdown-link { color: rgba(255,255,255,.85); }
    .topnav.is-open .nav-dropdown-link:hover,
    .topnav.is-open .nav-dropdown-link.is-active { background: rgba(255,255,255,.15); color: #fff; }
    .flash-stack { left: 12px; right: 12px; max-width: none; top: 66px; }
}

/* ===========================================================
   In ấn báo cáo (print_monthly_report.php)
   =========================================================== */
@media print {
    .topbar, .bottomnav, .sitefoot, .no-print, .flash-stack, .nav-toggle { display: none !important; }
    body { background: #fff; padding: 0; }
    .container { max-width: 100%; padding: 0; }
    .print-sheet { box-shadow: none; border: 0; }
    .data-table th, .data-table td { border: 1px solid #94a3b8 !important; }
    @page { size: A4; margin: 14mm; }
}
.print-head { display: flex; align-items: center; gap: 16px; border-bottom: 3px solid var(--primary, #16a34a); padding-bottom: 12px; margin-bottom: 18px; }
.print-head .plogo { width: 64px; height: 64px; object-fit: contain; }
.print-head h1 { margin: 0; font-size: 26px; }
.print-head .pclub { color: var(--ink-2); font-size: 14px; }
.print-title { text-align: center; font-size: 20px; margin: 8px 0 18px; text-transform: uppercase; }
.sign-row { display: flex; justify-content: space-around; margin-top: 40px; text-align: center; }
.sign-row .sign-name { font-weight: 700; margin-bottom: 60px; }

/* ===========================================================
   v5 — ADMIN SHELL REDESIGN (sidebar trái + topbar)
   Minimal admin dashboard · xanh thể thao · mobile-first.
   Tất cả class mới, tương thích ngược với markup cũ.
   =========================================================== */
:root {
    /* Bảng màu theo yêu cầu (primary vẫn nhận màu CLB động qua --primary) */
    --primary-dark:  color-mix(in srgb, var(--primary, #0f9f6e) 82%, #000);
    --primary-light: color-mix(in srgb, var(--primary, #0f9f6e) 12%, #fff);
    --surface:  #ffffff;
    --text:     #1f2937;
    --muted:    #6b7280;
    --danger:   #ef4444;
    --warning:  #f59e0b;
    --success:  #10b981;
    --info:     #3b82f6;
    --sidebar-w: 250px;
}

/* Bỏ padding dành cho bottom-nav cũ (đã thay bằng sidebar drawer) */
body.has-shell { padding-bottom: 0; background: var(--bg); }
body.no-shell  { padding-bottom: 0; }

/* ---------- Layout khung ---------- */
.app-layout { display: flex; min-height: 100vh; align-items: stretch; }
.app-main {
    flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    flex: 0 0 var(--sidebar-w); width: var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--border);
    position: sticky; top: 0; align-self: flex-start;
    height: 100vh; overflow-y: auto; z-index: 60;
    display: flex; flex-direction: column;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 18px; border-bottom: 1px solid var(--border);
    color: var(--text); text-decoration: none; position: sticky; top: 0;
    background: var(--surface); z-index: 1;
}
.sidebar-logo:hover { text-decoration: none; }
.sidebar-logo-img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.sidebar-logo-badge {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: grid; place-items: center; font-size: 20px;
    background: var(--primary-light); color: var(--primary-dark);
}
.sidebar-logo-text {
    font-family: 'Barlow Condensed','Barlow',sans-serif;
    font-weight: 700; font-size: 20px; line-height: 1.05; color: var(--text);
}
.sidebar-menu { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: 10px;
    color: var(--ink-2); font-weight: 600; font-size: 15px;
    text-decoration: none; transition: background .15s, color .15s;
    position: relative;
}
.sidebar-link:hover { background: #f1f5f9; color: var(--text); text-decoration: none; }
.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.sidebar-link.active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--primary, #0f9f6e);
}
.sidebar-link-icon { font-size: 18px; width: 22px; text-align: center; flex: none; }
.sidebar-link-text { flex: 1 1 auto; }
.sidebar-link-badge {
    background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-link-logout { margin-top: 6px; color: var(--danger); }
.sidebar-link-logout:hover { background: var(--red-soft); color: #991b1b; }

/* Nhóm menu thu gọn (Quản Trị Viên) */
.sidebar-group { display: block; }
.sidebar-group-summary { cursor: pointer; list-style: none; user-select: none; }
.sidebar-group-summary::-webkit-details-marker { display: none; }
.sidebar-group-caret {
    flex: none; width: 8px; height: 8px; margin-left: auto;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .18s; opacity: .55;
}
.sidebar-group[open] > .sidebar-group-summary .sidebar-group-caret { transform: rotate(-135deg); }
.sidebar-group-items { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 14px;
    padding-left: 8px; border-left: 1px solid var(--border, #e5e7eb); }
/* Ẩn menu con khi nhóm đang đóng — chỉ hiện khi click mở hoặc đang ở trang con.
   (author display:flex ở trên có thể ghi đè rule ẩn mặc định của <details>, nên ẩn tường minh) */
.sidebar-group:not([open]) > .sidebar-group-items { display: none; }
.sidebar-sublink { font-size: 14px; padding: 9px 12px; }

.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.45);
    z-index: 55; border: 0;
}
.sidebar-overlay[hidden] { display: none; }

/* ---------- Topbar (shell) ---------- */
.app-main .topbar {
    background: var(--surface); color: var(--text);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 45;
    display: flex; align-items: center; gap: 14px;
    padding: 10px 20px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.topbar-title { min-width: 0; }
.page-title-top {
    margin: 0; font-size: 22px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: 'Barlow Condensed','Barlow',sans-serif; letter-spacing: .2px;
}
.topbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-search { position: relative; }
.topbar-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 14px; opacity: .6; pointer-events: none;
}
.topbar-search input[type=search] {
    width: 220px; padding: 9px 12px 9px 34px; border-radius: 999px;
    background: var(--bg); border: 1px solid var(--border); font-size: 14px;
}
.topbar-search input[type=search]:focus { background: #fff; }
.topbar-bell {
    position: relative; width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; color: var(--ink-2); text-decoration: none; flex: none;
}
.topbar-bell:hover { background: #f1f5f9; text-decoration: none; }
.topbar-bell-count {
    position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.topbar-user {
    display: flex; align-items: center; gap: 9px;
    text-decoration: none; padding: 4px 8px 4px 4px; border-radius: 999px;
    transition: background .15s ease;
}
.topbar-user:hover { background: rgba(0,0,0,.05); }
.topbar-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex: none;
    background: linear-gradient(135deg, var(--primary, #0f9f6e), var(--primary-dark));
    color: #fff; font-weight: 700; font-size: 16px;
    display: grid; place-items: center;
    font-family: 'Barlow Condensed','Barlow',sans-serif;
}
.topbar-avatar-img { object-fit: cover; background: none; }
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.topbar-user-name { font-weight: 700; font-size: 14px; color: var(--text); }
.topbar-user-role { font-size: 11px; color: var(--muted); }

/* ---------- Main content ---------- */
.main-content { flex: 1 1 auto; width: 100%; }
body.has-shell .main-content.container { max-width: 1200px; }

/* ---------- Page header ---------- */
.page-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-header h1, .page-header .page-title { font-size: 26px; margin: 0; font-weight: 700; }

/* ---------- Grid tiện dụng ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Button aliases (bổ sung, primary đã có) ---------- */
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #f8fafc; border-color: var(--ink-3); color: var(--text); }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #b91c1c; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.topbar-logout { flex: none; }

/* ---------- Form aliases ---------- */
.form-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.form-group > label { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-control {
    font-family: inherit; font-size: 15px; color: var(--text);
    padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; width: 100%; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
    outline: none; border-color: var(--primary, #0f9f6e);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #0f9f6e) 22%, transparent);
}

/* ---------- Badge aliases (theo tên chuẩn) ---------- */
.badge-success { background: var(--green-soft); color: var(--green-dark); }
.badge-danger  { background: var(--red-soft);   color: #991b1b; }
.badge-warning { background: var(--amber-soft); color: #92400e; }
.badge-info    { background: var(--blue-soft);  color: #1e40af; }

/* ---------- Empty state / toast aliases ---------- */
.empty-state {
    text-align: center; padding: 48px 20px; background: #fff;
    border: 1px dashed var(--border); border-radius: var(--radius); color: var(--ink-2);
}
.empty-state .empty-icon { font-size: 42px; display: block; margin-bottom: 10px; opacity: .8; }
.toast {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: 12px; margin-bottom: 12px; font-weight: 500;
    border: 1px solid transparent; box-shadow: var(--shadow);
}

/* Ẩn dòng khi tìm nhanh (topbar search) */
.search-hidden { display: none !important; }

/* ---------- Responsive shell ---------- */
@media (min-width: 769px) {
    .nav-toggle { display: none; }
}
@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .topbar-search input[type=search] { width: 160px; }
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100dvh;
        transform: translateX(-100%); transition: transform .25s ease;
        box-shadow: 0 10px 40px rgba(0,0,0,.25);
    }
    .sidebar.is-open { transform: none; }
    body.has-shell .app-main { min-height: 100vh; }
    .app-main .topbar { padding: 10px 14px; }
    .nav-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--primary-light); color: var(--primary-dark);
        border: 0; width: 42px; height: 42px; border-radius: 10px;
        font-size: 20px; cursor: pointer; flex: none;
    }
    .topbar-user-meta { display: none; }
    .topbar-logout { display: none; }
    body.has-shell .main-content.container { padding: 16px 14px 32px; }
}
@media (max-width: 560px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .topbar-search { display: none; }
    .page-title-top { font-size: 19px; }
    .btn { min-height: 44px; }
}

/* Guest shell (login/register) — giữ topbar xanh gọn, canh giữa */
.topbar-guest { background: linear-gradient(120deg, var(--primary,#0f9f6e), var(--secondary,#0b7285)); }
.guest-container { max-width: 480px; }

/* ===========================================================
   v6 — PREMIUM / VIP LAYER
   Sidebar tối sang trọng · topbar kính mờ · card tầng bóng đổ
   · SVG icon Lucide · micro-interaction. Chỉ override phần
   nhìn, KHÔNG đụng logic/markup backend.
   =========================================================== */
:root {
    --font-sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head: 'Barlow Condensed', 'Barlow', sans-serif;

    /* Nền tổng thể ấm/sâu hơn — bớt cảm giác template phẳng */
    --bg: #eef2f1;
    --border: #e6ebe9;

    /* Tông tối của sidebar dẫn xuất từ màu CLB (tự thích ứng brand) */
    --side-1: color-mix(in srgb, var(--primary, #0f9f6e) 34%, #06231a);
    --side-2: #05201a;
    --side-txt:  rgba(255,255,255,.72);
    --side-txt2: rgba(255,255,255,.45);

    /* Bóng đổ nhiều tầng — chìa khoá tạo cảm giác cao cấp */
    --shadow-xs: 0 1px 2px rgba(16,32,24,.06);
    --shadow-sm: 0 1px 3px rgba(16,32,24,.07), 0 1px 2px rgba(16,32,24,.05);
    --shadow:    0 4px 12px rgba(16,32,24,.06), 0 12px 32px rgba(16,32,24,.07);
    --shadow-lg: 0 10px 24px rgba(16,32,24,.10), 0 24px 60px rgba(16,32,24,.12);

    --ring: color-mix(in srgb, var(--primary, #0f9f6e) 40%, transparent);
    --radius:    16px;
    --radius-sm: 12px;
}

body { font-family: var(--font-sans); letter-spacing: .1px; }

/* SVG icon dùng chung (nav_icon) */
.sidebar-link-icon svg, .topbar-bell svg, .topbar-search-icon svg,
.nav-toggle svg, .sidebar-logo-badge svg, .brand-badge svg { width: 20px; height: 20px; display: block; }
.topbar-search-icon svg { width: 17px; height: 17px; }

/* ---------- Sidebar tối sang trọng ---------- */
.sidebar {
    background: linear-gradient(180deg, var(--side-1) 0%, var(--side-2) 100%);
    border-right: 0;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.04), 4px 0 24px rgba(6,32,24,.10);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 6px; }

.sidebar-logo {
    background: transparent; border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 20px 18px; gap: 12px;
}
.sidebar-logo-text { color: #fff; letter-spacing: .4px; }
.sidebar-logo-badge {
    background: linear-gradient(135deg, var(--primary, #0f9f6e), color-mix(in srgb, var(--primary,#0f9f6e) 55%, #063));
    color: #fff; width: 40px; height: 40px; border-radius: 12px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary,#0f9f6e) 45%, transparent);
}

.sidebar-menu { padding: 14px 12px; gap: 3px; }
/* Nhãn nhóm nhỏ phía trên menu (nếu muốn) — để trống, giữ tối giản */
.sidebar-link {
    color: var(--side-txt); font-weight: 500; font-size: 14.5px;
    padding: 11px 13px; border-radius: 11px; gap: 13px;
}
.sidebar-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-link-icon { color: var(--side-txt2); transition: color .15s; width: 20px; }
.sidebar-link:hover .sidebar-link-icon { color: rgba(255,255,255,.9); }

.sidebar-link.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary,#0f9f6e) 30%, transparent), rgba(255,255,255,.02));
    color: #fff; font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.sidebar-link.active .sidebar-link-icon { color: #fff; }
.sidebar-link.active::before {
    content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px;
    width: 3px; border-radius: 0 4px 4px 0;
    background: #fff; box-shadow: 0 0 10px rgba(255,255,255,.5);
}
.sidebar-link-logout { color: rgba(255,180,180,.8); margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,.07); border-radius: 11px; padding-top: 14px; }
.sidebar-link-logout:hover { background: rgba(239,68,68,.16); color: #fff; }
.sidebar-link-logout .sidebar-link-icon { color: inherit; }

/* ---------- Topbar kính mờ ---------- */
.app-main .topbar {
    background: rgba(255,255,255,.78);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(16,32,24,.02);
    padding: 12px 24px;
}
.page-title-top { font-family: var(--font-head); font-size: 23px; font-weight: 700; letter-spacing: .3px; }
.topbar-search input[type=search] {
    width: 240px; border-radius: 12px; border-color: var(--border);
    background: var(--bg); padding: 10px 12px 10px 38px; font-size: 14px;
    transition: box-shadow .18s, border-color .18s, background .18s;
}
.topbar-search input[type=search]:focus { background:#fff; border-color: var(--primary,#0f9f6e); box-shadow: 0 0 0 4px var(--ring); }
.topbar-search-icon { left: 13px; color: var(--muted); opacity: 1; }
.topbar-bell { color: var(--ink-2); border-radius: 12px; border: 1px solid transparent; }
.topbar-bell:hover { background: var(--bg); border-color: var(--border); }

.topbar-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--primary,#0f9f6e) 30%, transparent),
                0 4px 10px color-mix(in srgb, var(--primary,#0f9f6e) 30%, transparent);
    font-family: var(--font-head);
}

/* ---------- Card cao cấp ---------- */
body.has-shell { background:
    radial-gradient(1200px 400px at 100% -5%, color-mix(in srgb, var(--primary,#0f9f6e) 8%, transparent), transparent),
    var(--bg);
}
.card {
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 24px;
    transition: box-shadow .2s, transform .2s;
}
.section-title, .page-header h1 { font-family: var(--font-head); }

/* Stat card: accent trên đỉnh + hiệu ứng nâng khi hover */
.stat-card {
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 20px 20px 18px; transition: transform .2s, box-shadow .2s;
    background: linear-gradient(180deg, #fff, #fdfefb);
}
.stat-card::before { width: 100%; height: 4px; bottom: auto; right: 0;
    background: linear-gradient(90deg, var(--green), var(--green-ring)); }
.stat-blue::before  { background: linear-gradient(90deg, var(--blue), #60a5fa); }
.stat-amber::before { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.stat-red::before   { background: linear-gradient(90deg, var(--red), #f87171); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-value { font-family: var(--font-head); font-size: 40px; letter-spacing: .5px; }
.stat-label { text-transform: uppercase; letter-spacing: .5px; font-size: 12px; }

/* Shortcut card premium hover */
.shortcut { border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.shortcut:hover { transform: translateY(-3px); box-shadow: var(--shadow);
    border-color: color-mix(in srgb, var(--primary,#0f9f6e) 45%, var(--border)); }

/* ---------- Nút gradient có ánh sáng ---------- */
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary,#0f9f6e), color-mix(in srgb, var(--primary,#0f9f6e) 72%, #000));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary,#0f9f6e) 32%, transparent);
}
.btn-primary:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary,#0f9f6e) 90%, #000), color-mix(in srgb, var(--primary,#0f9f6e) 62%, #000));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--primary,#0f9f6e) 42%, transparent);
    transform: translateY(-1px);
}
.btn-secondary, .btn-ghost { box-shadow: var(--shadow-xs); }

/* ---------- Bảng tinh gọn hơn ---------- */
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table thead th { background: #f6faf8; letter-spacing: .5px; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--primary,#0f9f6e) 5%, #fff); }

/* ---------- Badge mềm hơn ---------- */
.badge, .pill { letter-spacing: .2px; }

/* ---------- Nút menu mobile (SVG) ---------- */
.nav-toggle svg { width: 22px; height: 22px; }

/* ---------- Trang khách: badge gradient ---------- */
.brand-badge {
    background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.12));
    color: #fff; width: 38px; height: 38px; border-radius: 11px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}

/* Sidebar sáng lại trên mobile? — giữ tối, đã hợp gu premium */
@media (max-width: 768px) {
    .sidebar { box-shadow: none; }
    .app-main .topbar { padding: 11px 16px; }
}

/* ===========================================================
   v7 — SÁNG & XANH DƯƠNG (BRIGHT ROYAL-BLUE PREMIUM)
   Mục tiêu: bớt tối, chủ đạo xanh dương, sang hơn nữa.
   - Nền canvas airy blue, không còn xám xanh lá.
   - Sidebar: gradient royal-blue rực rỡ + glow (thay tông gần đen).
   - Topbar kính trong hơn, viền xanh nhạt.
   - Accent, ring, shadow đều lệch hue sang xanh dương.
   Chỉ override phần nhìn — KHÔNG đụng markup/logic backend.
   =========================================================== */
:root {
    /* Canvas sáng, hơi ám xanh dương */
    --bg:        #eef3fc;
    --border:    #e2e9f6;
    --ink:       #16223b;
    --ink-2:     #4a5878;
    --ink-3:     #8b98b5;
    --text:      #16223b;
    --muted:     #64708c;

    /* Sidebar royal-blue: sáng, rực, vẫn premium */
    --side-1: #2f6bff;   /* đỉnh: xanh dương tươi */
    --side-2: #143b97;   /* đáy: navy sâu tạo chiều */
    --side-txt:  rgba(255,255,255,.82);
    --side-txt2: rgba(255,255,255,.60);

    /* Bóng đổ hue xanh dương */
    --shadow-xs: 0 1px 2px rgba(29,58,138,.08);
    --shadow-sm: 0 1px 3px rgba(29,58,138,.10), 0 1px 2px rgba(29,58,138,.06);
    --shadow:    0 6px 16px rgba(29,58,138,.10), 0 16px 40px rgba(29,58,138,.12);
    --shadow-lg: 0 12px 28px rgba(29,58,138,.16), 0 28px 70px rgba(29,58,138,.18);
    --ring: color-mix(in srgb, var(--primary,#2563eb) 42%, transparent);
}

/* Canvas: gradient sáng + vệt sáng xanh dịu ở góc */
body.has-shell {
    background:
        radial-gradient(1100px 460px at 100% -8%, rgba(59,130,246,.16), transparent),
        radial-gradient(900px 500px at -10% 110%, rgba(37,99,235,.10), transparent),
        var(--bg);
}

/* ---------- Sidebar SÁNG (light glass) + accent xanh dương ---------- */
.sidebar {
    background:
        linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    border-right: 1px solid var(--border);
    box-shadow: none;
}
.sidebar::-webkit-scrollbar-thumb { background: #cdd8ee; }
.sidebar-logo {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #f6f9ff);
}
.sidebar-logo-text { color: #14213d; }
.sidebar-logo-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: none;
}
.sidebar-link { color: #56617e; font-weight: 600; }
.sidebar-link:hover { background: #eef3fc; color: #14213d; }
.sidebar-link-icon { color: #93a0bd; }
.sidebar-link:hover .sidebar-link-icon { color: #2563eb; }
.sidebar-link.active {
    background: linear-gradient(90deg, #e8f0ff, #f3f7ff);
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(37,99,235,.12), 0 4px 12px rgba(37,99,235,.10);
}
.sidebar-link.active .sidebar-link-icon { color: #2563eb; }
.sidebar-link.active::before {
    left: -1px; background: linear-gradient(180deg, #3b82f6, #2563eb);
    box-shadow: 0 0 12px rgba(37,99,235,.55);
}
.sidebar-link-logout {
    color: #dc2626; border-top: 1px solid var(--border);
}
.sidebar-link-logout:hover { background: #fee2e2; color: #991b1b; }
.sidebar-link-logout .sidebar-link-icon { color: currentColor; }

/* ---------- Topbar kính trong, viền xanh ---------- */
.app-main .topbar {
    background: rgba(255,255,255,.82);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 14px rgba(29,58,138,.05);
}
.page-title-top { color: #14213d; }
.topbar-search input[type=search] {
    background: #f3f7ff; border-color: var(--border);
}
.topbar-search input[type=search]:focus {
    background: #fff; border-color: var(--primary,#2563eb);
    box-shadow: 0 0 0 4px var(--ring);
}
.topbar-bell { color: var(--ink-2); }
.topbar-bell:hover { background: #eef3fc; border-color: var(--border); }
.topbar-avatar {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37,99,235,.30),
                0 6px 14px rgba(37,99,235,.35);
}

/* ---------- Thẻ sáng, viền xanh nhạt, bóng dịu ---------- */
.card, .stat-card, .table-wrap, .checkin-card {
    border-color: var(--border);
    background: #ffffff;
}
.stat-card { background: linear-gradient(180deg, #ffffff, #f7faff); }
.stat-card::before { background: linear-gradient(90deg, var(--primary,#2563eb), #60a5fa); }
.stat-blue::before  { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.data-table thead th { background: #f2f7ff; color: var(--ink-2); }
.data-table tbody tr:hover { background: #f3f8ff; }

/* Badge xanh dương đậm chất hơn */
.badge-blue, .badge-info { background: #dbe8ff; color: #1e40af; }

/* Nút chính: gradient xanh dương sáng + glow */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 18px rgba(37,99,235,.34);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2f6bff, #1e40af);
    box-shadow: 0 10px 24px rgba(37,99,235,.44);
    transform: translateY(-1px);
}

/* Link chung theo xanh dương */
a { color: #1d4ed8; }

/* Trang khách (login) — nền xanh dương sáng thay vì xanh lá */
.install-page { background: linear-gradient(135deg, #3b82f6, #1e3a8a); }

@media (max-width: 768px) {
    .sidebar { box-shadow: none; }
}

/* ===========================================================
   v8 — MENU NỔI BẬT (prominent navigation)
   - Icon nằm trong ô bo tròn → luôn nhìn thấy rõ, có chiều sâu.
   - Active = pill xanh dương ĐẶC, chữ trắng + glow (nổi bật nhất).
   - Hover: nền xanh nhạt + trượt nhẹ sang phải.
   Chỉ override phần nhìn của menu — KHÔNG đụng markup/logic.
   =========================================================== */
.sidebar-menu { padding: 16px 12px; gap: 6px; }

/* Tiêu đề nhóm nhỏ phía trên menu (dùng chung cả logo dưới) */
.sidebar-logo { padding: 18px 18px 16px; }

.sidebar-link {
    padding: 11px 13px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 650;
    color: #47536e;
    letter-spacing: .1px;
    transition: background .16s, color .16s, transform .16s, box-shadow .16s;
}

/* Icon trong ô bo tròn — tăng độ nhận diện */
.sidebar-link-icon {
    width: 34px; height: 34px; font-size: 0;
    display: grid; place-items: center;
    border-radius: 10px;
    background: #eef3fc;
    color: #5b6a8a;
    box-shadow: none;
    transition: background .16s, color .16s;
}
.sidebar-link-icon svg { width: 18px; height: 18px; }

.sidebar-link:hover {
    background: #eaf1ff;
    color: #14213d;
    transform: translateX(2px);
}
.sidebar-link:hover .sidebar-link-icon {
    background: #dbe8ff; color: #2563eb;
}

/* Active = pill gradient xanh dương đặc, chữ trắng, glow rõ */
.sidebar-link.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    box-shadow: none;
    transform: none;
}
.sidebar-link.active:hover { transform: none; background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.sidebar-link.active .sidebar-link-icon {
    background: rgba(255,255,255,.22); color: #fff;
    box-shadow: none;
}
/* Bỏ thanh chỉ báo cũ — đã thay bằng pill đặc */
.sidebar-link.active::before { display: none; }
.sidebar-link.active .sidebar-link-badge { background: #fff; color: #2563eb; }

/* Logout: icon đỏ nổi bật, tách khỏi nhóm chính */
.sidebar-link-logout { margin-top: 10px; padding-top: 12px; }
.sidebar-link-logout .sidebar-link-icon { background: #fee2e2; color: #dc2626; }
.sidebar-link-logout:hover { transform: translateX(2px); }
.sidebar-link-logout:hover .sidebar-link-icon { background: #fecaca; color: #b91c1c; }

/* ==== Trang nộp phí (pay_membership.php) ==== */
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.plan-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 8px;
}
.plan-card {
    padding: 18px 20px;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: transform .15s ease, box-shadow .15s ease;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(37,99,235,.12); }
.plan-card-name   { font-weight: 700; font-size: 1.05rem; color: #111827; }
.plan-card-price  { font-size: 1.5rem; font-weight: 800; color: #2563eb; margin: 6px 0 2px; }
.plan-card-months { color: #6b7280; font-size: .9rem; }
.plan-card-desc   { color: #6b7280; font-size: .85rem; margin-top: 8px; }

.pay-qr-card {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
    padding: 24px;
}
.pay-qr-img-wrap {
    background: #fff;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    flex: 0 0 auto;
}
.pay-qr-img { display: block; width: 170px; max-width: 55vw; height: auto; border-radius: 8px; }
.pay-qr-empty {
    flex: 1;
    color: #9ca3af;
    font-style: italic;
    padding: 24px;
    text-align: center;
    background: #f9fafb;
    border-radius: 12px;
}
.pay-qr-info { flex: 1; min-width: 220px; line-height: 1.9; }
.pay-lbl { color: #6b7280; }
.pay-acc { letter-spacing: .5px; }
.pay-qr-note { margin-top: 10px; padding: 10px 12px; background: #eff6ff; border-radius: 10px; color: #1e40af; font-size: .9rem; }
.pay-qr-hint { margin-top: 12px; color: #6b7280; font-size: .85rem; }

/* ===== Thông báo NỔI BẬT: gửi ảnh đã chuyển khoản ===== */
.pay-cta {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 6px 18px rgba(245, 158, 11, .18);
    animation: payCtaPulse 2.4s ease-in-out infinite;
}
@keyframes payCtaPulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(245, 158, 11, .18); }
    50%      { box-shadow: 0 6px 26px rgba(245, 158, 11, .34); }
}
.pay-cta-icon {
    flex: 0 0 auto;
    width: 52px; height: 52px;
    display: grid; place-items: center;
    font-size: 30px; line-height: 1;
    background: #fff; border-radius: 14px;
    box-shadow: 0 3px 8px rgba(245, 158, 11, .2);
}
.pay-cta-body { flex: 1; min-width: 0; }
.pay-cta-title {
    font-size: 1.25rem; font-weight: 800; color: #b45309;
    letter-spacing: -.01em; line-height: 1.2;
}
.pay-cta-text { margin: 6px 0 0; font-size: 1rem; line-height: 1.55; color: #78350f; }
.pay-cta-text b { color: #92400e; }
.pay-cta-btn {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 12px;
    padding: 11px 20px;
    font-size: 1rem; font-weight: 700;
    color: #fff; text-decoration: none;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(234, 88, 12, .32);
    transition: transform .15s ease, box-shadow .15s ease;
}
.pay-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(234, 88, 12, .42); }

/* ===== Form gửi ảnh + lưới ảnh chuyển khoản ===== */
.proof-card { padding: 22px; }
.proof-lead {
    margin-bottom: 16px; padding: 12px 14px;
    background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px;
    color: #166534; font-size: .95rem; line-height: 1.55;
}
.proof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.proof-item { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.proof-thumb {
    flex: 0 0 auto; width: 96px; height: 96px;
    border-radius: 12px; overflow: hidden;
    border: 1px solid #e5e7eb; background: #fff;
    display: grid; place-items: center;
}
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proof-meta { flex: 1; min-width: 0; line-height: 1.5; }
.proof-who { font-size: .95rem; color: #1e293b; margin-bottom: 4px; }
.proof-date { color: #64748b; font-size: .82rem; margin-top: 4px; }
.proof-note {
    margin-top: 6px; font-size: .85rem; color: #475569;
    background: #f8fafc; border-radius: 8px; padding: 6px 8px;
    word-break: break-word;
}
.proof-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) {
    .pay-cta { flex-direction: column; text-align: center; align-items: center; }
    .proof-item { flex-direction: column; align-items: center; text-align: center; }
}

/* ===== Uploader chuyên nghiệp (kéo-thả + preview) ===== */
.uploader {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    padding: 22px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    cursor: pointer;
    overflow: hidden;
}
.uploader:hover { border-color: #93c5fd; background: #f5f9ff; }
.uploader.is-drag {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12) inset;
}
.uploader.is-error { border-color: #ef4444; background: #fef2f2; }
.uploader-input {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 2;
}
.uploader.has-file .uploader-input { pointer-events: none; }

/* Khu vực kéo-thả (trạng thái trống) */
.uploader-drop {
    display: flex; align-items: center; gap: 16px;
    color: #475569; pointer-events: none;
}
.uploader.has-file .uploader-drop { display: none; }
.uploader-icon {
    width: 64px; height: 64px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 14px;
    background: #e0edff; color: #2563eb;
    transition: transform .2s ease;
}
.uploader:hover .uploader-icon,
.uploader.is-drag .uploader-icon { transform: translateY(-2px) scale(1.03); }
.uploader-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.5; }
.uploader-text b { color: #1e293b; font-size: .98rem; }
.uploader-text span { font-size: .88rem; color: #64748b; }
.uploader-text u { color: #2563eb; text-decoration: none; border-bottom: 1px solid #93c5fd; }
.uploader-text small { color: #94a3b8; font-size: .78rem; margin-top: 2px; }

/* Preview (trạng thái có ảnh) */
.uploader-preview {
    display: none;
    align-items: center; gap: 18px;
    animation: uploaderIn .35s cubic-bezier(.2,.8,.2,1);
}
.uploader.has-file .uploader-preview { display: flex; }
@keyframes uploaderIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.uploader-thumb {
    width: 96px; height: 96px; flex: 0 0 auto;
    border-radius: 12px; overflow: hidden;
    background: #fff; border: 1px solid #e5e7eb;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(15,23,42,.08);
}
.uploader-thumb img { width: 100%; height: 100%; object-fit: contain; }
.uploader-meta { flex: 1; min-width: 0; }
.uploader-fname {
    font-weight: 600; color: #1e293b; font-size: .92rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.uploader-fsize { color: #64748b; font-size: .82rem; margin-top: 2px; }
.uploader-bar {
    height: 6px; border-radius: 999px; background: #e2e8f0;
    margin: 10px 0; overflow: hidden;
}
.uploader-bar span {
    display: block; height: 100%; width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}
.uploader-change {
    position: relative; z-index: 3;
    background: #fff; border: 1px solid #cbd5e1;
    color: #2563eb; font-weight: 600; font-size: .82rem;
    padding: 6px 14px; border-radius: 8px; cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.uploader-change:hover { background: #eff6ff; border-color: #93c5fd; }
@media (max-width: 520px) {
    .uploader-drop, .uploader-preview { flex-direction: column; text-align: center; }
}
