/* =========================================================
   TASKFLOW
   Global Styles — v2.0.0
========================================================= */

:root {
    --bg: #0b0d12;
    --surface: #11141b;
    --surface-2: #151922;
    --surface-3: #1b1f29;

    --text: #f4f5f7;
    --text-soft: #b2b5bf;
    --text-muted: #747883;
    --text-dim: #626671;

    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.12);

    --accent: #8b7cff;
    --accent-hover: #978aff;
    --accent-soft: rgba(139, 124, 255, 0.12);

    --danger: #ff7272;
    --danger-soft: rgba(255, 114, 114, 0.10);

    --success: #53d69a;
    --warning: #e8ae61;

    --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}


html[data-theme="light"] {

    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #eef0f4;

    --text: #151821;
    --text-soft: #454a56;
    --text-muted: #747985;
    --text-dim: #8b8f99;

    --border: rgba(20, 24, 32, 0.09);
    --border-strong: rgba(20, 24, 32, 0.14);

    --accent: #6f5fe8;
    --accent-hover: #6252dc;
    --accent-soft: rgba(111, 95, 232, 0.10);

    --shadow: 0 20px 60px rgba(20, 24, 32, 0.10);
}


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    -webkit-font-smoothing: antialiased;

    transition:
        background 180ms ease,
        color 180ms ease;
}


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


button {
    border: 0;
    cursor: pointer;
}


button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* =========================================================
   APP
========================================================= */

.app {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(112, 91, 255, 0.08),
            transparent 35%
        ),
        var(--bg);
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: sticky;
    top: 0;

    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 28px 18px;

    border-right: 1px solid var(--border);

    background: color-mix(
        in srgb,
        var(--surface) 92%,
        transparent
    );

    backdrop-filter: blur(20px);

    z-index: 900;
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 10px 34px;
}


.brand-mark {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #8b7cff,
            #5f4ee8
        );

    color: white;

    font-size: 18px;

    box-shadow:
        0 8px 25px rgba(109, 91, 255, 0.25);
}


.brand-text h1 {
    font-size: 17px;
    font-weight: 700;

    letter-spacing: -0.02em;
}


.brand-text span {
    display: block;

    margin-top: 2px;

    color: var(--text-dim);

    font-size: 11px;
}


/* =========================================================
   NAVIGATION
========================================================= */

.navigation {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.nav-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 12px;

    border-radius: var(--radius-md);

    background: transparent;

    color: var(--text-muted);

    text-align: left;

    transition:
        background 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}


.nav-item:hover {
    background: var(--accent-soft);
    color: var(--text);
}


.nav-item.active {
    background: var(--accent-soft);
    color: var(--text);
}


.nav-icon {
    width: 18px;

    display: grid;
    place-items: center;

    color: var(--accent);
}


/* =========================================================
   SIDEBAR SECTIONS
========================================================= */

.sidebar-section {
    margin-top: 34px;
}


.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 10px 10px;

    color: var(--text-dim);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.categories {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.category-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 12px;

    background: transparent;

    color: var(--text-muted);

    border-radius: 9px;

    text-align: left;

    transition:
        background 180ms ease,
        color 180ms ease;
}


.category-item:hover,
.category-item.active {
    background: var(--accent-soft);
    color: var(--text);
}


.category-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 auto;

    border-radius: 50%;
}


.category-dot.purple {
    background: #9b8cff;
}

.category-dot.blue {
    background: #4fa8ff;
}

.category-dot.green {
    background: #53d69a;
}

.category-dot.orange {
    background: #ffad5c;
}

.category-dot.pink {
    background: #ff78b6;
}


.sidebar-footer {
    margin-top: auto;
}


.sidebar-overlay {
    display: none;
}


/* =========================================================
   ICON BUTTON
========================================================= */

.icon-button {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: transparent;

    color: var(--text-muted);

    transition:
        background 180ms ease,
        color 180ms ease;
}


.icon-button:hover {
    background: var(--accent-soft);
    color: var(--text);
}


.icon-button.small {
    width: 28px;
    height: 28px;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
    min-width: 0;
}


