:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(22, 27, 34, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #3182ce;
    --success: #2ea043;
    --danger: #da3633;
    --warning: #d29922;
    --card-bg: rgba(33, 38, 45, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow-x: hidden;
    padding: 20px 0;
}

/* Background Blobs for Glassmorphism effect */
.blob-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 { top: -10%; left: -10%; width: 500px; height: 500px; background: #58a6ff; }
.blob-2 { bottom: -20%; right: -10%; width: 600px; height: 600px; background: #8a2be2; animation-delay: -5s; }
.blob-3 { top: 40%; left: 50%; width: 400px; height: 400px; background: #2ea043; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.2); }
}

/* Base UI Glass Container */
.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: min(98vw, 1880px);
    max-width: 1880px;
    min-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
}

/* Sections */
.section {
    display: none;
    padding: 34px 42px;
    animation: fadeIn 0.5s ease;
    flex: 1;
}
.section.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login Form */
#loginSection {
    max-width: 450px;
    margin: auto;
    width: 100%;
    text-align: center;
}

.header-title h2 { font-weight: 800; font-size: 2rem; margin: 15px 0 5px; background: linear-gradient(135deg, #58a6ff, #8a2be2); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-title p { color: var(--text-secondary); margin-bottom: 30px; }
.header-title i { font-size: 3rem; color: var(--accent); }

.form-group { display: flex; flex-direction: column; gap: 15px; }

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}
.input-container i {
    position: absolute;
    left: 15px;
    color: var(--text-secondary);
}
input {
    width: 100%;    padding: 15px 15px 15px 45px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: 0.3s;
}
input:focus { outline: none; border-color: var(--accent); background: rgba(0,0,0,0.4); }

.divider { display: flex; align-items: center; text-align: center; margin: 10px 0; color: var(--text-secondary); font-size: 0.8rem; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--glass-border); }
.divider span { padding: 0 10px; }

.playwright-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 2px 2px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: 0.2s ease;
}
.playwright-toggle:hover {
    border-color: rgba(88,166,255,0.35);
    background: rgba(88,166,255,0.08);
}
.playwright-toggle__switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
}
.playwright-toggle__switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.playwright-toggle__slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.15);
    transition: 0.2s ease;
}
.playwright-toggle__slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #ffffff;
    transition: 0.2s ease;
}
#loginUsePlaywright:checked + .playwright-toggle__slider {
    background: rgba(88,166,255,0.95);
    border-color: rgba(88,166,255,0.95);
}
#loginUsePlaywright:checked + .playwright-toggle__slider::before {
    transform: translateX(16px);
}
.playwright-toggle__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}
.playwright-toggle__text strong {
    font-size: 12px;
    font-weight: 700;
    color: #dbeafe;
}
.playwright-toggle__text small {
    font-size: 11px;
    color: #9ca3af;
}

.rescan-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    user-select: none;
}
.rescan-toggle--buy:hover {
    border-color: rgba(139,92,246,0.45);
    background: rgba(139,92,246,0.09);
}
.rescan-toggle--sell:hover {
    border-color: rgba(249,115,22,0.45);
    background: rgba(249,115,22,0.09);
}
.rescan-toggle__switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex: 0 0 40px;
}
.rescan-toggle__switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.rescan-toggle__slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.16);
    transition: 0.2s ease;
}
.rescan-toggle__slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #ffffff;
    transition: 0.2s ease;
}
.rescan-toggle__switch input:checked + .rescan-toggle__slider::before {
    transform: translateX(18px);
}
.rescan-toggle--buy .rescan-toggle__switch input:checked + .rescan-toggle__slider {
    background: rgba(139,92,246,0.95);
    border-color: rgba(139,92,246,0.95);
}
.rescan-toggle--sell .rescan-toggle__switch input:checked + .rescan-toggle__slider {
    background: rgba(249,115,22,0.95);
    border-color: rgba(249,115,22,0.95);
}
.rescan-toggle__text {
    font-size: 12px;
    line-height: 1.35;
}
.rescan-toggle--buy .rescan-toggle__text { color: #ddd6fe; }
.rescan-toggle--sell .rescan-toggle__text { color: #fed7aa; }

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.primary-btn { background: var(--accent); color: white; }
.primary-btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 10px 20px rgba(88, 166, 255, 0.4); }
.small-btn { padding: 8px 15px; font-size: 0.9rem; background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--glass-border);}
.small-btn:hover { background: rgba(255,255,255,0.1); }

