/* ==================== RESET & ROOT ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; }

:root {
    --primary: #00d9ff;
    --primary-dark: #0088cc;
    --discord: #5865F2;
    --telegram: #0088cc;
    --facebook: #1877f2;
    --zalo: #0068ff;
    --bg-dark: #0a0a0a;
    --bg-card: #151515;
    --bg-input: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --border: #2a2a2a;
    --error: #ff4444;
    --success: #00d9ff;
    --warning: #ffa500;
}

/* ==================== BODY & BACKGROUND ==================== */
body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    min-width: 0;
}
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0,174,255,.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0,174,255,.03) 0%, transparent 50%);
    animation: moveBackground 20s ease-in-out infinite;
    pointer-events: none; z-index: 0;
}
body::after {
    content: '';
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        linear-gradient(rgba(0,174,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,174,255,.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none; z-index: 0;
}
@keyframes moveBackground {
    0%,100% { transform: translate(0,0); }
    50% { transform: translate(-5%,-5%); }
}

/* ==================== HEADER & NAV ==================== */
header {
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 20px rgba(0,174,255,.1);
    position: fixed; width: 100%; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(0,174,255,.1);
}
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}
.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem; font-weight: 900;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px; text-transform: uppercase;
}
.logo span {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0,174,255,.5);
}

/* ==================== HAMBURGER ==================== */
.hamburger { display: flex; flex-direction: column; cursor: pointer; gap: 5px; }
.hamburger span { width: 25px; height: 3px; background: var(--primary); border-radius: 3px; transition: all .3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(8px,8px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px,-6px); }

/* ==================== NAV LINKS (MOBILE DRAWER) ==================== */
.nav-links {
    position: fixed; top: 80px; right: -100%;
    width: 280px; max-height: calc(100vh - 80px);
    background: rgba(0,0,0,.95); backdrop-filter: blur(10px);
    display: flex; flex-direction: column;
    padding: 2rem; transition: right .3s;
    border-left: 2px solid var(--primary);
    z-index: 999; overflow-y: auto;
}
.nav-links.active { right: 0; }
.nav-link {
    color: var(--text-secondary); text-decoration: none;
    font-weight: 600; transition: all .3s;
    padding: 1rem; border-radius: 5px;
    width: 100%; text-align: left;
    border-bottom: 1px solid var(--border);
}
.nav-link:hover { color: var(--primary); background: rgba(0,174,255,.05); }

/* ==================== BUTTONS ==================== */
.btn-logout {
    background: #ff4444; color: white;
    border: none; padding: 1rem 1.2rem;
    border-radius: 5px; font-weight: 600;
    cursor: pointer; transition: all .3s;
    width: 100%; margin-top: 1rem;
    font-family: 'Rajdhani', sans-serif; font-size: 1rem;
}
.btn-logout:hover { background: #cc0000; transform: translateY(-2px); }

.btn-submit {
    width: 100%; padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none; border-radius: 10px;
    color: #000; font-size: 1.2rem; font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer; transition: all .3s;
    text-transform: uppercase; letter-spacing: 2px;
}
.btn-submit:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,174,255,.4); }
.btn-submit:disabled { opacity: .5; cursor: not-allowed; }

.copy-btn {
    background: var(--primary); color: #000;
    border: none; padding: .6rem 1.2rem;
    border-radius: 8px; cursor: pointer;
    font-weight: 700; transition: all .3s; font-size: .9rem;
    margin-left: 1rem;
}
.copy-btn:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,174,255,.3); }

/* ==================== MAIN LAYOUT ==================== */
main {
    margin-top: 100px; padding: 2rem;
    max-width: 1400px;
    margin-left: auto; margin-right: auto;
    min-height: calc(100vh - 180px);
    position: relative; z-index: 1;
}
main.narrow { max-width: 900px; }

/* ==================== PAGE HEADER ==================== */
.page-header { text-align: center; margin-bottom: 3rem; animation: slideUp .6s ease; }
.page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem; margin-bottom: .5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase; letter-spacing: 2px;
}
.page-subtitle { color: var(--text-secondary); font-size: 1.1rem; }

/* ==================== CARDS ==================== */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 15px; padding: 2.5rem;
    margin-bottom: 2.5rem;
    position: relative; overflow: hidden;
}
.card-glow::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: .2; animation: rotateBorder 3s linear infinite; z-index: -1;
}
@keyframes rotateBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== STATS GRID ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.stat-item {
    background: var(--bg-input); padding: 1.5rem;
    border-radius: 10px; border: 1px solid var(--border); text-align: center;
}
.stat-label { color: var(--text-secondary); font-size: .95rem; margin-bottom: .8rem; text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); font-family: 'Orbitron', sans-serif; }

/* ==================== FORM ==================== */
.form-group { margin-bottom: 1.8rem; }
.form-group label {
    display: block; margin-bottom: .8rem;
    color: var(--text-primary); font-weight: 600;
    font-size: 1rem; text-transform: uppercase; letter-spacing: 1px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 1rem 1.2rem;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 10px; color: var(--text-primary);
    font-size: 1rem; font-family: 'Rajdhani', sans-serif; transition: all .3s;
}
.form-group textarea { resize: vertical; min-height: 120px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0,174,255,.1);
}
/* Ẩn spinner trên input[type=number] */
.form-group input[type=number]::-webkit-inner-spin-button,
.form-group input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.form-group input[type=number] { -moz-appearance: textfield; }
.form-hint { font-size: .9rem; color: var(--text-secondary); margin-top: .5rem; }

/* ==================== ALERT ==================== */
.alert {
    padding: 1.2rem 1.5rem; border-radius: 10px;
    margin-bottom: 1.5rem; font-weight: 600;
    display: none; font-size: 1.05rem;
}
.alert.success { background: rgba(0,174,255,.15); border: 2px solid var(--primary); color: var(--primary); }
.alert.error   { background: rgba(255,68,68,.15);  border: 2px solid #ff4444; color: #ff4444; }
.alert.show    { display: block; animation: slideDown .3s ease; }

/* ==================== SECTION TITLE ==================== */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem; color: var(--primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase; letter-spacing: 1px;
}

/* ==================== LOADING ==================== */
.loading { text-align: center; padding: 2rem; font-size: 1.1rem; color: var(--primary); }
.loading::after { content: '...'; animation: dots 1.5s infinite; }
@keyframes dots {
    0%,20% { content: '.'; }
    40%     { content: '..'; }
    60%,100%{ content: '...'; }
}

/* ==================== EMPTY STATE ==================== */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text-secondary); }
.empty-icon  { font-size: 5rem; margin-bottom: 1.5rem; opacity: .5; }
.empty-text  { font-size: 1.4rem; margin-bottom: .8rem; }

/* ==================== FOOTER ==================== */
footer {
    background: rgba(0,0,0,.8); backdrop-filter: blur(10px);
    padding: 2rem; text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(0,174,255,.1);
    position: relative; z-index: 1; margin-top: 3rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==================== PROFILE (account.html) ==================== */
.profile-header {
    display: flex; align-items: center; gap: 2rem;
    margin-bottom: 2rem; padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}
.profile-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 700; color: #000;
    font-family: 'Orbitron', sans-serif;
}
.profile-info h2 { font-family: 'Orbitron', sans-serif; font-size: 2rem; margin-bottom: .5rem; }
.profile-email   { color: var(--text-secondary); font-size: 1.1rem; }

/* ==================== HISTORY (history.html) ==================== */
.stats-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
    gap: 1.5rem; margin-bottom: 3rem;
}
.stat-box {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 15px; padding: 2rem; text-align: center;
    transition: all .3s; position: relative; overflow: hidden;
}
.stat-box::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.stat-box:hover::before { opacity: .3; }
.stat-box:hover { border-color: var(--primary); transform: translateY(-5px); }

