:root {
    --todo-bg: #0b0b0d;
    --todo-surface: #18181c;
    --todo-surface-hover: #202026;
    --todo-line: rgba(255, 255, 255, 0.08);
    --todo-text: #f3f4f6;
    --todo-muted: #9ca3af;
    --todo-accent: #7c92ff;
    --todo-accent-strong: #90a2ff;
    --todo-danger: #ff7b7b;
    --todo-success: #7ed957;
    --todo-warning: #f6b657;
    --todo-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(124, 146, 255, 0.16), transparent 32%),
        linear-gradient(180deg, #0b0b0d 0%, #101014 100%);
    color: var(--todo-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.min-w-0 {
    min-width: 0;
}

.todo-app-shell {
    min-height: 100vh;
}

.todo-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(16px);
    background: rgba(11, 11, 13, 0.72);
    border-bottom: 1px solid var(--todo-line);
}

.todo-topbar-inner,
.todo-page-container {
    width: min(100%, 860px);
    margin: 0 auto;
    padding-inline: 1rem;
}

.todo-topbar-inner {
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.todo-page-container {
    padding-top: 1.25rem;
    padding-bottom: 6rem;
}

.todo-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--todo-text);
    font-weight: 700;
}

.todo-brand-icon {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 146, 255, 0.14);
    color: var(--todo-accent-strong);
    box-shadow: inset 0 0 0 1px rgba(124, 146, 255, 0.12);
}

.todo-brand-title {
    letter-spacing: -0.02em;
}

.todo-screen {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.todo-page-header-detail {
    align-items: flex-start;
}

.todo-page-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.todo-page-meta {
    color: var(--todo-muted);
    font-size: 0.96rem;
}

.todo-surface {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--todo-line);
    border-radius: 1.25rem;
    box-shadow: var(--todo-shadow);
}

.todo-list-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.todo-list-row,
.todo-task-row {
    min-height: 5.25rem;
    padding: 1rem 1rem 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    transition: background-color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.todo-list-row:hover,
.todo-task-row:hover {
    background: var(--todo-surface-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.todo-row-main {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    color: inherit;
}

.todo-row-title,
.todo-task-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    word-break: break-word;
}

.todo-row-subtitle,
.todo-task-meta {
    margin-top: 0.28rem;
    color: var(--todo-muted);
    font-size: 0.9rem;
}

.todo-task-title-done {
    color: #a1a1aa;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.todo-counts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.todo-count-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.35rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--todo-line);
    color: var(--todo-muted);
    font-size: 0.9rem;
}

.todo-count-chip strong {
    color: var(--todo-text);
    font-weight: 700;
}

.todo-empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.todo-empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 146, 255, 0.12);
    color: var(--todo-accent-strong);
    font-size: 1.45rem;
}

.todo-empty-title {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.todo-empty-text {
    margin: 0;
    color: var(--todo-muted);
}

.todo-icon-button,
.todo-status-button,
.todo-fab {
    border: 0;
    outline: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.todo-icon-button {
    width: 2.8rem;
    height: 2.8rem;
    background: rgba(255, 255, 255, 0.05);
    color: #d4d4d8;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.todo-icon-button:hover,
.todo-status-button:hover,
.todo-fab:hover {
    transform: translateY(-1px);
}

.todo-icon-button-primary {
    background: var(--todo-accent);
    color: #101014;
    box-shadow: 0 10px 22px rgba(124, 146, 255, 0.32);
}

.todo-back-button {
    flex: 0 0 auto;
}

.todo-status-button {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.05rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.todo-status-button-not-purchased {
    background: rgba(255, 255, 255, 0.04);
    color: #d4d4d8;
}

.todo-status-button-in-cart {
    background: rgba(246, 182, 87, 0.14);
    color: var(--todo-warning);
}

.todo-status-button-purchased {
    background: rgba(126, 217, 87, 0.16);
    color: var(--todo-success);
}

.todo-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 4.25rem;
    height: 4.25rem;
    z-index: 1025;
    background: var(--todo-accent);
    color: #101014;
    box-shadow: 0 18px 34px rgba(124, 146, 255, 0.34);
    font-size: 1.4rem;
}

.todo-modal-content,
.confirm-modal {
    border-radius: 1.6rem;
    background: #1b1b20;
    color: var(--todo-text);
    box-shadow: 0 24px 65px rgba(0, 0, 0, 0.45);
}

.todo-modal-content .btn-close,
.confirm-modal .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.todo-label {
    color: #e5e7eb;
    font-size: 0.9rem;
}

.todo-input,
.form-control,
.form-select {
    min-height: 3.25rem;
    border-radius: 1rem;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: var(--todo-text);
    box-shadow: none !important;
}

.todo-input::placeholder,
.form-control::placeholder {
    color: #71717a;
}

.todo-input:focus,
.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.06);
    color: var(--todo-text);
    border-color: rgba(124, 146, 255, 0.62);
}

.todo-menu {
    min-width: 13rem;
    border-radius: 1rem;
    border-color: rgba(255, 255, 255, 0.08);
    background: #202027;
    box-shadow: 0 24px 55px rgba(0, 0, 0, 0.38);
}

.todo-menu .dropdown-item {
    color: #f3f4f6;
    padding-block: 0.65rem;
}

.todo-menu .dropdown-item:hover,
.todo-menu .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.todo-menu .dropdown-divider {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.todo-menu form {
    margin: 0;
}

.sync-status-badge {
    min-height: 2.35rem;
    padding: 0.52rem 0.85rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--todo-line);
}

.sync-status-connected {
    color: #98ffb8;
}

.sync-status-reconnecting {
    color: #ffd28c;
}

.sync-status-disconnected {
    color: #ff9c9c;
}

.app-toast {
    min-width: min(22rem, calc(100vw - 2rem));
    border-radius: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    background: rgba(27, 27, 32, 0.96);
    color: var(--todo-text);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.app-toast .toast-body {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
}

.app-toast-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1rem;
}

.app-toast-icon-success {
    background: rgba(126, 217, 87, 0.16);
    color: var(--todo-success);
}

.app-toast-icon-danger {
    background: rgba(255, 123, 123, 0.14);
    color: #ff9c9c;
}

.app-toast-icon-warning {
    background: rgba(246, 182, 87, 0.14);
    color: var(--todo-warning);
}

.app-toast-icon-info {
    background: rgba(124, 146, 255, 0.14);
    color: var(--todo-accent-strong);
}

.confirm-modal .modal-body,
.app-toast .text-secondary,
.text-secondary {
    color: var(--todo-muted) !important;
}

.form-control.input-validation-error,
.input-validation-error.form-control {
    border-color: #ef4444;
}

.form-control.input-validation-error:focus,
.input-validation-error.form-control:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.12) !important;
}

.is-submitting {
    pointer-events: none;
}

@media (max-width: 767.98px) {
    .todo-topbar-inner,
    .todo-page-container {
        padding-inline: 0.9rem;
    }

    .todo-page-container {
        padding-bottom: 6.5rem;
    }

    .todo-page-header {
        align-items: flex-start;
    }

    .todo-page-title {
        font-size: 2.55rem;
    }

    .todo-list-row,
    .todo-task-row {
        min-height: 4.85rem;
        padding: 0.95rem;
    }

    .todo-row-title,
    .todo-task-title {
        font-size: 1.02rem;
    }

    .todo-fab {
        width: 4rem;
        height: 4rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast-container {
        width: 100%;
        max-width: 100%;
    }
}


.live-refreshing {
    opacity: 0.72;
    transition: opacity 0.16s ease;
}