/* Dashboard Topbar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    margin-bottom: 18px;
    background: linear-gradient(145deg, rgba(21, 34, 56, 0.55), rgba(10, 16, 28, 0.45));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.logo h3 { letter-spacing: 0.2px; font-weight: 800; }
.user-info { display: flex; gap: 10px; align-items: center; }
.info-badge {
    background: rgba(15, 25, 41, 0.7);
    padding: 8px 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.info-badge i { color: var(--success); }
.info-badge.highlight i { color: var(--warning); }
.info-badge.blue i { color: var(--accent); }
#serverClock {
    margin-left: 10px !important;
    padding: 5px 10px !important;
    background: rgba(8, 13, 23, 0.75) !important;
    border-radius: 999px !important;
    font-size: 0.8rem !important;
    border: 1px solid rgba(167, 139, 250, 0.35) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Dashboard Content & Nav */
.dashboard-content { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.nav-menu {
    flex: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.58), rgba(12, 19, 30, 0.38));
    overflow-x: auto;
    justify-content: center;
    scrollbar-width: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.nav-menu::-webkit-scrollbar { display: none; }
.nav-btn { background: transparent; color: var(--text-secondary); border: none; padding: 10px 16px; border-radius: 999px; text-align: left; font-size: 0.93rem; font-weight: 600; cursor: pointer; transition: 0.25s; display: flex; align-items: center; gap: 7px; white-space: nowrap; flex-shrink: 0; }
.nav-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); transform: translateY(-1px); }
.nav-btn.active {
    background: linear-gradient(145deg, #67b3ff, #3d8de6);
    color: #fff;
    box-shadow: 0 8px 18px rgba(60, 145, 240, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Panels */
.panels-container {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    padding: 34px;
    border: 1px solid var(--glass-border);
    overflow-y: auto;
    min-height: 0;
    max-height: none;
}
.panel { display: none; animation: fadeIn 0.4s; }
.panel.active { display: block; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.panel-header h2 { font-weight: 600; }
.favorites-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.favorites-search-wrap {
    position: relative;
    width: min(360px, 45vw);
}
.favorites-search-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
}
#favoritesSearchInput {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 0.9rem;
}
#favoritesSearchInput:focus {
    outline: none;
    border-color: var(--accent);
}

/* Cards Grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 22px; }
.player-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 26px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.player-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.player-card .grade { position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.1); padding: 5px 10px; border-radius: 8px; font-weight: 800; font-size: 1rem; color: #ffd700; }
.player-card h3 { margin-bottom: 5px; color: var(--text-primary); font-size: 1.2rem; }
.player-card .spid { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 15px; }
.player-card .price-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 1.05rem; }
.player-card .price-row .val { font-weight: 600; color: white; }

.inventory-section {
    margin-bottom: 16px;
}
.inventory-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 800;
}
.inventory-section-count {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    background: rgba(255,255,255,0.08);
}
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 10px;
}
.inventory-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(255,255,255,0.045);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.inventory-card:hover {
    border-color: rgba(88,166,255,0.28);
    background: rgba(255,255,255,0.065);
    transform: translateY(-1px);
}
.inventory-season {
    width: 28px;
    min-width: 28px;
    display: flex;
    justify-content: center;
}
.inventory-season img {
    max-width: 28px;
    max-height: 24px;
    object-fit: contain;
}
.inventory-name {
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inventory-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    color: #8b949e;
    font-size: 11px;
}
.inventory-pill {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.08);
}
.inventory-grade {
    min-width: 34px;
    text-align: right;
    font-weight: 900;
    font-size: 15px;
}
.grade-icon {
    width: 27px;
    height: 16px;
    object-fit: contain;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}
.grade-icon--sm {
    width: 27px;
    height: 16px;
}
.grade-icon--lg {
    width: 27px;
    height: 16px;
}
.inventory-grade .grade-icon {
    width: 27px;
    height: 16px;
}
.inventory-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.inventory-action-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
}
.inventory-action-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}
.inventory-action-btn.registry {
    background: rgba(46,160,67,0.12);
    border: 1px solid rgba(46,160,67,0.28);
    color: #7ee787;
}
.inventory-action-btn.registry:hover:not(:disabled) {
    background: rgba(46,160,67,0.2);
}
.inventory-action-btn.favorite {
    background: rgba(218,54,51,0.08);
    border: 1px solid rgba(218,54,51,0.18);
    color: var(--danger);
}
.inventory-action-btn.favorite:hover {
    background: rgba(218,54,51,0.18);
}

/* ─── Inventory table layout (Đội hình / Kho) ─── */
.inv-section {
    margin-bottom: 26px;
}
.inv-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.inv-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.inv-section-title.is-squad .inv-section-value { color: #58a6ff; }
.inv-section-title.is-reserve .inv-section-value { color: #58a6ff; }
.inv-section-value {
    font-weight: 800;
}
.inv-section-count {
    font-size: 12px;
    font-weight: 700;
    color: #8b949e;
    padding: 1px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
}
.inv-batch-btn {
    white-space: nowrap;
}
.inv-batch-btn.active {
    background: rgba(218,54,51,0.18);
    border-color: rgba(218,54,51,0.4);
    color: #ff7b72;
}
.inv-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
}
.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.inv-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #8b949e;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
    background: rgba(255,255,255,0.015);
}
.inv-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}
.inv-table tbody tr:last-child td {
    border-bottom: none;
}
.inv-row {
    transition: background 0.15s ease;
}
.inv-row:hover {
    background: rgba(255,255,255,0.035);
}
.inv-col-select {
    width: 40px;
    text-align: center;
}
.inv-col-grade,
.inv-col-ovr {
    white-space: nowrap;
}
.inv-col-value {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.inv-col-action {
    width: 1%;
    white-space: nowrap;
}
.inv-batch-check {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--danger);
}
.inv-player-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 180px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.inv-player-cell:hover {
    background: rgba(88,166,255,0.08);
}
.inv-player-cell:hover .inv-player-name {
    color: #79c0ff;
}
.inv-face-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.inv-face {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255,255,255,0.05);
}
.inv-face-fallback {
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    color: #555;
    font-size: 18px;
}
.inv-player-info {
    min-width: 0;
}
.inv-player-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.inv-player-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}
.inv-season-img {
    max-width: 22px;
    max-height: 18px;
    object-fit: contain;
}
.inv-pos-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}
.inv-reset {
    font-size: 10px;
    color: #8b949e;
}
.inv-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}
.inv-act-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #c9d1d9;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.inv-act-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.09);
}
.inv-act-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}
.inv-act-btn.act-replace {
    border-color: rgba(88,166,255,0.3);
    color: #79c0ff;
    background: rgba(88,166,255,0.08);
}
.inv-act-btn.act-replace:hover:not(:disabled) { background: rgba(88,166,255,0.16); }
.inv-act-btn.act-add {
    border-color: rgba(46,160,67,0.3);
    color: #7ee787;
    background: rgba(46,160,67,0.08);
}
.inv-act-btn.act-add:hover:not(:disabled) { background: rgba(46,160,67,0.16); }
.inv-act-btn.act-buy {
    border-color: rgba(218,54,51,0.3);
    color: #ff7b72;
    background: rgba(218,54,51,0.08);
}
.inv-act-btn.act-buy:hover:not(:disabled) { background: rgba(218,54,51,0.16); }
.inv-act-btn.act-sell {
    border-color: rgba(46,160,67,0.3);
    color: #7ee787;
    background: rgba(46,160,67,0.08);
}
.inv-act-btn.act-sell:hover:not(:disabled) { background: rgba(46,160,67,0.16); }
.inv-act-btn.act-upgrade {
    border-color: rgba(88,166,255,0.3);
    color: #79c0ff;
    background: rgba(88,166,255,0.08);
}
.inv-act-btn.act-upgrade:hover:not(:disabled) { background: rgba(88,166,255,0.16); }

