:root {
    --tg-blue: #2AABEE;
    --tg-blue-dark: #229ED9;
    --tg-blue-light: #E8F4FD;
    --bg: #0f1419;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2a3d;
    --bg-input: #0d1117;
    --text: #e7ecf3;
    --text-muted: #8b9cb3;
    --border: #2a3548;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--tg-blue); text-decoration: none; }
a:hover { color: var(--tg-blue-dark); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }

/* Navbar */
.navbar {
    background: rgba(26, 35, 50, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.logo-icon { font-size: 1.4rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }

.nav-balance {
    background: var(--tg-blue-light);
    color: var(--tg-blue-dark);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--tg-blue);
    color: #fff;
}
.btn-primary:hover { background: var(--tg-blue-dark); color: #fff; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--tg-blue); color: var(--tg-blue); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Hero */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(42, 171, 238, 0.15) 0%, transparent 60%);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero h1 span { color: var(--tg-blue); }

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Features */
.features { padding: 4rem 0; }

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--tg-blue);
}

.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--tg-blue);
    box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.15);
}

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Auth */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 4rem;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.pricing-card.featured {
    border-color: var(--tg-blue);
    transform: scale(1.03);
}

.pricing-card.featured::before {
    content: 'Populer';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tg-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 20px;
}

.pricing-card:hover { border-color: var(--tg-blue); }

.pricing-coins {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--tg-blue);
}

.pricing-price {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.5rem 0 1rem;
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin: 1.25rem 0;
}

.pricing-features li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pricing-features li::before {
    content: '✓ ';
    color: var(--success);
    font-weight: 700;
}

.check-price-banner {
    background: linear-gradient(135deg, var(--tg-blue), var(--tg-blue-dark));
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.check-price-banner h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.check-price-banner .price { font-size: 3rem; font-weight: 800; }

/* Dashboard layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 64px);
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
}

.sidebar-header {
    padding: 0 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.sidebar-header h3 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.sidebar-balance { font-size: 1.25rem; font-weight: 700; color: var(--tg-blue); margin-top: 0.25rem; }

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(42, 171, 238, 0.08);
    color: var(--tg-blue);
    border-left-color: var(--tg-blue);
}

.dashboard-content { padding: 2rem; }

.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header p { color: var(--text-muted); font-size: 0.95rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }
.stat-card .value.blue { color: var(--tg-blue); }

/* Tables */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

tr:hover td { background: var(--bg-card-hover); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-error { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-info { background: rgba(42, 171, 238, 0.15); color: var(--tg-blue); }

/* Alerts */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    margin: 1rem auto;
    max-width: 1140px;
    font-size: 0.9rem;
}

.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-demo { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35); color: #fcd34d; margin: 0 auto 1rem; max-width: 1140px; padding: 0.85rem 1.25rem; border-radius: 8px; font-size: 0.9rem; }

/* Export toolbar */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.export-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
}

.export-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.export-btn { font-size: 0.8rem !important; }

/* Check result */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.result-item .key { color: var(--text-muted); }
.result-item .val { font-weight: 500; text-align: right; }

.history-list { list-style: none; }
.history-list li {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

/* Admin */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-tabs a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.admin-tabs a.active,
.admin-tabs a:hover {
    background: var(--tg-blue);
    color: #fff;
    border-color: var(--tg-blue);
}

.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 3rem;
}

/* Payment QRIS */
.payment-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
}

.payment-qr-card { text-align: center; }

.payment-status { margin-bottom: 1rem; }

.payment-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.qr-wrapper {
    display: inline-block;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: opacity 0.3s;
}

.payment-amount { margin-bottom: 1.25rem; }
.payment-amount .label { display: block; font-size: 0.85rem; color: var(--text-muted); }
.payment-amount .amount { font-size: 2rem; font-weight: 800; color: var(--tg-blue); }
.payment-amount .fee-note { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

.payment-details { text-align: left; margin-bottom: 1rem; }
.payment-hint { font-size: 0.8rem; color: var(--text-muted); }

.payment-success { padding: 1.5rem 0; }
.payment-success .success-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.payment-success h3 { margin-bottom: 0.5rem; }

.payment-steps {
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.payment-steps li { margin-bottom: 0.6rem; }

@media (max-width: 768px) {
    .payment-layout { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { display: flex; overflow-x: auto; }
    .sidebar-nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar-nav a.active { border-bottom-color: var(--tg-blue); border-left-color: transparent; }
}