.history-list { display: flex; flex-direction: column; gap: 1.5rem; }
.history-item {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 15px; overflow: hidden; transition: all .3s;
}
.history-item.expanded { border-color: var(--primary); box-shadow: 0 10px 30px rgba(0,174,255,.2); }
.history-header {
    padding: 1.5rem 2rem; display: flex;
    justify-content: space-between; align-items: center;
    cursor: pointer; user-select: none; transition: background .3s;
}
.history-header:hover { background: var(--bg-input); }
.history-main-info {
    flex: 1; display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 2rem; align-items: center;
}
.order-id { font-size: .95rem; color: var(--text-secondary); font-weight: 700; font-family: 'Orbitron', sans-serif; }
.product-name { font-weight: 700; color: var(--text-primary); font-size: 1.2rem; }
.product-meta { font-size: .9rem; color: var(--text-secondary); }
.order-price { font-size: 1.5rem; font-weight: 700; color: var(--primary); font-family: 'Orbitron', sans-serif; }
.expand-btn {
    background: var(--bg-input); border: 2px solid var(--border);
    width: 45px; height: 45px; border-radius: 50%;
    color: var(--primary); font-size: 1.2rem;
    cursor: pointer; transition: all .3s;
    display: flex; align-items: center; justify-content: center;
}
.expand-btn:hover { background: var(--primary); color: #000; border-color: var(--primary); }
.expand-btn.active { transform: rotate(180deg); }
.history-details { max-height: 0; overflow: hidden; transition: max-height .4s ease-out; background: var(--bg-input); }
.history-details.active { max-height: 1500px; border-top: 2px solid var(--border); }
.details-content { padding: 2rem; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.detail-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; }
.detail-title {
    color: var(--primary); font-weight: 700; margin-bottom: 1.2rem;
    font-size: 1.2rem; display: flex; align-items: center; gap: .5rem;
    font-family: 'Orbitron', sans-serif;
}
.detail-row { display: flex; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); font-size: 1rem; }
.detail-value { color: var(--text-primary); font-weight: 600; text-align: right; }
.account-box { background: var(--bg-input); border: 2px solid var(--primary); border-radius: 10px; padding: 1.5rem; margin-top: 1rem; }
.credential-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.credential-value {
    flex: 1; background: var(--bg-dark); padding: 1rem;
    border-radius: 8px; color: var(--primary);
    font-family: 'Courier New', monospace; font-weight: 700;
    word-break: break-all; border: 1px solid var(--border);
}
.status-badge { padding: .5rem 1.2rem; border-radius: 20px; font-size: .9rem; font-weight: 700; background: var(--primary); color: #000; }

/* ==================== PRODUCT / HOME (index.html) ==================== */
.hero { text-align: center; padding: 3rem 1rem; margin-bottom: 3rem; animation: slideUp .6s ease; }
.hero h1 {
    font-family: 'Orbitron', sans-serif; font-size: 3.5rem; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { font-size: 1.3rem; color: var(--text-secondary); }

.breadcrumb {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: 2rem; padding: 1rem 1.5rem;
    background: var(--bg-card); border-radius: 10px; border: 1px solid var(--border);
}
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 600; transition: opacity .3s; }
.breadcrumb a:hover { opacity: .7; }
.breadcrumb span { color: var(--text-secondary); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 2rem; margin-bottom: 3rem; }
.category-card {
    background: var(--bg-card); border-radius: 15px; overflow: hidden;
    border: 2px solid var(--border);
    transition: all .4s cubic-bezier(.175,.885,.32,1.275);
    cursor: pointer; position: relative;
}
.category-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.category-card:hover::before { opacity: .5; }
.category-card:hover { transform: translateY(-10px) scale(1.02); border-color: var(--primary); box-shadow: 0 20px 40px rgba(0,174,255,.2); }
.category-image { width: 100%; height: 200px; object-fit: cover; background: var(--bg-input); }
.category-info { padding: 1.5rem; text-align: center; }
.category-name { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: .5rem; font-family: 'Orbitron', sans-serif; }
.category-count { color: var(--primary); font-size: 1rem; font-weight: 600; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 2rem; margin-bottom: 3rem; }
.product-card {
    background: var(--bg-card); border-radius: 15px; padding: 2rem;
    border: 2px solid var(--border); transition: all .3s; position: relative;
    display: flex; flex-direction: column; height: 100%;
}
.product-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(135deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.product-card:hover::before { opacity: .3; }
.product-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 15px 35px rgba(0,174,255,.2); }
.product-header { margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: 1rem; }
.product-price { font-size: 1.8rem; color: var(--primary); font-weight: 700; font-family: 'Orbitron', sans-serif; }
.product-desc { color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.7; font-size: 1rem; }
.product-stock { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; font-size: 1rem; }
.stock-badge { background: var(--primary); color: #000; padding: .4rem 1rem; border-radius: 20px; font-size: .9rem; font-weight: 700; }
.stock-badge.out-of-stock { background: #ff4444; color: white; }
.btn-buy {
    width: 100%; padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none; border-radius: 10px; color: #000;
    font-size: 1.1rem; font-weight: 700; font-family: 'Orbitron', sans-serif;
    cursor: pointer; transition: all .3s; text-transform: uppercase; letter-spacing: 1px;
    margin-top: auto;
}
.btn-buy:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,174,255,.4); }
.btn-buy:disabled { opacity: .5; cursor: not-allowed; background: #666; }
.btn-back {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: 1rem 1.8rem; background: var(--bg-card);
    border: 2px solid var(--border); border-radius: 10px;
    color: var(--text-primary); text-decoration: none;
    font-weight: 700; transition: all .3s; margin-bottom: 2rem;
}
.btn-back:hover { border-color: var(--primary); background: var(--bg-input); transform: translateX(-5px); }
.user-info { display: flex; align-items: center; gap: 1.5rem; }
.balance {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: .5rem 1.2rem; border-radius: 20px;
    font-weight: 700; color: #000; font-size: 1rem;
}
.section-title-lg {
    font-family: 'Orbitron', sans-serif; font-size: 2.2rem;
    margin-bottom: 2.5rem; color: var(--text-primary);
    text-align: center; text-transform: uppercase; letter-spacing: 2px;
}
.hidden { display: none; }

/* ==================== MODAL ==================== */
.modal-overlay {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.85); backdrop-filter: blur(5px);
    z-index: 2000; animation: fadeIn .3s ease;
}
.modal-overlay.active { display: flex; justify-content: center; align-items: center; padding: 1rem; }
.modal {
    background: var(--bg-card); border: 2px solid var(--primary);
    border-radius: 20px; max-width: 500px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
    animation: slideDown .3s ease; box-shadow: 0 20px 60px rgba(0,174,255,.3);
}
@keyframes slideDown {
    from { opacity:0; transform: translateY(-50px) scale(.9); }
    to   { opacity:1; transform: translateY(0) scale(1); }
}
.modal-header { padding: 2rem; border-bottom: 2px solid var(--border); position: relative; }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; color: var(--primary); text-align: center; text-transform: uppercase; }
.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: transparent; border: none; color: var(--text-secondary);
    font-size: 2rem; cursor: pointer; transition: all .3s;
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.modal-close:hover { color: var(--primary); background: rgba(0,174,255,.1); transform: rotate(90deg); }
.modal-body { padding: 2rem; }
.modal-product-info { background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 2rem; }
.modal-product-name { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; }
.modal-info-row { display: flex; justify-content: space-between; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.modal-info-row:last-child { border-bottom: none; }
.modal-info-label { color: var(--text-secondary); font-weight: 600; }
.modal-info-value { color: var(--text-primary); font-weight: 700; font-family: 'Orbitron', sans-serif; }
.modal-info-value.price { color: var(--primary); font-size: 1.2rem; }
.quantity-selector { margin-bottom: 2rem; }
.quantity-label { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.quantity-controls { display: flex; align-items: center; gap: 1rem; }
.quantity-btn {
    width: 50px; height: 50px; background: var(--bg-input);
    border: 2px solid var(--border); border-radius: 10px;
    color: var(--primary); font-size: 1.5rem; font-weight: 700;
    cursor: pointer; transition: all .3s; display: flex; align-items: center; justify-content: center;
}
.quantity-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--primary); color: #000; transform: scale(1.1); }
.quantity-btn:disabled { opacity: .3; cursor: not-allowed; }
.quantity-input {
    flex: 1; text-align: center; font-size: 2rem; font-weight: 700;
    color: var(--primary); background: var(--bg-input);
    border: 2px solid var(--border); border-radius: 10px; padding: .8rem;
    font-family: 'Orbitron', sans-serif;
}
.quantity-input:focus { outline: none; border-color: var(--primary); }
.total-section {
    background: linear-gradient(135deg, rgba(0,174,255,.1) 0%, rgba(0,174,255,.05) 100%);
    border: 2px solid var(--primary); border-radius: 10px; padding: 1.5rem; margin-bottom: 2rem;
}
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.total-row:last-child { margin-bottom: 0; padding-top: 1rem; border-top: 2px solid var(--primary); }
.total-label { font-size: 1.1rem; color: var(--text-secondary); font-weight: 600; }
.total-value { font-size: 1.2rem; color: var(--text-primary); font-weight: 700; font-family: 'Orbitron', sans-serif; }
.total-final { font-size: 1.8rem; color: var(--primary); }
.balance-after { font-size: 1.1rem; color: var(--text-secondary); text-align: center; margin-bottom: 1.5rem; }
.balance-after strong { color: var(--text-primary); font-family: 'Orbitron', sans-serif; }
.insufficient-balance { color: #ff4444; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-btn { padding: 1.2rem; border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 700; font-family: 'Orbitron', sans-serif; cursor: pointer; transition: all .3s; text-transform: uppercase; }
.modal-btn-cancel { background: var(--bg-input); border: 2px solid var(--border); color: var(--text-primary); }
.modal-btn-cancel:hover { border-color: #ff4444; color: #ff4444; }
.modal-btn-confirm { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #000; }
.modal-btn-confirm:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,174,255,.4); }
.modal-btn-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* SUCCESS MODAL */
.success-modal { max-width: 700px; }
.success-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); padding: 2rem; text-align: center; border-radius: 20px 20px 0 0; }
.success-title { font-family: 'Orbitron', sans-serif; font-size: 2rem; color: #000; text-transform: uppercase; margin: 0; }
.success-subtitle { color: rgba(0,0,0,.7); font-size: 1.1rem; margin-top: .5rem; }
.success-body { padding: 2rem; max-height: 60vh; overflow-y: auto; }
.account-list { display: flex; flex-direction: column; gap: 1.5rem; }
.account-item {
    background: var(--bg-input); border: 2px solid var(--border);
    border-radius: 15px; padding: 1.5rem;
    transition: all .3s; animation: slideInAccount .4s ease forwards; opacity: 0;
}
.account-item:nth-child(1){animation-delay:.1s} .account-item:nth-child(2){animation-delay:.2s}
.account-item:nth-child(3){animation-delay:.3s} .account-item:nth-child(4){animation-delay:.4s}
.account-item:nth-child(5){animation-delay:.5s}
@keyframes slideInAccount {
    from { opacity:0; transform: translateX(-30px); }
    to   { opacity:1; transform: translateX(0); }
}
.account-item:hover { border-color: var(--primary); transform: translateX(5px); }
.account-number { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; background: var(--primary); color: #000; border-radius: 50%; font-weight: 700; font-family: 'Orbitron', sans-serif; margin-bottom: 1rem; }
.account-field { display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.account-field:last-child { border-bottom: none; }
.account-field-label { color: var(--text-secondary); font-weight: 600; font-size: .95rem; }
.account-field-value { color: var(--primary); font-weight: 700; font-family: 'Courier New', monospace; font-size: 1rem; display: flex; align-items: center; gap: .8rem; }
.copy-icon { cursor: pointer; padding: .4rem .8rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 5px; transition: all .3s; font-size: .85rem; }
.copy-icon:hover, .copy-icon.copied { background: var(--primary); color: #000; border-color: var(--primary); }
.success-actions { padding: 0 2rem 2rem 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-view-history {
    padding: 1.2rem; background: var(--bg-input); border: 2px solid var(--primary);
    border-radius: 10px; color: var(--primary); font-size: 1rem; font-weight: 700;
    font-family: 'Orbitron', sans-serif; cursor: pointer; transition: all .3s;
    text-transform: uppercase; text-decoration: none;
    display: flex; align-items: center; justify-content: center;
}
.btn-view-history:hover { background: var(--primary); color: #000; }
.btn-continue {
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none; border-radius: 10px; color: #000;
    font-size: 1rem; font-weight: 700; font-family: 'Orbitron', sans-serif;
    cursor: pointer; transition: all .3s; text-transform: uppercase;
}
.btn-continue:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,174,255,.4); }

/* ==================== LOGIN (login.html) ==================== */
body.center-layout { display: flex; flex-direction: column; }
.login-container {
    background: var(--bg-card); padding: 3rem; border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(0,174,255,.1);
    width: 100%; max-width: 480px; position: relative; animation: slideUp .6s ease;
}
.login-container::before {
    content: ''; position: absolute; inset: -2px; border-radius: 20px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.login-container:hover::before { opacity: .3; }
.tabs { display: flex; gap: 1rem; margin-bottom: 2.5rem; }
.tab-btn {
    flex: 1; padding: 1rem; background: var(--bg-input);
    border: 2px solid var(--border); border-radius: 10px;
    color: var(--text-secondary); font-size: 1.1rem; font-weight: 700;
    font-family: 'Orbitron', sans-serif; cursor: pointer; transition: all .3s;
    text-transform: uppercase; letter-spacing: 1px;
}
.tab-btn.active { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #000; border-color: var(--primary); box-shadow: 0 5px 20px rgba(0,174,255,.3); transform: translateY(-2px); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .4s ease; }
.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; font-size: .95rem; }
.remember-me { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.remember-me input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.forgot-password { color: var(--primary); text-decoration: none; font-weight: 600; transition: all .3s; }
.forgot-password:hover { text-shadow: 0 0 10px rgba(0,174,255,.5); }
.alert-error   { background: rgba(255,68,68,.1);  border: 1px solid var(--error); color: var(--error); }
.alert-success { background: rgba(0,174,255,.1);  border: 1px solid var(--success); color: var(--success); }
.alert { padding: 1rem 1.2rem; border-radius: 10px; margin-bottom: 1.5rem; font-weight: 600; animation: slideDown .3s ease; display: block; }
/* Không chèn icon/chuỗi mã hóa lỗi vào thông báo đăng nhập. */
.alert::before, .alert-success::before { content: none !important; display: none !important; }

/* ==================== TOP-UP (top-up.html) ==================== */
.balance-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border: 2px solid var(--primary); border-radius: 15px;
    padding: 2.5rem; text-align: center; margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0,174,255,.2); position: relative; overflow: hidden;
}
.balance-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: .3; animation: rotateBorder 3s linear infinite; z-index: -1;
}
.balance-label { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: .8rem; text-transform: uppercase; letter-spacing: 1px; }
.balance-amount { font-size: 3.5rem; font-weight: 700; color: var(--primary); font-family: 'Orbitron', sans-serif; }
.payment-methods {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
    margin-bottom: 3rem;
}
.payment-methods .method-card {
    flex: 1 1 300px;
    width: min(100%, 360px);
    max-width: 360px;
}
.method-card {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 15px; padding: 2.5rem;
    cursor: pointer; transition: all .3s; position: relative;
}
.method-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.method-card:hover::before { opacity: .5; }
.method-card:hover, .method-card.active { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,174,255,.2); }
.method-card.active { background: var(--bg-input); box-shadow: 0 10px 30px rgba(0,174,255,.3); }
.method-icon { font-size: 4rem; text-align: center; margin-bottom: 1.2rem; }
.method-name { font-size: 1.8rem; font-weight: 700; text-align: center; color: var(--text-primary); margin-bottom: .8rem; font-family: 'Orbitron', sans-serif; }
.method-desc { text-align: center; color: var(--text-secondary); font-size: 1rem; }
.form-container { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 2.5rem; display: none; margin-bottom: 3rem; }
.form-container.active { display: block; animation: slideUp .4s ease; }
.form-title { font-family: 'Orbitron', sans-serif; font-size: 2rem; color: var(--primary); margin-bottom: 2rem; text-align: center; text-transform: uppercase; }
.amount-buttons { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.amount-btn { padding: 1.2rem; background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; color: var(--text-primary); font-size: 1rem; font-weight: 700; cursor: pointer; transition: all .3s; font-family: 'Orbitron', sans-serif; }
.amount-btn:hover { border-color: var(--primary); background: var(--bg-card); }
.amount-btn.active { border-color: var(--primary); background: var(--primary); color: #000; box-shadow: 0 5px 15px rgba(0,174,255,.3); }
.bank-info { background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; padding: 2rem; margin-bottom: 2rem; }
.bank-row { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.bank-row:last-child { border-bottom: none; }
.bank-label { color: var(--text-secondary); font-size: 1rem; font-weight: 600; }
.bank-value { color: var(--text-primary); font-weight: 700; font-size: 1.1rem; font-family: 'Courier New', monospace; }
.qr-section { background: var(--bg-input); border: 2px solid var(--border); border-radius: 15px; padding: 2rem; margin-bottom: 2rem; text-align: center; }
.qr-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--primary); margin-bottom: 1.5rem; text-transform: uppercase; }
.qr-container { background: white; padding: 1.5rem; border-radius: 10px; display: inline-block; margin-bottom: 1.5rem; }
.qr-container img { display: block; max-width: 300px; width: 100%; height: auto; }
.qr-instructions { background: rgba(0,174,255,.1); border: 1px solid var(--primary); border-radius: 10px; padding: 1.5rem; margin-top: 1.5rem; }
.qr-instructions h4 { color: var(--primary); font-family: 'Orbitron', sans-serif; margin-bottom: 1rem; font-size: 1.2rem; }
.qr-instructions ol { text-align: left; color: var(--text-secondary); padding-left: 2rem; line-height: 1.8; }
.qr-instructions li { margin-bottom: .5rem; }
.qr-instructions strong { color: var(--primary); }

/* TOAST */
.toast-container { position: fixed; top: 100px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 1rem; max-width: 400px; }
.toast { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 1.5rem; box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: slideInRight .3s ease; position: relative; overflow: hidden; }
@keyframes slideInRight { from { opacity:0; transform: translateX(100px); } to { opacity:1; transform: translateX(0); } }
.toast.success { border-color: var(--primary); }
.toast.success::before, .toast.error::before, .toast.warning::before { content: ''; position: absolute; left:0; top:0; bottom:0; width:5px; }
.toast.success::before { background: var(--primary); }
.toast.error { border-color: #ff4444; }
.toast.error::before { background: #ff4444; }
.toast.warning { border-color: #ffa500; }
.toast.warning::before { background: #ffa500; }
.toast-header { display: flex; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.toast-icon { font-size: 2rem; flex-shrink: 0; }
.toast-title { font-family: 'Orbitron', sans-serif; font-size: 1.2rem; font-weight: 700; color: var(--text-primary); text-transform: uppercase; }
.toast-close { margin-left: auto; background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; transition: all .3s; padding:0; width:30px; height:30px; display:flex; align-items:center; justify-content:center; border-radius:50%; }
.toast-close:hover { color: var(--text-primary); background: rgba(255,255,255,.1); }
.toast-message { color: var(--text-secondary); line-height: 1.6; margin-left: 3rem; white-space: pre-line; }
.toast-actions { margin-top: 1rem; margin-left: 3rem; display: flex; gap: .8rem; }
.toast-btn { padding: .7rem 1.2rem; border: none; border-radius: 8px; font-weight: 700; font-family: 'Rajdhani', sans-serif; cursor: pointer; transition: all .3s; font-size: .95rem; }
.toast-btn-primary { background: var(--primary); color: #000; }
.toast-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,174,255,.3); }
.toast-btn-secondary { background: var(--bg-input); border: 1px solid var(--border); color: var(--text-primary); }
.toast-btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ==================== CONTACT (contact.html) ==================== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 2rem; margin-bottom: 3rem; }
.contact-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 20px; padding: 2.5rem; position: relative; overflow: hidden; transition: all .3s; text-align: center; }
.contact-card::before { content: ''; position: absolute; inset: -2px; border-radius: 20px; opacity: 0; transition: opacity .3s; z-index: -1; }
.contact-card:hover { transform: translateY(-5px); }
.discord-card  { border-color: rgba(88,101,242,.3); }
.telegram-card { border-color: rgba(0,136,204,.3); }
.facebook-card { border-color: rgba(24,119,242,.3); }
.zalo-card     { border-color: rgba(0,104,255,.3); }
.discord-card::before  { background: linear-gradient(45deg, transparent, var(--discord), transparent); }
.telegram-card::before { background: linear-gradient(45deg, transparent, var(--telegram), transparent); }
.facebook-card::before { background: linear-gradient(45deg, transparent, var(--facebook), transparent); }
.zalo-card::before     { background: linear-gradient(45deg, transparent, var(--zalo), transparent); }
.discord-card:hover  { box-shadow: 0 10px 40px rgba(88,101,242,.3); }
.telegram-card:hover { box-shadow: 0 10px 40px rgba(0,136,204,.3); }
.facebook-card:hover { box-shadow: 0 10px 40px rgba(24,119,242,.3); }
.zalo-card:hover     { box-shadow: 0 10px 40px rgba(0,104,255,.3); }
.discord-card:hover::before, .telegram-card:hover::before,
.facebook-card:hover::before, .zalo-card:hover::before { opacity: .2; }
.card-icon  { font-size: 4rem; margin-bottom: 1.5rem; display: block; }
.card-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; margin-bottom: 1rem; color: var(--text-primary); }
.card-value { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 1.5rem; word-break: break-word; }
.btn-contact { display: inline-block; padding: 1rem 2rem; border-radius: 10px; text-decoration: none; font-weight: 700; font-family: 'Orbitron', sans-serif; transition: all .3s; color: white; }
.btn-discord  { background: var(--discord); }
.btn-telegram { background: var(--telegram); }
.btn-facebook { background: var(--facebook); }
.btn-zalo     { background: var(--zalo); }
.btn-discord:hover  { background: #4752C4; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(88,101,242,.4); }
.btn-telegram:hover { background: #006ba3; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,136,204,.4); }
.btn-facebook:hover { background: #0f5fc2; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(24,119,242,.4); }
.btn-zalo:hover     { background: #0054cc; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,104,255,.4); }

/* ==================== TRANSACTION HISTORY ==================== */
.filters { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 1.5rem; margin-bottom: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.filter-btn { padding: .8rem 1.5rem; background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; color: var(--text-secondary); cursor: pointer; font-weight: 600; transition: all .3s; font-family: 'Rajdhani', sans-serif; }
.filter-btn.active { background: var(--primary); color: #000; border-color: var(--primary); }
.filter-btn:hover { border-color: var(--primary); }
.auto-refresh { margin-left: auto; display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); }
.auto-refresh input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.transaction-list { display: flex; flex-direction: column; gap: 1rem; }
.transaction-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 1.5rem; transition: all .3s; }
.transaction-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.transaction-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.transaction-id { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--primary); }
.transaction-status { padding: .5rem 1rem; border-radius: 8px; font-weight: 700; font-size: .9rem; }
.status-success { background: rgba(0,174,255,.2); color: var(--success); border: 1px solid var(--success); }
.status-pending { background: rgba(255,165,0,.2); color: var(--warning); border: 1px solid var(--warning); animation: blink 2s infinite; }
.status-failed  { background: rgba(255,68,68,.2); color: var(--error); border: 1px solid var(--error); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.6} }
.transaction-details { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 1rem; }
.detail-item { display: flex; flex-direction: column; gap: .3rem; }
.amount-value { font-family: 'Orbitron', sans-serif; color: var(--primary); font-size: 1.3rem; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 968px) {
    .payment-methods { grid-template-columns: 1fr; }
    .history-main-info { grid-template-columns: 1fr; gap: 1rem; }
    .details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .page-title    { font-size: 2rem; }
    .hero h1       { font-size: 2rem; }
    .balance-amount{ font-size: 2.5rem; }
    .profile-header{ flex-direction: column; text-align: center; }
    .stats-grid    { grid-template-columns: 1fr; }
    .modal, .login-container { margin: 1rem; }
    .modal-actions, .success-actions, .tabs { grid-template-columns: 1fr; }
    .tabs { flex-direction: column; gap: .8rem; }
    .form-options  { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .category-grid, .product-grid { grid-template-columns: 1fr; }
    .amount-buttons{ grid-template-columns: repeat(2,1fr); }
    .filters       { flex-direction: column; align-items: stretch; }
    .auto-refresh  { margin-left: 0; }
    .transaction-details { grid-template-columns: 1fr; }
    .toast-container { right:10px; left:10px; max-width: none; }
    .toast-message, .toast-actions { margin-left: 0; }
    .toast-actions { flex-direction: column; }
    .contact-grid  { grid-template-columns: 1fr; }
    .qr-container img { max-width: 250px; }
}

/* ==================== ADMIN - SHARED ==================== */

/* Hamburger luôn hiển thị */
.admin-hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    flex-shrink: 0;
}
.admin-hamburger span { width: 25px; height: 3px; background: var(--primary); border-radius: 3px; transition: all .3s; }
.admin-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(8px,8px); }
.admin-hamburger.active span:nth-child(2) { opacity: 0; }
.admin-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px,-6px); }

/* Nav admin: logo sát trái, hamburger sát phải */
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1600px;
}

/* Nav luôn là drawer dọc từ phải */
.admin-nav-links {
    position: fixed; top: 80px; right: -100%;
    width: 280px; max-height: calc(100vh - 80px);
    background: rgba(0,0,0,.95); backdrop-filter: blur(10px);
    display: flex; flex-direction: column; align-items: stretch;
    padding: 2rem; transition: right .3s;
    border-left: 2px solid var(--primary);
    z-index: 999; overflow-y: auto; gap: 0;
    flex-wrap: nowrap;
}
.admin-nav-links.active { right: 0; }
.admin-nav-links .nav-link {
    border-bottom: 1px solid var(--border);
    padding: 1rem; width: 100%; text-align: left;
    font-size: 1rem; white-space: normal;
}
.admin-nav-links .btn-logout { width: 100%; margin-top: 1rem; padding: 1rem 1.2rem; font-size: 1rem; }

/* Admin main layout */
.admin-main {
    margin-top: 100px; padding: 2rem;
    max-width: 1600px;
    margin-left: auto; margin-right: auto;
    position: relative; z-index: 1;
}
.admin-title {
    font-family: 'Orbitron', sans-serif;
    text-align: center; font-size: 2.5rem;
    margin-bottom: 2rem; color: var(--primary);
    text-transform: uppercase; letter-spacing: 2px;
}
.admin-title-grad {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Admin stat cards */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: 15px; padding: 1.5rem; transition: all .3s;
    position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; inset: -2px; border-radius: 15px;
    background: linear-gradient(45deg, transparent, var(--primary), transparent);
    opacity: 0; transition: opacity .3s; z-index: -1;
}
.stat-card:hover::before { opacity: .2; }
.stat-card:hover { border-color: var(--primary); transform: translateY(-5px); }
.stat-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.stat-card .stat-value { font-size: 2rem; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 1rem; margin-bottom: .5rem; text-transform: uppercase; letter-spacing: 1px; }

/* Admin panel box */
.panel { background: var(--bg-card); padding: 2rem; border-radius: 15px; border: 2px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,.5); margin-bottom: 2rem; }
.panel-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--primary); border-bottom: 2px solid var(--border); padding-bottom: .8rem; text-transform: uppercase; letter-spacing: 1px; }

