:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --border: #e2e8f0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Main workspace visual refresh */
#mainApp.app-container {
    background: #f5f6fa;
    color: #172033;
}

#mainApp .sidebar {
    width: 248px;
    padding: 1.5rem 1rem;
    background: #111827;
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: 16px 0 45px rgba(15,23,42,.08);
}

#mainApp .logo {
    gap: .8rem;
    margin-bottom: 2.2rem;
    padding: 0 .65rem;
}

#mainApp .logo-mark {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg,#ff7a1a,#ff4d1f);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(249,115,22,.32);
}

#mainApp .logo-mark i { font-size: 1rem; }
#mainApp .logo h1 { color: #fff; background: none; -webkit-text-fill-color: initial; font-size: 1.35rem; line-height: 1; }
#mainApp .logo small { display: block; margin-top: .2rem; color: #8d99ae; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-label { display: block; margin: 0 .7rem .65rem; color: #64748b; font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
#mainApp .nav-menu { gap: .35rem; }
#mainApp .nav-item { position: relative; gap: .8rem; padding: .8rem .85rem; color: #96a2b7; border: 1px solid transparent; border-radius: 12px; font-size: .9rem; font-weight: 650; }
#mainApp .nav-item i { width: 22px; color: #728099; text-align: center; }
#mainApp .nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
#mainApp .nav-item.active { color: #fff; background: linear-gradient(135deg,rgba(249,115,22,.2),rgba(249,115,22,.08)); border-color: rgba(251,146,60,.2); box-shadow: none; }
#mainApp .nav-item.active i { color: #fb923c; }
#mainApp .nav-item.active::after { content: ""; position: absolute; right: -.98rem; width: 3px; height: 24px; background: #f97316; border-radius: 3px 0 0 3px; }