/* Batch-sell floating bar */
.inv-batch-bar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #161b22;
    border: 1px solid rgba(240,246,252,0.14);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.inv-batch-bar-info {
    font-size: 13px;
    color: #c9d1d9;
}
.inv-batch-confirm {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: var(--danger) !important;
}
.inv-batch-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.inv-bsell-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.inv-bsell-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.inv-bsell-price {
    width: 130px;
    font-size: 13px;
    padding: 7px 8px;
    text-align: right;
    font-weight: 700;
    color: var(--accent);
    background: rgba(13,17,23,0.7);
    border: 1px solid rgba(240,246,252,0.14);
    border-radius: 8px;
}

/* ── SVIP/VIP header badge ── */
.info-badge.vip {
    background: linear-gradient(145deg, rgba(187,128,9,0.22), rgba(120,80,5,0.12));
    border-color: rgba(242,204,96,0.4);
}
.info-badge.vip i { color: #f2cc60; }
.vip-expiry {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ── Kho vật phẩm (items inventory) ── */
.items-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.items-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 3px;
}
.items-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: 0.2s ease;
}
.items-toggle-btn:hover { color: var(--text-primary); }
.items-toggle-btn.active {
    background: linear-gradient(145deg, #67b3ff, #3d8de6);
    color: #fff;
    box-shadow: 0 4px 12px rgba(60,145,240,0.32);
}
.items-search-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}
.items-search-wrap i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
}
#itemsSearchInput {
    width: 100%;
    padding: 10px 12px 10px 34px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 0.9rem;
}
#itemsSearchInput:focus { outline: none; border-color: var(--accent); }
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr));
    gap: 12px;
}
.item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.09);
    background: rgba(255,255,255,0.04);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.item-card:hover {
    border-color: rgba(88,166,255,0.28);
    background: rgba(255,255,255,0.06);
    transform: translateY(-1px);
}
.item-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
.item-icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.35);
    overflow: hidden;
}
.item-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.item-icon-fallback {
    color: #f2cc60;
    font-size: 26px;
}
.item-body { flex: 1; min-width: 0; }
.item-name {
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.item-meta {
    font-size: 12px;
    color: #8b949e;
    line-height: 1.5;
}
.item-claim-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(88,166,255,0.35);
    border-radius: 9px;
    cursor: pointer;
    background: rgba(88,166,255,0.14);
    color: #8cc4ff;
    transition: 0.2s ease;
}
.item-claim-btn:hover:not(:disabled) {
    background: rgba(88,166,255,0.24);
    border-color: rgba(88,166,255,0.5);
}
.item-claim-btn:disabled { cursor: not-allowed; opacity: 0.65; }
.item-store-tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #8b949e;
}
.item-open-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(88,166,255,0.35);
    border-radius: 9px;
    cursor: pointer;
    background: rgba(88,166,255,0.14);
    color: #8cc4ff;
    transition: 0.2s ease;
}
.item-open-btn:hover:not(:disabled) {
    background: rgba(88,166,255,0.24);
    border-color: rgba(88,166,255,0.5);
}
.item-open-btn:disabled { cursor: not-allowed; opacity: 0.65; }

