:root {
    --color-primary: #EE4D2D;
    --color-primary-light: #FF7337;
    --color-lazada: #0F146D;
    --color-bg: #F7F8FA;
    --color-surface: #FFFFFF;
    --color-text: #222222;
    --color-text-secondary: #6B7280;
    --color-border: #E5E7EB;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-error: #DC2626;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --max-width: 1100px;
    --font: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {

        font-family: var(--font);
        background: var(--color-bg);
        color: var(--color-text);
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        padding-bottom: calc(var(--bottom-nav-height) + 16px);
        /* ===== STICKY FOOTER ===== */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    

   /* font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-height) + 16px); */
}

/* Layout */
.app {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    flex: 1 0 auto;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

p {
    color: var(--color-text-secondary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Top Nav */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
}

.top-nav .brand {
    font-weight: 800;
    font-size: 20px;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-nav .nav-links {
    display: none;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}

.top-nav .nav-links a {
    color: var(--color-text-secondary);
    transition: 0.2s;
}

.top-nav .nav-links a:hover,
.top-nav .nav-links a.active {
    color: var(--color-primary);
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-nav .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* Bottom Nav Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    height: var(--bottom-nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-secondary);
    height: 100%;
    transition: 0.2s;
    text-decoration: none;
}

.bottom-nav a.active {
    color: var(--color-primary);
}

.bottom-nav a svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
    padding: 12px 20px;
    min-height: 48px;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background: #d73211;
}

.btn--secondary {
    background: #fff;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-bg);
}

.btn--success {
    background: var(--color-success);
    color: #fff;
}

.btn--danger {
    background: var(--color-error);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn--lg {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    border-radius: var(--radius-sm);
}

.btn--sm {
    padding: 8px 12px;
    min-height: 36px;
    font-size: 13px;
}

/* Inputs */
.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--color-surface);
    transition: 0.2s;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(238, 77, 45, 0.08);
}

.input::placeholder {
    color: #9CA3AF;
}

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.card--stat {
    text-align: center;
    padding: 20px 16px;
}

.card--stat .value {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.card--stat .label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.card--stat.green .value {
    color: var(--color-success);
}

.card--stat.blue .value {
    color: #2563EB;
}

.card--stat.gray .value {
    color: var(--color-text-secondary);
}

.card--hero {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    text-align: center;
    padding: 28px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.card--hero h1 {
    color: #fff;
    margin-bottom: 6px;
    font-size: 22px;
}

.card--hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px !important;
    font-weight: 700;
    text-transform: none !important;
    letter-spacing: 0.02em;
}

.badge--pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge--confirmed {
    background: #D1FAE5;
    color: #065F46;
}

.badge--paid {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge--cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.badge--admin {
    background: var(--color-lazada);
    color: #fff;
}

/* Tables Desktop */
.table-wrap {
    overflow-x: auto;
    display: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th,
.table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-weight: 600;
    color: var(--color-text-secondary);
    background: #FAFAFA;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Card List Mobile */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-item {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.card-item .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-item .title {
    font-weight: 700;
    font-size: 12px;
    color: var(--color-text);
}

.card-item .meta {
    font-size: 10px;
    color: var(--color-text-secondary);
}

.card-item .amount {
    font-weight: 800;
    color: var(--color-primary);
    font-size: 15px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin-bottom: 6px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}

.alert--success {
    background: #F0FDF4;
    color: var(--color-success);
    border: 1px solid #BBF7D0;
}

.alert--error {
    background: #FEF2F2;
    color: var(--color-error);
    border: 1px solid #FECACA;
}

.alert--warning {
    background: #FFFBEB;
    color: var(--color-warning);
    border: 1px solid #FDE68A;
}

/* Product Card */
.product-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.product-card__top {
    display: flex;
    gap: 16px;
    padding: 20px;
}

.product-card__top img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    background: #f3f4f6;
}

.product-card__info {
    flex: 1;
    min-width: 0;
}

.product-card__name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card__price {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.product-card__cashback {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-success);
    background: #F0FDF4;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
}

.product-card__actions {
    display: flex;
    border-top: 1px solid var(--color-border);
}

.product-card__actions a,
.product-card__actions button {
    flex: 1;
    padding: 14px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.product-card__actions .btn-buy {
    background: var(--color-primary);
    color: #fff;
}

.product-card__actions .btn-copy {
    background: #fff;
    color: var(--color-text);
    border-left: 1px solid var(--color-border);
}

.product-card__actions .btn-copy.copied {
    background: var(--color-success);
    color: #fff;
}

/* Platform Tag */
.platform-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.platform-tag--shopee {
    background: var(--color-primary);
    color: #fff;
}

.platform-tag--lazada {
    background: var(--color-lazada);
    color: #fff;
}

.platform-tag--tiktok {
    background: linear-gradient(90deg, #ff0050, #00f2ea);
    color: #fff;
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(238, 77, 45, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 28px 16px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border);
    /* ===== STICKY FOOTER ===== */
    margin-top: auto;
    flex-shrink: 0;
}

.site-footer .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.site-footer a:hover {
    color: var(--color-primary);
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mt-2 {
    margin-top: 16px;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.gap-2 {
    gap: 16px;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

/* Grid Stats */
.grid-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #fff 0%, var(--color-bg) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px 24px;
}

.auth-card h1 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 24px;
    font-size: 24px;
}

.auth-card .form-group {
    margin-bottom: 18px;
}

.auth-card label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
}

.auth-card .divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-secondary);
    font-size: 13px;
    margin: 20px 0;
}

.auth-card .divider::before,
.auth-card .divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Admin Bar */
.admin-bar {
    background: var(--color-lazada);
    color: #fff;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

/* Desktop Overrides */

/* ===== CĂN NAV THEO KHUNG NỘI DUNG (CHỈ PC >= 1024px) ===== */
@media (min-width: 1024px) {
  .top-nav {
    padding-left:  max(24px, calc((100% - var(--max-width)) / 2 + 24px));
    padding-right: max(24px, calc((100% - var(--max-width)) / 2 + 24px));
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .top-nav {
    padding-left: 10px;
    padding-right: 10px;
  }
}

@media (min-width: 768px) {
    body {
        padding-bottom: 16px;
    }

    .bottom-nav {
        display: none;
    }

    .top-nav .nav-links {
        display: flex;
    }

    .table-wrap {
        display: block;
    }

    .card-list--desktop-hide {
        display: none;
    }

    .grid-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-card__top img {
        width: 120px;
        height: 120px;
    }

    h1 {
        font-size: 28px;
    }
}


@media (min-width: 1024px) {

    .app,
    .container {
        padding: 24px;
    }

    .grid-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Store Grid */
.store-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .store-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Leaderboard */
.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #FAFAFA;
    border-radius: 10px;
}

.leaderboard-rank {
    font-size: 18px;
    font-weight: 800;
    width: 28px;
    text-align: center;
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.leaderboard-name {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 15px;
}

.leaderboard-amount {
    font-weight: 800;
    color: var(--color-primary);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   DROPDOWN VOUCHER DESKTOP + MOBILE
============================================================ */

/* Dropdown desktop */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: 0.2s;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active {
    color: var(--color-primary);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    z-index: 1000;
    padding-top: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    margin: 0;
}

.nav-dropdown-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.nav-dropdown-panel a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.nav-dropdown-panel a:last-child {
    border-bottom: none;
}

.nav-dropdown-panel a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.nav-dropdown.active .nav-dropdown-content {
    display: block;
}

@media (min-width: 768px) {

    .nav-dropdown:hover .nav-dropdown-content,
    .nav-dropdown:focus-within .nav-dropdown-content {
        display: block;
    }
}

/* Dropdown mobile */
.bottom-nav-dropdown {
    position: relative;
    flex: 1;
    display: flex;
}

.bottom-nav-dropdown > a {
    width: 100%;
    height: 100%;
}

.bottom-nav-dropdown-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 175px;
    z-index: 1000;
    padding-bottom: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
    margin: 0;
}

.bottom-nav-dropdown-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.bottom-nav .bottom-nav-dropdown-panel a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    height: auto;
    flex: none;
    width: 100%;
}

.bottom-nav .bottom-nav-dropdown-panel a:last-child {
    border-bottom: none;
}

.bottom-nav .bottom-nav-dropdown-panel a:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.bottom-nav-dropdown.active .bottom-nav-dropdown-content {
    display: block;
}

.bottom-nav-dropdown.active > a {
    color: var(--color-primary);
}