:root {
    color-scheme: light dark;
    --green: #e65100; /* Darker, punchier orange for light mode */
    --green-strong: #bf360c;
    --mint: #fff3e0;
    --orange: #ef6c00;
    --accent: #e65100;
    --danger: #ff3b68;
    --ink: #111827;
    --muted: #64748b; /* Slightly darker muted text */
    --soft: #fdfaf8;
    --bg: #f8fafc;
    /* Cleaner background for light mode */
    --panel: rgba(255, 255, 255, .98);
    --panel-solid: #fff;
    --line: rgba(17, 24, 39, .12);
    /* Soft line */
    --shadow: 0 20px 50px rgba(15, 23, 42, .12);
    --toast-bg: rgba(17, 24, 39, 0.95);
    --toast-ink: #fff;
    --toast-muted: rgba(255, 255, 255, 0.7);
    --glow: rgba(242, 107, 0, 0.3);
    --sidebar: rgba(255, 255, 255, .92);
    --code: #4d5872;
    --code-head: #3d465e;
    --white: #ffffff;
}

[data-theme="dark"] {
    --green: #ff8800;
    --green-strong: #ffcc33;
    --mint: rgba(255, 136, 0, .12);
    --orange: #ffb547;
    --danger: #ff6b8c;
    --ink: #eef5f2;
    --muted: #9aa8a2;
    --soft: #101514;
    --bg: #070a09;
    --panel: rgba(18, 24, 22, .85);
    --panel-solid: #121816;
    --line: rgba(238, 245, 242, .05);
    --shadow: 0 15px 50px rgba(0, 0, 0, .4);
    --toast-bg: rgba(255, 255, 255, 0.98);
    --toast-ink: #111827;
    --toast-muted: #6b7280;
    --glow: rgba(255, 136, 0, 0.6);
    --sidebar: rgba(12, 18, 16, .94);
    --code: #293247;
    --code-head: #20283a;
    --white: #eef5f2;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --green: #ff8800;
        --green-strong: #ffcc33;
        --mint: rgba(255, 136, 0, .12);
        --orange: #ffb547;
        --danger: #ff6b8c;
        --ink: #eef5f2;
        --muted: #9aa8a2;
        --soft: #101514;
        --bg: #070a09;
        --panel: rgba(18, 24, 22, .85);
        --panel-solid: #121816;
        --line: rgba(238, 245, 242, .05);
        --shadow: 0 15px 50px rgba(0, 0, 0, .4);
        --glow: rgba(255, 136, 0, 0.6);
        --sidebar: rgba(12, 18, 16, .94);
        --code: #293247;
        --code-head: #20283a;
        --white: #eef5f2;
        --toast-bg: rgba(255, 255, 255, 0.98);
        --toast-ink: #111827;
        --toast-muted: #6b7280;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: 'Be Vietnam Pro', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 84% 8%, rgba(16, 184, 102, .12), transparent 28rem),
        radial-gradient(circle at 14% 16%, rgba(19, 150, 255, .08), transparent 26rem),
        var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button,
a,
input,
select {
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    padding: 24px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
    box-shadow: 16px 0 44px rgba(15, 23, 42, .06);
    overflow-y: auto;
    scrollbar-width: none;
    z-index: 99;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Auth header styles moved to line 980 for consolidation */

.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
    cursor: pointer;
}

.auth-logo:hover {
    opacity: 0.8;
}

.auth-logo span {
    font-size: 20px;
    font-weight: 800;
}

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.2);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 10px;
}

.brand strong {
    display: block;
    font-size: 17px;
    line-height: 1.1;
    color: var(--ink);
}

.brand span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Giam tu 24px xuong 12px de cac muc khit nhau hon */
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-group-label {
    padding: 0 16px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    border: 0;
    transition: all .2s ease;
    text-decoration: none;
}

.nav-link:hover {
    background: rgba(255, 136, 0, 0.08);
    color: var(--green);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--green), #ff5500);
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.2);
}