/* ===== Mở hàng loạt (batch select) ===== */
#itemsBatchToggleBtn.active {
    background: rgba(248,81,73,0.16);
    border-color: rgba(248,81,73,0.5);
    color: #ff7b72;
}
.item-card.selectable { cursor: pointer; }
.item-card.selectable:hover {
    border-color: rgba(88,166,255,0.4);
}
.item-select {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    cursor: pointer;
}
.item-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.items-batch-bar {
    position: sticky;
    bottom: 14px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(88,166,255,0.3);
    background: rgba(20,24,33,0.96);
    box-shadow: 0 8px 26px rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    z-index: 20;
}
.items-batch-bar.hidden { display: none; }
.items-batch-info { color: #c9d1d9; font-size: 14px; }
.items-batch-info b { color: var(--accent); font-size: 15px; }
.items-batch-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Modal Mở vật phẩm ===== */
.open-modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #8b949e;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s ease;
}
.open-modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.open-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}
.open-item-info { display: flex; align-items: center; gap: 14px; min-width: 0; }
.open-item-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
}
.open-item-icon .item-icon { width: 56px; height: 56px; min-width: 56px; }
.open-item-name { font-weight: 800; font-size: 15px; color: #fff; }
.open-item-sub { font-size: 12px; color: #8b949e; margin-top: 3px; }
.open-item-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.open-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 70px;
    padding: 8px 12px;
    border-radius: 9px;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255,255,255,0.07);
}
.open-stat-label { font-size: 11px; color: #8b949e; }
.open-stat-value { font-size: 16px; font-weight: 800; color: #fff; }
.open-results-title {
    font-size: 12px;
    font-weight: 700;
    color: #8b949e;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}
.open-results-head {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #6e7681;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.open-results-body {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 18px;
}
.open-result-empty {
    text-align: center;
    padding: 30px 20px;
    color: #6e7681;
    font-size: 13px;
}
.open-result-row {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
}
.open-result-type { flex: 0 0 90px; color: #8b949e; display: inline-flex; align-items: center; gap: 6px; }
.open-result-item { flex: 1; color: #fff; display: inline-flex; align-items: center; gap: 7px; min-width: 0; flex-wrap: wrap; }
.open-result-value { flex: 0 0 110px; text-align: right; font-weight: 700; color: #2ea043; }
.open-result-season {
    font-size: 11px;
    color: #8b949e;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.06);
}
.open-result-season-img {
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}
.open-result-ovr {
    font-size: 11px;
    font-weight: 700;
    color: #f0b429;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(240,180,41,0.12);
}
.open-item-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.open-count-wrap { display: flex; flex-direction: column; gap: 6px; }
.open-count-wrap label { font-size: 12px; font-weight: 600; color: #8b949e; }
.open-count-input {
    width: 100px;
    padding: 9px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 8px;
    border: 1px solid rgba(88,166,255,0.3);
    font-size: 14px;
}
.open-confirm-btn {
    background: #1f6feb;
    border: none;
    box-shadow: 0 5px 15px rgba(31,111,235,0.4);
}
.open-all-btn {
    background: rgba(88,166,255,0.14);
    border: 1px solid rgba(88,166,255,0.35);
    color: #8cc4ff;
}
.open-all-btn:hover:not(:disabled) {
    background: rgba(88,166,255,0.24);
    border-color: rgba(88,166,255,0.5);
}
.open-all-btn:disabled { cursor: not-allowed; opacity: 0.65; }
.items-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #8b949e;
    font-size: 14px;
}

.upgrade-maintenance {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 620px;
    margin: 0 auto;
    padding: 34px;
    border-radius: 12px;
    border: 1px solid rgba(240,246,252,0.1);
    background: linear-gradient(145deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
}
.upgrade-maintenance__eyebrow {
    width: fit-content;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(242,204,96,0.32);
    background: rgba(187,128,9,0.1);
    color: #f2cc60;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.upgrade-maintenance h3 {
    color: #f0f6fc;
    font-size: 1.35rem;
    margin-bottom: 10px;
}
.upgrade-maintenance p {
    color: #9da7b3;
    line-height: 1.65;
    max-width: 520px;
}
.upgrade-maintenance__bar {
    height: 6px;
    margin-top: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.07);
}
.upgrade-maintenance__bar span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f2cc60, #58a6ff);
}

/* Skeletons */
.skeleton-card { background: var(--card-bg); height: 160px; border-radius: 15px; position: relative; overflow: hidden; }
.skeleton-card::after { content: ""; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent); animation: skeleton 1.5s infinite; }
@keyframes skeleton { 100% { left: 100%; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* Utils */
.hidden { display: none !important; }
.toast { position: fixed; bottom: 30px; right: 30px; background: rgba(46, 160, 67, 0.9); color: white; padding: 15px 25px; border-radius: 10px; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); transform: translateY(100px); opacity: 0; transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 10000; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: rgba(218, 54, 51, 0.9); }

.search-result { margin-top: 20px; background: var(--card-bg); padding: 20px; border-radius: 15px; border: 1px solid var(--glass-border); }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex; justify-content: center; align-items: center;
    z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    width: 90%; max-width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    text-align: center;
    transform: translateY(-20px) scale(0.95); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.show .modal-box { transform: translateY(0) scale(1); }
.modal-box h3 { margin-bottom: 10px; color: white; font-size:1.5rem; }
.modal-box p { margin-bottom: 25px; color: var(--text-secondary); font-size: 1.05rem; line-height:1.5; }
.modal-actions { display: flex; gap: 15px; justify-content: center; }

/* Order Book Table */
.ob-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.95rem; }
.ob-table th, .ob-table td { padding: 10px; text-align: center; border-bottom: 1px solid var(--glass-border); }
.ob-table th { color: var(--text-secondary); font-weight: 600; border-bottom: 2px solid var(--glass-border); }
.ob-buy { color: var(--danger); font-weight: 700; }
.ob-sell { color: var(--accent); font-weight: 700; }
.ob-price { color: white; font-weight: 600; }

/* Autocomplete CSS Override */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: calc(100% - 190px);
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
}
.autocomplete-item:hover {
    background: rgba(255,255,255,0.1);
}
.autocomplete-item:last-child {
    border-bottom: none;
}

/* Price-history snapshot dropdown (custom, themed) */
.ph-select { position: relative; user-select: none; }
.ph-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.ph-select__trigger:hover { border-color: var(--accent); }
.ph-select.open .ph-select__trigger { border-color: var(--accent); background: rgba(88,166,255,0.08); }
.ph-select__caret { color: var(--text-secondary); font-size: 11px; transition: transform 0.2s; flex-shrink: 0; }
.ph-select.open .ph-select__caret { transform: rotate(180deg); }
.ph-select__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(18, 18, 18, 0.97);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    z-index: 1200;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 12px 30px rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    padding: 4px;
    display: none;
}
.ph-select.open .ph-select__menu { display: block; }
.ph-select__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s;
}
.ph-select__option:hover { background: rgba(255,255,255,0.07); }
.ph-select__option.selected { background: var(--accent); color: #fff; font-weight: 700; }
.ph-select__option .ph-opt-ago { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-select__option .ph-opt-meta { color: var(--text-secondary); font-size: 12px; flex-shrink: 0; }
.ph-select__option.selected .ph-opt-meta { color: rgba(255,255,255,0.85); }

/* Phân bổ cấp thẻ 24h */
.ph-dist {
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    overflow: hidden;
}
.ph-dist-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
}
.ph-dist-toggle .ph-dist-caret {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}
.ph-dist.collapsed .ph-dist-caret {
    transform: rotate(-90deg);
}
.ph-dist-body {
    padding: 0 14px 12px;
}
.ph-dist.collapsed .ph-dist-body {
    display: none;
}
.ph-dist-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.ph-dist-title {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ph-dist-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.ph-dist-totals {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.ph-dist-totals b { color: #fff; font-weight: 800; }
.ph-dist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ph-dist-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px 3px 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
}
.ph-dist-chip b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Settings columns */
.settings-columns {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.settings-columns > div {
    flex: 1;
    min-width: 0;
}

/* ============= MOBILE RESPONSIVE ============= */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 0;
    }

    .glass-container {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .section {
        padding: 15px;
    }

    /* Login */
    #loginSection {
        padding: 20px 10px;
    }
    .header-title h2 { font-size: 1.5rem; }
    .header-title i { font-size: 2rem; }

    /* Topbar */
    .topbar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        padding: 10px;
        margin-bottom: 12px;
    }
    .logo {
        font-size: 1rem;
        flex-wrap: wrap;
        gap: 6px;
    }
    .logo h3 { font-size: 1rem; }
    .user-info {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        overflow-x: visible;
        scrollbar-width: none;
    }
    .user-info::-webkit-scrollbar { display: none; }
    .info-badge {
        padding: 6px 10px;
        font-size: 0.72rem;
        border-radius: 10px;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
    }
    /* VIP badge chiếm trọn một hàng cho dễ đọc */
    .info-badge.vip:not(.hidden) {
        flex: 1 1 100%;
    }
    /* Gom nút khóa + đăng xuất về cuối, giữ cạnh nhau */
    .user-info #webLockBtn { margin-left: auto; }
    .user-info #webLockBtn,
    .user-info #logoutBtn {
        flex: 0 0 auto;
        padding: 8px 12px !important;
    }
    #serverClock {
        margin-left: 0 !important;
        font-size: 0.72rem !important;
        padding: 4px 8px !important;
    }

    /* Nav → horizontal scroll */
    .dashboard-content { gap: 12px; }
    .nav-menu {
        flex-direction: row;
        gap: 4px;
        padding-bottom: 2px;
        border-radius: 10px;
        padding: 4px;
        justify-content: flex-start;
    }
    .nav-btn {
        white-space: nowrap;
        padding: 10px 0;
        font-size: 0.9rem;
        border-radius: 8px;
        flex: 1;
        text-align: center;
        justify-content: center;
    }
    .nav-label { display: none; }

    /* Panels */
    .panels-container {
        padding: 12px;
        max-height: none;
        border-radius: 10px;
    }
    .panel-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        margin-bottom: 15px;
    }
    .panel-header h2 { font-size: 1rem; flex:1; }
    .favorites-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .favorites-search-wrap {
        width: 100%;
        min-width: 0;
    }

    /* Cards */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .player-card {
        padding: 14px;
    }
    .player-card h3 {
        font-size: 0.95rem;
        padding-right: 35px !important;
    }
    .player-card .grade {
        top: 10px;
        right: 10px;
        padding: 3px 8px;
        font-size: 0.85rem;
    }
    .player-card .price-row {
        font-size: 0.9rem;
    }

    /* Modals */
    .modal-box {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-box h3 { font-size: 1.2rem; }

    /* Toast */
    .toast {
        left: 10px;
        right: 10px;
        bottom: 15px;
        font-size: 0.85rem;
        padding: 12px 15px;
    }

    /* Autocomplete */
    .autocomplete-dropdown {
        width: 100%;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* Settings: 1 cột trên mobile */
    .settings-columns {
        flex-direction: column;
        gap: 16px;
    }

    /* Inventory: bảng → thẻ dọc, không cần cuộn ngang */
    .inv-table-wrap {
        overflow-x: visible;
        border: none;
        border-radius: 0;
        background: none;
    }
    .inv-table,
    .inv-table tbody,
    .inv-table tbody tr,
    .inv-table tbody td {
        display: block;
        width: 100%;
    }
    .inv-table thead {
        display: none;
    }
    .inv-row {
        border: 1px solid rgba(255,255,255,0.09);
        border-radius: 12px;
        background: rgba(255,255,255,0.03);
        padding: 12px;
        margin-bottom: 12px;
    }
    .inv-row:hover {
        background: rgba(255,255,255,0.03);
    }
    .inv-table tbody td {
        padding: 0;
        border-bottom: none;
    }
    /* Ô cầu thủ full-width ở trên cùng */
    .inv-col-player {
        margin-bottom: 10px;
    }
    .inv-player-cell {
        min-width: 0;
    }
    .inv-player-name {
        max-width: none;
    }
    /* Cấp thẻ / OVR / Giá trị: hàng nhãn - giá trị */
    .inv-col-grade,
    .inv-col-ovr,
    .inv-col-value {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 6px 2px !important;
        border-bottom: 1px solid rgba(255,255,255,0.05) !important;
        font-size: 0.82rem;
    }
    .inv-col-grade::before,
    .inv-col-ovr::before,
    .inv-col-value::before {
        content: attr(data-label);
        color: #8b949e;
        font-weight: 600;
        font-size: 0.78rem;
    }
    /* Nút hành động dàn đủ chiều ngang */
    .inv-col-action {
        width: 100% !important;
        margin-top: 10px;
    }
    .inv-actions {
        justify-content: stretch;
        flex-wrap: wrap;
        gap: 8px;
    }
    .inv-act-btn {
        flex: 1 1 0;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.8rem;
    }
    /* Checkbox chọn (batch) hiển thị đầu thẻ khi bật */
    .inv-col-select {
        width: 100% !important;
        text-align: left !important;
        margin-bottom: 8px;
    }
    /* Header section: gọn lại trên mobile */
    .inv-section-head {
        flex-wrap: wrap;
    }
    .inv-section-title {
        font-size: 0.95rem;
    }
}

@media (min-width: 1600px) {
    .section {
        padding: 38px 46px;
    }
    .nav-menu { gap: 12px; padding: 9px; }
    .panels-container {
        padding: 38px;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
    }
}

@media (max-width: 400px) {
    .info-badge {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .player-card {
        padding: 12px;
    }
}

/* ─── Snipe Targets Panel (two-column layout) ─── */
.snipe-panel-sub {
    margin: 4px 0 0;
    font-size: 13px;
    color: #8b949e;
}
.snipe-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
}
@media (max-width: 900px) {
    .snipe-layout {
        grid-template-columns: 1fr;
    }
}
.snipe-tasks-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
}
.snipe-tasks-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.snipe-tasks-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}
.snipe-tasks-title i {
    color: var(--accent);
}
.snipe-tasks-count {
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 4px 12px;
    white-space: nowrap;
}