.sidebar-tip { margin: auto .25rem 1.1rem; padding: 1rem; color: #cbd5e1; background: linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; }
.sidebar-tip > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: .7rem; color: #fb923c; background: rgba(249,115,22,.13); border-radius: 10px; }
.sidebar-tip strong { display: block; margin-bottom: .25rem; color: #f8fafc; font-size: .82rem; }
.sidebar-tip p { color: #8290a7; font-size: .72rem; line-height: 1.5; }
#mainApp .sidebar-account { margin-top: 0; padding: 1rem .35rem 0; border-color: rgba(255,255,255,.08); }
#mainApp .sidebar-account strong { color: #f8fafc; }
#mainApp .sidebar-account small { color: #718096; }
#mainApp .sidebar-account button { color: #718096; }
#mainApp .account-avatar { background: linear-gradient(145deg,#ff7a1a,#ff4d1f); box-shadow: 0 8px 20px rgba(249,115,22,.2); }

#mainApp .main-content { padding: 2rem clamp(1.5rem,3vw,3.5rem) 3rem; background: radial-gradient(circle at 92% 3%,rgba(99,102,241,.08),transparent 22%), #f5f6fa; }
#mainApp .header { max-width: 1380px; margin: 0 auto 1.7rem; }
.header-copy { display: flex; flex-direction: column; gap: .3rem; }
.header-eyebrow { color: #f97316; font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
#mainApp .header h2 { color: #172033; font-size: clamp(1.55rem,2.4vw,2rem); letter-spacing: -.035em; }
.header-actions { display: flex; align-items: center; gap: .65rem; }
.header-help { padding: .65rem .9rem; color: #526078; background: #fff; border: 1px solid #e6e9f0; border-radius: 12px; font-weight: 700; cursor: pointer; }
.header-help:hover { color: #f97316; border-color: #fed7aa; }
#mainApp .status-badge { padding: .65rem .95rem; color: #166534; border: 1px solid #dcfce7; background: #f0fdf4; box-shadow: none; font-size: .82rem; font-weight: 700; }
#mainApp .dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
#mainApp .screen { max-width: 1380px; margin: auto; }

#mainApp .intro-card { min-height: 305px; grid-template-columns: minmax(0,1fr) 330px; gap: 2.5rem; padding: clamp(1.8rem,4vw,3.4rem); border: 0; border-radius: 28px; background: radial-gradient(circle at 80% 50%,rgba(255,255,255,.12),transparent 24%), linear-gradient(125deg,#141b2d 0%,#242d4d 58%,#3b3473 100%); box-shadow: 0 28px 60px rgba(20,27,45,.16); }
#mainApp .intro-card::before { width: 280px; height: 280px; right: 22%; bottom: -175px; background: rgba(249,115,22,.13); }
#mainApp .intro-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: 9%; top: -110px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
#mainApp .intro-copy { position: relative; z-index: 2; }
#mainApp .intro-kicker { color: #fdba74; background: rgba(249,115,22,.12); border-color: rgba(251,146,60,.18); }
#mainApp .intro-copy h3 { margin: 1rem 0; color: #fff; font-size: clamp(2rem,4vw,3.65rem); line-height: 1.04; letter-spacing: -.045em; }
#mainApp .intro-copy h3 em { color: #fb923c; font-style: normal; }
#mainApp .intro-copy p { max-width: 700px; color: #aeb8cd; font-size: .96rem; line-height: 1.7; }
.hero-trust { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.hero-trust span { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .7rem; color: #d9e0ed; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; font-size: .75rem; font-weight: 700; }
.hero-trust i { color: #fb923c; }
#mainApp .cashback-highlight { position: relative; z-index: 2; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; overflow: hidden; background: linear-gradient(145deg,#ff8a1f,#f55420 55%,#e83b2e); border: 1px solid rgba(255,255,255,.22); border-radius: 50%; aspect-ratio: 1; box-shadow: 0 25px 55px rgba(239,68,36,.35); transform: rotate(3deg); }
#mainApp .cashback-highlight span { font-size: .72rem; letter-spacing: .12em; }
#mainApp .cashback-highlight strong { margin: .15rem 0; font-size: clamp(4.3rem,7vw,6rem); letter-spacing: -.08em; text-shadow: none; }
#mainApp .cashback-highlight sup { font-size: .38em; vertical-align: super; }
#mainApp .cashback-highlight small { max-width: 150px; font-size: .72rem; }
.cashback-orbit { position: absolute; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.orbit-one { inset: 11px; }.orbit-two { inset: 24px; }

.process-strip { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 1rem; margin: 1.15rem 0; padding: 1rem 1.25rem; background: #fff; border: 1px solid #e9ebf1; border-radius: 18px; box-shadow: 0 10px 30px rgba(15,23,42,.04); }
.process-strip > div { display: flex; align-items: center; gap: .75rem; }
.process-strip b { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; color: #f97316; background: #fff7ed; border-radius: 10px; font-size: .72rem; }
.process-strip span { display: flex; flex-direction: column; gap: .12rem; }
.process-strip strong { color: #263146; font-size: .82rem; }.process-strip small { color: #98a2b3; font-size: .68rem; }
.process-strip > i { color: #d5dae3; font-size: .7rem; }

#mainApp .converter-card { overflow: hidden; border: 1px solid #e8ebf1; border-radius: 24px; box-shadow: 0 18px 50px rgba(15,23,42,.06); }
#mainApp .converter-card .card-body { padding: clamp(1.3rem,3vw,2rem); }
.converter-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; padding-bottom: 1.25rem; border-bottom: 1px solid #edf0f4; }
.converter-heading > div { display: flex; align-items: center; gap: .8rem; }
.converter-icon { width: 45px; height: 45px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#ff8a1f,#f55420); border-radius: 14px; box-shadow: 0 9px 20px rgba(249,115,22,.22); }
.converter-heading h3 { margin-bottom: .2rem; color: #202a3d; font-size: 1rem; }.converter-heading p { color: #98a2b3; font-size: .76rem; }
.secure-note { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .7rem; color: #15803d; background: #f0fdf4; border-radius: 9px; font-size: .7rem; font-weight: 750; }
#mainApp .form-group label { margin-bottom: .65rem; color: #3e4a61; font-size: .78rem; font-weight: 750; }
.link-input-wrap { display: flex; align-items: stretch; min-height: 94px; overflow: hidden; background: #f9fafc; border: 1.5px solid #e3e7ee; border-radius: 16px; transition: .2s; }
.link-input-wrap:focus-within { background: #fff; border-color: #fb923c; box-shadow: 0 0 0 4px rgba(249,115,22,.09); }
.link-input-wrap > span { width: 60px; display: grid; place-items: center; flex: 0 0 auto; color: #f97316; background: #fff7ed; font-size: 1rem; }
#mainApp .link-input-wrap textarea { min-height: 92px; padding: 1.1rem; border: 0; background: transparent; box-shadow: none; resize: none; font-size: .92rem; }
.input-support { display: block; margin-top: .55rem; color: #98a2b3; font-size: .7rem; }.input-support i { margin-right: .25rem; }
#mainApp .action-buttons { justify-content: flex-start; margin-top: 1.25rem; }
#mainApp .btn-primary, #mainApp .btn-secondary { min-height: 50px; border-radius: 13px; font-size: .84rem; }
#mainApp #convertShopeeBtn { flex: 0 1 310px; background: linear-gradient(135deg,#ff7a1a,#f24b24); box-shadow: 0 12px 24px rgba(249,83,30,.22); }
#mainApp #convertShopeeBtn:hover:not(:disabled) { box-shadow: 0 16px 30px rgba(249,83,30,.3); }
#mainApp .btn-secondary { flex: 0 0 140px; color: #6b768b; border: 1px solid #e2e6ed; background: #f9fafb; }

#mainApp .support-floating { right: 1.1rem; bottom: 1.2rem; gap: .55rem; }
#mainApp .support-btn { width: 46px; height: 46px; border: 4px solid #fff; box-shadow: 0 8px 22px rgba(15,23,42,.15); }
#mainApp .support-btn.telegram { font-size: 1.2rem; }

.header-subtitle { color: #7b879b; font-size: .78rem; }

#ordersScreen {
    padding: 1.3rem;
    background-color: #fffaf5;
    background-image: radial-gradient(rgba(249,115,22,.16) 1px, transparent 1px);
    background-size: 22px 22px;
    border: 1px solid #ffedd5;
    border-radius: 24px;
}

.orders-process-label { display: flex; align-items: center; gap: .45rem; margin: 0 .4rem .65rem; color: #667085; font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.orders-process-label i { color: #f97316; }
.orders-process-card { position: relative; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1rem 4.2rem 1rem 1.5rem; background: #fff; border: 1px solid #eceff3; border-radius: 22px; box-shadow: 0 12px 30px rgba(15,23,42,.08); }
.orders-process-step { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-direction: column; color: #1f2a44; }
.orders-process-step strong { font-size: .84rem; }
.orders-process-step span { width: 36px; height: 36px; display: grid; place-items: center; color: #f97316; font-size: 1.25rem; }
.orders-process-step small { display: none; max-width: 180px; color: #7b879b; font-size: .68rem; line-height: 1.45; text-align: center; }
.orders-process-card.expanded .orders-process-step small { display: block; }
.orders-process-line { color: #cfd6e3; font-size: .75rem; letter-spacing: .12em; }
.orders-process-toggle { position: absolute; right: 1rem; top: 50%; width: 38px; height: 38px; border: 1px solid #fed7aa; color: #f97316; background: #fff7ed; border-radius: 50%; transform: translateY(-50%); cursor: pointer; transition: .2s; }
.orders-process-toggle.expanded { transform: translateY(-50%) rotate(180deg); }

.orders-filters { display: grid; grid-template-columns: minmax(240px,1fr) 230px auto; gap: .7rem; margin-top: 1rem; }
.orders-search, .orders-date { min-height: 50px; display: flex; align-items: center; gap: .65rem; padding: 0 .9rem; background: #fff; border: 1px solid #e1e6ee; border-radius: 14px; box-shadow: 0 6px 16px rgba(15,23,42,.05); }
.orders-search i, .orders-date i { color: #94a3b8; }
.orders-search input, .orders-date input { width: 100%; min-width: 0; border: 0; outline: 0; color: #263146; background: transparent; font: inherit; font-size: .82rem; }
.orders-search input::placeholder { color: #a0a9b8; }
.orders-filter-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 94px; padding: 0 1rem; color: #344054; background: #fff; border: 1px solid #e1e6ee; border-radius: 14px; box-shadow: 0 6px 16px rgba(15,23,42,.05); font-weight: 750; cursor: pointer; }
.orders-filter-btn:hover { color: #f97316; border-color: #fdba74; }

.orders-tabs { display: grid; grid-template-columns: repeat(3,1fr); margin-top: .75rem; padding: .25rem; background: #f8fafc; border: 1px solid #e1e6ee; border-radius: 14px; }
.orders-tabs button { min-height: 46px; color: #667085; background: transparent; border: 1px solid transparent; border-radius: 11px; font-weight: 750; cursor: pointer; }
.orders-tabs button span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: .3rem; padding: 0 .35rem; color: #8490a3; background: #eef1f5; border-radius: 10px; font-size: .65rem; }
.orders-tabs button.active { color: #ea580c; background: #fff; border-color: #fed7aa; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
.orders-tabs button.active span { color: #fff; background: #f97316; }

.orders-info { display: flex; align-items: flex-start; gap: .6rem; margin-top: .75rem; padding: .85rem 1rem; color: #9a3412; background: rgba(255,247,237,.9); border: 1px solid #ffedd5; border-radius: 14px; font-size: .74rem; line-height: 1.55; }
.orders-info i { margin-top: .15rem; color: #f97316; }
.orders-list { min-height: 330px; margin-top: 1rem; overflow: hidden; background: #fff; border: 1px solid #e4e8ef; border-radius: 22px; box-shadow: 0 12px 30px rgba(15,23,42,.05); }
.orders-loading, .orders-empty, .orders-error { min-height: 330px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 2rem; text-align: center; }
.orders-loading { gap: .7rem; color: #7b879b; }
.orders-loading i { color: #f97316; font-size: 1.5rem; }
.orders-empty > span, .orders-error > i { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 1.2rem; color: #f97316; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 22px; font-size: 1.8rem; }
.orders-empty h3, .orders-error strong { color: #172033; font-size: 1.1rem; }
.orders-empty p, .orders-error p { margin: .55rem 0 1.2rem; color: #7b879b; font-size: .82rem; }
.orders-empty button, .orders-error button { padding: .78rem 1.2rem; color: #fff; background: linear-gradient(135deg,#ff7a1a,#f24b24); border: 0; border-radius: 12px; box-shadow: 0 9px 20px rgba(249,83,30,.22); font-weight: 750; cursor: pointer; }
.order-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid #edf0f4; }
.order-card:last-child { border-bottom: 0; }
.order-card-icon { width: 46px; height: 46px; display: grid; place-items: center; color: #f97316; background: #fff7ed; border-radius: 13px; }
.order-card-head { display: flex; align-items: center; gap: .6rem; }
.order-card-head strong { min-width: 0; overflow: hidden; color: #263146; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.order-card-main p { margin: .35rem 0; color: #667085; font-size: .72rem; }.order-card-main small { color: #98a2b3; font-size: .68rem; }
.order-status { padding: .25rem .5rem; border-radius: 999px; font-size: .62rem; font-weight: 800; white-space: nowrap; }
.order-status.pending { color: #c2410c; background: #fff7ed; }.order-status.paid { color: #15803d; background: #f0fdf4; }.order-status.cancelled { color: #b91c1c; background: #fef2f2; }
.order-card-money { display: grid; grid-template-columns: auto auto; gap: .25rem 1rem; text-align: right; }
.order-card-money small { color: #98a2b3; font-size: .66rem; }.order-card-money strong { color: #344054; font-size: .78rem; }.order-card-money b { color: #ea580c; font-size: .82rem; }

/* Hang thong ke dau man hinh chinh: Tong thu nhap / Cho duyet / Ti le hoan */
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: 1rem; }
.home-stat { display: flex; flex-direction: column; gap: .1rem; padding: 1rem; background: #fff; border: 1px solid #e7eaf0; border-radius: 16px; box-shadow: 0 8px 22px rgba(15, 23, 42, .04); }
.home-stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; margin-bottom: .35rem; font-size: .85rem; }
.home-stat-icon.income { color: #15803d; background: #f0fdf4; }
.home-stat-icon.pending { color: #b45309; background: #fffbeb; }
.home-stat strong { color: #172033; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.home-stat small { color: #7b879b; font-size: .66rem; }
.home-stat.rate { text-align: right; align-items: flex-end; }
.home-stat.rate strong { color: #f2551d; font-size: 1.4rem; }
.home-stat.rate strong sup { font-size: .7rem; }
.home-stat.rate small { color: #172033; font-weight: 800; font-size: .72rem; }
.home-stat.rate em { color: #98a2b3; font-size: .62rem; font-style: normal; }
@media (max-width: 620px) { .home-stats { gap: .5rem; } .home-stat { padding: .75rem; } .home-stat strong { font-size: 1rem; } .home-stat.rate strong { font-size: 1.15rem; } }

.settings-shell {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8ebf1;
    border-radius: 24px;
    box-shadow: 0 18px 50px rgba(15,23,42,.06);
}

.account-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin: 0 2rem 2rem; padding: 1.25rem; background: #fffafa; border: 1px solid #fecaca; border-radius: 16px; }
.danger-kicker { color: #dc2626; font-size: .62rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.account-danger-zone h4 { margin: .25rem 0; color: #991b1b; font-size: .95rem; }
.account-danger-zone p { max-width: 720px; color: #7f1d1d; font-size: .72rem; line-height: 1.55; }
.account-danger-zone button { flex: 0 0 auto; padding: .7rem .9rem; color: #dc2626; background: #fff; border: 1px solid #fca5a5; border-radius: 11px; font-weight: 750; cursor: pointer; }
.account-danger-zone button:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.delete-account-dialog { position: relative; width: min(92vw,470px); padding: 2rem; color: #172033; background: #fff; border-radius: 22px; box-shadow: 0 24px 70px rgba(15,23,42,.26); }
.delete-dialog-close { position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; color: #7b879b; background: #f5f6f8; border: 0; border-radius: 10px; cursor: pointer; }
.delete-dialog-icon { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 1rem; color: #dc2626; background: #fef2f2; border-radius: 16px; font-size: 1.3rem; }
.delete-account-dialog h3 { color: #991b1b; font-size: 1.25rem; }
.delete-account-dialog > p { margin: .6rem 0 1.2rem; color: #667085; font-size: .76rem; line-height: 1.6; }
.delete-account-dialog form > label:first-child { display: flex; flex-direction: column; gap: .5rem; color: #344054; font-size: .72rem; font-weight: 750; }
.delete-account-dialog input[type="password"] { width: 100%; padding: .8rem .9rem; border: 1.5px solid #e1e6ee; border-radius: 11px; font: inherit; }
.delete-account-dialog input[type="password"]:focus { outline: 0; border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.08); }
.delete-confirm-row { display: flex; align-items: flex-start; gap: .55rem; margin-top: 1rem; color: #667085; font-size: .7rem; line-height: 1.4; }
.delete-confirm-row input { margin-top: .15rem; }
.delete-dialog-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.25rem; }
.delete-dialog-actions button { padding: .7rem .9rem; border-radius: 10px; font-weight: 750; cursor: pointer; }
.delete-cancel-btn { color: #526078; background: #f5f6f8; border: 1px solid #e1e6ee; }
.delete-confirm-btn { color: #fff; background: #dc2626; border: 1px solid #dc2626; }
.delete-confirm-btn:disabled { opacity: .6; cursor: not-allowed; }

.settings-intro {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.6rem 2rem;
    color: #fff;
    background: radial-gradient(circle at 88% 15%,rgba(249,115,22,.2),transparent 28%), linear-gradient(125deg,#141b2d,#242d4d);
}

.settings-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: linear-gradient(145deg,#ff8a1f,#f55420);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(249,115,22,.25);
}

.settings-kicker { color: #fdba74; font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.settings-intro h3 { margin: .2rem 0; font-size: 1.35rem; }
.settings-intro p { color: #aeb8cd; font-size: .8rem; }
.settings-form { padding: 2rem; transition: opacity .2s; }
.settings-form.is-loading { opacity: .55; pointer-events: none; }
.settings-section-heading { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.25rem; }
.settings-section-heading > span { width: 40px; height: 40px; display: grid; place-items: center; color: #f97316; background: #fff7ed; border-radius: 12px; }
.settings-section-heading h4 { color: #202a3d; font-size: .95rem; }
.settings-section-heading p { margin-top: .2rem; color: #98a2b3; font-size: .72rem; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 1.25rem; }
.settings-account-number { grid-column: 1 / -1; }
.settings-form input[readonly] { color: #7b879b; background: #f5f6f8; cursor: not-allowed; }
.settings-divider { height: 1px; margin: .4rem 0 1.5rem; background: #edf0f4; }
.bank-otp-panel { display: flex; gap: 1rem; margin: .25rem 0 1.4rem; padding: 1.2rem; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 16px; }
.bank-otp-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg,#ff8a1f,#f55420); border-radius: 12px; }
.bank-otp-copy { min-width: 0; flex: 1; }
.bank-otp-copy h4 { color: #7c2d12; font-size: .9rem; }
.bank-otp-copy p { margin: .3rem 0 .8rem; color: #9a3412; font-size: .76rem; line-height: 1.5; }
.bank-otp-copy small { display: block; margin-top: .7rem; color: #9a3412; font-size: .68rem; }
.bank-otp-controls { display: flex; align-items: stretch; gap: .65rem; }
.bank-otp-controls input { max-width: 230px; padding: .8rem 1rem; border: 1.5px solid #fdba74; border-radius: 11px; font-size: 1rem; font-weight: 750; letter-spacing: .16em; }
.bank-otp-controls input:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 4px rgba(249,115,22,.1); }
#mainApp .bank-otp-controls .btn-primary { min-height: 44px; flex: 0 0 auto; padding: .7rem 1rem; background: linear-gradient(135deg,#ff7a1a,#f24b24); }
.bank-otp-controls .text-button { padding: .6rem; color: #c2410c; white-space: nowrap; }
.bank-otp-controls .text-button:disabled { opacity: .5; cursor: not-allowed; }
.settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .5rem; }
.settings-security { color: #15803d; font-size: .72rem; font-weight: 700; }
.settings-security i { margin-right: .35rem; }
#mainApp #saveSettingsBtn { flex: 0 0 auto; min-width: 190px; background: linear-gradient(135deg,#ff7a1a,#f24b24); box-shadow: 0 12px 24px rgba(249,83,30,.2); }

@media (max-width: 980px) {
    #mainApp .sidebar { width: 210px; }
    #mainApp .intro-card { grid-template-columns: minmax(0,1fr) 240px; }
    #mainApp .cashback-highlight { min-height: 190px; }
    .process-strip { gap: .55rem; }
}

@media (max-width: 768px) {
    #mainApp.app-container { display: block; }
    #mainApp .sidebar { width: 100%; padding: .8rem 1rem; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1rem; }
    #mainApp .logo { margin: 0; padding: 0; }
    #mainApp .logo-mark { width: 38px; height: 38px; }
    #mainApp .logo small, .sidebar-label, .sidebar-tip, #mainApp .sidebar-account { display: none; }
    #mainApp .nav-menu { flex-direction: row; justify-content: flex-end; padding: 0; overflow: visible; }
    #mainApp .nav-item { padding: .65rem; }
    #mainApp .nav-item span { display: none; }
    #mainApp .nav-item.active::after { display: none; }
    #mainApp .main-content { padding: 1.1rem 1rem 5rem; }
    #mainApp .header { flex-direction: row; align-items: center; gap: .75rem; }
    #mainApp .header h2 { font-size: 1.25rem; }
    .header-actions { margin-left: auto; }.header-help { display: none; }
    #mainApp .status-badge { padding: .55rem; font-size: 0; }
    #mainApp .status-badge .dot { margin: 0; }
    #mainApp .intro-card { min-height: 0; grid-template-columns: 1fr; padding: 1.5rem; border-radius: 22px; }
    #mainApp .intro-copy h3 { font-size: 2.25rem; }
    #mainApp .cashback-highlight { width: 180px; min-height: 180px; margin: auto; transform: none; }
    #mainApp .cashback-highlight strong { font-size: 4.2rem; }
    .process-strip { grid-template-columns: repeat(3,1fr); gap: .4rem; padding: .8rem; }
    .process-strip > i, .process-strip small { display: none; }
    .process-strip > div { flex-direction: column; gap: .35rem; text-align: center; }
    .converter-heading { align-items: flex-start; }.secure-note { display: none; }
    #mainApp .action-buttons { flex-direction: row; }
    #mainApp #convertShopeeBtn { flex: 1; }
    #mainApp .btn-secondary { flex: 0 0 105px; }
    .link-input-wrap > span { width: 48px; }
    .settings-form, .settings-intro { padding: 1.3rem; }
    .account-danger-zone { margin: 0 1.3rem 1.3rem; }
    #ordersScreen { padding: .8rem; }
    .orders-process-card { grid-template-columns: repeat(3,1fr); padding: 1rem 3.2rem 1rem 1rem; }
    .orders-process-line { display: none; }
    .orders-filters { grid-template-columns: 1fr auto; }
    .orders-date { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 460px) {
    #mainApp .intro-copy h3 { font-size: 1.9rem; }
    .hero-trust { gap: .4rem; }.hero-trust span { padding: .4rem .5rem; font-size: .66rem; }
    #mainApp .cashback-highlight { width: 155px; min-height: 155px; }
    #mainApp .cashback-highlight strong { font-size: 3.6rem; }
    #mainApp .action-buttons { flex-direction: column; }
    #mainApp .btn-secondary { flex-basis: auto; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-account-number { grid-column: auto; }
    .settings-actions { align-items: stretch; flex-direction: column; }
    #mainApp #saveSettingsBtn { width: 100%; }
    .bank-otp-panel { flex-direction: column; }
    .bank-otp-controls { flex-direction: column; }
    .bank-otp-controls input { max-width: none; }
    .account-danger-zone { align-items: stretch; flex-direction: column; margin: 0 1rem 1rem; }
    .account-danger-zone button { width: 100%; }
    .delete-dialog-actions { flex-direction: column-reverse; }
    .delete-dialog-actions button { width: 100%; }
    .orders-process-step strong { font-size: .7rem; }
    .orders-process-step small { font-size: .6rem; }
    .orders-tabs button { font-size: .72rem; }
    .order-card { grid-template-columns: auto minmax(0,1fr); }
    .order-card-money { grid-column: 1 / -1; padding-top: .7rem; border-top: 1px dashed #e5e7eb; }
}

.is-hidden { display: none !important; }

/* Mobile polish pass: app-like spacing, touch-safe controls, and no horizontal creep */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        overflow-x: hidden;
    }

    .entry-screen {
        min-height: 100svh;
        align-items: start;
        padding: max(.9rem, env(safe-area-inset-top)) .9rem max(1rem, env(safe-area-inset-bottom));
    }

    .login-layout {
        width: 100%;
        min-height: calc(100svh - 2rem);
        align-content: center;
        gap: 1rem;
    }

    .login-showcase {
        display: block;
        min-height: 0;
    }

    .login-showcase .brand-pill {
        padding: .55rem .8rem;
        font-size: .82rem;
        box-shadow: 0 8px 22px rgba(124,45,18,.07);
    }

    .login-card {
        width: 100%;
        max-width: none;
        padding: 1rem;
        border-radius: 18px;
        box-shadow: 0 18px 46px rgba(15,23,42,.12);
    }

    .login-card h2 {
        font-size: 1.28rem;
    }

    .login-note {
        margin-bottom: .75rem;
        font-size: .78rem;
    }

    .auth-mode-switch button,
    .auth-field > div,
    .login-submit,
    #googleSignInButton {
        min-height: 46px;
    }

    .auth-field {
        margin-bottom: .62rem;
    }

    .remember-row {
        align-items: flex-start;
        line-height: 1.35;
    }

    #mainApp .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        grid-template-columns: auto minmax(0,1fr) auto;
        padding: .72rem .75rem;
        border-bottom: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 10px 28px rgba(15,23,42,.16);
    }

    #mainApp .sidebar-account {
        display: flex;
        align-items: center;
        gap: .4rem;
        margin: 0;
        padding: 0;
        border: 0;
    }

    #mainApp .sidebar-account > div:not(.account-avatar) {
        display: none;
    }

    #mainApp .sidebar-account .account-avatar {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: .82rem;
    }

    #mainApp .sidebar-account button {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        padding: 0;
        color: #cbd5e1;
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 12px;
    }

    #mainApp .logo h1 {
        font-size: 1.08rem;
    }

    #mainApp .nav-menu {
        justify-content: flex-start;
        gap: .35rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    #mainApp .nav-menu::-webkit-scrollbar {
        display: none;
    }

    #mainApp .nav-item {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        flex: 0 0 auto;
        padding: .62rem;
    }

    #mainApp .main-content {
        padding: .9rem .78rem 5.5rem;
        background: #f5f6fa;
    }

    #mainApp .header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    #mainApp .intro-card,
    #mainApp .converter-card,
    .orders-list,
    .settings-shell {
        border-radius: 18px;
    }

    #mainApp .intro-card {
        padding: 1.1rem;
    }

    #mainApp .intro-copy h3 {
        margin: .65rem 0;
        font-size: clamp(1.65rem, 9vw, 2.15rem);
    }

    #mainApp .intro-copy p {
        font-size: .82rem;
        line-height: 1.55;
    }

    .hero-trust {
        margin-top: .9rem;
    }

    .process-strip {
        margin: .85rem 0;
        border-radius: 16px;
    }

    .converter-heading {
        gap: .75rem;
        margin-bottom: 1rem;
        padding-bottom: .9rem;
    }

    .converter-heading > div {
        min-width: 0;
    }

    .link-input-wrap {
        min-height: 88px;
        border-radius: 14px;
    }

    #mainApp .link-input-wrap textarea {
        min-height: 86px;
        padding: .9rem;
        font-size: .86rem;
    }

    #ordersScreen {
        padding: .65rem;
        border-radius: 18px;
    }

    .orders-process-card {
        grid-template-columns: 1fr;
        gap: .55rem;
        padding: .9rem;
    }

    .orders-process-step {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .orders-process-step span {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .orders-process-toggle {
        position: static;
        width: 100%;
        height: 40px;
        margin-top: .2rem;
        border-radius: 12px;
        transform: none;
    }

    .orders-process-toggle.expanded {
        transform: rotate(180deg);
    }

    .orders-filters {
        grid-template-columns: 1fr;
    }

    .orders-date {
        grid-column: auto;
        grid-row: auto;
    }

    .orders-search,
    .orders-date,
    .orders-filter-btn {
        min-height: 46px;
    }

    .orders-filter-btn {
        width: 100%;
    }

    .orders-tabs {
        gap: .2rem;
        overflow-x: auto;
    }

    .orders-tabs button {
        min-width: 98px;
        padding: 0 .55rem;
        white-space: nowrap;
    }

    .order-card {
        align-items: start;
        gap: .75rem;
        padding: .9rem;
    }

    .order-card-icon {
        width: 40px;
        height: 40px;
    }

    .settings-form,
    .settings-intro {
        padding: 1rem;
    }

    .settings-section-heading {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .entry-screen {
        padding-inline: .65rem;
    }

    .login-card {
        padding: .9rem;
    }

    #mainApp .sidebar {
        gap: .5rem;
        padding-inline: .55rem;
    }

    #mainApp .sidebar-account .account-avatar {
        display: none;
    }

    .auth-field input {
        font-size: .82rem;
    }

    #mainApp .main-content {
        padding-inline: .62rem;
    }

    #mainApp .cashback-highlight {
        display: none;
    }

    .process-strip {
        grid-template-columns: 1fr;
    }

    .process-strip > div {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}

.entry-screen { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 2rem; background: #f8fafc; }
.entry-backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 14% 20%, rgba(251,146,60,.3), transparent 30%), radial-gradient(circle at 88% 80%, rgba(99,102,241,.25), transparent 32%), linear-gradient(135deg,#fff7ed,#f8fafc 45%,#eef2ff); }
.login-layout { position: relative; width: min(1080px,100%); display: grid; grid-template-columns: 1.2fr .8fr; gap: 3rem; align-items: center; }
.brand-pill, .guide-badge { display: inline-flex; align-items: center; gap: .55rem; width: fit-content; padding: .65rem 1rem; border-radius: 999px; color: #c2410c; background: rgba(255,255,255,.78); border: 1px solid rgba(249,115,22,.22); font-weight: 800; box-shadow: 0 8px 25px rgba(124,45,18,.08); }
.eyebrow { margin-top: 2.2rem; color: #ea580c; font-size: .78rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.login-showcase h1 { margin: .75rem 0 1.2rem; color: #0f172a; font-size: clamp(3rem,6vw,5.5rem); line-height: .98; letter-spacing: -.06em; }
.login-showcase h1 span { color: #f97316; }
.login-lead { max-width: 640px; color: #64748b; font-size: 1.08rem; line-height: 1.75; }
.showcase-points { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.showcase-points span { padding: .7rem .9rem; color: #334155; background: rgba(255,255,255,.72); border: 1px solid #e2e8f0; border-radius: 12px; font-weight: 700; }
.showcase-points i { margin-right: .35rem; color: #f97316; }
.login-card { width: 100%; max-width: 420px; justify-self: end; padding: 1.5rem; background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.98); border-radius: 20px; box-shadow: 0 24px 64px rgba(15,23,42,.12); backdrop-filter: blur(18px); }
.login-icon, .login-card > .eyebrow { display: none; }
.login-card h2 { margin: 0 0 .3rem; color: #0f172a; font-size: 1.45rem; letter-spacing: -.025em; }
.login-note { margin-bottom: 1rem; color: #64748b; font-size: .84rem; line-height: 1.45; }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem; margin-bottom: .85rem; padding: .22rem; background: #f1f5f9; border-radius: 10px; }
.auth-mode-switch button { min-height: 40px; padding: .55rem; color: #64748b; background: transparent; border: 0; border-radius: 8px; font-weight: 750; cursor: pointer; }
.auth-mode-switch button.active { color: #c2410c; background: #fff; box-shadow: 0 3px 12px rgba(15,23,42,.08); }
.google-auth { margin-bottom: .8rem; }
#googleSignInButton { min-height: 44px; display: flex; justify-content: center; }
#googleSignInButton > div { width: 100% !important; }
.google-auth-status { margin: .45rem 0 0; color: #64748b; text-align: center; font-size: .76rem; }
.google-auth-status.error { color: #b91c1c; }
.auth-divider { display: flex; align-items: center; gap: .6rem; margin-top: .65rem; color: #94a3b8; font-size: .7rem; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: #e2e8f0; }
.auth-divider span { text-align: center; }
.auth-error { margin: 0 0 .7rem; padding: .6rem .7rem; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 9px; font-size: .78rem; line-height: 1.35; }
.otp-help { margin: -.35rem 0 .65rem; color: #64748b; font-size: .78rem; line-height: 1.45; }
.resend-otp { margin-bottom: 1rem; padding: 0; color: #ea580c; background: transparent; border: 0; font-weight: 750; cursor: pointer; }
.resend-otp:disabled { color: #94a3b8; cursor: not-allowed; }
.forgot-password-link { display: block; margin: -.15rem 0 .65rem auto; padding: 0; color: #ea580c; background: transparent; border: 0; font-size: .8rem; font-weight: 750; cursor: pointer; }
.auth-field { display: block; margin-bottom: .7rem; color: #334155; font-size: .78rem; font-weight: 750; }
.auth-field > span { display: block; margin-bottom: .3rem; }
.auth-field > div { min-height: 44px; display: flex; align-items: center; gap: .6rem; padding: 0 .75rem; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; transition: .2s; }
.auth-field > div:focus-within { background: white; border-color: #f97316; box-shadow: 0 0 0 4px rgba(249,115,22,.1); }
.auth-field i { color: #94a3b8; }
.auth-field input { min-width: 0; flex: 1; padding: .72rem 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .86rem; font-weight: 500; }
.password-toggle { padding: .5rem; border: 0; background: transparent; cursor: pointer; }
.remember-row { display: flex; align-items: center; gap: .5rem; margin: .15rem 0 .8rem; color: #64748b; font-size: .8rem; cursor: pointer; }
.remember-row input, .guide-actions input { accent-color: #f97316; }
.login-submit { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: .65rem; padding: .75rem; color: white; background: linear-gradient(135deg,#fb923c,#ea580c); border: 0; border-radius: 11px; font-size: .9rem; font-weight: 800; cursor: pointer; box-shadow: 0 10px 22px rgba(234,88,12,.2); transition: .2s; }
.login-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(234,88,12,.3); }
.privacy-note { margin-top: .65rem; color: #94a3b8; text-align: center; font-size: .68rem; }
#guideScreen { display: block; padding: 0; background: linear-gradient(160deg,#fff7ed,#f8fafc 50%,#eef2ff); overflow-y: auto; }
.guide-wrap { width: min(1180px,100%); min-height: 100vh; margin: auto; padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.guide-topbar { display: flex; align-items: center; justify-content: space-between; }
.text-button { padding: .7rem 1rem; color: #64748b; border: 0; background: transparent; font-weight: 700; cursor: pointer; }
.guide-hero { max-width: 760px; margin: 4rem auto 2.5rem; text-align: center; }
.guide-hero .guide-badge { margin: auto; }
.guide-hero h1 { margin: 1.2rem 0 .7rem; color: #0f172a; font-size: clamp(2.2rem,5vw,4rem); letter-spacing: -.04em; }
.guide-hero p { color: #64748b; font-size: 1.05rem; line-height: 1.65; }
.guide-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.2rem; }
.guide-steps article { position: relative; padding: 1.7rem; background: rgba(255,255,255,.86); border: 1px solid white; border-radius: 24px; box-shadow: 0 16px 45px rgba(15,23,42,.08); }
.guide-steps article > span { position: absolute; right: 1.3rem; top: 1rem; color: #e2e8f0; font-size: 2.2rem; font-weight: 900; }
.step-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 1.2rem; color: #ea580c; background: #ffedd5; border-radius: 16px; font-size: 1.2rem; }
.guide-steps h3 { margin-bottom: .55rem; color: #1e293b; }
.guide-steps p { color: #64748b; line-height: 1.6; }
.guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; color: #64748b; }
.guide-actions label { display: flex; gap: .5rem; cursor: pointer; }
.guide-continue { width: auto; min-width: 220px; }
.sidebar { display: flex; flex-direction: column; }
.sidebar-account { display: grid; grid-template-columns: 42px 1fr auto; gap: .65rem; align-items: center; margin-top: auto; padding: 1rem .6rem 0; border-top: 1px solid #e2e8f0; }
.account-avatar { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: linear-gradient(135deg,#fb923c,#ea580c); border-radius: 13px; font-weight: 900; }
.sidebar-account strong, .sidebar-account small { max-width: 110px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { color: #334155; font-size: .9rem; }
.sidebar-account small { color: #94a3b8; font-size: .72rem; }
.sidebar-account button { padding: .5rem; color: #94a3b8; border: 0; background: transparent; cursor: pointer; }

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    padding: 2rem 1rem;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: var(--gray);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
}

.nav-item i {
    width: 20px;
}

.nav-item:hover {
    background: var(--light);
    color: var(--primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark);
    font-size: 1.8rem;
}

.header h2 i {
    color: var(--primary);
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Card */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

.intro-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.6rem;
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 15%, rgba(16, 185, 129, 0.28), transparent 26%),
        linear-gradient(135deg, #fff7ed 0%, #ecfeff 48%, #eef2ff 100%);
    border: 1px solid rgba(245, 158, 11, 0.25);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.intro-card::before {
    content: "";
    position: absolute;
    inset: auto -60px -95px auto;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.18);
}

.intro-copy,
.cashback-highlight {
    position: relative;
    z-index: 1;
}

.intro-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.8rem;
    border-radius: 999px;
    color: #92400e;
    background: rgba(251, 191, 36, 0.22);
    font-weight: 800;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.intro-copy h3 {
    color: var(--dark);
    font-size: clamp(1.55rem, 3vw, 2.4rem);
    line-height: 1.08;
    margin-bottom: 0.75rem;
}

.intro-copy p {
    color: #475569;
    line-height: 1.65;
    max-width: 760px;
}

.cashback-highlight {
    min-height: 178px;
    padding: 1.1rem;
    border-radius: 22px;
    text-align: center;
    color: white;
    background: linear-gradient(145deg, #f97316 0%, #ef4444 48%, #be123c 100%);
    box-shadow: 0 18px 35px rgba(239, 68, 68, 0.28);
    transform: rotate(1.5deg);
}

.cashback-highlight span,
.cashback-highlight small {
    display: block;
    font-weight: 800;
}

.cashback-highlight span {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.92;
}

.cashback-highlight strong {
    display: block;
    margin: 0.15rem 0;
    font-size: clamp(4rem, 9vw, 5.6rem);
    line-height: 0.95;
    text-shadow: 0 7px 0 rgba(127, 29, 29, 0.22);
}

.cashback-highlight small {
    font-size: 0.9rem;
    line-height: 1.35;
    opacity: 0.95;
}

.hero-card {
    border: 1px solid rgba(99, 102, 241, 0.18);
}

.hero-copy {
    color: var(--gray);
    margin-bottom: 1.25rem;
}

.quick-actions {
    display: flex;
    gap: 1rem;
}

.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.card-body {
    padding: 2rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-weight: 500;
}

.form-group label i {
    color: var(--primary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Examples */
.examples {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
    flex-wrap: wrap;
}

.example-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.example-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Filters Row */
.filters-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: var(--gray);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.section-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

.section-title h3 {
    font-size: 1.25rem;
}

.aff-result {
    margin-top: 1.5rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 24px;
}

.aff-result label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--dark);
    font-weight: 600;
}

.commission-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    padding: 1.35rem;
    color: #431407;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 42%, #fed7aa 100%);
    border: 1px solid rgba(251, 146, 60, 0.45);
    border-radius: 24px;
    box-shadow: 0 22px 55px rgba(194, 65, 12, 0.18);
}

.commission-card::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.8), transparent 62%);
    pointer-events: none;
}

.commission-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.commission-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    color: #9a3412;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(251, 146, 60, 0.36);
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
}

.commission-head strong {
    color: #ea580c;
    font-size: clamp(2.1rem, 5vw, 3.7rem);
    text-shadow: 0 4px 0 rgba(255, 255, 255, 0.8);
    line-height: 1;
}

.commission-link-row {
    position: relative;
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 0.95rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px dashed rgba(234, 88, 12, 0.38);
    border-radius: 16px;
    font-weight: 700;
}

.commission-link-row a {
    min-width: 0;
    color: #c2410c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

.commission-link-row a:hover {
    text-decoration: underline;
}

.commission-meta {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.commission-meta span {
    padding: 0.72rem 0.95rem;
    background: #fff;
    border: 1px solid rgba(251, 146, 60, 0.32);
    border-radius: 14px;
    color: #7c2d12;
    font-size: 0.95rem;
    box-shadow: 0 10px 24px rgba(124, 45, 18, 0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.commission-meta i {
    color: #ea580c;
}

.commission-meta b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commission-meta .technical-meta {
    display: none;
}

.commission-warning {
    position: relative;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(67, 20, 7, 0.86);
    color: #ffedd5;
    border-radius: 18px;
}

.commission-warning h4 {
    margin-bottom: 0.55rem;
    color: #fde68a;
}

.commission-warning p {
    margin: 0.35rem 0;
    line-height: 1.45;
}

.commission-warning small {
    display: block;
    margin-top: 0.7rem;
    color: rgba(255, 237, 213, 0.82);
}

.aff-result-box {
    display: flex;
    gap: 1rem;
}

.aff-result-box input {
    flex: 1;
    padding: 0.875rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.95rem;
}

.aff-result-box .btn-secondary {
    flex: 0 0 auto;
}

.open-aff-btn {
    flex: 0 0 190px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 12px 24px rgba(234, 88, 12, 0.24);
}

.copy-aff-btn {
    flex: 0 0 130px;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

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

/* ===== Man hinh lon (2K / 3K / 4K) =====
   Gan het kich thuoc trong file nay dung rem, nen chi can phong font-size goc la moi
   thu (chu, padding, bo goc, khoang cach) gian deu theo - khong lech layout. Rieng
   sidebar va be ngang noi dung dang px nen chinh tay cho can doi. */
@media (min-width: 1700px) {
    html { font-size: 17.5px; }
    #mainApp .sidebar { width: 268px; }
    #mainApp .header,
    #mainApp .screen { max-width: 1560px; }
}

@media (min-width: 2200px) {
    html { font-size: 19px; }
    #mainApp .sidebar { width: 296px; }
    #mainApp .header,
    #mainApp .screen { max-width: 1780px; }
}

@media (min-width: 2800px) {
    html { font-size: 21px; }
    #mainApp .sidebar { width: 328px; }
    #mainApp .header,
    #mainApp .screen { max-width: 2040px; }
}

/* Loading overlay khi dang dang nhap (tranh nguoi dung tuong web loi) */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: authOverlayFade 0.2s ease;
}

.auth-overlay.is-hidden {
    display: none;
}

.auth-overlay-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.2rem 2.6rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 90vw;
    animation: slideUp 0.3s ease;
}

.auth-overlay-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 1.1rem;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.auth-overlay-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.auth-overlay-sub {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

@keyframes authOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Results Section */
.results-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.3s ease;
}

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

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-title i {
    font-size: 1.5rem;
    color: var(--primary);
}

.results-title h3 {
    color: var(--dark);
}

.results-title span {
    background: var(--light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary);
    margin-left: 0.5rem;
}

.results-actions {
    display: flex;
    gap: 0.5rem;
}

/* Email Table */
.email-table {
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.table-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

.table-row {
    display: flex;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
}

.table-row:hover {
    background: var(--light);
}

.table-row.has-code {
    background: rgba(245, 158, 11, 0.05);
}

.table-row.has-code:hover {
    background: rgba(245, 158, 11, 0.1);
}

.table-cell {
    padding: 1rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sender Info */
.sender-info {
    display: flex;
    flex-direction: column;
}

.sender-info small {
    color: var(--gray);
    font-size: 0.8rem;
}

/* Subject Preview */
.subject-preview {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.subject-preview .preview-text {
    font-size: 0.8rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Code Badge */
.code-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--warning);
    cursor: pointer;
    transition: all 0.2s;
}

.code-badge:hover {
    background: var(--warning);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.no-code {
    color: var(--gray);
    font-style: italic;
}

/* Folder Badge */
.folder-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.folder-badge.inbox {
    background: var(--light);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.folder-badge.spam {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Stats Section */
.stats-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--light), white);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 2rem;
}

.email-info {
    background: var(--light);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.email-info p {
    margin: 0.5rem 0;
}

.email-content-full {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* Code Box */
.code-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px dashed var(--warning);
    flex-wrap: wrap;
    gap: 1rem;
}

.code-value {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: bold;
    color: var(--warning);
    letter-spacing: 2px;
}

.copy-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: none;
    border-radius: 10px;
    color: var(--warning);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.copy-btn:hover {
    background: var(--warning);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
    border-left: 4px solid var(--success);
}

.toast.show {
    transform: translateX(0);
}

.toast i {
    font-size: 1.2rem;
    color: var(--success);
}

.support-floating {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.support-btn {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    border: 4px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.32);
}

.support-btn.telegram {
    background: #2aabee;
    font-size: 1.55rem;
}

.support-btn.zalo {
    background: white;
    color: #176bff;
    font-weight: 900;
    font-size: 0.9rem;
}

.support-btn.zalo-group {
    background: #0068ff;
    font-size: 1.3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .main-content {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .header h2 {
        font-size: 1.35rem;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
    }

    .logo {
        margin-bottom: 1rem;
    }

    .nav-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .card-body,
    .results-section,
    .stats-section {
        padding: 1rem;
    }

    .intro-card {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
        border-radius: 18px;
    }

    .cashback-highlight {
        min-height: auto;
        padding: 0.9rem;
        transform: none;
    }

    .cashback-highlight strong {
        font-size: 3.6rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .commission-head,
    .commission-link-row,
    .aff-result-box {
        flex-direction: column;
        align-items: stretch;
    }

    .commission-head strong {
        font-size: clamp(1.9rem, 13vw, 2.35rem);
        word-break: break-word;
    }

    .commission-meta {
        grid-template-columns: 1fr;
    }

    .open-aff-btn {
        flex-basis: auto;
    }

    .copy-aff-btn {
        flex-basis: auto;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        padding: 0.9rem 1rem;
        border-radius: 18px;
        transform: translateY(140px);
    }

    .toast.show {
        transform: translateY(0);
    }

    .support-floating {
        right: 0.45rem;
        bottom: 0.75rem;
        gap: 0.65rem;
    }

    .support-btn {
        width: 42px;
        height: 42px;
        border-width: 3px;
    }

    .support-btn.zalo {
        display: none;
    }

    .table-header {
        display: none;
    }

    .table-row {
        flex-direction: column;
        padding: 1rem;
    }

    .table-cell {
        padding: 0.5rem 0;
    }

    .code-badge {
        width: fit-content;
    }

    .code-box {
        flex-direction: column;
        text-align: center;
    }

    .code-value {
        font-size: 1.5rem;
    }

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

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .entry-screen { padding: 1rem; }
    .login-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .login-showcase { text-align: center; }
    .login-showcase .brand-pill { margin: auto; }
    .login-showcase .eyebrow, .showcase-points { display: none; }
    .login-showcase h1, .login-lead { display: none; }
    .login-card { max-width: 420px; justify-self: center; padding: 1.15rem; border-radius: 16px; }
    .guide-wrap { padding: 1rem; justify-content: flex-start; }
    .guide-hero { margin: 2.5rem auto 1.5rem; }
    .guide-steps { grid-template-columns: 1fr; }
    .guide-actions { flex-direction: column; align-items: stretch; padding-bottom: 1rem; }
    .guide-continue { width: 100%; }
}

/* Final mobile overrides loaded last on purpose */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
    }

    .entry-screen {
        min-height: 100svh;
        align-items: start;
        place-items: initial;
        padding: max(.9rem, env(safe-area-inset-top)) .9rem max(1rem, env(safe-area-inset-bottom));
    }

    .login-layout {
        width: 100%;
        min-height: calc(100svh - 2rem);
        align-content: center;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .login-card {
        width: 100%;
        max-width: none;
        justify-self: stretch;
        padding: 1rem;
        border-radius: 18px;
        box-shadow: 0 18px 46px rgba(15,23,42,.12);
    }

    .auth-mode-switch button,
    .auth-field > div,
    .login-submit,
    #googleSignInButton {
        min-height: 46px;
    }

    #mainApp .sidebar {
        position: sticky;
        top: 0;
        z-index: 20;
        grid-template-columns: auto minmax(0,1fr) auto;
        padding: .72rem .75rem;
        border-bottom: 1px solid rgba(255,255,255,.08);
        box-shadow: 0 10px 28px rgba(15,23,42,.16);
    }

    #mainApp .sidebar-account {
        display: flex;
        align-items: center;
        gap: .4rem;
        margin: 0;
        padding: 0;
        border: 0;
    }

    #mainApp .sidebar-account > div:not(.account-avatar) {
        display: none;
    }

    #mainApp .sidebar-account .account-avatar {
        width: 34px;
        height: 34px;
        border-radius: 11px;
        font-size: .82rem;
    }

    #mainApp .sidebar-account button {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        padding: 0;
        color: #cbd5e1;
        background: rgba(255,255,255,.06);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 12px;
    }

    #mainApp .nav-menu {
        justify-content: flex-start;
        gap: .35rem;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    #mainApp .nav-menu::-webkit-scrollbar {
        display: none;
    }

    #mainApp .nav-item {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        flex: 0 0 auto;
    }

    #mainApp .main-content {
        padding: .9rem .78rem 5.5rem;
        background: #f5f6fa;
    }

    #mainApp .header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }

    #mainApp .intro-card,
    #mainApp .converter-card,
    .orders-list,
    .settings-shell {
        border-radius: 18px;
    }

    .orders-process-card {
        grid-template-columns: 1fr;
        gap: .55rem;
        padding: .9rem;
    }

    .orders-process-step {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .orders-process-toggle {
        position: static;
        width: 100%;
        height: 40px;
        margin-top: .2rem;
        border-radius: 12px;
        transform: none;
    }

    .orders-process-toggle.expanded {
        transform: rotate(180deg);
    }

    .orders-filters {
        grid-template-columns: 1fr;
    }

    .orders-date {
        grid-column: auto;
        grid-row: auto;
    }

    .orders-filter-btn {
        width: 100%;
        min-height: 46px;
    }
}

@media (max-width: 420px) {
    .entry-screen {
        padding-inline: .65rem;
    }

    .login-card {
        padding: .9rem;
    }

    #mainApp .sidebar {
        gap: .5rem;
        padding-inline: .55rem;
    }

    #mainApp .sidebar-account .account-avatar {
        display: none;
    }

    #mainApp .main-content {
        padding-inline: .62rem;
    }

    #mainApp .cashback-highlight {
        display: none;
    }

    .process-strip {
        grid-template-columns: 1fr;
    }

    .process-strip > div {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}

/* ===== Gon lai cho dien thoai =====
   Van de: o dan link la khoi THU 4 tren man hinh - user phai cuon qua banner
   80%, hang thong ke va dai 01/02/03 moi nhap duoc link. Viec dau tien nguoi
   ta vao web de lam lai nam duoi cung.
   Cach sua: doi THU TU HIEN THI bang CSS order (khong dong vao HTML nen khong
   anh huong logic JS), dua o nhap len dau tren man hinh hep. */
@media (max-width: 820px) {
    #mainApp #shopeeScreen { display: flex; flex-direction: column; }
    #mainApp #shopeeScreen > .converter-card { order: 1; }
    #mainApp #shopeeScreen > .home-stats     { order: 3; }
    #mainApp #shopeeScreen > .process-strip  { order: 4; }
    #mainApp #shopeeScreen > .intro-card     { order: 5; }

    /* Banner gioi thieu day xuong cuoi thi thu nho lai cho do chiem cho */
    #mainApp .intro-card { padding: 1.1rem; }
    #mainApp .intro-card h3 { font-size: 1.05rem; }
    #mainApp .intro-copy > p { font-size: .72rem; }

    /* 4 dong Gia/Hoa hong/Ti le/Nguon dang moi dong mot hang -> xep 2 cot */
    #mainApp .commission-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .45rem;
    }
    #mainApp .commission-meta > span {
        margin: 0;
        padding: .5rem .6rem;
        font-size: .7rem;
    }
    /* "Nguon: addlivetag" la thong tin ky thuat, khong giup nguoi mua quyet dinh */
    #mainApp .commission-meta > span.meta-source { display: none; }

    /* Khoi "Luu y" dai 5 dong, day nut "Mo Link" xuong khuat man hinh. Thu gon
       chu lai va gioi han chieu cao - van doc duoc nhung khong chiem het trang. */
    #mainApp .commission-warning { padding: .8rem .9rem; }
    #mainApp .commission-warning h4 { font-size: .78rem; margin-bottom: .35rem; }
    #mainApp .commission-warning p { font-size: .7rem; line-height: 1.45; margin: .18rem 0; }
    #mainApp .commission-warning small { font-size: .62rem; line-height: 1.4; }
}