/* Admin setting section */
.setting-section { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 2rem; margin-bottom: 2rem; }
.setting-section .section-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--primary); margin-bottom: 1.5rem; border-bottom: 2px solid var(--border); padding-bottom: .8rem; }

/* Admin table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-input); }
th { padding: 1rem; text-align: left; color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: .9rem; border-bottom: 2px solid var(--border); }
td { padding: 1rem; border-bottom: 1px solid var(--border); }
tbody tr { transition: all .3s; }
tbody tr:hover { background: rgba(0,174,255,.05); }

/* Admin table wrapped in card */
.table-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; overflow: hidden; }
.table-card table th { background: var(--bg-input); }
.table-card table td { border-top: 1px solid var(--border); border-bottom: none; }
.table-card table tr:hover td { background: var(--bg-input); }

/* Admin buttons */
.btn { padding: .8rem 1.5rem; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; transition: all .3s; text-transform: uppercase; font-family: 'Orbitron', sans-serif; }
.btn-admin-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #000; }
.btn-admin-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(0,174,255,.4); }
.btn-admin-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-admin-full { width: 100%; padding: 1rem 2rem; font-size: 1.1rem; }
.btn-admin-small { padding: .5rem 1rem; font-size: .85rem; }
.btn-admin-pw { background: #5865F2; color: white; }
.btn-admin-pw:hover:not(:disabled) { background: #4752C4; }
.btn-admin-danger { background: #ff4444; color: white; }
.btn-admin-danger:hover { background: #cc0000; }
.btn-admin-info { background: var(--primary); color: #000; }
.btn-admin-info:hover { transform: translateY(-2px); }

/* Admin modal */
.admin-modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,.9); z-index: 2000; justify-content: center; align-items: center; }
.admin-modal.active { display: flex; }
.admin-modal-content { background: var(--bg-card); border: 2px solid var(--primary); border-radius: 15px; padding: 2rem; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; }
.admin-modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.5rem; color: var(--primary); margin-bottom: 1.5rem; }

/* Admin filters */
.admin-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 1rem; margin-bottom: 2rem; }
.filter-group { display: flex; flex-direction: column; gap: .5rem; }
.filter-group label { color: var(--text-secondary); font-weight: 600; font-size: .9rem; text-transform: uppercase; }
.filter-group input, .filter-group select { padding: .8rem; background: var(--bg-input); border: 2px solid var(--border); border-radius: 8px; color: var(--text-primary); font-family: 'Rajdhani', sans-serif; transition: all .3s; }
.filter-group input:focus, .filter-group select:focus { outline: none; border-color: var(--primary); }

/* Admin search section */
.search-section { background: var(--bg-card); border: 2px solid var(--border); border-radius: 15px; padding: 1.5rem; margin-bottom: 2rem; }
.search-box { display: flex; gap: 1rem; }
.search-box input { flex: 1; padding: 1rem; background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; color: var(--text-primary); font-family: 'Rajdhani', sans-serif; }
.search-box input:focus { outline: none; border-color: var(--primary); }

/* User avatar */
.user-info { display: flex; align-items: center; gap: .8rem; }
.user-avatar { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #000; flex-shrink: 0; }

/* Quick amount grid */
.quick-amount { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; margin-bottom: 1rem; }
.quick-btn { padding: .8rem; background: var(--bg-input); border: 2px solid var(--border); border-radius: 8px; color: var(--text-primary); cursor: pointer; font-weight: 600; font-family: 'Rajdhani', sans-serif; transition: border-color .3s; }
.quick-btn:hover { border-color: var(--primary); }

/* Warning box */
.warning-box { background: rgba(255,68,68,.1); border: 2px solid #ff4444; border-radius: 10px; padding: 1rem; margin-bottom: 1.5rem; color: #ff4444; }
.warning-box strong { display: block; margin-bottom: .5rem; }

/* Badges */
.badge { padding: .3rem .8rem; border-radius: 12px; font-size: .85rem; font-weight: 700; display: inline-block; }
.badge-success { background: var(--primary); color: #000; }
.badge-pending { background: #ffa500; color: #000; animation: blink 2s infinite; }
.badge-failed  { background: #ff4444; color: white; }
.type-badge { padding: .3rem .8rem; border-radius: 12px; font-size: .85rem; font-weight: 700; display: inline-block; }
.type-bank  { background: rgba(0,123,255,.2); color: #4da3ff; border: 1px solid #4da3ff; }
.type-card  { background: rgba(255,165,0,.2); color: #ffa500; border: 1px solid #ffa500; }
.type-admin { background: rgba(138,43,226,.2); color: #b870ff; border: 1px solid #b870ff; }

/* Payment grid */
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

/* API note */
.api-note { background: rgba(0,174,255,.1); border: 1px solid var(--primary); border-radius: 10px; padding: 1rem; margin-top: 1rem; font-size: .95rem; line-height: 1.6; }
.api-note strong { color: var(--primary); }

/* Shop list */
.shop-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.shop-item { background: var(--bg-input); padding: 1.5rem; border-radius: 10px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: all .3s; }
.shop-item:hover { border-color: var(--primary); }
.shop-info h4 { color: var(--primary); margin-bottom: .5rem; font-size: 1.2rem; }
.shop-info p { color: var(--text-secondary); font-size: .9rem; margin-bottom: .3rem; }
.shop-actions { display: flex; gap: .5rem; }

@media (max-width: 968px) {
    .payment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-filters { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: 1fr; }
    table { font-size: .85rem; }
    th, td { padding: .5rem; }
    .admin-title { font-size: 1.8rem; }
}

/* ==================== ADMIN - PRODUCT PAGE ==================== */
.admin-container { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 1200px) { .admin-container { grid-template-columns: 1fr; } }

/* Admin panel tabs */
.panel .tabs { display: flex; gap: 0; margin-bottom: 2rem; border-bottom: 2px solid var(--border); overflow-x: auto; background: transparent; scrollbar-width: none; }
.panel .tabs::-webkit-scrollbar { display: none; }
.panel .tab-btn { padding: .9rem 1.5rem; background: transparent; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--text-secondary); font-weight: 600; cursor: pointer; transition: all .3s; white-space: nowrap; font-size: .95rem; font-family: 'Rajdhani', sans-serif; border-radius: 0; text-transform: none; letter-spacing: 0; box-shadow: none; transform: none; }
.panel .tab-btn:hover { color: var(--primary); background: rgba(0,174,255,.04); }
.panel .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(0,174,255,.05); transform: none; box-shadow: none; }
.panel .tab-content { display: none; }
.panel .tab-content.active { display: block; }

/* Button variants */
.btn-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #000; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(0,174,255,.4); }
.btn-warning { background: linear-gradient(135deg, #ffa500 0%, #ff8c00 100%); color: #000; }
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255,165,0,.4); }
.btn-danger { background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255,68,68,.4); }
.btn-small { padding: .4rem .9rem; font-size: .8rem; border-radius: 6px; }
.product-list-admin { display: flex; flex-direction: column; gap: 1rem; }

/* Partner products */
.partner-select-box { background: var(--bg-input); padding: 1.5rem; border-radius: 10px; border: 2px solid var(--border); margin-bottom: 1.5rem; }
.partner-products-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 1rem; max-height: 500px; overflow-y: auto; padding: .5rem; }
.partner-products-grid::-webkit-scrollbar { width: 8px; }
.partner-products-grid::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 4px; }
.partner-products-grid::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
.partner-product-card { background: var(--bg-input); border: 2px solid var(--border); border-radius: 10px; padding: 1.2rem; transition: all .3s; cursor: pointer; position: relative; }
.partner-product-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.partner-product-card.selected { border-color: var(--primary); background: rgba(0,174,255,.1); }
.partner-product-card.selected::before { content: '\2713'; position: absolute; top: .5rem; right: .5rem; width: 24px; height: 24px; background: var(--primary); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.partner-product-name { font-weight: 700; color: var(--text-primary); margin-bottom: .5rem; font-size: 1rem; padding-right: 30px; }
.partner-product-price { color: var(--primary); font-weight: 700; font-size: 1.2rem; margin-bottom: .5rem; }
.partner-product-stock { font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }
.partner-product-desc { font-size: .85rem; color: var(--text-secondary); line-height: 1.4; max-height: 60px; overflow: hidden; text-overflow: ellipsis; }
.import-controls { background: var(--bg-input); padding: 1.5rem; border-radius: 10px; border: 2px solid var(--primary); margin-top: 1.5rem; display: none; }
.import-controls.active { display: block; }
.selected-count { color: var(--primary); font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }

/* Category list — không giới hạn chiều cao, scroll tự nhiên */
.category-list {
    display: flex; flex-direction: column; gap: 1rem;
    max-height: none;
    overflow-y: visible;
    padding-right: .5rem;
}
.product-list-admin {
    display: flex; flex-direction: column; gap: 1rem;
    max-height: none; overflow: visible; padding-right: 0;
}
.category-list::-webkit-scrollbar { width: 8px; }
.category-list::-webkit-scrollbar-track { background: var(--bg-input); border-radius: 4px; }
.category-list::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.category-item { background: var(--bg-input); padding: 1rem 1.2rem; border-radius: 10px; border: 1px solid var(--border); transition: all .3s; display: flex; align-items: center; gap: .8rem; min-height: 80px; }
.category-item:hover { border-color: var(--primary); }
.category-item.draggable { cursor: grab; user-select: none; }
.category-item.draggable:active { cursor: grabbing; }
.category-item.dragging { opacity: .4; border-color: var(--primary); background: rgba(0,174,255,.05); }
.category-item.drag-over { border-color: var(--primary); border-width: 2px; box-shadow: 0 0 15px rgba(0,174,255,.3); transform: scale(1.02); }
.drag-handle { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; cursor: grab; opacity: .4; transition: opacity .3s; flex-shrink: 0; }
.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
.drag-handle span { display: block; width: 18px; height: 2px; background: var(--primary); border-radius: 1px; }
.sort-order-badge { background: rgba(0,174,255,.15); color: var(--primary); font-weight: 700; font-size: .8rem; padding: 2px 8px; border-radius: 5px; margin-left: .5rem; font-family: 'Orbitron', sans-serif; }
.save-order-bar { display: none; background: rgba(0,174,255,.1); border: 2px solid var(--primary); border-radius: 10px; padding: 1rem 1.5rem; margin-bottom: 1rem; align-items: center; justify-content: space-between; gap: 1rem; animation: fadeIn .3s ease; }
.save-order-bar.active { display: flex; }
.save-order-bar .info { color: var(--primary); font-weight: 600; font-size: .95rem; }
.save-order-bar .btns { display: flex; gap: .5rem; }
.category-icon { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; background: var(--border); flex-shrink: 0; }
.category-info { flex: 1; min-width: 0; }
.category-name { font-weight: 700; color: var(--text-primary); font-size: 1rem; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-count { font-size: .85rem; color: var(--text-secondary); }
.category-actions { display: flex; gap: .4rem; flex-shrink: 0; }

/* Product items */
.product-item-admin { background: var(--bg-input); padding: 1.5rem; border-radius: 10px; border: 1px solid var(--border); transition: all .3s; }
.product-item-admin:hover { border-color: var(--primary); }
.product-item-admin.selected { border-color: #ff5555; box-shadow: 0 0 0 1px rgba(255,85,85,.25); }
.product-select-row { display: flex; align-items: center; gap: .7rem; margin: -.5rem 0 .8rem; color: var(--text-secondary); font-size: .88rem; }
.product-select-row label { display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.product-select-row input, .product-bulk-bar input { width: 17px; height: 17px; accent-color: var(--primary); }
.product-bulk-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); }
.product-bulk-bar label { display: flex; align-items: center; gap: .5rem; color: var(--text-secondary); cursor: pointer; }
.product-bulk-bar button:disabled { opacity: .45; cursor: not-allowed; }
.product-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.product-item-name { font-weight: 700; color: var(--text-primary); font-size: 1.2rem; }
.product-item-price { color: var(--primary); font-weight: 700; font-size: 1.3rem; font-family: 'Orbitron', sans-serif; }
.product-item-desc { color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.6; }
.product-item-info { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-bottom: 1rem; font-size: .95rem; }
.product-item-info span { color: var(--text-secondary); }

/* Account input */
.account-input-section { background: var(--bg-input); padding: 1.5rem; border-radius: 10px; margin-top: 1rem; border: 1px solid var(--border); }
.account-hint { font-size: .9rem; color: var(--text-secondary); margin-bottom: .8rem; line-height: 1.6; }

/* Modal for admin pages */
.modal-overlay { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,.85); backdrop-filter: blur(5px); z-index: 2000; animation: fadeIn .3s ease; justify-content: center; align-items: center; padding: 1rem; }
.modal-overlay.active { display: flex; }
.modal { background: var(--bg-card); border: 2px solid var(--primary); border-radius: 20px; max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; animation: slideDown .3s ease; box-shadow: 0 20px 60px rgba(0,174,255,.3); }
.modal-header { padding: 2rem; border-bottom: 2px solid var(--border); position: relative; }
.modal-title { font-family: 'Orbitron', sans-serif; font-size: 1.8rem; color: var(--primary); text-align: center; text-transform: uppercase; }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: transparent; border: none; color: var(--text-secondary); font-size: 2rem; cursor: pointer; transition: all .3s; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.modal-close:hover { color: var(--primary); background: rgba(0,174,255,.1); transform: rotate(90deg); }
.modal-body { padding: 2rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.modal-btn { padding: 1.2rem; border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 700; font-family: 'Orbitron', sans-serif; cursor: pointer; transition: all .3s; text-transform: uppercase; }
.modal-btn-cancel { background: var(--bg-input); border: 2px solid var(--border); color: var(--text-primary); }
.modal-btn-cancel:hover { border-color: #ff4444; color: #ff4444; }
.modal-btn-confirm { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #000; }
.modal-btn-confirm:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,174,255,.4); }
.modal-btn-confirm:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 768px) {
    .modal-actions { grid-template-columns: 1fr; }
    .partner-products-grid { grid-template-columns: 1fr; }
    .save-order-bar { flex-direction: column; text-align: center; }
}

/* ==================== ADMIN-ODER (order management) ==================== */
.order-card { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: all .3s; }
.order-card:hover { border-color: var(--primary); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: .5rem; }
.order-code { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--primary); font-size: 1rem; }
.order-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .95rem; color: var(--text-secondary); margin-bottom: 1rem; }
.order-meta span strong { color: var(--text-primary); }
.order-amount { font-family: 'Orbitron', sans-serif; font-weight: 700; color: var(--primary); font-size: 1.2rem; }
.order-account { background: var(--bg-dark); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-family: 'Courier New', monospace; font-size: .9rem; color: var(--primary); word-break: break-all; white-space: pre-wrap; }
.order-list { display: flex; flex-direction: column; gap: 1rem; }

/* Order stats bar */
.order-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 1rem; margin-bottom: 2rem; }

/* ============================================================================
   NTT HUB THEME + RESPONSIVE HARDENING
   Added as a final override so the existing HTML/API logic stays untouched.
   ============================================================================ */
:root {
    --primary: #00e5ff;
    --primary-dark: #0088cc;
    --accent: #a78bfa;
    --bg-dark: #05050a;
    --bg-card: rgba(12, 13, 22, .86);
    --bg-input: rgba(14, 16, 28, .94);
    --text-primary: #f2f3fb;
    --text-secondary: #858aa5;
    --border: rgba(129, 143, 184, .25);
    --success: #0088cc;
    --error: #ff5d7a;
    --warning: #ffbd66;
    --header-height: 78px;
}

html {
    min-width: 320px;
    background: var(--bg-dark);
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(ellipse at 8% 12%, rgba(91, 50, 170, .18), transparent 38%),
        radial-gradient(ellipse at 92% 82%, rgba(0, 205, 190, .10), transparent 34%),
        var(--bg-dark);
    color: var(--text-primary);
    -webkit-text-size-adjust: 100%;
}

body::before {
    background:
        radial-gradient(circle at 14% 20%, rgba(134, 76, 255, .13) 0, transparent 34%),
        radial-gradient(circle at 88% 80%, rgba(0, 229, 255, .09) 0, transparent 32%);
    animation-duration: 28s;
}

body::after {
    background-image:
        linear-gradient(rgba(137, 112, 210, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(137, 112, 210, .025) 1px, transparent 1px);
    background-size: 44px 44px;
}

*, *::before, *::after { min-width: 0; }
img, video, iframe, svg, canvas { max-width: 100%; }
button, input, select, textarea { max-width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

header {
    height: var(--header-height);
    padding: .9rem max(1rem, env(safe-area-inset-right)) .9rem max(1rem, env(safe-area-inset-left));
    background: rgba(5, 5, 10, .78);
    border-bottom: 1px solid rgba(117, 126, 174, .20);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .20);
}

header nav {
    width: min(100%, 1120px);
    min-height: 100%;
    gap: 1rem;
}

.logo {
    flex: 0 0 auto;
    font-size: clamp(1.15rem, 2.2vw, 1.55rem);
    letter-spacing: .13em;
    white-space: nowrap;
}

.logo span {
    color: var(--primary);
    text-shadow: 0 0 18px rgba(0, 229, 255, .45);
}

.user-info { flex: 0 0 auto; gap: .7rem; }
.balance {
    padding: .42rem .78rem;
    border: 1px solid rgba(0, 229, 255, .45);
    border-radius: 3px;
    background: rgba(0, 229, 255, .08);
    color: var(--primary);
    box-shadow: 0 0 18px rgba(0, 229, 255, .08);
    white-space: nowrap;
}

.hamburger, .admin-hamburger { display: none; }

/* Desktop navigation: horizontal like the reference design. */
header .nav-links,
header .admin-nav-links {
    position: static;
    inset: auto;
    width: auto;
    max-height: none;
    margin-left: auto;
    padding: 0;
    overflow: visible;
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    gap: .35rem;
    background: transparent;
    border: 0;
    backdrop-filter: none;
    transition: none;
}

header .nav-link,
header .admin-nav-links .nav-link {
    width: auto;
    padding: .55rem .8rem;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #858aa5;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: .04em;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

header .nav-link:hover,
header .admin-nav-links .nav-link:hover {
    color: var(--primary);
    background: rgba(0, 229, 255, .055);
    border-color: rgba(0, 229, 255, .36);
}

header .btn-logout,
header .admin-nav-links .btn-logout {
    width: auto;
    margin: 0;
    padding: .55rem .8rem;
    border: 1px solid rgba(255, 93, 122, .48);
    border-radius: 3px;
    background: rgba(255, 93, 122, .08);
    color: #ff9aac;
    font-family: 'Courier New', monospace;
    font-size: .78rem;
    font-weight: 600;
}

header .btn-logout:hover,
header .admin-nav-links .btn-logout:hover {
    background: rgba(255, 93, 122, .16);
    border-color: #ff5d7a;
    transform: none;
}

main {
    width: min(100%, 1120px);
    margin-top: var(--header-height);
    padding: clamp(1.2rem, 3vw, 2.8rem) clamp(1rem, 3vw, 2rem);
    min-height: calc(100vh - var(--header-height) - 100px);
}

main.narrow { width: min(100%, 900px); }
.admin-main { width: min(100%, 1440px); margin-top: var(--header-height); padding: clamp(1.2rem, 3vw, 2.5rem); }

.page-header { margin-bottom: clamp(1.6rem, 4vw, 3rem); }
.page-title,
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: -.035em;
    text-wrap: balance;
}
.page-subtitle, .hero p { max-width: 720px; margin-inline: auto; line-height: 1.55; }
.hero { padding: clamp(1.4rem, 5vw, 3rem) .2rem; margin-bottom: clamp(1.5rem, 4vw, 3rem); }

.card,
.panel,
.setting-section,
.form-container,
.balance-card,
.method-card,
.search-section,
.table-card,
.stat-card,
.contact-card,
.transaction-card {
    border-width: 1px;
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .16);
}

.card, .panel, .setting-section, .form-container { padding: clamp(1rem, 3vw, 2rem); }
.panel-title, .section-title, .form-title { letter-spacing: .07em; }
.section-title-lg { font-size: clamp(1.35rem, 4vw, 2.2rem); line-height: 1.15; }

.category-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: clamp(.8rem, 2vw, 1.25rem); }
.product-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: clamp(.8rem, 2vw, 1.25rem); }
.category-card, .product-card { border-width: 1px; border-radius: 8px; }
.category-card:hover, .product-card:hover { transform: translateY(-4px); }
.category-image { height: clamp(145px, 22vw, 200px); }
.category-info, .product-card { padding: clamp(1rem, 2.5vw, 1.5rem); }

