:root {
    --bg: #0a0f1c;
    --card: #12192b;
    --text: #e8ecf5;
    --muted: #9aa4c2;
    --accent: #4f83ff;
    --accent-2: #1f2b44;
    --border: #1f2a3d;
    --danger: #ef4444;
    --success: #22c55e;
    --info: #60a5fa;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.theme-dark { }

.theme-blue {
    --bg: #0a0f1c;
    --card: #101728;
    --accent: #3b82f6;
    --accent-2: #1e293b;
}

.theme-pink {
    --bg: #1a0f1d;
    --card: #251028;
    --accent: #ec4899;
    --accent-2: #311234;
}

.theme-winter {
    --bg: #0c1220;
    --card: #0f1a2d;
    --accent: #7dd3fc;
    --accent-2: #0b2138;
}

.theme-jungle {
    --bg: #0d1a14;
    --card: #12231b;
    --accent: #34d399;
    --accent-2: #0f2a1f;
}

.theme-christmas {
    --bg: #210101;
    --card: #2e0c0c;
    --accent: #e11d48;
    --accent-2: #124423;
    --text: #f8fafc;
    --muted: #fef3c7;
    --border: #3f1a1a;
    --success: #22c55e;
    --danger: #f87171;
}

* { box-sizing: border-box; }
body {
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
    padding: 1.25rem;
    background: linear-gradient(145deg, var(--bg) 0%, #050810 70%);
    color: var(--text);
    font-size: 15.5px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header { margin-bottom: 1.1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.brand { font-weight: 700; letter-spacing: 0.5px; }

.nav-header { display:flex; align-items:center; gap:0.75rem; position:relative; }
.nav-links { display:flex; gap:0.5rem; align-items:center; }
.nav-links a { padding:0.35rem 0.45rem; border-radius:6px; color: var(--text); font-weight:600; border-bottom: 2px solid transparent; }
.nav-links a:hover { border-bottom-color: var(--accent); text-decoration:none; }
.nav-toggle { display:none; background: transparent; color: var(--text); border:1px solid var(--border); border-radius:6px; padding:0.4rem 0.6rem; font-weight:700; cursor:pointer; }
.nav-meta { display:flex; gap:0.35rem; align-items:center; margin-left:auto; flex-wrap:wrap; }
.pill { background: var(--accent-2); color: var(--text); padding:0.3rem 0.6rem; border-radius:999px; border:1px solid var(--border); font-weight:600; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.9rem;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
}
.task-accordion details { margin-bottom: 0.6rem; background: var(--accent-2); border:1px solid var(--border); border-radius:10px; padding:0.6rem 0.8rem; }
.task-summary { display:flex; justify-content:space-between; align-items:center; gap:0.6rem; cursor:pointer; list-style:none; }
.task-summary::-webkit-details-marker { display:none; }
.task-summary-left { display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap; }
.task-summary-actions { display:flex; gap:0.35rem; align-items:center; flex-wrap:wrap; }
.muted-small { color: var(--muted); font-size:0.9em; }

.btn {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--accent);
    color: #0a0f1c;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.05s ease, filter 0.1s ease;
    }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.secondary { background: var(--accent-2); color: var(--text); border-color: var(--border); }
.btn.danger { background: var(--danger); color: #fff; }

.field { margin-bottom: 0.6rem; }
label { display: block; margin-bottom: 0.2rem; color: var(--muted); font-size: 0.95em; }
input, textarea, select {
    width: 100%;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0b1322;
    color: var(--text);
}
button { font-family: inherit; }

.flash {
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
}
.flash.success { background: rgba(34, 197, 94, 0.12); color: #bbf7d0; }
.flash.error { background: rgba(239, 68, 68, 0.12); color: #fecdd3; }
.flash.info { background: rgba(96, 165, 250, 0.12); color: #bfdbfe; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.4rem; text-align: left; }
th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
tr + tr { border-top: 1px solid var(--border); }

ul { padding-left: 1rem; }

.ordering-animate { transition: transform 0.2s ease, background-color 0.2s ease; }
.ordering-animate.moved { background: rgba(255,255,255,0.14); transform: scale(1.04); box-shadow: 0 6px 18px rgba(0,0,0,0.25); }

/* Mobile tweaks */
@media (max-width: 640px) {
    body { padding: 0.9rem; font-size: 16px; }
    .nav-header { flex-wrap:wrap; }
    .nav-toggle { display:block; }
    .nav-links { width:100%; flex-direction:column; align-items:flex-start; display:none; }
    .nav-links[data-open="true"] { display:flex; }
    .nav-meta { width:100%; justify-content:flex-start; }
    header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .card { padding: 0.95rem; }
    .btn { width: 100%; text-align: center; }
    input, textarea, select { font-size: 16px; }
    table { font-size: 14px; }
    th, td { padding: 0.5rem 0.3rem; }
}

.theme-pattern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.15;
    z-index: -1;
}
.pattern-jungle { background-image: radial-gradient(circle at 20% 20%, rgba(52,211,153,0.25), transparent 40%), radial-gradient(circle at 80% 60%, rgba(16,185,129,0.25), transparent 45%), url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 140c10-20 30-20 40-40s0-40-20-40-30 20-40 40 10 20 20 40z' fill='%2310b981' fill-opacity='0.25'/%3E%3C/svg%3E"); }
.pattern-winter { background-image: radial-gradient(circle at 30% 30%, rgba(125,211,252,0.25), transparent 40%), radial-gradient(circle at 70% 70%, rgba(191,219,254,0.25), transparent 45%), url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M80 20l10 25 25 10-25 10-10 25-10-25-25-10 25-10z' stroke='%237dd3fc' stroke-opacity='0.4' stroke-width='3' fill='none'/%3E%3C/svg%3E"); }
.pattern-blue { background-image: radial-gradient(circle at 20% 80%, rgba(59,130,246,0.25), transparent 40%), radial-gradient(circle at 70% 20%, rgba(37,99,235,0.25), transparent 40%); }
.pattern-pink { background-image: radial-gradient(circle at 25% 25%, rgba(236,72,153,0.25), transparent 45%), radial-gradient(circle at 75% 70%, rgba(244,114,182,0.2), transparent 45%); }
.pattern-dark { background-image: radial-gradient(circle at 15% 40%, rgba(79,131,255,0.12), transparent 50%), radial-gradient(circle at 70% 70%, rgba(79,131,255,0.08), transparent 55%); }

.celebration .star {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    background: linear-gradient(135deg, #fbbf24, #f97316);
    animation: pop 0.6s ease, spin 1s linear;
}

.confetti::before, .confetti::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle, #f87171 2px, transparent 2px),
        radial-gradient(circle, #34d399 2px, transparent 2px),
        radial-gradient(circle, #60a5fa 2px, transparent 2px),
        radial-gradient(circle, #fbbf24 3px, transparent 3px);
    background-size: 120px 120px;
    animation: fall 2.4s linear infinite;
    opacity: 0.7;
}
.confetti::after { animation-delay: 0.7s; opacity: 0.5; }

@keyframes pop {
    0% { transform: scale(0.6); opacity: 0.3; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes fall {
    0% { background-position: 0 0, 30px 30px, 60px 60px, 90px 90px; }
    100% { background-position: 0 400px, 30px 430px, 60px 460px, 90px 490px; }
}