/* ─── Snipe Targets Panel (table) ─── */
.snipe-targets-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.snipe-targets-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}
.snipe-targets-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}
.snipe-target-tr {
    transition: background 0.15s;
}
.snipe-target-tr:hover {
    background: rgba(255, 255, 255, 0.04);
}
.snipe-targets-table .col-player {
    min-width: 220px;
}
.snipe-targets-table .col-qty,
.snipe-targets-table .col-action {
    white-space: nowrap;
}
.snipe-targets-table .col-price,
.snipe-targets-table .col-lastprice {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.snipe-target-tr .player-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.snipe-target-tr .player-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}
.snipe-target-tr .player-info {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}
.snipe-target-tr .player-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    max-width: 160px;
}
.snipe-target-tr .pos-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    text-transform: uppercase;
}
.snipe-target-tr .ovr-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
    background: #1e3a5f;
    color: #60a5fa;
}
.snipe-target-tr .price-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}
.snipe-action-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
}
.snipe-action-tag.action-buy {
    background: rgba(46, 160, 67, 0.15);
    color: #2ea043;
    border: 1px solid rgba(46, 160, 67, 0.3);
}
.snipe-action-tag.action-sell {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}
.snipe-target-tr .status-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.snipe-target-tr .status-running {
    background: rgba(46, 160, 67, 0.15);
    color: #2ea043;
}
.snipe-target-tr .status-waiting {
    background: rgba(139, 148, 158, 0.15);
    color: #8b949e;
}
.snipe-target-tr .status-triggered {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}
.snipe-target-tr .status-done {
    background: rgba(139, 148, 158, 0.1);
    color: #666;
}
.snipe-target-tr .action-btn {
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.snipe-target-tr .action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.snipe-target-tr .action-btn.btn-stop {
    border-color: rgba(218, 54, 51, 0.3);
    color: #da3633;
}
.snipe-target-tr .action-btn.btn-stop:hover {
    background: rgba(218, 54, 51, 0.2);
}
.snipe-target-tr .action-btn.btn-reorder {
    border-color: rgba(46, 160, 67, 0.3);
    color: #2ea043;
}
.snipe-target-tr .action-btn.btn-reorder:hover {
    background: rgba(46, 160, 67, 0.2);
}
.grade-badge-sm {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Card tier badge */
.tier-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 165, 0, 0.15);
    color: #ffa500;
    flex-shrink: 0;
}