.breadcrumb {
    gap: .7rem;
    padding: .75rem 1rem;
    border-radius: 5px;
    background: rgba(12, 13, 22, .70);
    border-color: rgba(129, 143, 184, .22);
}
.quick-search input, .search-modal-controls input { min-width: 0; }

.form-group { margin-bottom: 1.2rem; }
.form-group input, .form-group select, .form-group textarea,
.filter-group input, .filter-group select,
.search-box input {
    min-height: 44px;
    border-width: 1px;
    border-radius: 5px;
    padding: .78rem .9rem;
}
.btn, .btn-submit, .btn-buy, .btn-continue, .modal-btn, .btn-contact { min-height: 42px; }
.btn-submit, .btn-buy { border-radius: 5px; padding: .85rem 1rem; }

.modal-overlay, .admin-modal { padding: max(.75rem, env(safe-area-inset-top)) .75rem; }
.modal, .admin-modal-content { border-width: 1px; border-radius: 9px; max-width: min(640px, 100%); }
.modal-header, .modal-body { padding: clamp(1rem, 3vw, 1.6rem); }
.modal-title { font-size: clamp(1rem, 3.5vw, 1.45rem); padding-right: 2rem; line-height: 1.25; }
.modal-actions { gap: .7rem; }

.table-container, .table-card {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-container table, .table-card table { min-width: 640px; }
th, td { white-space: nowrap; }

.chat-panel { border-color: rgba(129, 143, 184, .25) !important; border-radius: 8px !important; }
.chat-messages { min-width: 0; }
.msg-bubble, .order-account, .credential-value { overflow-wrap: anywhere; }

/* Mobile drawer and compact layout. */
@media (max-width: 900px) {
    :root { --header-height: 70px; }

    header { padding-top: max(.65rem, env(safe-area-inset-top)); padding-bottom: .65rem; }
    header nav { gap: .6rem; }
    .hamburger, .admin-hamburger { display: flex; }

    header .nav-links,
    header .admin-nav-links {
        position: fixed;
        top: var(--header-height);
        right: -105%;
        width: min(86vw, 330px);
        max-height: calc(100dvh - var(--header-height));
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: .25rem;
        overflow-y: auto;
        background: rgba(7, 8, 15, .97);
        border-left: 1px solid rgba(0, 229, 255, .48);
        box-shadow: -20px 20px 50px rgba(0, 0, 0, .38);
        backdrop-filter: blur(18px);
        transition: right .25s ease;
    }

    header .nav-links.active,
    header .admin-nav-links.active { right: 0; }
    header .nav-link,
    header .admin-nav-links .nav-link,
    header .btn-logout,
    header .admin-nav-links .btn-logout {
        width: 100%;
        min-height: 44px;
        padding: .75rem .85rem;
        text-align: left;
        border-radius: 4px;
    }

    .balance { font-size: .78rem; padding: .36rem .55rem; }
    main, .admin-main { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
    .admin-container { grid-template-columns: 1fr; }
    .payment-grid, .payment-methods { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
    .history-main-info { grid-template-columns: 1fr; gap: .65rem; }
    .details-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    header .logo { font-size: 1.05rem; letter-spacing: .09em; }
    header .user-info { gap: .45rem; }
    header .balance { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }

    .page-title, .hero h1 { font-size: clamp(1.8rem, 10vw, 2.5rem); }
    .page-subtitle, .hero p { font-size: .95rem; }
    .hero { padding-top: 1.1rem; }
    .section-title-lg { margin-bottom: 1.25rem; }

    /* index.html has an inline nowrap rule; !important is intentional here. */
    .breadcrumb { flex-wrap: wrap !important; align-items: stretch; }
    #breadcrumbPath { width: 100%; white-space: normal !important; }
    .quick-search { width: 100%; flex: 1 1 100%; }
    .quick-search button { padding-inline: .75rem; }

    .card, .panel, .setting-section, .form-container, .balance-card,
    .method-card, .search-section { padding: 1rem; }
    .profile-header { gap: 1rem; padding-bottom: 1rem; }
    .profile-avatar { width: 76px; height: 76px; font-size: 2rem; }
    .profile-info h2 { font-size: 1.45rem; }
    .balance-amount { font-size: clamp(2rem, 11vw, 3rem); }

    .tabs { gap: .5rem; margin-bottom: 1.5rem; }
    .tab-btn { padding: .75rem .6rem; font-size: .9rem; }
    .form-options { gap: .7rem; align-items: flex-start; }
    .form-options .forgot-password { align-self: flex-end; }
    .form-title { font-size: 1.35rem; }

    .amount-buttons, .quick-amount { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bank-row, .transaction-header, .product-item-header { align-items: flex-start; gap: .55rem; flex-direction: column; }
    .bank-value, .detail-value { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
    .credential-row { align-items: stretch; flex-direction: column; }
    .copy-btn { margin-left: 0; width: 100%; }

    .history-header { padding: 1rem; align-items: flex-start; gap: .7rem; }
    .history-main-info { width: 100%; }
    .details-content { padding: 1rem; }
    .detail-section { padding: 1rem; }
    .detail-row { gap: .35rem; align-items: flex-start; flex-direction: column; }
    .status-badge { align-self: flex-start; }

    .shop-item, .category-item { align-items: stretch; flex-direction: column; }
    .shop-actions, .category-actions { flex-wrap: wrap; }
    .shop-actions > *, .category-actions > * { flex: 1 1 auto; }
    .category-icon { width: 44px; height: 44px; }
    .category-name { white-space: normal; }
    .product-item-header { padding-bottom: .7rem; }
    .product-item-name { font-size: 1rem; }
    .product-item-info { gap: .65rem; }

    .search-box, .search-modal-controls { flex-direction: column; }
    .search-box button, .search-modal-controls button { width: 100%; }
    .search-result-item { grid-template-columns: 1fr; }
    .search-result-buy { width: 100%; }

    .modal-actions { grid-template-columns: 1fr; }
    .modal-close { top: .55rem; right: .55rem; }
    .toast-container { top: calc(var(--header-height) + .6rem); right: .6rem; left: .6rem; max-width: none; }
    .toast { padding: 1rem; }

    .admin-title { font-size: clamp(1.35rem, 8vw, 2rem); letter-spacing: .04em; }
    .panel-title { font-size: 1.15rem; }
    .admin-stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.35rem; }
    .stat-icon { font-size: 1.8rem; }
    .panel .tabs { margin-inline: -1rem; padding-inline: 1rem; }
    .save-order-bar { align-items: stretch; flex-direction: column; text-align: center; }
    .save-order-bar .btns { justify-content: center; flex-wrap: wrap; }

    .chat-panel { height: calc(100dvh - var(--header-height) - 125px) !important; min-height: 360px; }
    .chat-panel-header { padding: .8rem; }
    .chat-input-area { padding: .65rem; }
    .msg { max-width: 90%; }

    .qr-container { padding: .75rem; max-width: 100%; }
    .qr-container img { max-width: min(250px, 100%); }
    .contact-card { padding: 1.4rem 1rem; }
    .card-icon, .method-icon { font-size: 3rem; }
    .btn-contact { width: 100%; padding-inline: 1rem; }
}

/* Lịch sử nạp: các cột và ghi chú luôn thẳng hàng trên desktop. */
.transaction-card .transaction-details {
    display: grid;
    grid-template-columns: minmax(130px, .9fr) minmax(150px, 1fr) minmax(190px, 1.25fr);
    gap: 1rem 2rem;
    align-items: start;
}
.transaction-card .detail-item {
    min-width: 0;
    align-items: flex-start;
}
.transaction-card .detail-label,
.transaction-card .detail-value {
    width: 100%;
    text-align: left;
}
.transaction-card .detail-value {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.transaction-card .transaction-note {
    grid-column: 1 / -1;
}
@media (max-width: 760px) {
    .transaction-card .transaction-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 1rem;
    }
    .transaction-card .transaction-time,
    .transaction-card .transaction-note {
        grid-column: 1 / -1;
    }
}
@media (max-width: 480px) {
    .transaction-card .transaction-details {
        grid-template-columns: minmax(0, 1fr);
    }
    .transaction-card .transaction-time,
    .transaction-card .transaction-note {
        grid-column: auto;
    }
}

/* ==================== CONTENT SAFETY ==================== */
/* Không để chuỗi token dài hoặc nội dung đối tác phá vỡ chiều rộng card. */
main, header, footer, nav, section, article,
.card, .panel, .setting-section, .form-container,
.product-grid, .product-card, .product-header, .product-desc-wrap,
.category-grid, .category-card, .category-info,
.category-item, .product-item-admin,
.modal, .modal-header, .modal-body, .admin-modal-content,
.chat-layout, .chat-panel, .chat-messages, .toast {
    min-width: 0;
}

.product-card,
.category-card,
.partner-product-card,
.product-item-admin,
.category-item,
.modal,
.admin-modal-content {
    max-width: 100%;
    overflow: hidden;
}

.product-name,
.product-desc,
.product-item-name,
.product-item-desc,
.partner-product-name,
.partner-product-desc,
.category-name,
.order-account,
.credential-value,
.detail-value,
.bank-value,
.msg-bubble,
.chat-request-summary,
.toast-message,
.form-hint,
.panel p,
.card p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.partner-product-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mọi modal không mở phải hoàn toàn bỏ qua chuột và cảm ứng. */
.modal-overlay:not(.active),
.admin-modal:not(.active) {
    pointer-events: none !important;
    visibility: hidden;
}
.modal-overlay.active,
.admin-modal.active {
    pointer-events: auto;
    visibility: visible;
}

/* Modal nội dung: gọn trên desktop, vẫn cuộn được khi form dài. */
.modal {
    width: min(100%, 640px);
    max-width: min(640px, 100%);
    max-height: min(88vh, 760px);
    overflow-x: hidden;
    overflow-y: auto;
}
#purchaseModal > .modal { max-width: 620px; }
#editProductModal > .modal { max-width: 720px; }
.modal-header, .modal-body { padding: clamp(.9rem, 2vw, 1.25rem); }
.modal-title { font-size: clamp(1rem, 2.4vw, 1.35rem); }
@media (max-width: 640px) {
    .modal {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 1.5rem);
    }
}

/* Hộp thông báo dùng chung, thay cho alert native của trình duyệt. */
.neko-alert-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, visibility .16s ease;
}
.neko-alert-modal[hidden] { display: none; }
.neko-alert-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.neko-alert-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 3, 10, .78);
    backdrop-filter: blur(5px);
}
.neko-alert-card {
    position: relative;
    width: min(520px, 100%);
    max-height: min(82vh, 620px);
    overflow: auto;
    background: linear-gradient(145deg, rgba(13, 15, 28, .98), rgba(8, 22, 31, .98));
    border: 1px solid var(--primary);
    border-radius: 12px;
    box-shadow: 0 0 34px rgba(0, 229, 255, .22), 0 18px 60px rgba(0, 0, 0, .5);
    color: var(--text-primary);
}
.neko-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.neko-alert-header h2 {
    margin: 0;
    color: var(--primary);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 3vw, 1.25rem);
    line-height: 1.3;
}
.neko-alert-close {
    flex: 0 0 auto;
    min-height: 34px;
    padding: .45rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    cursor: pointer;
}
.neko-alert-close:hover { border-color: var(--primary); color: var(--primary); }
.neko-alert-message {
    padding: 1.25rem 1.15rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.55;
}
.neko-alert-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 1.15rem 1.15rem;
}
.neko-alert-ok {
    min-width: 112px;
    min-height: 42px;
    padding: .7rem 1rem;
    border: 0;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #061018;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
}
.neko-alert-ok:hover { filter: brightness(1.08); }
@media (max-width: 520px) {
    .neko-alert-card { border-radius: 9px; }
    .neko-alert-header { padding: .85rem .9rem; }
    .neko-alert-message { padding: 1rem .9rem; }
    .neko-alert-actions { padding: 0 .9rem .9rem; }
    .neko-alert-ok { width: 100%; }
}