/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    height: 76px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 42px;

    border-bottom: 1px solid var(--border);

    background: color-mix(
        in srgb,
        var(--bg) 72%,
        transparent
    );

    backdrop-filter: blur(20px);

    position: sticky;
    top: 0;
    z-index: 100;
}


.topbar-search {
    width: min(420px, 50%);

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 12px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--surface);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}


.topbar-search:focus-within {
    border-color: rgba(139, 124, 255, 0.45);

    box-shadow:
        0 0 0 3px rgba(139, 124, 255, 0.08);
}


.search-icon {
    color: var(--text-dim);
    font-size: 18px;
}


.topbar-search input {
    width: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--text);

    font-size: 13px;
}


.topbar-search input::placeholder {
    color: var(--text-dim);
}


.topbar-search kbd {
    padding: 3px 6px;

    border: 1px solid var(--border);

    border-radius: 5px;

    color: var(--text-dim);

    font-size: 10px;

    white-space: nowrap;
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.avatar {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--surface-3);

    color: var(--text);

    font-size: 12px;
    font-weight: 700;
}


.mobile-menu {
    display: none;
}


/* =========================================================
   PAGE
========================================================= */

.page {
    width: min(1200px, 100%);

    margin: 0 auto;

    padding: 48px 42px 70px;
}


.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 34px;
}


.eyebrow {
    display: block;

    margin-bottom: 8px;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.14em;
}


.page-header h2 {
    font-size: clamp(28px, 4vw, 40px);

    line-height: 1.1;

    letter-spacing: -0.04em;
}


.wave {
    font-size: 0.8em;
}


.page-subtitle {
    margin-top: 10px;

    color: var(--text-muted);

    font-size: 14px;
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button {
    min-height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 17px;

    border-radius: var(--radius-md);

    background: var(--accent);

    color: white;

    font-size: 13px;
    font-weight: 600;

    box-shadow:
        0 8px 24px rgba(139, 124, 255, 0.18);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        background 180ms ease;
}


.primary-button:hover {
    background: var(--accent-hover);

    transform: translateY(-1px);

    box-shadow:
        0 12px 30px rgba(139, 124, 255, 0.25);
}


.secondary-button {
    min-height: 36px;

    padding: 0 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--surface);

    color: var(--text-soft);

    font-size: 12px;

    transition:
        background 180ms ease,
        color 180ms ease,
        border-color 180ms ease;
}


.secondary-button:hover {
    background: var(--surface-3);
    color: var(--text);
    border-color: var(--border-strong);
}


.danger-button {
    min-height: 36px;

    padding: 0 12px;

    border: 1px solid rgba(255, 114, 114, 0.18);

    border-radius: 9px;

    background: var(--danger-soft);

    color: var(--danger);

    font-size: 12px;
    font-weight: 600;

    transition:
        background 180ms ease,
        border-color 180ms ease;
}


.danger-button:hover {
    background: rgba(255, 114, 114, 0.16);

    border-color:
        rgba(255, 114, 114, 0.28);
}


/* =========================================================
   STATISTICS
========================================================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 42px;
}


.stat-card {
    min-height: 110px;

    display: flex;
    align-items: center;

    gap: 14px;

    padding: 20px;

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    background: var(--surface);

    transition:
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}


.stat-card:hover {
    border-color:
        rgba(139, 124, 255, 0.22);

    transform: translateY(-2px);

    box-shadow: var(--shadow);
}


.stat-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border-radius: 10px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 16px;
}


.stat-label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 11px;
}


.stat-value {
    display: block;

    color: var(--text);

    font-size: 22px;

    letter-spacing: -0.03em;
}


.progress-ring {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border: 3px solid rgba(139, 124, 255, 0.15);

    border-top-color: var(--accent);

    border-radius: 50%;

    transition:
        background 300ms ease;
}


.progress-ring.complete {
    border-color: var(--success);
}


.progress-ring span {
    font-size: 9px;
    font-weight: 700;
}


/* =========================================================
   TASK SECTION
========================================================= */

