@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --bg-main: #f5f7fb;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent-primary: #2563eb;
    --accent-secondary: #f59e0b;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --border-subtle: rgba(15, 23, 42, 0.06);
    --radius-large: 24px;
    --radius-medium: 18px;
    --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.12);
}

.dark-theme {
    --bg-main: radial-gradient(circle at top, #0f172a 0%, #020617 50%, #000000 100%);
    --bg-card: rgba(15, 23, 42, 0.96);
    --bg-elevated: rgba(15, 23, 42, 0.9);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent-primary: #38bdf8;
    --accent-secondary: #f97316;
    --accent-soft: rgba(56, 189, 248, 0.12);
    --border-subtle: rgba(148, 163, 184, 0.3);
    --shadow-soft: 0 24px 80px rgba(15, 23, 42, 0.9);
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: background 0.6s ease, color 0.4s ease;
}

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

input,
button {
    font-family: inherit;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, 0.7);
}

.install-page {
    background: radial-gradient(circle at top, #0f172a 0, #020617 50%, #000000 100%);
}

.install-wrapper {
    width: 100%;
    max-width: 480px;
}

.install-card {
    background: var(--bg-card);
    border-radius: 28px;
    padding: 28px 26px 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.install-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

.install-card h1 {
    position: relative;
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.install-card form {
    position: relative;
    z-index: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(18px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dark-theme .form-group input {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-main);
}

.form-group input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.btn-primary {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.45);
    transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.6);
    filter: brightness(1.03);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.app-shell {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 760px;
    background: var(--bg-elevated);
    border-radius: 32px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
}

.sidebar {
    width: 240px;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-right: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 55%), var(--bg-card);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.sidebar-logo-badge {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 20%, var(--accent-secondary), var(--accent-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-size: 16px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.sidebar-link span.icon {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.04);
}

.sidebar-link.active,
.sidebar-link:hover {
    background: var(--accent-soft);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.2), transparent 50%), var(--bg-main);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 12px;
}

.header-left h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.header-left span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.theme-toggle {
    width: 52px;
    height: 26px;
    border-radius: 999px;
    padding: 3px;
    background: rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.theme-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
    transform: translateX(0);
    transition: transform 0.22s ease, background 0.22s ease;
}

.dark-theme .theme-toggle-thumb {
    transform: translateX(24px);
    background: #0f172a;
}

.theme-toggle span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
}

.theme-toggle .sun {
    left: 8px;
}

.theme-toggle .moon {
    right: 8px;
}

.avatar-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
}

.avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, var(--accent-secondary), var(--accent-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9fafb;
    font-size: 13px;
}

.avatar-pill span {
    font-size: 12px;
}

.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr);
    gap: 18px;
    padding: 0 22px 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-large);
    padding: 18px 18px 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    position: relative;
    overflow: hidden;
}

.card-subtle {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-header h3 {
    margin: 0;
    font-size: 15px;
}

.card-header span {
    font-size: 12px;
    color: var(--text-muted);
}

.earnings-circle-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
}

.earnings-circle {
    position: relative;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 20%, rgba(248, 250, 252, 0.7), transparent 56%),
        conic-gradient(from 220deg, var(--accent-secondary) 0 40%, var(--accent-primary) 40% 78%, rgba(148, 163, 184, 0.5) 78% 100%);
    padding: 18px;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.35);
}

.dark-theme .earnings-circle {
    background:
        radial-gradient(circle at 30% 20%, rgba(15, 23, 42, 0.1), transparent 56%),
        conic-gradient(from 220deg, #f97316 0 40%, #38bdf8 40% 78%, rgba(30, 64, 175, 0.6) 78% 100%);
}

.earnings-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.98), rgba(226, 232, 240, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.dark-theme .earnings-circle-inner {
    background: radial-gradient(circle at top, #020617, #020617);
}

.earnings-circle-inner h2 {
    margin: 0;
    font-size: 26px;
}

.earnings-circle-inner span {
    font-size: 12px;
    color: var(--text-muted);
}

.earnings-badge {
    position: absolute;
    bottom: 14px;
    right: 18px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.dark-theme .earnings-badge {
    background: rgba(15, 23, 42, 0.95);
}

.earnings-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.meta-row span.label {
    color: var(--text-muted);
}

.meta-row span.value {
    font-weight: 500;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 11px;
}

.tag-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent-primary);
}

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

.task-card {
    border-radius: var(--radius-medium);
    padding: 12px 10px 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dark-theme .task-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.96));
}

.task-title {
    font-size: 13px;
    font-weight: 500;
}

.task-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.task-amount {
    font-weight: 600;
    font-size: 12px;
}

.task-cta {
    margin-top: 4px;
    font-size: 11px;
    align-self: flex-start;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    cursor: pointer;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.stats-label {
    color: var(--text-muted);
}

.stats-value {
    font-weight: 500;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 22px;
    display: none;
}

.bottom-nav-inner {
    max-width: 460px;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: #9ca3af;
}

.bottom-nav-item span.icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: inherit;
    font-size: 14px;
}

.bottom-nav-item.active {
    color: #f9fafb;
}

.bottom-nav-item.active span.icon {
    background: linear-gradient(135deg, #38bdf8, #f97316);
}

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

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

.table-simple th {
    color: var(--text-muted);
    font-weight: 500;
}

.table-simple tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.02);
}

.badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
}

.badge-success {
    background: rgba(22, 163, 74, 0.15);
    color: #15803d;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.18);
    color: #a16207;
}

.badge-neutral {
    background: rgba(148, 163, 184, 0.18);
    color: #4b5563;
}

@media (max-width: 900px) {
    body {
        padding: 16px 12px 80px;
    }

    .app-shell {
        max-height: none;
        border-radius: 26px;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        padding-bottom: 8px;
    }

    .earnings-circle-wrap {
        flex-direction: column;
        align-items: center;
    }

    .earnings-circle {
        width: 220px;
        height: 220px;
    }

    .bottom-nav {
        display: block;
    }
}

@media (max-width: 520px) {
    .install-card {
        border-radius: 24px;
        padding: 22px 18px 18px;
    }
}