/* Card sản phẩm dùng cùng một vùng mô tả; nút mua luôn được đẩy xuống đáy. */
.product-desc-wrap {
    min-height: calc(3 * 1.7em + 1.45rem);
}
.product-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3 !important;
    height: 4.35em !important;
    max-height: 4.35em !important;
    line-height: 1.45 !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: normal !important;
}
.product-desc-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: .35rem .7rem;
    border: 1px solid rgba(0, 229, 255, .65);
    border-radius: 6px;
    background: rgba(0, 229, 255, .08);
    color: var(--primary);
    font: 700 .88rem 'Rajdhani', sans-serif;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
    transition: background .2s, border-color .2s, transform .2s;
}
.product-desc-more:hover {
    color: var(--text-primary);
    background: rgba(0, 229, 255, .18);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.product-meta {
    margin-top: auto;
    min-width: 0;
}
.product-meta .product-stock {
    margin-bottom: .75rem;
}
.product-meta .product-stock:last-child {
    margin-bottom: 0;
}
.product-card > .btn-buy {
    margin-top: .8rem;
}

pre, code {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 390px) {
    .admin-stats { grid-template-columns: 1fr; }
    .amount-buttons, .quick-amount { grid-template-columns: 1fr; }
    .balance { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

/* ==================== FINAL SHOP HEADER / PRODUCT LAYOUT ==================== */
/* Menu luôn là drawer; không dùng thanh menu ngang trên desktop. */
header nav {
    position: relative;
    display: flex;
    align-items: center;
    gap: clamp(.65rem, 2vw, 1rem);
}

header .hamburger,
header .admin-hamburger {
    display: flex;
    flex: 0 0 auto;
    order: -1;
    width: 28px;
    min-width: 28px;
    align-items: center;
    justify-content: center;
    padding: 3px 0;
    z-index: 1002;
}

header .hamburger span,
header .admin-hamburger span {
    width: 24px;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 8px rgba(0, 229, 255, .25);
}

header .logo { order: 0; }
header .user-info {
    order: 1;
    margin-left: auto;
    display: flex;
    align-items: center;
}

header .nav-links,
header .admin-nav-links {
    position: fixed;
    top: var(--header-height);
    right: auto;
    left: -105%;
    width: min(86vw, 330px);
    height: calc(100dvh - var(--header-height));
    max-height: none;
    margin: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(18, 12, 40, .985) 0%, rgba(7, 11, 18, .985) 100%);
    border-right: 1px solid rgba(0, 229, 255, .48);
    border-left: 0;
    box-shadow: 20px 20px 50px rgba(0, 0, 0, .38);
    backdrop-filter: blur(18px);
    transition: left .25s ease;
    z-index: 1001;
}

header .nav-links.active,
header .admin-nav-links.active { left: 0; }

header .nav-link,
header .admin-nav-links .nav-link,
header .btn-logout,
header .admin-nav-links .btn-logout {
    width: 100%;
    min-height: 44px;
    padding: .75rem .85rem;
    text-align: left;
    border-radius: 4px;
}

/* Menu drawer: chữ đậm, sáng và dễ bấm/đọc trên cả điện thoại lẫn PC. */
header .nav-links .nav-link,
header .admin-nav-links .nav-link {
    color: #edf4ff;
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1rem, 3.6vw, 1.1rem);
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1.25;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}

header .nav-links .nav-link:hover,
header .nav-links .nav-link:focus-visible,
header .admin-nav-links .nav-link:hover,
header .admin-nav-links .nav-link:focus-visible {
    color: var(--primary);
    background: rgba(0, 229, 255, .1);
    border-color: rgba(0, 229, 255, .5);
    outline: none;
}

header .nav-links .btn-logout,
header .admin-nav-links .btn-logout {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1rem, 3.6vw, 1.1rem);
    font-weight: 800;
    letter-spacing: .035em;
}