.tasks-section {
    min-width: 0;
}


.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 16px;
}


.tasks-header h3 {
    font-size: 18px;

    letter-spacing: -0.02em;
}


.task-count {
    display: block;

    margin-top: 4px;

    color: var(--text-dim);

    font-size: 11px;
}


.task-controls {
    display: flex;
    gap: 8px;
}


/* =========================================================
   FILTER / CONTROL PANEL
========================================================= */

.control-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-bottom: 14px;

    padding: 10px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--surface);
}


.filter-option {
    padding: 7px 10px;

    border-radius: 7px;

    background: transparent;

    color: var(--text-muted);

    font-size: 11px;
}


.filter-option:hover,
.filter-option.active {
    background: var(--accent-soft);
    color: var(--text);
}


/* =========================================================
   TASK LIST
========================================================= */

.task-list {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


.task-item {
    display: grid;

    grid-template-columns: auto 1fr auto;

    align-items: center;

    gap: 13px;

    padding: 15px 16px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--surface);

    transition:
        background 180ms ease,
        border-color 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}


.task-item:hover {
    background: var(--surface-2);

    border-color: var(--border-strong);

    transform: translateX(2px);
}


.task-item.completed {
    opacity: 0.68;
}


.task-item.completed .task-title {
    color: var(--text-muted);

    text-decoration: line-through;
}


.task-checkbox {
    width: 19px;
    height: 19px;

    display: grid;
    place-items: center;

    border: 1px solid #505460;

    border-radius: 6px;

    background: transparent;

    color: white;

    transition:
        background 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}


.task-checkbox:hover {
    border-color: var(--accent);
}


.task-checkbox.checked {
    background: var(--accent);
    border-color: var(--accent);
}


.task-checkbox.checked::after {
    content: "✓";

    font-size: 11px;
    font-weight: 800;
}


.task-content {
    min-width: 0;
}


.task-title {
    color: var(--text);

    font-size: 13px;
    font-weight: 500;

    word-break: break-word;
}


.task-description {
    margin-top: 4px;

    overflow: hidden;

    color: var(--text-muted);

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.task-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 7px;
}


.priority {
    padding: 3px 7px;

    border-radius: 5px;

    background: var(--surface-3);

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;
}


.priority.high {
    background: rgba(255, 89, 89, 0.10);
    color: #ff8888;
}


.priority.medium {
    background: rgba(255, 186, 73, 0.10);
    color: var(--warning);
}


.priority.low {
    background: rgba(83, 214, 154, 0.10);
    color: var(--success);
}


.task-category {
    padding: 3px 7px;

    border-radius: 5px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 9px;
    font-weight: 700;
}


.task-date {
    color: var(--text-dim);

    font-size: 10px;
}


.task-date.overdue {
    color: var(--danger);
}


.task-actions {
    display: flex;
    gap: 3px;
}


.task-actions .icon-button {
    opacity: 0;
}


.task-item:hover .task-actions .icon-button,
.task-actions .icon-button:focus-visible {
    opacity: 1;
}


/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;

    padding: 70px 20px;

    border: 1px dashed var(--border-strong);

    border-radius: var(--radius-lg);

    text-align: center;
}


.empty-icon {
    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    margin-bottom: 16px;

    border-radius: 15px;

    background: var(--accent-soft);

    color: var(--accent);

    font-size: 20px;
}


.empty-state h3 {
    font-size: 16px;
}


.empty-state p {
    max-width: 360px;

    margin: 8px 0 20px;

    color: var(--text-muted);

    font-size: 12px;

    line-height: 1.6;
}


/* =========================================================
   MODALS
========================================================= */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: grid;
    place-items: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.65);

    backdrop-filter: blur(8px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 180ms ease,
        visibility 180ms ease;
}


.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}


.modal {
    width: min(500px, 100%);

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    padding: 26px;

    border: 1px solid var(--border-strong);

    border-radius: var(--radius-xl);

    background: var(--surface);

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45);

    transform: translateY(10px) scale(0.98);

    transition: transform 180ms ease;
}


.small-modal {
    width: min(430px, 100%);
}


