:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --border: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #16a34a;
    --accent-soft: #dcfce7;
    --accent-soft-stronger: #bbf7d0;
    --radius-lg: 16px;
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #ecfdf3 0, #f3f4f6 45%, #e5e7eb 100%);
    color: var(--text-main);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 16px;
}

header {
    padding: 16px 0 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #4ade80);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.35);
    flex-shrink: 0;
}

.brand-text-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.brand-text-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

main {
    flex: 1;
    padding-bottom: 24px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-name {
    font-weight: 600;
}

.user-uid {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #166534;
    font-size: 0.75rem;
    margin-top: 4px;
}

.balance-box {
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-stronger));
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
}

.balance-label {
    font-size: 0.8rem;
    color: #166534;
}

.balance-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #14532d;
}

.balance-sub {
    font-size: 0.75rem;
    color: #166534;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-pill {
    border-radius: 999px;
    padding: 4px 10px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.tabs {
    margin-top: 20px;
}

.tab-nav {
    display: flex;
    gap: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.tab-button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tab-button.active {
    background: var(--accent);
    color: #ecfdf5;
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.45);
}

.tab-button span.icon {
    font-size: 1rem;
}

.tab-content {
    margin-top: 16px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.section-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.reward-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reward-header {
    display: flex;
    gap: 10px;
}

/*.reward-icon {*/
/*    width: 32px;*/
/*    height: 32px;*/
/*    border-radius: 999px;*/
/*    background: radial-gradient(circle at 30% 0, #facc15, #16a34a);*/
/*    flex-shrink: 0;*/
/*}*/

.reward-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: white;
    flex-shrink: 0;
}

.reward-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.reward-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.reward-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.reward-cost {
    font-weight: 600;
    color: #166534;
}

.reward-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    display: inline-block;         /* Supaya padding dan radius bekerja */
    text-decoration: none;         /* Hilangkan underline */
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: #ecfdf5;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.4);
    width: 100%;
    margin-top: 4px;
}

.btn-primary:disabled {
    background: #9ca3af;
    box-shadow: none;
    cursor: default;
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.55);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.history-table thead {
    background: var(--surface-soft);
}

.history-table th,
.history-table td {
    padding: 8px 10px;
    text-align: left;
}

.history-table th {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.history-table tr + tr {
    border-top: 1px solid var(--border);
}

.status-pill {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.7rem;
    display: inline-block;
}

.status-success {
    background: var(--accent-soft);
    color: #166534;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-danger {
    background: #fec7c7;
    color: #920e0e;
}

footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0 20px;
}

@media (max-width: 640px) {
    .summary-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .balance-box {
        align-items: flex-start;
    }
}

/* ==== Forms ==== */
.form-card {
    margin-top: 16px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.form-label {
    font-weight: 600;
    color: var(--text-main);
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 8px 10px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--surface-soft);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.15);
    background: #ffffff;
}

.form-help {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.alert-warning {
    margin-top: 8px;
    font-size: 0.78rem;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fef3c7;
    border: 1px solid #facc15;
    color: #92400e;
}

.form-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
}

.form-actions .btn {
    min-width: 120px;
}

/* ==== MODAL ==== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-box {
    background: var(--surface);
    padding: 20px 24px;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid var(--border);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

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

/* ==== SOCIAL BUTTONS (Bootstrap Icons) ==== */
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--text-main);
    transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.social-btn i {
    font-size: 1rem;
}

.social-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* warna khas platform */
.social-ig {
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
    color: #701a75;
}

.social-tiktok {
    background: #f8fafc;
    color: #0f172a;
}

.social-yt {
    background: #fee2e2;
    color: #991b1b;
}

.social-wa {
    background: #dcfce7;
    color: #166534;
}