/* Một sản phẩm không được kéo dài kín cả màn hình desktop. */
.product-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 360px));
    justify-content: start;
    align-items: stretch;
}

.product-card { min-width: 0; }

@media (max-width: 640px) {
    header nav { gap: .5rem; }
    header .logo { font-size: clamp(.95rem, 5vw, 1.15rem); }
    header .balance { max-width: 42vw; }
    .product-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Final sizing: cards stay compact when a category has only a few products. */
main { width: min(100%, 1280px); }
main.narrow { width: min(100%, 900px); }
.product-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 250px));
    justify-content: start;
    align-items: stretch;
}
.product-grid > .empty-state { grid-column: 1 / -1; }

@media (max-width: 640px) {
    main, main.narrow { width: 100%; }
    .product-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 390px) {
    header .balance {
        display: block !important;
        max-width: 33vw;
        padding: .3rem .42rem;
        font-size: .68rem;
    }
}

/* Vertical mobile layout and admin product-management tabs. */
.admin-management-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    margin: 0 auto 1.25rem;
    width: min(100%, 1120px);
}
.admin-management-tab {
    min-width: 0;
    min-height: 46px;
    padding: .7rem .55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(12, 13, 22, .72);
    color: var(--text-secondary);
    font: 700 .84rem 'Rajdhani', sans-serif;
    cursor: pointer;
    transition: .2s ease;
}
.admin-management-tab:hover,
.admin-management-tab.active {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 229, 255, .08);
    box-shadow: 0 0 18px rgba(0, 229, 255, .08);
}
.admin-management-pane { display: none; }
.admin-management-pane.active { display: block; }
.admin-management-tabs + .admin-container { display: block; }
.admin-management-tabs + .admin-container > .admin-management-pane > .panel { margin-bottom: 0; }

