:root {
    color-scheme: dark;
    --bg-deep: #06111f;
    --bg-panel: rgba(9, 17, 31, 0.88);
    --bg-panel-soft: rgba(15, 23, 42, 0.76);
    --line-soft: rgba(148, 163, 184, 0.16);
    --text-strong: #e5eefc;
    --text-body: #c0d0e7;
    --text-muted: #8ea3bf;
    --brand-1: #4f46e5;
    --brand-2: #0891b2;
    --brand-3: #22c55e;
}

* {
    box-sizing: border-box;
}

html {
    background: #020817;
}

body {
    font-family: 'Manrope', sans-serif;
    margin: 0;
    color: var(--text-strong);
    text-rendering: optimizeLegibility;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 320px 1fr;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(8, 145, 178, 0.18), transparent 30%),
        radial-gradient(circle at 50% 100%, rgba(34, 197, 94, 0.08), transparent 32%),
        linear-gradient(180deg, #020617, #08111f 45%, #0a1424);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    border-right: 1px solid var(--line-soft);
    background:
        linear-gradient(180deg, rgba(6, 17, 31, 0.97), rgba(5, 11, 24, 0.98)),
        linear-gradient(135deg, rgba(79, 70, 229, 0.06), transparent);
    backdrop-filter: blur(18px);
}

.brand-mark {
    width: 3.5rem;
    height: 3.5rem;
    display: grid;
    place-items: center;
    border-radius: 1.4rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #4f46e5, #0891b2);
    font-weight: 800;
    letter-spacing: 0.18em;
    box-shadow: 0 18px 40px rgba(79, 70, 229, 0.25);
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    color: var(--text-body);
    transition: 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.nav-link:hover,
.nav-link.is-active {
    color: white;
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.16), rgba(8, 145, 178, 0.12));
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.main-panel {
    padding: 2rem 2rem 3rem;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.glass-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--line-soft);
    background: rgba(8, 17, 31, 0.62);
    color: var(--text-strong);
    text-decoration: none;
    backdrop-filter: blur(14px);
}

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

.stat-card,
.panel,
.habit-card,
.goal-card,
.notification-card {
    border: 1px solid var(--line-soft);
    background:
        linear-gradient(180deg, rgba(10, 20, 36, 0.96), rgba(8, 17, 31, 0.86)),
        linear-gradient(135deg, rgba(79, 70, 229, 0.06), transparent);
    box-shadow: 0 26px 70px rgba(1, 7, 16, 0.42);
    border-radius: 1.5rem;
    overflow: hidden;
}

.stat-card {
    padding: 1.5rem;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0;
}

.stat-card h3 {
    margin-top: 0.75rem;
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    font-weight: 800;
    line-height: 1.05;
    color: #ffffff;
}

.stat-card.accent {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(8, 145, 178, 0.82));
}

.panel {
    padding: 1.5rem;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.panel-head h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0.2rem 0 0;
    color: #f8fbff;
}

.panel-kicker,
.eyebrow {
    color: #8dd4ff;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.16);
    color: #e0e7ff;
    font-size: 0.8rem;
    border: 1px solid rgba(129, 140, 248, 0.24);
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-body);
    vertical-align: top;
}

.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
}

