:root {
    --app-bg: #f4f7fb;
    --panel-bg: #ffffff;
    --sidebar-bg: #fbfcfe;
    --text-main: #1f2937;
    --text-soft: #6b7280;
    --line: #e5e7eb;
    --surface-muted: #f8fafc;
    --surface-strong: #ffffff;
    --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.06);
    --theme-toggle-bg: rgba(255, 255, 255, 0.85);
    --theme-toggle-border: rgba(15, 23, 42, 0.08);
    --theme-toggle-text: #1f2937;
}

:root[data-theme='dark'] {
    --app-bg: #0c1220;
    --panel-bg: #111827;
    --sidebar-bg: #0f172a;
    --text-main: #e5edf8;
    --text-soft: #94a3b8;
    --line: rgba(148, 163, 184, 0.18);
    --surface-muted: #162032;
    --surface-strong: #111827;
    --shadow-soft: 0 24px 50px rgba(2, 6, 23, 0.45);
    --theme-toggle-bg: rgba(15, 23, 42, 0.92);
    --theme-toggle-border: rgba(148, 163, 184, 0.18);
    --theme-toggle-text: #e5edf8;
}

body {
    background: linear-gradient(180deg, #f8fbff 0%, var(--app-bg) 100%);
    color: var(--text-main);
    transition: background-color 0.2s ease, color 0.2s ease;
}

:root[data-theme='dark'] body {
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.1), transparent 24%), linear-gradient(180deg, #07111f 0%, var(--app-bg) 100%);
}

.sidebar-panel {
    background: var(--sidebar-bg);
    min-height: 100vh;
    color: var(--text-main);
}

.sidebar-scroll {
    max-height: calc(100vh - 190px);
    overflow-y: auto;
}

.app-main {
    background: radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 28%), transparent;
}

.hero-panel {
    background: var(--panel-bg);
    border: 1px solid rgba(13, 110, 253, 0.08);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.counter-pill {
    border: 1px solid var(--line);
    font-size: 0.95rem;
    padding: 0.6rem 0.85rem;
    background: var(--surface-muted) !important;
    color: var(--text-main) !important;
}

.list-link {
    color: var(--text-main);
    display: block;
    font-weight: 600;
    text-decoration: none;
}

.list-link.active {
    color: #0d6efd;
}

.task-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.08);
}

:root[data-theme='dark'] .task-card:hover {
    box-shadow: 0 18px 32px rgba(2, 6, 23, 0.4);
}

.task-card.is-completed .task-title,
.task-card.is-completed .task-description {
    text-decoration: line-through;
    color: var(--text-soft);
}

.category-badge {
    color: #fff;
    font-weight: 600;
}

.empty-state {
    margin-top: 3rem;
}

.auth-card {
    max-width: 460px;
    width: 100%;
    border-radius: 1.25rem;
}

.surface-card,
.card {
    background: var(--surface-strong);
    color: var(--text-main);
}

.card,
.form-control,
.form-select,
.btn-light,
.alert,
.modal-content {
    border-color: var(--line);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
    background-color: var(--surface-muted);
    color: var(--text-main);
}

.form-control::placeholder {
    color: var(--text-soft);
}

.text-muted,
.small,
.form-label,
.form-check-label,
.card-body p,
.card-body code {
    color: var(--text-soft) !important;
}

.google-mark {
    align-items: center;
    background: #fff;
    border-radius: 999px;
    color: #db4437;
    display: inline-flex;
    font-weight: 700;
    height: 1.75rem;
    justify-content: center;
    width: 1.75rem;
}

.auth-avatar {
    flex-shrink: 0;
    height: 42px;
    object-fit: cover;
    width: 42px;
}

.auth-avatar-fallback {
    align-items: center;
    background: #0d6efd;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
}

.theme-toggle {
    backdrop-filter: blur(10px);
    background: var(--theme-toggle-bg);
    border: 1px solid var(--theme-toggle-border);
    border-radius: 999px;
    color: var(--theme-toggle-text);
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1040;
}

.theme-toggle:hover {
    background: var(--panel-bg);
    color: var(--theme-toggle-text);
}

.theme-toggle-icon {
    font-size: 1rem;
    margin-right: 0.35rem;
}

.alert-success {
    background: rgba(25, 135, 84, 0.12);
    color: var(--text-main);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.14);
    color: var(--text-main);
}

.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-primary,
.btn-outline-dark {
    border-color: var(--line);
}

.btn-light {
    background: var(--surface-muted);
    color: var(--text-main);
}

.list-group-item,
.border,
.border-top,
.border-end,
.border-bottom {
    border-color: var(--line) !important;
}

.bg-white,
.bg-light-subtle {
    background: var(--surface-strong) !important;
}

@media (max-width: 991.98px) {
    .sidebar-panel {
        min-height: auto;
    }

    .sidebar-scroll {
        max-height: none;
    }

    .theme-toggle {
        right: 0.75rem;
        top: 0.75rem;
    }
}