.hero h1 {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: clamp(1.55rem, 8vw, 2.5rem);
        line-height: 1.1;
        letter-spacing: -.045em;
    }
    .hero { padding-inline: 0; }
    .admin-management-tabs { gap: .35rem; }
    .admin-management-tab { min-height: 42px; padding: .6rem .25rem; font-size: .72rem; line-height: 1.15; }
}

@media (max-width: 420px) {
    .admin-management-tabs { grid-template-columns: 1fr; }
    .admin-management-tab { text-align: left; padding-inline: .8rem; }
}

@media (max-width: 768px) {
    .chat-layout { margin-top: var(--header-height) !important; }
    .chat-area-header { padding: .75rem; align-items: flex-start; }
    .chat-area-actions { width: 100%; }
    .chat-area-actions .action-btn { flex: 1 1 100%; min-height: 40px; }
    .chat-messages { padding: .75rem; }
    .chat-locked { padding: .75rem; line-height: 1.4; }
}

/* ==================== LATEST MOBILE SHOP / ADMIN FIXES ==================== */
/* Nội dung danh mục trong trang quản lý luôn đọc từ trái sang phải. */
.admin-main .category-info { text-align: left; }
.category-name { overflow-wrap: anywhere; }

/* Kéo bằng chuột hoặc ngón tay trên đúng biểu tượng tay nắm. */
.drag-handle {
    min-width: 28px;
    min-height: 28px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
.category-item.draggable { cursor: grab; }
.category-item.draggable:active { cursor: grabbing; }

/* Trên điện thoại, danh mục và sản phẩm vẫn nằm cạnh nhau như bố cục desktop. */
@media (max-width: 640px) {
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .7rem;
        align-items: stretch;
    }

    .category-card,
    .product-card { min-width: 0; }

    .category-image {
        height: clamp(105px, 28vw, 145px);
    }
    .category-info { padding: .75rem .65rem; }
    .category-name {
        font-size: clamp(.78rem, 3.55vw, 1rem);
        line-height: 1.2;
        margin-bottom: .3rem;
    }
    .category-count { font-size: .76rem; }

    .product-card { padding: .8rem; }
    .product-header {
        margin-bottom: .75rem;
        padding-bottom: .65rem;
    }
    .product-name {
        font-size: clamp(.78rem, 3.4vw, .98rem);
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .product-price {
        font-size: clamp(.95rem, 4.2vw, 1.25rem);
        line-height: 1.2;
    }
    .product-desc {
        font-size: .76rem;
        line-height: 1.45;
        margin-bottom: .8rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
    .product-stock {
        gap: .25rem;
        flex-wrap: wrap;
        margin-bottom: .8rem;
        font-size: .73rem;
    }
    .stock-badge {
        padding: .22rem .4rem;
        font-size: .66rem;
    }
    .btn-buy {
        min-height: 38px;
        padding: .65rem .35rem;
        font-size: .74rem;
        letter-spacing: 0;
    }

    /* Trang quản lý: icon danh mục lớn và nằm giữa card dọc. */
    .category-item {
        align-items: stretch;
        flex-direction: column;
        padding: .9rem;
        gap: .65rem;
    }
    .category-item .drag-handle { align-self: flex-start; }
    .category-item .category-icon {
        align-self: center;
        width: 78px;
        height: 78px;
    }
    .category-item .category-info { width: 100%; }
    .category-item .category-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .category-item .category-actions > * { flex: 1 1 0; }
}

/* ==================== FINAL COMPACT SHOP CARDS ==================== */
/* Keep long names/descriptions inside a predictable card height. */
.product-card {
    min-width: 0;
    padding: 1.1rem;
}
.product-card .product-header {
    display: block;
    min-width: 0;
    height: 3.75rem;
    margin-bottom: .45rem;
    padding-bottom: .55rem;
}
.product-card .product-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    height: 2.5em;
    max-height: 2.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}
.product-card .product-desc-wrap {
    min-width: 0;
    min-height: 1.45em;
    height: 1.45em;
    margin-bottom: .45rem;
}
.product-card .product-desc {
    display: block;
    width: 100%;
    height: 1.45em !important;
    max-height: 1.45em !important;
    margin: 0 !important;
    line-height: 1.45 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
}
.product-card > .product-price {
    display: flex;
    align-items: center;
    height: 1.6rem;
    margin: 0 0 .55rem;
    font-size: 1.4rem;
    line-height: 1.1;
}
.product-card .product-meta {
    min-width: 0;
    margin-top: auto;
}
.product-card .product-stock-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, auto) minmax(0, auto);
    justify-content: start;
    align-items: center;
    gap: .35rem;
    flex-wrap: nowrap;
    height: 28px;
    overflow: hidden;
    white-space: nowrap;
}
.product-card .product-stock-main > span:first-child {
    min-width: 0;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card .product-stock-main > * { min-width: 0; }
.product-card .product-stock-main .stock-badge {
    min-width: 0;
    justify-self: start;
    width: 5rem;
    max-width: 100%;
    height: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    padding: .25rem .5rem;
}
.product-card .product-desc-more {
    min-width: 0;
    justify-self: end;
    min-height: 28px;
    margin-left: 0;
    padding: .22rem .45rem;
    border-radius: 5px;
    font-size: .78rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card .product-meta > .product-stock:not(.product-stock-main) {
    min-width: 0;
    height: 1.25rem;
    display: flex;
    margin-bottom: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-card .product-meta > .product-stock:not(.product-stock-main) span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-card .category-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    height: 2.3em;
    max-height: 2.3em;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
}

@media (max-width: 640px) {
    /* Category cards: three compact items per row on phones. */
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: .45rem;
    }
    .category-card {
        border-radius: 6px;
    }
    .category-image {
        height: clamp(80px, 24vw, 110px);
    }
    .category-info {
        min-width: 0;
        padding: .45rem .3rem .55rem;
    }
    .category-card .category-name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        height: 2.3em;
        max-height: 2.3em;
        margin-bottom: .25rem;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(.54rem, 2.6vw, .75rem);
        line-height: 1.15;
        overflow-wrap: normal;
        word-break: normal;
    }
    .category-card .category-count {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .58rem;
        line-height: 1.1;
    }

    /* Product cards remain compact in two columns on phones. */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: .6rem;
    }
    .product-card {
        padding: .7rem;
        border-radius: 7px;
    }
    .product-card .product-header {
        height: 2.85rem;
        margin-bottom: .35rem;
        padding-bottom: .45rem;
    }
    .product-card .product-name {
        height: 2.36em;
        max-height: 2.36em;
        font-size: clamp(.78rem, 3.4vw, .98rem);
        line-height: 1.18;
    }
    .product-card .product-desc-wrap {
        height: 1.35em;
        min-height: 1.35em;
    }
    .product-card .product-desc {
        height: 1.35em !important;
        max-height: 1.35em !important;
        line-height: 1.35 !important;
        font-size: .76rem;
    }
    .product-card > .product-price {
        height: 1.35rem;
        margin-bottom: .45rem;
        font-size: clamp(.95rem, 4.4vw, 1.25rem);
    }
    .product-card .product-stock {
        gap: .2rem;
        margin-bottom: .45rem;
        font-size: .68rem;
    }
    .product-card .product-stock-main .stock-badge {
        width: 4rem;
        height: 1.4rem;
        padding: .2rem .35rem;
        font-size: .6rem;
    }
    .product-card .product-stock-main {
        height: 25px;
        grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
        justify-content: start;
    }
    .product-card .product-desc-more {
        min-height: 25px;
        padding: .2rem .28rem;
        font-size: .6rem;
    }
    .product-card > .btn-buy {
        min-height: 35px;
        padding: .5rem .25rem;
        font-size: .68rem;
        letter-spacing: 0;
    }
}

