* {
    box-sizing: border-box;
}

:root {
    --bg: #090b11;
    --bg-soft: #0f1420;
    --panel: rgba(14, 20, 32, 0.86);
    --panel-strong: #121a29;
    --line: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --muted: #95a2c5;
    --accent: #6ea8fe;
    --accent-strong: #4f8bff;
    --success: #33d17a;
    --warning: #f6c343;
    --danger: #ff6b81;
    --info: #55c2ff;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
    --radius: 20px;
}

html, body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(79, 139, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(51, 209, 122, 0.10), transparent 22%),
        linear-gradient(180deg, #070a10 0%, #090b11 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

input,
textarea,
select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    outline: none;
    transition: 0.2s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(110, 168, 254, 0.75);
    box-shadow: 0 0 0 4px rgba(110, 168, 254, 0.12);
}

label {
    display: grid;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.95rem;
}

label span {
    color: var(--text);
    font-weight: 600;
}

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

h1, h2, h3, p {
    margin-top: 0;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

.app-shell {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 1.35rem;
    border-right: 1px solid var(--line);
    background: rgba(8, 11, 18, 0.85);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
}

.brand {
    display: flex;
    gap: 0.95rem;
    align-items: center;
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(110, 168, 254, 0.14), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(110, 168, 254, 0.18);
    box-shadow: var(--shadow);
}

.brand strong {
    display: block;
    font-size: 1.15rem;
}

.brand small {
    color: var(--muted);
}

.brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #7c5cff);
    color: white;
    box-shadow: 0 14px 28px rgba(79, 139, 255, 0.35);
}

.nav {
    margin-top: 1.4rem;
    display: grid;
    gap: 0.5rem;
}

.nav a {
    color: var(--muted);
    padding: 0.95rem 1rem;
    border-radius: 14px;
    transition: 0.2s ease;
    border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.sidebar-card {
    margin-top: 1.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
}

.mini-label {
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
}

.user-chip {
    font-size: 1rem;
    font-weight: 700;
}

.user-email {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.ghost-link {
    display: inline-block;
    margin-top: 0.9rem;
    color: var(--accent);
    font-weight: 600;
}

.content {
    padding: 1.8rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.7rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    margin-bottom: 0.6rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-grid,
.grid-2,
.category-grid,
.feature-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 2rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.stat-card strong {
    font-size: 2rem;
    line-height: 1;
}

.feature-card,
.category-card,
.task-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.025);
}

.task-list {
    display: grid;
    gap: 0.9rem;
}

.task-card h3,
.category-card h3 {
    margin-bottom: 0.4rem;
}

.task-top,
.task-bottom,
.meta-row,
.section-head,
.inline-actions,
.form-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.task-bottom {
    margin-top: 0.9rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.meta-row {
    justify-content: flex-start;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.33rem 0.7rem;
    font-size: 0.78rem;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
}

.badge.accent {
    color: #d9e8ff;
    background: rgba(79, 139, 255, 0.16);
    border-color: rgba(79, 139, 255, 0.32);
}

.badge.success {
    color: #dfffea;
    background: rgba(51, 209, 122, 0.16);
    border-color: rgba(51, 209, 122, 0.28);
}

.badge.warning {
    color: #fff5d9;
    background: rgba(246, 195, 67, 0.14);
    border-color: rgba(246, 195, 67, 0.28);
}

.badge.danger {
    color: #ffe3e8;
    background: rgba(255, 107, 129, 0.14);
    border-color: rgba(255, 107, 129, 0.28);
}

.badge.info {
    color: #dff6ff;
    background: rgba(85, 194, 255, 0.15);
    border-color: rgba(85, 194, 255, 0.28);
}

.badge.muted {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-weight: 700;
    transition: 0.2s ease;
    border: 1px solid transparent;
}

.btn.primary {
    color: white;
    background: linear-gradient(135deg, var(--accent-strong), #7c5cff);
    box-shadow: 0 14px 28px rgba(79, 139, 255, 0.28);
}

.btn.primary:hover {
    transform: translateY(-1px);
}

.btn.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.text-link {
    color: var(--accent);
    font-weight: 600;
    background: transparent;
    padding: 0;
}

.text-link.danger {
    color: var(--danger);
}

.alert {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--line);
}

.alert.success {
    background: rgba(51, 209, 122, 0.14);
    color: #dfffea;
    border-color: rgba(51, 209, 122, 0.26);
}

.alert.error {
    background: rgba(255, 107, 129, 0.12);
    color: #ffe3e8;
    border-color: rgba(255, 107, 129, 0.24);
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 18px;
    padding: 1.2rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}

.auth-wrap {
    min-height: calc(100vh - 3.6rem);
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 1rem;
    align-items: center;
}

.auth-wrap-single {
    grid-template-columns: 1fr;
    max-width: 840px;
    margin: 0 auto;
}

.auth-hero {
    padding: 1rem;
}

.auth-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    margin-bottom: 1rem;
}

.auth-panel {
    max-width: 520px;
    width: 100%;
    justify-self: end;
}

.auth-panel.wide {
    max-width: none;
    justify-self: stretch;
}

.panel-head {
    margin-bottom: 1.2rem;
}

.stack {
    display: grid;
    gap: 1rem;
}

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-col .full {
    grid-column: 1 / -1;
}

.auth-note {
    margin-top: 1rem;
    color: var(--muted);
}

.auth-note a {
    color: var(--accent);
    font-weight: 600;
}

.form-panel {
    max-width: 900px;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2,
    .auth-wrap,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .auth-panel {
        justify-self: stretch;
        max-width: none;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .content,
    .sidebar {
        padding: 1rem;
    }

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

    .brand {
        padding: 0.85rem;
    }
}