.nav-link.active .nav-icon {
    color: #fff !important;
}

.nav-badge {
    background: #ff3b68; /* Mau do noi bat */
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: auto;
    box-shadow: 0 0 10px rgba(255, 59, 104, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); box-shadow: 0 0 15px rgba(255, 59, 104, 0.6); }
    100% { transform: scale(1); }
}

.nav-dropdown {
    display: flex;
    flex-direction: column;
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding-left: 44px;
    gap: 2px;
}

.nav-dropdown.open .dropdown-content {
    max-height: 500px;
    margin: 8px 0;
}

.nav-dropdown.open .chevron {
    transform: rotate(180deg);
}

.dropdown-content a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    border-radius: 10px;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background: rgba(255, 136, 0, 0.05);
    color: var(--green);
}

.dropdown-content a.active {
    color: var(--green);
    font-weight: 800;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 16px 0;
    border-top: 1px solid var(--line);
}

.theme-toggle {
    margin: 20px 12px 0;
    padding: 0 16px;
}

#theme-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    background: rgba(255, 136, 0, 0.08);
    border: 1px solid rgba(255, 136, 0, 0.2);
    border-radius: 12px;
    color: var(--green);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    background: rgba(255, 136, 0, 0.15);
    border-color: var(--green);
}

@media (max-width: 1024px) {
    .theme-toggle, 
    .theme-toggle-btn, 
    #theme-toggle {
        display: none !important;
    }

    .auth-header {
        padding: 20px;
    }
}