/* ==================== FINAL BLUE MODAL + CHAT TUNING ==================== */
/* Keep the established cyan/blue NTT theme; remove the old green glow from overlays. */
:root {
    --primary: #00d9ff;
    --primary-dark: #0088cc;
    --success: #00d9ff;
}

.modal-overlay {
    padding: clamp(.5rem, 2vw, 1rem);
}

.modal,
.admin-modal-content {
    width: min(92vw, 620px);
    max-width: min(92vw, 620px);
    height: auto;
    max-height: calc(100dvh - 2rem);
    box-shadow: 0 18px 55px rgba(0, 174, 255, .24);
}

#editProductModal > .modal { width: min(94vw, 700px); max-width: min(94vw, 700px); }
.modal-header,
.modal-body { padding: clamp(.8rem, 2vw, 1.25rem); }
.modal-close { font-size: 1.65rem; }
.modal-close:hover {
    background: rgba(0, 174, 255, .1);
    transform: none;
}
.modal-product-info,
.total-section {
    padding: clamp(.75rem, 2vw, 1.2rem);
    margin-bottom: clamp(.85rem, 2vw, 1.35rem);
}
.total-section {
    background: linear-gradient(135deg, rgba(0, 174, 255, .13) 0%, rgba(0, 120, 210, .08) 100%);
}
.modal-btn-confirm:hover:not(:disabled) {
    box-shadow: 0 10px 30px rgba(0, 174, 255, .38);
}
.alert.success {
    background: rgba(0, 174, 255, .12);
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 640px) {
    .modal,
    .admin-modal-content,
    #editProductModal > .modal {
        width: min(94vw, 420px);
        max-width: min(94vw, 420px);
        max-height: calc(100dvh - 1rem);
        border-radius: 12px;
    }
    .modal-header,
    .modal-body { padding: .8rem; }
    .modal-title { font-size: clamp(.95rem, 4.2vw, 1.2rem); }
    .modal-close {
        top: .4rem;
        right: .4rem;
        width: 32px;
        height: 32px;
        font-size: 1.5rem;
    }
    .modal-product-name { font-size: 1.05rem; margin-bottom: .55rem; }
    .modal-info-row { gap: .75rem; padding: .5rem 0; font-size: .88rem; }
    .quantity-selector { margin-bottom: 1rem; }
    .quantity-label { font-size: .95rem; margin-bottom: .6rem; }
    .quantity-controls { gap: .5rem; }
    .quantity-btn { width: 38px; height: 38px; font-size: 1.2rem; }
    .quantity-input { font-size: 1.35rem; padding: .5rem; }
    .total-section { padding: .8rem; margin-bottom: 1rem; }
    .total-label { font-size: .9rem; }
    .total-final { font-size: 1.35rem; }
    .modal-actions { gap: .55rem; margin-top: 1rem; }
    .modal-btn { min-height: 38px; padding: .7rem .55rem; font-size: .82rem; }
}

/* List pagination */
.neko-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    padding: 1rem .5rem;
    flex: 0 0 auto;
    min-width: 0;
}
.neko-pagination button {
    display: grid;
    place-items: center;
    min-width: 40px;
    min-height: 40px;
    padding: .4rem .7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font: 700 1.2rem 'Rajdhani', sans-serif;
    cursor: pointer;
}
.neko-pagination button:hover:not(:disabled),
.neko-pagination button:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}
.neko-pagination button:disabled { opacity: .35; cursor: default; }
.neko-page-counter {
    min-width: 54px;
    text-align: center;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* History, balance movements, and withdrawal QR. */
[hidden] { display:none !important; }
.history-tabs { display:flex; gap:.5rem; overflow:auto; border-bottom:1px solid var(--border); margin-bottom:1.3rem; }
.history-tab { flex:0 0 auto; min-height:46px; padding:.7rem 1rem; border:0; border-bottom:3px solid transparent; background:transparent; color:var(--text-secondary); font:800 1rem 'Rajdhani',sans-serif; cursor:pointer; }
.history-tab.active { color:var(--primary); border-bottom-color:var(--primary); }
.movement-filters { display:grid; grid-template-columns:minmax(160px,2fr) repeat(4,minmax(100px,1fr)); gap:12px; margin-bottom:20px; }
.movement-filters label { display:block; margin-bottom:6px; color:var(--text-secondary); }
.movement-filters input,.movement-filters select { width:100%; box-sizing:border-box; min-height:42px; border:1px solid var(--border); border-radius:7px; padding:8px 10px; background:var(--bg-input); color:var(--text-primary); font:inherit; }
.movement-list { display:grid; gap:10px; }
.movement-card { display:grid; grid-template-columns:minmax(145px,1fr) minmax(160px,2fr) auto auto; gap:16px; align-items:center; padding:16px; background:var(--bg-card); border:1px solid var(--border); border-radius:9px; min-width:0; }
.movement-card small { display:block; margin-top:5px; font-size:.85rem; color:var(--text-secondary); }
.movement-note { overflow-wrap:anywhere; }
.movement-amount { text-align:right; white-space:nowrap; }
.movement-amount.credit,.commission-balance { color:var(--primary); font-weight:700; }
.movement-amount.debit { color:#ff9aac; }
.movement-status { font-size:.85rem; padding:5px 9px; border-radius:8px; color:var(--primary); background:#00aeff16; white-space:nowrap; }
.movement-status.pending { color:#ffd58b; background:#ffb02016; }
.movement-status.failed { color:#ff9aac; background:#ff445516; }
.withdrawal-payment-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(210px,280px); gap:16px; align-items:start; }
.withdrawal-qr { margin:0; text-align:center; }
.withdrawal-qr img { display:block; width:100%; max-width:270px; height:auto; margin:auto; border-radius:8px; background:white; }
.withdrawal-qr figcaption { margin:8px 0; color:var(--text-primary); }
.withdrawal-qr a { color:var(--primary); }
@media(max-width:768px) {
    .movement-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .movement-filters>div:first-child { grid-column:1/-1; }
    .movement-card { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
    .movement-card .movement-note { grid-column:1/-1; grid-row:2; }
    .movement-card .movement-amount { grid-column:2; grid-row:1; }
    .movement-card .movement-status { justify-self:start; }
    .withdrawal-payment-grid { grid-template-columns:1fr; }
    .withdrawal-qr { max-width:270px; justify-self:center; }
}
