:root {
    --bg: #f4f8ff;
    --ink: #1e293b;
    --soft: #475569;
    --accent: #db2777;
    --accent-2: #0284c7;
    --card: #ffffffcc;
    --line: #dbe7ff;
    --line-strong: #b9d2ff;
    --ok: #166534;
    --danger: #9f1239;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 12%, #fbcfe890 0, transparent 30%),
        radial-gradient(circle at 88% 18%, #bae6fd80 0, transparent 30%),
        radial-gradient(circle at 92% 88%, #c7d2fe80 0, transparent 30%),
        linear-gradient(135deg, #f4f8ff 0%, #edf4ff 45%, #f0f9ff 100%);
    min-height: 100vh;
    transition: background 240ms ease, color 240ms ease;
}

.shell {
    width: min(1100px, 92%);
    margin: 2.5rem auto;
}

.home-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.3rem;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.09);
    backdrop-filter: blur(3px);
}

.hero {
    text-align: left;
    animation: fade-up 500ms ease;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    right: -48px;
    top: -64px;
    border-radius: 50%;
    background: radial-gradient(circle, #f9a8d480 0%, #f9a8d400 70%);
    pointer-events: none;
}

.hero::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -96px;
    bottom: -138px;
    border-radius: 50%;
    background: radial-gradient(circle, #93c5fd70 0%, #93c5fd00 70%);
    pointer-events: none;
}

.badge {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #7e22ce;
    background: linear-gradient(135deg, #f5d0fe 0%, #dbeafe 100%);
    border: 1px solid #d8b4fe;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
}

h1,
h2 {
    font-family: "Space Grotesk", sans-serif;
    margin: 0.7rem 0;
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h2 {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
}

p {
    color: var(--soft);
    line-height: 1.5;
}

.actions,
.top-actions,
.top-actions-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.actions,
.top-actions {
    margin-top: 1rem;
}

.top-actions {
    margin-top: 0;
    margin-bottom: 1rem;
    justify-content: space-between;
    align-items: center;
}

.btn {
    text-decoration: none;
    border: 1px solid var(--line-strong);
    color: var(--ink);
    padding: 0.68rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    background: #ffffff;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.btn.primary {
    background: linear-gradient(135deg, #db2777 0%, #9333ea 100%);
    color: #fff;
    border-color: #be185d;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(59, 130, 246, 0.2);
}

.btn.active {
    background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.btn.ghost {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.btn.ghost:hover {
    background: #dbeafe;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.hint {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: #6b5f52;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid #c4b5fd;
    color: #5b21b6;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.stats {
    margin-top: 1.2rem;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.stat {
    padding: 0.9rem;
    border-radius: 14px;
    border: 1px solid #cfe0ff;
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.stat:nth-child(1) {
    border-color: #f9a8d4;
    background: linear-gradient(145deg, #fff 0%, #fdf2f8 100%);
}

.stat:nth-child(2) {
    border-color: #93c5fd;
    background: linear-gradient(145deg, #fff 0%, #eff6ff 100%);
}

.stat:nth-child(3) {
    border-color: #c4b5fd;
    background: linear-gradient(145deg, #fff 0%, #f5f3ff 100%);
}

.stat strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

.split {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
}

.layout {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

form {
    display: grid;
    gap: 0.85rem;
}

.grid-2 {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr 1fr;
}

label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e3a8a;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 0.35rem;
    border-radius: 10px;
    border: 1px solid #c9dcff;
    padding: 0.7rem;
    font: inherit;
    background: #fcfeff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px #ddd6fe;
}

small {
    color: var(--soft);
}

.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.list li {
    border: 1px dashed #bfdbfe;
    border-radius: 10px;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
}

.empty-state {
    text-align: center;
    padding: 1.2rem;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: #7b6f61;
    background: #fff;
}

.msg {
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 0.92rem;
}

.msg.ok {
    color: var(--ok);
    background: #dcfce7;
}

.msg.error {
    color: var(--danger);
    background: #ffe4e6;
}

.list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.count-badge {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #e0e7ff 0%, #fce7f3 100%);
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    .split {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .top-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .top-actions-left {
        width: 100%;
    }

    .top-actions .btn.ghost {
        width: 100%;
    }

    .home-topbar {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --ink: #e2e8f0;
    --soft: #94a3b8;
    --accent: #f472b6;
    --accent-2: #38bdf8;
    --card: #111b2fd9;
    --line: #243552;
    --line-strong: #3a5279;
    --ok: #4ade80;
    --danger: #fb7185;
}

:root[data-theme="dark"] body {
    background:
        radial-gradient(circle at 10% 10%, #a21caf33 0, transparent 30%),
        radial-gradient(circle at 88% 18%, #0284c733 0, transparent 32%),
        radial-gradient(circle at 92% 88%, #4f46e533 0, transparent 30%),
        linear-gradient(140deg, #0b1220 0%, #0f172a 50%, #111827 100%);
}

:root[data-theme="dark"] .card {
    box-shadow: 0 18px 40px rgba(2, 8, 23, 0.45);
}

:root[data-theme="dark"] .btn {
    background: #0f1b33;
    color: #dbeafe;
    border-color: #334b74;
}

:root[data-theme="dark"] .btn.primary {
    background: linear-gradient(135deg, #ec4899 0%, #7c3aed 100%);
    border-color: #be185d;
    color: #ffffff;
}

:root[data-theme="dark"] .btn.active {
    background: linear-gradient(135deg, #1e293b 0%, #1e1b4b 100%);
    border-color: #6366f1;
    color: #c7d2fe;
}

:root[data-theme="dark"] .btn.ghost {
    background: #132136;
    border-color: #35527f;
    color: #93c5fd;
}

:root[data-theme="dark"] .btn.ghost:hover {
    background: #1a2b47;
}

:root[data-theme="dark"] .badge {
    color: #e9d5ff;
    background: linear-gradient(135deg, #581c87 0%, #1e3a8a 100%);
    border-color: #7e22ce;
}

:root[data-theme="dark"] .tag {
    color: #ddd6fe;
    background: linear-gradient(135deg, #312e81 0%, #1e3a8a 100%);
    border-color: #6366f1;
}

:root[data-theme="dark"] .stat,
:root[data-theme="dark"] .stat:nth-child(1),
:root[data-theme="dark"] .stat:nth-child(2),
:root[data-theme="dark"] .stat:nth-child(3) {
    border-color: #2b4268;
    background: linear-gradient(145deg, #111b2f 0%, #0f1a2e 100%);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
    background: #0f1b33;
    color: #e2e8f0;
    border-color: #334b74;
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] select:focus,
:root[data-theme="dark"] textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px #0ea5e933;
}

:root[data-theme="dark"] .list li {
    border-color: #2d466f;
    background: linear-gradient(145deg, #0f1b33 0%, #132136 100%);
}

:root[data-theme="dark"] .count-badge {
    background: linear-gradient(135deg, #312e81 0%, #3b0764 100%);
    color: #ddd6fe;
    border-color: #6366f1;
}

:root[data-theme="dark"] .msg.ok {
    background: #052e16;
    color: #86efac;
}

:root[data-theme="dark"] .msg.error {
    background: #4c0519;
    color: #fda4af;
}