/* ─── Snipe Quick Add form ─── */
.snipe-quickadd {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: visible;
}
.snipe-quickadd-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.snipe-quickadd-head i {
    color: var(--accent);
}
.snipe-quickadd-body {
    padding: 16px 18px 18px;
}
.sqa-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    margin-bottom: 6px;
}
.sqa-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    background: rgba(13, 17, 23, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.sqa-input:focus {
    border-color: var(--accent);
}
select.sqa-input {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}
.sqa-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.sqa-ac-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s;
}
.sqa-ac-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.sqa-selected {
    margin-top: 8px;
    font-size: 12px;
    color: #fff;
    padding: 8px 10px;
    background: rgba(46, 160, 67, 0.08);
    border: 1px solid rgba(46, 160, 67, 0.25);
    border-radius: 8px;
}
.sqa-hint {
    font-size: 12px;
    color: #666;
    margin: 8px 0 14px;
}
.sqa-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.sqa-col {
    flex: 1;
    min-width: 120px;
}
.sqa-submit {
    width: 100%;
    padding: 12px;
    margin-top: 4px;
    background: #6d28d9;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, opacity 0.15s;
    box-shadow: 0 5px 15px rgba(109, 40, 217, 0.35);
}
.sqa-submit:hover:not(:disabled) {
    background: #7c3aed;
}
.sqa-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==========================================================================
   Coupon picker (Nhận BP hàng loạt) — dropdown tự vẽ, menu "portal" ra body
   để không bị cắt bởi danh sách thẻ có overflow-y: auto.
   ========================================================================== */