.status-chip {
    display: inline-flex;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pending { background: rgba(250, 204, 21, 0.18); color: #fde68a; }
.status-in-progress { background: rgba(59, 130, 246, 0.18); color: #bfdbfe; }
.status-completed { background: rgba(34, 197, 94, 0.18); color: #bbf7d0; }
.status-blocked { background: rgba(248, 113, 113, 0.18); color: #fecaca; }

.btn-primary,
.btn-secondary,
.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-weight: 700;
    transition: 0.2s ease;
}

.btn-primary {
    padding: 0.95rem 1.15rem;
    background: linear-gradient(135deg, #4f46e5, #0891b2);
    color: white;
    border: 0;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(79, 70, 229, 0.28);
}

.btn-secondary {
    padding: 0.9rem 1.15rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.btn-small {
    padding: 0.55rem 0.85rem;
    background: rgba(79, 70, 229, 0.2);
    color: #dbeafe;
    font-size: 0.78rem;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.btn-muted {
    background: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.btn-success {
    background: rgba(34, 197, 94, 0.24);
    color: #bbf7d0;
}

.form-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #d5e0f2;
}

.form-input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 20, 36, 0.9);
    color: #f8fbff;
    outline: none;
    appearance: none;
}

.form-input:focus {
    border-color: rgba(129, 140, 248, 0.55);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.form-input::placeholder {
    color: #8fa3bf;
}

select.form-input option {
    color: #f8fbff;
    background: #0b1728;
}

textarea.form-input {
    resize: vertical;
}

.kanban-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.kanban-column {
    min-height: 24rem;
    padding: 1rem;
    border-radius: 1.3rem;
    background: rgba(8, 17, 31, 0.68);
    border: 1px solid var(--line-soft);
}

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

.kanban-dropzone {
    min-height: 18rem;
    display: grid;
    gap: 0.85rem;
}

.kanban-card {
    padding: 1rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(19, 31, 52, 0.88), rgba(11, 22, 37, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.14);
    cursor: grab;
    box-shadow: 0 12px 24px rgba(3, 8, 18, 0.26);
}

.kanban-card h5,
.habit-card h4,
.goal-card h4,
.notification-card h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #f8fbff;
    margin: 0;
}

.kanban-card p,
.habit-card p,
.goal-card p,
.notification-card p {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.priority-dot {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.priority-low { background: #22c55e; }
.priority-medium { background: #eab308; }
.priority-high { background: #f97316; }
.priority-critical { background: #ef4444; }

.habit-card,
.goal-card,
.notification-card {
    padding: 1.35rem;
}

.progress-track {
    height: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
}

.notification-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.notification-card.is-read {
    opacity: 0.7;
}

.notification-card span {
    display: block;
    margin-top: 0.45rem;
    color: #7c93b1;
    font-size: 0.78rem;
}

.mini-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.mini-metric span {
    color: var(--text-muted);
}

.mini-metric strong {
    font-size: 1.05rem;
    color: #f8fbff;
}

.alert {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    font-weight: 600;
}

.alert-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.alert-error {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.26), transparent 30%),
        radial-gradient(circle at bottom right, rgba(8, 145, 178, 0.22), transparent 30%),
        linear-gradient(180deg, #030712, #08111f 55%, #0a1424);
    color: white;
}

.auth-grid {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
    align-items: center;
    gap: 3rem;
    padding: 3rem clamp(1.4rem, 3vw, 3.5rem);
}

.auth-hero {
    max-width: 42rem;
}

.auth-hero h1 {
    margin-top: 1rem;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 0.95;
    font-weight: 800;
    max-width: 12ch;
    letter-spacing: -0.04em;
}

.auth-copy {
    max-width: 40rem;
    margin-top: 1.5rem;
    color: #d3ddef;
    font-size: 1.05rem;
    line-height: 1.75;
}

.auth-points {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.auth-points div,
.auth-card {
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
}

.auth-points div {
    padding: 1.15rem 1.2rem;
    max-width: 34rem;
    color: #eff6ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-card {
    max-width: 34rem;
    width: 100%;
    justify-self: end;
    padding: 2.2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 252, 0.96));
    color: #0f172a;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.38);
}

.auth-card .form-label {
    color: #1e293b;
}

.auth-card .form-input {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #d7dfeb;
}

.auth-card .form-input::placeholder {
    color: #8090a6;
}

.auth-card .btn-primary {
    min-height: 3.4rem;
}

.auth-note {
    margin-top: 1.5rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: #eef4ff;
    border: 1px solid #d8e4fb;
}

.auth-note strong,
.auth-note span,
.auth-note p,
.auth-note li {
    color: #24364d;
}

.auth-note p {
    margin: 0 0 0.55rem;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-note ul {
    margin: 0;
    padding-left: 1rem;
}

.auth-note li + li {
    margin-top: 0.35rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.85rem;
}

.calendar-header div {
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.calendar-cell {
    min-height: 9rem;
    padding: 0.8rem;
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-cell.is-muted {
    opacity: 0;
    pointer-events: none;
}

.calendar-day {
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.calendar-event {
    padding: 0.55rem 0.6rem;
    border-radius: 0.8rem;
    margin-bottom: 0.45rem;
    font-size: 0.78rem;
}

.calendar-event.task {
    background: rgba(37, 99, 235, 0.16);
    color: #dbeafe;
}

.calendar-event.habit {
    background: rgba(34, 197, 94, 0.16);
    color: #d1fae5;
}

canvas {
    width: 100% !important;
    min-height: 280px;
}

a {
    color: inherit;
}

strong {
    color: inherit;
}

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

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

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

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

    .auth-card {
        justify-self: start;
    }
}

@media (max-width: 900px) {
    .auth-grid,
    .stats-grid,
    .kanban-grid,
    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .notification-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-panel {
        padding: 1.2rem;
    }

    .auth-grid {
        padding: 1.2rem;
    }

    .auth-card {
        justify-self: stretch;
        max-width: none;
        padding: 1.4rem;
    }

    .sidebar,
    .panel,
    .stat-card {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .auth-hero h1 {
        max-width: none;
    }

    .topbar-meta {
        width: 100%;
    }
}