.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}


.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    margin-bottom: 25px;
}


.modal-header h2 {
    font-size: 22px;

    letter-spacing: -0.03em;
}


/* =========================================================
   FORM
========================================================= */

.form-group {
    margin-bottom: 17px;
}


.form-group label {
    display: block;

    margin-bottom: 7px;

    color: var(--text-soft);

    font-size: 11px;
    font-weight: 600;
}


.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;

    border: 1px solid var(--border);

    border-radius: 9px;

    outline: none;

    background: var(--surface-2);

    color: var(--text);

    transition:
        border-color 180ms ease,
        box-shadow 180ms ease;
}


.form-group input,
.form-group select {
    height: 42px;

    padding: 0 12px;
}


.form-group textarea {
    padding: 11px 12px;

    resize: vertical;
}


.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: rgba(139, 124, 255, 0.65);

    box-shadow:
        0 0 0 3px rgba(139, 124, 255, 0.08);
}


.form-group select option {
    background: var(--surface);
    color: var(--text);
}


.form-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;
}


.modal-actions {
    display: flex;
    justify-content: flex-end;

    gap: 8px;

    margin-top: 25px;
}


.confirm-message {
    color: var(--text-muted);

    font-size: 13px;

    line-height: 1.6;
}


/* =========================================================
   SETTINGS
========================================================= */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 15px;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--surface-2);
}


.setting-row strong {
    display: block;

    margin-bottom: 4px;

    font-size: 13px;
}


.setting-row span {
    display: block;

    color: var(--text-muted);

    font-size: 11px;

    line-height: 1.5;
}


/* =========================================================
   TOAST
========================================================= */

.toast {
    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 2000;

    max-width: 320px;

    padding: 12px 16px;

    border: 1px solid var(--border-strong);

    border-radius: 10px;

    background: var(--surface-3);

    color: var(--text);

    font-size: 12px;

    box-shadow: var(--shadow);

    opacity: 0;
    transform: translateY(10px);

    pointer-events: none;

    transition:
        opacity 180ms ease,
        transform 180ms ease;
}


.toast.show {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

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

}


@media (max-width: 760px) {

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


    .sidebar {
        position: fixed;

        left: 0;
        top: 0;

        width: 260px;

        transform: translateX(-100%);

        transition: transform 220ms ease;
    }


    .sidebar.open {
        transform: translateX(0);
    }


    .sidebar-overlay {
        position: fixed;

        inset: 0;

        z-index: 899;

        display: block;

        background: rgba(0, 0, 0, 0.5);

        opacity: 0;
        visibility: hidden;

        transition:
            opacity 220ms ease,
            visibility 220ms ease;
    }


    .sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }


    .mobile-menu {
        width: 34px;
        height: 34px;

        display: grid;
        place-items: center;

        flex: 0 0 auto;

        border-radius: 8px;

        background: transparent;

        color: var(--text-muted);
    }


    .topbar {
        padding: 0 18px;

        gap: 12px;
    }


    .topbar-search {
        width: 100%;
    }


    .topbar-search kbd {
        display: none;
    }


    .page {
        padding: 32px 18px 50px;
    }


    .page-header {
        align-items: flex-start;

        flex-direction: column;
    }


    .page-header .primary-button {
        width: 100%;
    }


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

        gap: 8px;
    }


    .stat-card {
        padding: 15px;
    }


    .tasks-header {
        align-items: flex-start;

        gap: 15px;

        flex-direction: column;
    }


    .task-controls {
        width: 100%;
    }


    .task-controls button {
        flex: 1;
    }


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

}


@media (max-width: 480px) {

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


    .form-row {
        grid-template-columns: 1fr;
    }


    .modal {
        padding: 20px;
    }


    .task-item {
        grid-template-columns: auto 1fr;
    }


    .task-actions {
        grid-column: 2;

        justify-content: flex-end;
    }


    .task-actions .icon-button {
        opacity: 1;
    }


    .toast {
        right: 15px;
        bottom: 15px;
        left: 15px;

        max-width: none;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {

        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;
    }

}