.mt-auto {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.main {
    margin-left: 280px;
    min-height: 100vh;
    padding: 24px 20px;
    transition: margin-left 0.3s ease;
}

.content-shell {
    max-width: 1560px;
    margin: 0 auto;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 16px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.top-action-btn:hover {
    background: rgba(255, 136, 0, 0.08);
    color: var(--green);
    border-color: rgba(255, 136, 0, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 16px 6px 6px;
    font-weight: 800;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), #ff5500);
    color: #fff;
    display: grid;
    place-items: center;
}

.user-avatar i {
    width: 16px;
    height: 16px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 4px 0 30px;
    flex-wrap: wrap;
}

.page-head h1 {
    margin: 0 0 8px;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: 0;
    flex: 1;
    min-width: 200px;
}

.crumb {
    color: var(--muted);
    font-weight: 800;
}

.page-badge,
.balance-line,
.account-pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
    font-weight: 900;
    white-space: nowrap;
}

.balance-line {
    margin-bottom: 22px;
    gap: 6px;
}

.balance-line strong {
    color: var(--green-strong);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(20px, 5vw, 32px);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    margin: -4px 0 24px;
    padding-bottom: 22px;
    flex-wrap: wrap;
}

.section-title.compact {
    margin-top: 0;
}

.section-title h2,
.panel h2 {
    margin: 0 0 6px;
    font-size: 18px;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.metrics div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.metrics div:hover {
    transform: translateY(-4px);
    border-color: var(--green);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.metrics div i {
    position: absolute;
    right: -8px;
    bottom: -8px;
    font-size: 64px;
    opacity: 0.06;
    transform: rotate(-12deg);
    color: var(--green);
    pointer-events: none;
}

.metrics span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrics strong {
    display: block;
    font-size: 32px;
    color: var(--ink);
    font-weight: 900;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Compact Deposit Card UI */
.deposit-card {
    display: flex;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 850px; /* Thu nho card */
    margin: 0 auto 24px;
}

.qr-section {
    padding: 30px; /* Giam padding */
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.02);
    border-right: 1px solid var(--line);
    max-width: 320px; /* Thu nho vung QR */
}

.qr-section img {
    width: 100%;
    max-width: 200px; /* Thu nho QR */
    border-radius: 12px;
    border: 6px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.qr-section p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.info-section {
    padding: 30px; /* Giam padding */
    flex: 1.5;
}

.info-section h3 {
    font-size: 16px; /* Thu nho tieu de */
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section h3::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #ff8c00; /* Chuyen sang mau Cam */
    border-radius: 2px;
}

.input-group {
    margin-bottom: 14px; /* Giam khoang cach giua cac o */
}

.input-group label {
    display: block;
    font-size: 10px; /* Thu nho label */
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.input-box {
    display: flex;
    background: #0d1117;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 14px; /* Giam padding input */
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    outline: none;
    width: 100%;
}

.copy-btn {
    background: #ff8c00; /* Chuyen sang mau Cam */
    color: #fff; /* Chu trang tren nen Cam */
    border: none;
    padding: 0 15px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s;
    text-transform: uppercase;
}

.copy-btn:hover {
    background: #e67e00;
    filter: brightness(1.1);
}

.status-row {
    margin-top: 24px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deposit-success-screen {
    min-height: calc(100vh - 190px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.deposit-success-card {
    width: min(520px, 100%);
    padding: 42px 34px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-solid);
    color: var(--ink);
    box-shadow: var(--shadow);
    text-align: center;
}

.deposit-success-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(47, 201, 128, 0.16);
    color: var(--green-strong);
    border: 1px solid rgba(47, 201, 128, 0.28);
}

.deposit-success-icon svg {
    width: 38px;
    height: 38px;
    stroke-width: 3;
}

.deposit-success-card h1 {
    margin: 0 0 12px;
    font-size: 30px;
    color: var(--ink);
}

.deposit-success-card p {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    font-weight: 700;
}

.deposit-success-card strong {
    color: var(--green-strong);
}

.deposit-success-action {
    margin-top: 28px;
    display: inline-flex;
    width: auto;
    min-width: 220px;
    text-decoration: none;
    color: #fff;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .deposit-success-card {
    background: #fff;
    border-color: rgba(17, 24, 39, 0.14);
}

[data-theme="dark"] .deposit-success-card {
    background: #121816;
    border-color: rgba(238, 245, 242, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .deposit-success-card {
        background: #121816;
        border-color: rgba(238, 245, 242, 0.1);
    }
}

@media (max-width: 900px) {
    .deposit-card {
        flex-direction: column;
        max-width: 560px;
    }

    .qr-section {
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .deposit-success-screen {
        min-height: calc(100vh - 150px);
        padding: 32px 0;
    }
}

/* Restoring Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: 14px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
    text-align: left;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    color: var(--ink);
    font-size: 13px;
    background: var(--soft);
    font-weight: 700;
}

td code {
    font-weight: 800;
    word-break: break-all;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    color: var(--green-strong);
    display: block;
    width: 100%;
}

.license-table th,
.license-table td {
    white-space: normal;
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form input {
    width: 100%;
    flex: 1;
    min-width: 150px;
}

/* Standardized Buttons */
.primary,
.green,
.orange,
.dark,
.danger-btn,
.btn-primary {
    border: 0;
    border-radius: 12px;
    min-height: 46px;
    padding: 0 24px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sm {
    min-height: 34px;
    padding: 0 16px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    min-height: 56px;
    padding: 0 32px;
    font-size: 16px;
    border-radius: 14px;
}

.primary,
.green,
.btn-primary {
    background: linear-gradient(135deg, var(--green), #ff5500);
    box-shadow: 0 4px 12px rgba(255, 136, 0, 0.15);
}

.orange {
    background: linear-gradient(135deg, var(--orange), #ff7b1a);
    box-shadow: 0 4px 12px rgba(255, 159, 28, 0.15);
}

.dark {
    background: #172033;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.danger-btn {
    background: linear-gradient(135deg, var(--danger), #e11d48);
    box-shadow: 0 4px 12px rgba(255, 59, 104, 0.15);
}

.primary:hover,
.green:hover,
.orange:hover,
.dark:hover,
.danger-btn:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.primary:active,
.danger-btn:active {
    transform: translateY(0);
}

.purple {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.btn-text {
    background: transparent;
    color: var(--green);
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-text.danger {
    color: var(--danger);
}

.btn-text:hover {
    color: var(--green-strong);
    transform: translateX(2px);
}

.icon {
    border: 0;
    border-radius: 10px;
    min-height: 36px;
    padding: 0 12px;
    background: var(--mint);
    color: var(--green-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.copied {
    box-shadow: 0 0 0 3px rgba(16, 184, 102, .18);
}

.money {
    color: var(--danger);
    font-weight: 900;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 11px;
    background: var(--mint);
    color: var(--green-strong);
    font-weight: 900;
    font-size: 12px;
    box-shadow: none !important;
    text-shadow: none !important;
}

.badge.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.badge.red {
    background: rgba(255, 59, 104, 0.1);
    color: var(--danger);
}

.badge.gray {
    background: rgba(154, 168, 162, 0.1);
    color: var(--muted);
}

.badge.green {
    background: rgba(16, 184, 102, 0.1);
    color: #10b866;
}

.badge.orange {
    background: rgba(255, 159, 28, 0.1);
    color: var(--orange);
}

.badge.dark {
    background: rgba(0, 0, 0, 0.1);
    color: var(--muted);
}

.api-title {
    background: linear-gradient(135deg, var(--green), #079b58);
    color: #fff;
    border-radius: 14px;
    padding: 15px;
    text-align: center;
    font-weight: 900;
    margin-bottom: 14px;
    box-shadow: 0 16px 32px rgba(16, 184, 102, .18);
}

.api-docs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.code-card,
.response-card {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.code-card header,
.response-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
    padding: 0 18px;
    background: var(--soft);
    color: var(--muted);
    font-weight: 900;
}

.response-card header {
    background: var(--code-head);
    color: #eef2ff;
}

pre {
    margin: 0;
    padding: 22px 26px;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
}

.response-card pre {
    color: #fff;
    background: var(--code);
}

.form-stack {
    display: grid;
    gap: 12px;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
}

.check-row input {
    width: 20px;
    height: 20px;
    margin: 0;
}

input,
select,
.form-control {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 16px;
    background: var(--panel-solid);
    color: var(--ink);
    width: 100%;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

input:focus,
select:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(242, 107, 0, 0.15);
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.filters input,
.filters select {
    width: auto;
    min-width: 160px;
    min-height: 40px;
    border-radius: 10px;
}

.bank-info {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 14px;
}

.bank-info dt {
    color: var(--muted);
    font-weight: 900;
}

.bank-info dd {
    margin: 0;
}

.qr-panel img {
    max-width: 320px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.packages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.packages h3 {
    margin: 0 0 12px;
}

.packages strong {
    font-size: 25px;
    color: var(--green-strong);
}

.alert {
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-weight: 900;
}

.alert.success {
    background: var(--mint);
    color: var(--green-strong);
}

.alert.error,
.validation {
    background: rgba(255, 59, 104, .12);
    color: var(--danger);
}

.validation {
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.validation:empty,
.validation-summary-valid {
    display: none;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
}

.auth-card-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 60px 0;
}

.auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 30px;
    position: absolute;
    top: 10px; /* Higher */
    left: 0;
    right: 0;
    z-index: 100;
}

.auth-card {
    width: min(420px, 100%);
    background: var(--panel);
    border: 2px solid var(--line); /* Thicker border */
    border-top: 4px solid var(--green); /* Accent top border */
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    text-align: center;
    margin: 0 0 30px;
    font-size: 28px;
    border-bottom: 0;
    padding-bottom: 0;
}

.auth-card form {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-card label {
    font-size: 14px;
    font-weight: 800;
    color: var(--muted);
    margin-bottom: -8px;
}

.auth-card a {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--green);
}

.plans-hero {
    margin: 0 0 30px;
}

.plan-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 28px;
    max-width: 1040px;
}

.plan-card {
    min-height: 320px;
    border: 2px solid rgba(16, 184, 102, .7);
    border-radius: 22px;
    background: var(--panel);
    padding: 26px 24px;
    text-align: center;
    box-shadow: var(--shadow);
}

.plan-card h3 {
    margin: 0 0 28px;
    font-size: clamp(22px, 2vw, 27px);
}

.price-line {
    font-size: 23px;
    font-weight: 900;
    margin-bottom: 20px;
}

.price-line strong {
    color: var(--green-strong);
    font-size: clamp(38px, 5vw, 48px);
}

.price-line sup {
    color: var(--green-strong);
    font-size: 14px;
    margin-left: 4px;
}

.plan-card p {
    font-weight: 850;
    margin: 12px 0;
}

.plan-card form,
.block-link {
    display: block;
    margin-top: 18px;
}

.block-link {
    line-height: 40px;
}

.site-footer {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    padding: 60px 0 30px;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.6;
    border-top: 1px solid var(--line);
    margin-top: 60px;
    width: 100%;
}

.auth-footer {
    border-top: 0;
    margin-top: 20px;
}

.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--sidebar);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
}

.mobile-header .brand {
    margin: 0;
    min-height: auto;
    gap: 8px;
}

.mobile-header .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 12px;
}

.mobile-header strong {
    font-size: 15px;
}

#sidebar-toggle {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--ink);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 90;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .3s ease;
    pointer-events: none;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.desktop-only {
    display: flex;
}

@media (max-width: 992px) {
    .mobile-header {
        display: flex;
    }

    .desktop-only {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        z-index: 100;
        transition: left .3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100dvh;
        width: 280px;
    }

    .sidebar.open {
        left: 0;
    }

    .main {
        margin-left: 0;
        padding: 20px 14px;
    }

    .page-head,
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .metrics strong {
        font-size: 22px;
    }

    .grid-2,
    .form-row,
    .api-docs,
    .packages,
    .plan-choice {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Table Responsive */
    .responsive-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }

    table.stack-mobile thead {
        display: none;
    }

    table.stack-mobile tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--panel-solid);
        padding: 8px;
    }

    table.stack-mobile td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--line);
        padding: 10px 8px;
        text-align: right;
    }

    table.stack-mobile td:last-child {
        border-bottom: 0;
    }

    table.stack-mobile td::before {
        content: attr(data-label);
        font-weight: 800;
        color: var(--muted);
        text-align: left;
        font-size: 13px;
    }

    .bank-info {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .bank-info dd {
        margin-bottom: 10px;
    }

    .qr-panel img {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .metrics {
        grid-template-columns: 1fr;
    }

    .page-head h1 {
        font-size: 24px;
    }

    .auth-card {
        padding: 24px 18px;
    }

    .admin-form {
        grid-template-columns: 1fr;
    }

    .admin-form .primary,
    .check-row {
        grid-column: 1;
    }

    .deposit-card {
        border-radius: 16px;
        margin-bottom: 18px;
        width: 100%;
    }

    .qr-section {
        padding: 22px 18px 18px;
    }

    .qr-section img {
        max-width: min(190px, 82vw);
        border-width: 5px;
        margin-bottom: 12px;
    }

    .qr-section p {
        margin: 0;
        text-align: center;
    }

    .info-section {
        padding: 22px 18px;
    }

    .info-section h3 {
        font-size: 15px;
        line-height: 1.35;
        margin-bottom: 16px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    .input-box {
        min-width: 0;
    }

    .input-box input {
        min-width: 0;
        padding: 10px 12px;
        font-size: 13px;
    }

    .copy-btn {
        flex: 0 0 auto;
        min-width: 58px;
        padding: 0 10px;
        font-size: 10px;
    }

    .status-row {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .status-row .btn-text {
        justify-content: center;
        min-height: 42px;
    }

    .deposit-success-screen {
        min-height: calc(100vh - 132px);
        padding: 20px 0;
    }

    .deposit-success-card {
        border-radius: 16px;
        padding: 30px 20px;
    }

    .deposit-success-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }

    .deposit-success-icon svg {
        width: 32px;
        height: 32px;
    }

    .deposit-success-card h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .deposit-success-card p {
        font-size: 15px;
        line-height: 1.45;
    }

    .deposit-success-action {
        width: 100%;
        min-width: 0;
        margin-top: 22px;
        min-height: 48px;
        padding: 0 14px;
        font-size: 13px;
    }
}

.nav form {
    width: 100%;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color .24s;
    stroke-width: 2.5px;
}

.nav a:hover .nav-icon,
.nav button:hover .nav-icon,
.nav-title .nav-icon {
    color: var(--green-strong);
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-weight: 800;
    color: var(--ink);
}

.page-link:hover {
    background: var(--mint);
    color: var(--green-strong);
    transform: translateY(-1px);
}

.api-title {
    background: linear-gradient(135deg, var(--green), #ff3c00);
    color: #fff;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    font-weight: 900;
    letter-spacing: 3px;
    margin-bottom: 30px;
    box-shadow: 0 15px 40px rgba(255, 60, 0, 0.3);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.api-docs {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
}

.code-card,
.response-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.code-card header,
.response-card header {
    background: rgba(255, 255, 255, 0.04);
    padding: 18px 24px;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.responsive-table-wrapper th {
    background: rgba(255, 255, 255, 0.04);
    padding: 18px 24px;
    font-size: 13px;
    font-weight: 800;
    color: var(--muted);
    text-align: left;
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.responsive-table-wrapper td {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
    font-weight: 500;
}

.responsive-table-wrapper tr:hover td {
    background: rgba(255, 136, 0, 0.04);
}

.code-card pre,
.response-card pre {
    padding: 24px;
    margin: 0;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--green-strong);
}

@media (max-width: 1100px) {
    .api-docs {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .admin-form,
    .form-row,
    .filters {
        grid-template-columns: 1fr;
    }

    .filters input,
    .filters select {
        width: 100%;
    }

    .inline-form {
        flex-direction: column;
        width: 100%;
    }

    .inline-form input {
        width: 100%;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: var(--toast-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

.toast.hide {
    animation: toast-out 0.3s forwards;
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--toast-ink) !important; /* Cuong che mau chu tuong phan */
}

.toast-msg {
    font-size: 13px;
    color: var(--toast-muted) !important;
    line-height: 1.4;
    font-weight: 600;
}

.toast.success {
    border-left: 4px solid var(--green);
}

.toast.success .toast-icon {
    background: rgba(0, 255, 127, 0.1);
    color: var(--green);
}

.toast.error {
    border-left: 4px solid #ff4444;
}

.toast.error .toast-icon {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.toast.info {
    border-left: 4px solid #33b5e5;
}

.toast.info .toast-icon {
    background: rgba(51, 181, 229, 0.1);
    color: #33b5e5;
}

@keyframes toast-in {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    place-items: center;
    z-index: 2000;
    padding: 20px;
    animation: fade-in 0.3s ease;
}

.modal-overlay.open {
    display: grid;
}

.modal-card {
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 30px;
    width: min(450px, 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-card h3 {
    margin: 0 0 12px;
    font-size: 22px;
}

.modal-card p {
    color: var(--muted);
    margin-bottom: 24px;
    font-weight: 700;
}

.btn-sm {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 8px;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btns button {
    min-width: 120px;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Styles for Purchase Page Redesign */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.plan-card.compact {
    min-height: auto;
    position: relative;
    overflow: hidden;
    padding-top: 40px;
    border-color: rgba(255, 136, 0, 0.3) !important;
}

.card-badge {
    position: absolute;
    top: 12px;
    right: -30px;
    background: var(--green);
    color: white;
    padding: 4px 35px;
    font-size: 11px;
    font-weight: 900;
    transform: rotate(45deg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.features li {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.features li i {
    color: var(--green-strong);
    width: 16px;
}

.turns-card {
    border-color: rgba(255, 159, 28, 0.3) !important;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
    margin-bottom: 25px;
}

.card-head .icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--mint);
    color: var(--green-strong);
    display: grid;
    place-items: center;
    font-size: 24px;
}

.card-head h3 {
    margin: 0;
    font-size: 22px;
}

.card-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.tier-table {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--line);
    margin-bottom: 30px;
    overflow: hidden;
}

.tier-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    font-weight: 900;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
/* Global Theme Toggle Enhancements */
.theme-toggle-btn i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme='light'] .theme-toggle-btn i {
    color: #f59e0b !important;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.4));
}

[data-theme='dark'] .theme-toggle-btn i {
    color: #60a5fa !important;
    filter: drop-shadow(0 0 5px rgba(96, 165, 250, 0.4));
}

[data-theme='light'] .theme-toggle-btn {
    color: #111 !important;
    border-color: rgba(0,0,0,0.1) !important;
    background: rgba(0,0,0,0.04) !important;
}

[data-theme='light'] .theme-label {
    color: #111 !important;
}

[data-theme='light'] .auth-header .brand strong {
    color: #111 !important;
}

[data-theme='light'] .auth-header .auth-logo span {
    color: #111 !important;
}

/* Light Mode Support for Important Notification */
[data-theme='light'] .important-modal-card {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}

[data-theme='light'] .important-modal-card h2 {
    color: #111827 !important;
}

[data-theme='light'] .important-modal-card p {
    color: #4b5563 !important;
}

[data-theme='light'] .important-modal-close {
    color: #111827 !important;
}

/* Important Modal Styles */
.important-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.important-modal-overlay.visible {
    display: flex;
    opacity: 1;
}

.important-modal-card {
    background: var(--panel-solid);
    width: 100%;
    max-width: 440px;
    border-radius: 32px;
    border: 1px solid var(--line);
    padding: 40px 32px;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.important-modal-overlay.visible .important-modal-card {
    transform: translateY(0);
}

.important-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--soft);
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.important-modal-close:hover {
    background: var(--line);
    color: var(--ink);
}

.important-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 28px;
    background: rgba(16, 184, 102, 0.15); /* Greenish bg */
    color: #10b866; /* Pure Green icon */
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16, 184, 102, 0.2);
    box-shadow: 0 10px 25px rgba(16, 184, 102, 0.2);
}

.important-modal-icon i {
    width: 40px;
    height: 40px;
}

/* Modal Types */
.important-modal-card.error .important-modal-icon {
    background: rgba(255, 68, 68, 0.15);
    color: #ff4444;
    border-color: rgba(255, 68, 68, 0.2);
    box-shadow: 0 10px 25px rgba(255, 68, 68, 0.2);
}

.important-modal-card.error h2 {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.important-modal-card.error .important-modal-btn {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    box-shadow: 0 10px 20px rgba(255, 68, 68, 0.25);
}

.important-modal-card.success .important-modal-icon {
    background: rgba(16, 184, 102, 0.15);
    color: #10b866;
    border-color: rgba(16, 184, 102, 0.2);
    box-shadow: 0 10px 25px rgba(16, 184, 102, 0.2);
}

.important-modal-card.success h2 {
    background: linear-gradient(135deg, #10b866, #0d9653);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.important-modal-card.success .important-modal-btn {
    background: linear-gradient(135deg, #10b866, #0d9653);
    box-,shadow: 0 10px 20px rgba(16, 184, 102, 0.25);
}

.important-modal-card h2 {
    font-size: 24px;
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 12px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff8800, #ff5500); /* Orange title */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.important-modal-card p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 32px;
}

.important-modal-btn {
    width: 100%;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff8800, #ff5500); /* Orange button */
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 20px rgba(255, 136, 0, 0.25);
}

.important-modal-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 15px 30px rgba(255, 136, 0, 0.4);
}

[data-theme="light"] .important-modal-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.05);
}