.cpn-select { position: relative; flex: 1; min-width: 0; }

.cpn-select__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 7px 10px;
    background: rgba(22, 27, 34, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.cpn-select__trigger:hover {
    border-color: rgba(88, 166, 255, 0.6);
    background: rgba(88, 166, 255, 0.06);
}

.cpn-select.open .cpn-select__trigger {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.12);
}

.cpn-select__trigger.is-active {
    border-color: rgba(46, 160, 67, 0.5);
    background: rgba(46, 160, 67, 0.08);
}

.cpn-select__trigger.is-active:hover {
    border-color: rgba(46, 160, 67, 0.8);
}

.cpn-select__icon { color: var(--text-secondary); font-size: 11px; flex-shrink: 0; }
.cpn-select__trigger.is-active .cpn-select__icon { color: var(--success); }

.cpn-select__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpn-select__value { color: var(--success); font-weight: 800; flex-shrink: 0; }

.cpn-select__pill {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.cpn-select__pill--out { background: rgba(218, 54, 51, 0.18); color: #f87171; }
.cpn-select__pill--on { background: rgba(46, 160, 67, 0.18); color: #3fb950; }

.cpn-select__caret {
    color: var(--text-secondary);
    font-size: 10px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.cpn-select.open .cpn-select__caret { transform: rotate(180deg); }

.cpn-menu {
    position: fixed;
    z-index: 5000;
    display: none;
    padding: 5px;
    max-height: 320px;
    overflow-y: auto;
    background: rgba(16, 20, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(14px);
}

.cpn-menu.show { display: block; animation: cpnIn 0.12s ease-out; }

@keyframes cpnIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.cpn-menu__head {
    padding: 7px 10px 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.cpn-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.14s;
}

.cpn-opt:hover { background: rgba(255, 255, 255, 0.07); }
.cpn-opt.selected { background: rgba(88, 166, 255, 0.16); }

.cpn-opt.disabled { opacity: 0.45; cursor: not-allowed; }
.cpn-opt.disabled:hover { background: none; }

.cpn-opt__check { width: 13px; flex-shrink: 0; text-align: center; color: var(--accent); font-size: 11px; }
.cpn-opt__main { flex: 1; min-width: 0; }

.cpn-opt__name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpn-opt__sub { font-size: 10.5px; color: var(--text-secondary); margin-top: 1px; }
.cpn-opt.selected .cpn-opt__name { color: #fff; }
.cpn-opt__value { font-size: 12.5px; font-weight: 800; color: var(--success); flex-shrink: 0; }
.cpn-opt.disabled .cpn-opt__value { color: var(--text-secondary); }

