/* ======================================================
   GLOBAL DESIGN TOKENS
====================================================== */
:root {
    --bg-main: #f5f7fb;
    --bg-soft: #eef2ff;
    --card: #ffffff;

    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-soft: rgba(59,130,246,0.12);

    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text-main: #0f172a;
    --text-muted: #64748b;

    --border: #e5e7eb;

    --radius: 14px;
    --radius-pill: 999px;

    --shadow-sm: 0 6px 14px rgba(0,0,0,.06);
    --shadow-md: 0 12px 28px rgba(0,0,0,.08);
    --shadow-lg: 0 24px 48px rgba(0,0,0,.10);

    --transition: 0.25s ease;
    --max-width: 1120px;

    --font: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* ======================================================
   RESET
====================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: var(--font);
    background: radial-gradient(1200px 500px at top, var(--bg-soft), var(--bg-main));
    color: var(--text-main);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ======================================================
   LAYOUT
====================================================== */
.container {
    max-width: var(--max-width);
    margin: auto;
    padding: 28px 16px 56px;
}

main {
    flex: 1;
}

/* ======================================================
   TYPOGRAPHY
====================================================== */
h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin-bottom: 12px;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: 14px;
}

h3 {
    margin-bottom: 6px;
}

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

/* ======================================================
   CARDS
====================================================== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    margin-bottom: 18px;
}

/* ======================================================
   BUTTONS
====================================================== */
button,
.button {
    border: none;
    background: linear-gradient(135deg,var(--primary),var(--primary-hover));
    color: #fff;
    padding: 14px 22px;
    border-radius: var(--radius-pill);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.button.secondary {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border);
    box-shadow: none;
}

.button.secondary:hover {
    background: var(--primary-soft);
}

/* Disabled */
button:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ======================================================
   FORMS
====================================================== */
label {
    font-weight: 500;
    margin-top: 12px;
    display: block;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Prevent iOS zoom */
@media (max-width: 640px) {
    input,
    select,
    textarea {
        font-size: 16px;
    }
}

/* ======================================================
   AUTH / LOGIN BOX
====================================================== */
.login-box {
    max-width: 420px;
    margin: 60px auto;
    padding: 28px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
}

.login-box h2 {
    text-align: center;
}

/* Google button */
.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-weight: 500;
}

.google-btn img {
    width: 18px;
    height: 18px;
}

/* Divider */
.divider {
    text-align: center;
    margin: 16px 0;
    font-size: 13px;
    color: #888;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.divider::before { left: 0; }
.divider::after  { right: 0; }

/* ======================================================
   ALERTS
====================================================== */
.error {
    background: #fdecea;
    color: #b00020;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.success {
    background: #eafaf1;
    color: #065f46;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* ======================================================
   STATS GRID
====================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
    gap: 16px;
}

.stats-grid.single-row {
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
}

.stats-grid .card p {
    font-size: 1.6rem;
    font-weight: 600;
}

/* ======================================================
   ADMIN TOOLS GRID
====================================================== */
.admin-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 14px;
}

/* ======================================================
   TABLES (GLOBAL & MOBILE SAFE)
====================================================== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th {
    background: #f1f5f9;
    text-align: left;
}

@media (max-width: 768px) {
    .table {
        min-width: 720px;
    }
}

/* ======================================================
   PAGINATION
====================================================== */
.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.pagination a {
    padding: 8px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
}

.pagination a.active {
    background: var(--primary);
    color: #fff;
}

/* ======================================================
   LEGAL PAGES
====================================================== */
.legal p,
.legal li {
    line-height: 1.7;
}

.legal ul {
    padding-left: 18px;
}

/* ======================================================
   FOOTER
====================================================== */
.footer {
    text-align: center;
    padding: 24px 16px;
    font-size: .85rem;
    color: var(--text-muted);
}

/* ======================================================
   MOBILE REFINEMENTS
====================================================== */
@media (max-width: 640px) {

    .stats-grid,
    .admin-tools-grid {
        grid-template-columns: 1fr;
    }

    button,
    .button {
        width: 100%;
    }

    .card {
        padding: 18px;
    }
}
/* =========================
   HEADER & NAVIGATION
========================= */

.header {
    background: #0f172a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* NAV LINKS */
.nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;

    color: #e5e7eb;
    text-decoration: none;
    white-space: nowrap;

    border-radius: 8px;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

/* ICONS */
.nav a i {
    font-size: 1rem;
    line-height: 1;
    color: #9ca3af;
}

/* HOVER */
.nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.nav a:hover i {
    color: #ffffff;
}

/* ACTIVE PAGE */
.nav a.active {
    background: rgba(59,130,246,0.18);
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(59,130,246,0.35);
}

.nav a.active i {
    color: #60a5fa;
}

/* =========================
   MOBILE (ICON ONLY)
========================= */
@media (max-width: 720px) {

    .nav {
        gap: 8px;
        padding: 8px;
        flex-wrap: nowrap;
    }

    .nav a {
        padding: 8px 10px;
        justify-content: center;
    }

    .nav a span {
        display: none;
    }

    .nav a i {
        font-size: 1.1rem;
    }
}

/* =========================
   DESKTOP (ICON + TEXT)
========================= */
@media (min-width: 721px) {
    .nav a span {
        display: inline;
    }
}

/* Prevent empty icon fallback */
.nav i {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

@media (max-width: 720px) {
    .nav a span {
        display: inline;
        font-size: 0.75rem;
    }
}

.earn-block ul,
.features {
    list-style: none;
    padding: 0;
}

.earn-block li,
.features li {
    padding: 8px 0;
    font-weight: 500;
}

.lead {
    font-size: 1.1rem;
    max-width: 640px;
}

.note {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==============================
   EARNINGS CALCULATOR MODAL
============================== */
.calc-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.calc-modal.active {
    display: block;
}

.calc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

.calc-box {
    position: relative;
    max-width: 420px;
    margin: 10vh auto;
    z-index: 2;
}

@media (max-width: 640px) {
    .calc-box {
        margin: 12vh 16px;
    }
}