﻿:root {
    --primary: #6c63ff;
    --primary-dark: #574fd6;
    --background: #f7f8fc;
    --surface: #ffffff;
    --surface-soft: #f9f9fd;
    --text: #171827;
    --text-secondary: #73758a;
    --text-muted: #9a9bad;
    --border: #ececf3;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 250px;
    --shadow: 0 4px 20px rgba(25, 25, 60, 0.04);
    --shadow-hover: 0 10px 30px rgba(25, 25, 60, 0.08);
    --radius: 16px;
}


/* ========================================================= */
/* GLOBAL */
/* ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--text);
}

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

button {
    border: 0;
}

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


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

.app-shell {
    display: flex;
    min-height: 100vh;
    min-width: 0;
}


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

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-header {
    height: 82px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.7px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--primary);
    color: white;
    box-shadow: 0 6px 14px rgba(108, 99, 255, 0.25);
    font-size: 21px;
}

.brand-name span {
    color: var(--primary);
}

.sidebar-close {
    display: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
}


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

.sidebar-nav {
    padding: 8px 14px;
}

.nav-section-title {
    padding: 17px 12px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.1px;
    color: var(--text-muted);
}

.workspace-title {
    margin-top: 10px;
}

.nav-item {
    height: 44px;
    padding: 0 12px;
    margin: 3px 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

    .nav-item span:first-child {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .nav-item i {
        font-size: 17px;
    }

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

    .nav-item.active {
        background: rgba(108, 99, 255, 0.09);
        color: var(--primary);
        font-weight: 600;
    }

.nav-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #f0efff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}


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

.sidebar-categories {
    padding: 12px 14px;
    flex: 1;
    overflow-y: auto;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.icon-button {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    transition: 0.18s ease;
}

    .icon-button:hover {
        background: var(--surface-soft);
        color: var(--primary);
    }

.sidebar-category {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: 0.18s ease;
}

    .sidebar-category:hover {
        background: var(--surface-soft);
        color: var(--text);
    }

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--category-color, var(--primary));
}

.sidebar-category-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
}

.category-loading {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-category.active {
    background: rgba(108, 99, 255, 0.08);
    color: var(--primary);
    font-weight: 600;
}

    .sidebar-category.active
    .category-dot {
        box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.10);
    }


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

.sidebar-bottom {
    padding: 15px 14px;
    border-top: 1px solid var(--border);
}

.sidebar-bottom-item {
    width: 100%;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 9px;
    cursor: pointer;
}

    .sidebar-bottom-item > span {
        display: flex;
        align-items: center;
        gap: 11px;
    }

    .sidebar-bottom-item:hover {
        background: var(--surface-soft);
    }

.theme-switch {
    width: 34px;
    height: 20px;
    padding: 3px;
    border-radius: 20px;
    background: #e9e9f1;
}

    .theme-switch span {
        display: block;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: white;
        transition: transform 0.2s ease;
    }


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

.main-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
}


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

.topbar {
    height: 82px;
    padding: 0 38px;
    background: rgba(247, 248, 252, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(236, 236, 243, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 500;
}

.topbar-search {
    width: 340px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: var(--text-muted);
    transition: 0.2s ease;
}

    .topbar-search:focus-within {
        border-color: rgba(108, 99, 255, 0.4);
        box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.07);
    }

    .topbar-search > i {
        font-size: 15px;
    }

    .topbar-search input {
        width: 100%;
        height: 42px;
        border: 0;
        outline: 0;
        padding: 0 10px;
        background: transparent;
        color: var(--text);
        font-size: 13px;
    }

.search-shortcut {
    width: 23px;
    height: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.topbar-icon-button {
    width: 39px;
    height: 39px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.18s ease;
}

    .topbar-icon-button:hover {
        background: white;
        color: var(--primary);
    }

.notification-button {
    position: relative;
}

.notification-dot {
    width: 6px;
    height: 6px;
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--background);
}


/* ========================================================= */
/* USER */
/* ========================================================= */

.user-menu {
    position: relative;
    margin-left: 7px;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 8px;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

    .user-button:hover {
        background: white;
    }

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: linear-gradient( 135deg, #7c73ff, #5148d8 );
    color: white;
    font-size: 13px;
    font-weight: 700;
}

    .user-avatar.large {
        width: 42px;
        height: 42px;
    }

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

    .user-info strong {
        font-size: 12px;
    }

    .user-info small {
        font-size: 10px;
        color: var(--text-muted);
    }

.user-button > i {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.user-dropdown {
    width: 245px;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    padding: 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 15px 45px rgba(20, 20, 50, 0.13);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: 0.18s ease;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-user-info {
    padding: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
}

    .dropdown-user-info div {
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .dropdown-user-info strong {
        font-size: 13px;
    }

    .dropdown-user-info small {
        margin-top: 2px;
        color: var(--text-muted);
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--border);
}

.dropdown-item-custom {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    text-align: left;
    font-size: 13px;
    cursor: pointer;
}

    .dropdown-item-custom:hover {
        background: var(--surface-soft);
        color: var(--text);
    }

    .dropdown-item-custom.danger:hover {
        color: var(--danger);
    }


/* ========================================================= */
/* MOBILE MENU */
/* ========================================================= */

.mobile-menu-button {
    display: none;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
}


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

.page-container {
    padding: 34px 38px 60px;
    min-width: 0;
    max-width: 100%;
}


/* ========================================================= */
/* WELCOME */
/* ========================================================= */

.welcome-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.welcome-date {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-section h1 {
    margin: 0;
    font-size: 29px;
    font-weight: 750;
    letter-spacing: -1px;
}

.welcome-section p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}


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

.primary-button {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(108, 99, 255, 0.2);
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

    .primary-button:hover {
        background: var(--primary-dark);
        transform: translateY(-1px);
        box-shadow: 0 9px 20px rgba(108, 99, 255, 0.25);
    }

    .primary-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.secondary-button {
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.18s ease;
}

    .secondary-button:hover {
        border-color: #dcdce8;
        background: var(--surface-soft);
        color: var(--text);
    }


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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 24px;
}

.stat-card {
    min-height: 108px;
    position: relative;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card {
    overflow: hidden;
}

    .stat-card::after {
        content: "";
        position: absolute;
        width: 90px;
        height: 90px;
        right: -35px;
        bottom: -45px;
        border-radius: 50%;
        background: rgba(108, 99, 255, 0.035);
        pointer-events: none;
    }

    .stat-card:hover::after {
        transform: scale(1.15);
        transition: transform 0.3s ease;
    }

.stat-icon {
    transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.06);
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }

.stat-icon {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 19px;
}

    .stat-icon.purple {
        background: #efedff;
        color: #6c63ff;
    }

    .stat-icon.orange {
        background: #fff4df;
        color: #f59e0b;
    }

    .stat-icon.green {
        background: #e8f8ee;
        color: #16a34a;
    }

    .stat-icon.blue {
        background: #e9f2ff;
        color: #3b82f6;
    }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .stat-content span {
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 500;
    }

    .stat-content strong {
        font-size: 23px;
        line-height: 1;
        letter-spacing: -0.5px;
    }

.progress-stat {
    overflow: hidden;
}

.stat-progress {
    width: 55px;
    height: 4px;
    position: absolute;
    right: 18px;
    bottom: 20px;
    border-radius: 10px;
    background: #edf0f7;
}

.stat-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--info);
    transition: width 0.5s ease;
}


/* ========================================================= */
/* DASHBOARD GRID */
/* ========================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}

.tasks-panel {
    min-width: 0;
    padding: 23px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}


/* ========================================================= */
/* PANEL HEADER */
/* ========================================================= */

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

    .panel-header h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -0.3px;
    }

    .panel-header p {
        margin: 4px 0 0;
        color: var(--text-muted);
        font-size: 11px;
    }

.task-view-buttons {
    display: flex;
    padding: 3px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.view-button {
    width: 31px;
    height: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

    .view-button.active {
        background: white;
        color: var(--primary);
        box-shadow: 0 2px 6px rgba(20, 20, 50, 0.07);
    }


/* ========================================================= */
/* FILTERS */
/* ========================================================= */

.task-filters {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
}

.filter-tab {
    white-space: nowrap;
    padding: 7px 10px;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.18s ease;
}

    .filter-tab:hover {
        color: var(--text);
    }

    .filter-tab.active {
        background: #f0efff;
        color: var(--primary);
    }

.category-filter {
    height: 34px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-secondary);
    font-size: 11px;
    outline: none;
}


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

.task-list {
    min-height: 120px;
}

.task-item {
    min-height: 69px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 9px;
    border-top: 1px solid #f1f1f5;
    transition: background 0.18s ease, transform 0.18s ease;
}

    .task-item:first-child {
        border-top: 0;
    }

    .task-item:hover {
        background: #fbfbfe;
        border-radius: 10px;
    }

.task-checkbox {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #d5d5df;
    border-radius: 50%;
    background: white;
    color: transparent;
    cursor: pointer;
    transition: 0.2s ease;
}

    .task-checkbox:hover {
        border-color: var(--primary);
        background: #f5f3ff;
    }

.task-item.completed .task-checkbox {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

.task-checkbox i {
    font-size: 13px;
}

.task-main {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    cursor: pointer;
    overflow: hidden;
}

.task-title {
    margin-bottom: 5px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-item.completed .task-title {
    color: var(--text-muted);
    text-decoration: line-through;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.task-category {
    max-width: 130px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-category-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--category-color, var(--primary));
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 9px;
}

    .task-due.overdue {
        color: var(--danger);
        font-weight: 600;
    }

    .task-due.today {
        color: var(--warning);
        font-weight: 600;
    }

.priority-badge {
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

.priority-badge {
    min-width: 52px;
    text-align: center;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 8px;
    letter-spacing: 0.45px;
    transition: transform 0.18s ease;
}

.task-item:hover .priority-badge {
    transform: translateY(-1px);
}

.priority-high {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.priority-medium {
    background: rgba(245, 158, 11, 0.10);
    color: #c77a00;
}

.priority-low {
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

.priority-high {
    background: #fff0f0;
    color: var(--danger);
}

.priority-medium {
    background: #fff7e8;
    color: #d88900;
}

.priority-low {
    background: #edf9f2;
    color: var(--success);
}

.task-actions {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
    transform: translateX(0);
}

.task-action-button {
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

    .task-action-button:hover {
        background: white;
        border-color: var(--border);
        color: var(--primary);
        box-shadow: 0 2px 7px rgba(20, 20, 50, 0.05);
    }

    .task-action-button.delete:hover {
        background: #fff5f5;
        border-color: #ffe0e0;
        color: var(--danger);
    }

.task-action-button {
    width: 31px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

    .task-action-button:hover {
        background: var(--surface-soft);
        color: var(--text);
    }

    .task-action-button.delete:hover {
        color: var(--danger);
    }


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

.empty-state {
    padding: 65px 20px;
    text-align: center;
}

.empty-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #efedff;
    color: var(--primary);
    font-size: 28px;
}

.empty-state h3 {
    margin: 0 0 7px;
    font-size: 15px;
}

.empty-state p {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 12px;
}


/* ========================================================= */
/* LOADING */
/* ========================================================= */

.task-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

    .task-loading .spinner-border {
        width: 18px;
        height: 18px;
        color: var(--primary);
    }


/* ========================================================= */
/* RIGHT SIDE */
/* ========================================================= */

.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.side-card {
    padding: 19px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.side-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 18px;
}

.side-card-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
}

.side-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.today-icon {
    width: 33px;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff6dd;
    color: #f59e0b;
}

.side-action {
    width: 29px;
    height: 29px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-muted);
    cursor: pointer;
}

    .side-action:hover {
        color: var(--primary);
    }


/* ========================================================= */
/* TODAY PROGRESS */
/* ========================================================= */

.today-progress {
    display: flex;
    align-items: center;
    gap: 18px;
}

.progress-ring {
    width: 82px;
    height: 82px;
    position: relative;
    flex-shrink: 0;
}

    .progress-ring svg {
        width: 100%;
        height: 100%;
        transform: rotate(-90deg);
    }

    .progress-ring circle {
        fill: none;
        stroke-width: 4;
    }

.progress-ring-bg {
    stroke: #eeeeF5;
}

.progress-ring-value {
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-dasharray: 100.5;
    stroke-dashoffset: 100.5;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 750;
}

.today-stats {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

    .today-stats div {
        display: flex;
        flex-direction: column;
    }

    .today-stats strong {
        font-size: 15px;
    }

    .today-stats span {
        color: var(--text-muted);
        font-size: 9px;
    }


/* ========================================================= */
/* CATEGORY LIST */
/* ========================================================= */

.category-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-category {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
}

    .dashboard-category .category-dot {
        width: 8px;
        height: 8px;
    }

.dashboard-category-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.dashboard-category-count {
    color: var(--text-muted);
    font-size: 10px;
}


/* ========================================================= */
/* UPCOMING */
/* ========================================================= */

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 9px;
}

.upcoming-date {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--text-secondary);
}

    .upcoming-date strong {
        font-size: 12px;
        line-height: 1;
    }

    .upcoming-date span {
        margin-top: 2px;
        font-size: 7px;
        text-transform: uppercase;
    }

.upcoming-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

    .upcoming-info strong {
        overflow: hidden;
        color: var(--text);
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .upcoming-info span {
        margin-top: 2px;
        color: var(--text-muted);
        font-size: 9px;
    }


/* ========================================================= */
/* MODAL */
/* ========================================================= */

.modern-modal {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(20, 20, 50, 0.18);
}

    .modern-modal .modal-header {
        padding: 21px 23px;
        border-bottom: 1px solid var(--border);
    }

.modal-label {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1px;
}

.modern-modal .modal-title {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text-muted);
    cursor: pointer;
}

    .modal-close:hover {
        color: var(--text);
    }

.modern-modal .modal-body {
    padding: 23px;
}

.modern-modal .modal-footer {
    padding: 15px 23px;
    border-top: 1px solid var(--border);
    gap: 8px;
}

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

    .form-group-modern label {
        display: flex;
        align-items: center;
        gap: 5px;
        margin-bottom: 7px;
        color: var(--text);
        font-size: 11px;
        font-weight: 650;
    }

        .form-group-modern label span {
            color: var(--text-muted);
            font-size: 9px;
            font-weight: 400;
        }

.modern-input {
    width: 100%;
    min-height: 41px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: white;
    color: var(--text);
    font-size: 12px;
    transition: 0.18s ease;
}

textarea.modern-input {
    resize: vertical;
}

.modern-input:focus {
    border-color: rgba(108, 99, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.07);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.color-picker-row {
    display: flex;
    gap: 9px;
}

.color-option {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--category-color);
    cursor: pointer;
    box-shadow: 0 0 0 2px white, 0 0 0 3px transparent;
    transition: 0.18s ease;
}

    .color-option:hover,
    .color-option.selected {
        box-shadow: 0 0 0 2px white, 0 0 0 3px var(--category-color);
    }


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

.modern-toast {
    min-width: 310px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: white;
    box-shadow: 0 15px 45px rgba(20, 20, 50, 0.14);
}

    .modern-toast .toast-body {
        padding: 13px;
        display: flex;
        align-items: center;
        gap: 11px;
    }

.toast-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eaf8ef;
    color: var(--success);
}

.toast-body strong {
    display: block;
    font-size: 11px;
}

.toast-body p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 10px;
}


/* ========================================================= */
/* COMPACT VIEW */
/* ========================================================= */

.task-list.compact .task-item {
    min-height: 52px;
    padding: 7px 9px;
}

.task-list.compact .task-meta {
    display: none;
}

.task-list.compact .task-title {
    margin: 0;
}


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

@media (max-width: 1200px) {

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

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .topbar-search {
        width: 280px;
    }
}


@media (max-width: 1000px) {

    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
            box-shadow: 10px 0 40px rgba(20, 20, 50, 0.12);
        }

    .sidebar-close {
        display: block;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu-button {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar {
        padding: 0 20px;
        gap: 12px;
    }

    .topbar-search {
        flex: 1;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
        max-width: 100%;
    }

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


@media (max-width: 700px) {

    .page-container {
        padding: 24px 16px 40px;
        min-width: 0;
        max-width: 100%;
    }

    .topbar {
        height: 70px;
    }

    .topbar-search {
        display: none;
    }

    .welcome-section {
        align-items: flex-start;
        flex-direction: column;
        gap: 17px;
    }

    .welcome-section h1 {
        font-size: 24px;
    }

    .welcome-micro-stats {
        margin-top: 13px;
        display: inline-flex;
        align-items: center;
        padding: 6px 10px;
        border-radius: 8px;
        background: rgba(108, 99, 255, 0.07);
        color: var(--primary);
        font-size: 10px;
        font-weight: 600;
    }

        .welcome-micro-stats i {
            margin-right: 5px;
        }

    .primary-button {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        min-height: 95px;
        padding: 14px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .stat-content strong {
        font-size: 19px;
    }

    .tasks-panel {
        padding: 16px;
    }

    .task-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .category-filter {
        width: 100%;
    }

    .filter-tabs {
        width: 100%;
    }

    .dashboard-side {
        display: flex;
    }

    .user-info,
    .user-button > i {
        display: none;
    }

    .user-button {
        padding: 3px;
    }

    .task-actions {
        opacity: 1;
    }

    .priority-badge {
        display: none;
    }

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

    .task-smart-summary {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 430px) {

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

    .topbar-actions {
        gap: 2px;
    }

    .welcome-section h1 {
        font-size: 21px;
    }

    .filter-tab {
        font-size: 10px;
    }

    .task-category {
        max-width: 100px;
    }
}

/* ========================================================= */
/* DARK MODE */
/* ========================================================= */

body.dark-mode {
    --background: #111218;
    --surface: #191a22;
    --surface-soft: #20212b;
    --text: #f2f2f7;
    --text-secondary: #aaaaba;
    --text-muted: #77788a;
    --border: #292a35;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

    body.dark-mode .topbar {
        background: rgba(17, 18, 24, 0.9);
        border-color: var(--border);
    }

    body.dark-mode .topbar-search,
    body.dark-mode .topbar-icon-button:hover,
    body.dark-mode .user-button:hover,
    body.dark-mode .user-dropdown,
    body.dark-mode .stat-card,
    body.dark-mode .tasks-panel,
    body.dark-mode .side-card,
    body.dark-mode .modern-input,
    body.dark-mode .category-filter,
    body.dark-mode .secondary-button,
    body.dark-mode .modern-modal,
    body.dark-mode .modern-toast {
        background: var(--surface);
        color: var(--text);
        border-color: var(--border);
    }

    body.dark-mode .task-item:hover {
        background: var(--surface-soft);
    }

    body.dark-mode .view-button.active {
        background: var(--surface-soft);
    }

    body.dark-mode .theme-switch {
        background: var(--primary);
    }

        body.dark-mode .theme-switch span {
            transform: translateX(14px);
        }


/* ========================================================= */
/* PREMIUM TASK ROW */
/* ========================================================= */

.task-item {
    position: relative;
    min-height: 76px;
    padding: 13px 12px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-top: 0;
    border-radius: 11px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .task-item:hover {
        background: #fcfcff;
        border-color: #eeeeF5;
        transform: translateY(-1px);
        box-shadow: 0 5px 18px rgba(30, 30, 70, 0.045);
    }

    .task-item:first-child {
        border-top: 0;
    }

.task-main {
    padding-right: 5px;
}

.task-title {
    font-size: 13px;
    font-weight: 650;
    letter-spacing: -0.1px;
}

.task-meta {
    margin-top: 6px;
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border-width: 1.5px;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

    .task-checkbox:hover {
        transform: scale(1.08);
    }

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

.task-item.completed:hover {
    opacity: 1;
}

.task-smart-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 17px;
}

.smart-summary-item {
    min-height: 52px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

    .smart-summary-item:hover {
        transform: translateY(-1px);
        border-color: #dfdfea;
    }

    .smart-summary-item.active {
        border-color: rgba(108, 99, 255, 0.25);
        background: rgba(108, 99, 255, 0.04);
    }

.smart-summary-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
}

    .smart-summary-icon.today {
        background: #fff5df;
        color: #e28b00;
    }

    .smart-summary-icon.upcoming {
        background: #edf4ff;
        color: #3b82f6;
    }

    .smart-summary-icon.overdue {
        background: #fff0f0;
        color: #ef4444;
    }

.smart-summary-item > span:last-child {
    display: flex;
    flex-direction: column;
}

.smart-summary-item strong {
    font-size: 13px;
    line-height: 1.1;
}

.smart-summary-item small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

/* =========================================================
   TODO DETAIL DRAWER
   ========================================================= */

.todo-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 1090;
}

    .todo-detail-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.todo-detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(460px, 100vw);
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -15px 0 50px rgba(15, 23, 42, 0.12);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(.22, 1, .36, 1);
    z-index: 1100;
    display: flex;
    flex-direction: column;
}

    .todo-detail-drawer.active {
        transform: translateX(0);
    }

.todo-detail-header {
    position: relative;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.todo-detail-close {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

    .todo-detail-close:hover {
        background: rgba(239, 68, 68, .1);
        color: #ef4444;
        transform: rotate(4deg);
    }

.todo-detail-body {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 26px 32px;
    overscroll-behavior: contain;
}

.todo-detail-title-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 28px;
}

.todo-detail-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.todo-detail-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--border-color, #cbd5e1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s ease;
}

    .todo-detail-checkbox.completed {
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

.todo-detail-title {
    max-width: 100%;
    min-width: 0;
    font-size: 25px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.todo-detail-description {
    max-width: 100%;
    min-width: 0;
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.todo-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
}

.todo-detail-meta-item {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.todo-detail-meta-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
}

    .todo-detail-meta-label i {
        width: 20px;
        text-align: center;
    }

.todo-detail-meta-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.todo-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 28px;
}

.todo-detail-action {
    height: 46px;
    border: 0;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .todo-detail-action:hover {
        transform: translateY(-1px);
    }

    .todo-detail-action.primary {
        background: var(--primary);
        color: white;
    }

    .todo-detail-action.secondary {
        background: var(--surface-bg);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }

.todo-detail-delete {
    width: 100%;
    margin-top: 10px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #ef4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

    .todo-detail-delete:hover {
        background: rgba(239, 68, 68, .08);
    }

@media (max-width: 767px) {

    .todo-detail-overlay {
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
    }

    .todo-detail-drawer {
        top: auto;
        right: 0;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: 92vh;
        border-left: 0;
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        transform: translateY(100%);
        box-shadow: 0 -15px 50px rgba(15, 23, 42, 0.18);
    }

        .todo-detail-drawer.active {
            transform: translateY(0);
        }

    .todo-detail-header {
        min-height: 54px;
        padding: 10px 16px;
        justify-content: center;
        border-bottom: 0;
    }

    .todo-detail-drag-handle {
        position: absolute;
        top: 10px;
        left: 50%;
        width: 42px;
        height: 4px;
        transform: translateX(-50%);
        border-radius: 999px;
        background: var(--border-color);
    }

    .todo-detail-close {
        position: absolute;
        right: 14px;
        top: 12px;
        width: 36px;
        height: 36px;
    }

   /* .todo-detail-body {
        padding: 8px 20px calc(24px + env(safe-area-inset-bottom));
    }*/

    .todo-detail-title {
        font-size: 22px;
    }

    .todo-detail-actions {
        position: sticky;
        bottom: 0;
        padding-top: 12px;
        background: var(--card-bg);
        grid-template-columns: 1fr 1fr;
    }

    .todo-detail-action {
        height: 50px;
    }

    .todo-detail-delete {
        height: 46px;
        margin-top: 8px;
    }
}
[data-theme="dark"] .todo-detail-overlay {
    background: rgba(0, 0, 0, .55);
}
body.dark-mode .todo-detail-overlay {
    background: rgba(0, 0, 0, .55);
}
body.todo-detail-open {
    overflow: hidden;
}

/* ========================================================= */
/* MOBILE BOTTOM NAVIGATION */
/* ========================================================= */

.mobile-bottom-nav {
    display: none;
}


/* ========================================================= */
/* MOBILE */
/* ========================================================= */

@media (max-width: 700px) {

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 68px;
        display: grid;
        grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
        align-items: center;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
        z-index: 1100;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) 8px;
    }


    /* ===================================================== */
    /* NORMAL NAV ITEM */
    /* ===================================================== */

    .mobile-nav-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        height: 56px;
        border: 0;
        background: transparent;
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }


        .mobile-nav-item i {
            font-size: 20px;
            line-height: 1;
            transition: transform 0.2s ease, color 0.2s ease;
        }


        .mobile-nav-item span {
            line-height: 1;
        }


        /* ===================================================== */
        /* ACTIVE */
        /* ===================================================== */

        .mobile-nav-item.active {
            color: var(--primary);
        }


            .mobile-nav-item.active i {
                transform: translateY(-1px);
            }


            .mobile-nav-item.active::before {
                content: "";
                position: absolute;
                top: -6px;
                left: 50%;
                transform: translateX(-50%);
                width: 24px;
                height: 3px;
                border-radius: 0 0 4px 4px;
                background: var(--primary);
            }


    /* ===================================================== */
    /* CENTER ADD BUTTON */
    /* ===================================================== */

    .mobile-nav-add {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        height: 64px;
        border: 0;
        background: transparent;
        color: var(--primary);
        font-size: 10px;
        font-weight: 700;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }


    .mobile-nav-add-icon {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: var(--primary);
        color: #ffffff;
        box-shadow: 0 6px 18px rgba(108, 99, 255, 0.30);
        transform: translateY(-8px);
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }


        .mobile-nav-add-icon i {
            font-size: 23px;
        }


    .mobile-nav-add:active
    .mobile-nav-add-icon {
        transform: translateY(-6px) scale(0.95);
        box-shadow: 0 3px 10px rgba(108, 99, 255, 0.25);
    }


    .mobile-nav-add > span:last-child {
        transform: translateY(-7px);
    }


    /* ===================================================== */
    /* CONTENT BOTTOM SPACE */
    /* ===================================================== */

    body {
        padding-bottom: 76px;
    }


    /* ===================================================== */
    /* DRAWER / MODAL COMPATIBILITY */
    /* ===================================================== */

    .todo-detail-drawer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================================= */
/* MOBILE MORE BOTTOM SHEET */
/* ========================================================= */

.mobile-more-overlay {
    display: none;
}


.mobile-more-sheet {
    display: none;
}


@media (max-width: 700px) {

    /* ===================================================== */
    /* OVERLAY */
    /* ===================================================== */

    .mobile-more-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 16, 25, 0.45);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 1190;
    }


        .mobile-more-overlay.active {
            display: block;
            opacity: 1;
            pointer-events: auto;
        }


    /* ===================================================== */
    /* SHEET */
    /* ===================================================== */

    .mobile-more-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: block;
        background: var(--surface);
        border-radius: 22px 22px 0 0;
        border-top: 1px solid var(--border);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 1200;
        padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
        max-height: 80vh;
        overflow-y: auto;
    }


        .mobile-more-sheet.active {
            transform: translateY(0);
        }


    /* ===================================================== */
    /* HANDLE */
    /* ===================================================== */

    .mobile-more-handle {
        width: 38px;
        height: 4px;
        margin: 2px auto 16px;
        border-radius: 999px;
        background: var(--border);
    }


    /* ===================================================== */
    /* HEADER */
    /* ===================================================== */

    .mobile-more-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 2px 16px;
    }


    .mobile-more-eyebrow {
        display: block;
        margin-bottom: 3px;
        color: var(--text-muted);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 0.12em;
    }


    .mobile-more-header h3 {
        margin: 0;
        color: var(--text);
        font-size: 20px;
        font-weight: 700;
    }


    .mobile-more-close {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 50%;
        background: var(--surface-soft);
        color: var(--text-secondary);
        font-size: 16px;
        cursor: pointer;
    }


    /* ===================================================== */
    /* CONTENT */
    /* ===================================================== */

    .mobile-more-content {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }


    /* ===================================================== */
    /* ITEM */
    /* ===================================================== */

    .mobile-more-item {
        width: 100%;
        min-height: 64px;
        display: flex;
        align-items: center;
        gap: 13px;
        padding: 9px 10px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--text);
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }


        .mobile-more-item:active {
            background: var(--surface-soft);
            transform: scale(0.99);
        }


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

    .mobile-more-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        background: rgba(108, 99, 255, 0.09);
        color: var(--primary);
        font-size: 18px;
    }


    /* ===================================================== */
    /* TEXT */
    /* ===================================================== */

    .mobile-more-item-content {
        min-width: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }


        .mobile-more-item-content strong {
            color: var(--text);
            font-size: 14px;
            font-weight: 650;
        }


        .mobile-more-item-content small {
            color: var(--text-muted);
            font-size: 11px;
        }


    .mobile-more-arrow {
        color: var(--text-muted);
        font-size: 14px;
    }


    /* ===================================================== */
    /* THEME TOGGLE */
    /* ===================================================== */

    .mobile-theme-toggle {
        width: 42px;
        height: 24px;
        flex: 0 0 42px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 3px;
        border-radius: 999px;
        background: var(--border);
        transition: background 0.2s ease;
    }


        .mobile-theme-toggle i {
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: var(--surface);
            color: var(--text-muted);
            font-size: 10px;
        }


    /* ===================================================== */
    /* DANGER */
    /* ===================================================== */

    .mobile-more-item.danger {
        margin-top: 4px;
        border-top: 1px solid var(--border);
        border-radius: 0 0 14px 14px;
        padding-top: 13px;
    }


        .mobile-more-item.danger
        .mobile-more-icon {
            background: rgba(239, 68, 68, 0.09);
            color: var(--danger);
        }


        .mobile-more-item.danger
        strong {
            color: var(--danger);
        }

    body.mobile-sheet-open {
        overflow: hidden;
    }

}

/* ========================================================= */
/* MOBILE TODO MODAL */
/* ========================================================= */

@media (max-width: 700px) {

    #todoModal .modal-dialog {
        width: 100%;
        max-width: none;
        margin: 0;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        margin-bottom: 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier( 0.22, 1, 0.36, 1 );
    }


    #todoModal.show .modal-dialog {
        transform: translateY(0);
    }


    #todoModal .modal-content {
        border: 0;
        border-radius: 22px 22px 0 0;
        background: var(--surface);
        color: var(--text);
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }


    #todoModal .modal-header {
        position: relative;
        padding: 18px 18px 12px;
        border-bottom: 1px solid var(--border);
    }


        /*
     * Bottom sheet handle
     */

        #todoModal .modal-header::before {
            content: "";
            position: absolute;
            top: 7px;
            left: 50%;
            transform: translateX(-50%);
            width: 38px;
            height: 4px;
            border-radius: 999px;
            background: var(--border);
        }


    #todoModal .modal-title {
        padding-top: 6px;
        font-size: 18px;
        font-weight: 700;
    }


    #todoModal .modal-body {
        padding: 18px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
        min-height: 0;
    }


    #todoModal .modal-footer {
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: var(--surface);
        flex: 0 0 auto;
    }


        /*
     * Full-width action buttons
     */

        #todoModal .modal-footer button {
            min-height: 48px;
            flex: 1;
        }


    /*
     * Form controls
     */

    #todoModal input:not([type="checkbox"]),
    #todoModal textarea,
    #todoModal select {
        min-height: 46px;
        font-size: 16px;
    }


    #todoModal textarea {
        min-height: 110px;
    }


    /*
     * Make the close button easier
     * to touch
     */

    #todoModal .btn-close {
        width: 40px;
        height: 40px;
        padding: 10px;
        border-radius: 50%;
    }


    /*
     * Prevent background scrolling
     */

    body:has(#todoModal.show) {
        overflow: hidden;
    }
}

/* ========================================================= */
/* TODO DATE / TIME */
/* ========================================================= */

.todo-datetime-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 12px;
}


.todo-sub-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}


    .todo-sub-label span {
        color: var(--text-muted);
        font-weight: 500;
    }


@media (max-width: 700px) {

    .todo-datetime-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}


@media (max-width: 430px) {

    .todo-datetime-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ========================================================= */
/* MOBILE TASK SWIPE */
/* ========================================================= */

.task-swipe-action,
.task-swipe-actions-right {
    display: none;
}

.task-swipe-content {
    display: contents;
}


@media (max-width: 700px) {

    .task-item {
        position: relative;
        overflow: hidden;
        padding: 0;
        min-height: 69px;
        border-radius: 11px;
        touch-action: pan-y;
        background: var(--surface);
        isolation: isolate;
    }


    .task-swipe-content {
        position: relative;
        z-index: 3;
        min-height: 69px;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        display: flex;
        align-items: center;
        gap: 13px;
        padding: 11px 9px;
        background: var(--surface);
        transform: translateX(0);
        transition: transform 0.22s ease;
        will-change: transform;
        touch-action: pan-y;
        overflow: hidden;
    }


    /* Sağ swipe için sol taraftaki alan */

    .task-swipe-action {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 100px;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        background: var(--success);
        color: white;
        font-size: 10px;
        font-weight: 600;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.15s ease, visibility 0.15s ease;
    }
    .task-item.swipe-right .task-swipe-action {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }


        .task-swipe-action i {
            font-size: 20px;
        }


        .task-swipe-action span {
            font-size: 9px;
        }


    /* Sol swipe için sağdaki alan */

    .task-swipe-actions-right {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 150px;
        z-index: 1;
        display: flex;
        align-items: stretch;
        background: var(--surface-soft);
    }


    .swipe-action-button {
        width: 75px;
        border: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        font-size: 9px;
        font-weight: 600;
        cursor: pointer;
    }


        .swipe-action-button i {
            font-size: 18px;
        }


    .swipe-edit {
        background: rgba(108, 99, 255, 0.12);
        color: var(--primary);
    }


    .swipe-delete {
        background: rgba(239, 68, 68, 0.12);
        color: #ef4444;
    }


    .swipe-action-button:active {
        filter: brightness(0.94);
    }


    /* Swipe açıkken */

    .task-item.swipe-right
    .task-swipe-content {
        transform: translateX(100px);
    }


    .task-item.swipe-left
    .task-swipe-content {
        transform: translateX(-150px);
    }


    /* Swipe sırasında hover efektini kapat */

    .task-item:hover {
        background: var(--surface);
        transform: none;
        box-shadow: none;
    }


    /* Swipe sırasında task content hover da olmasın */

    .task-swipe-content:hover {
        background: var(--surface);
    }


    /* Mobilde eski sağdaki edit/delete butonlarını gizle.
       Swipe ile yeni butonları kullanacağız. */

    .task-swipe-content .task-actions {
        display: none;
    }
}
.swipe-complete {
    border: 0;
    margin: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

/* ========================================================= */
/* NOTIFICATION CENTER */
/* ========================================================= */

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}


.notification-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 16, 24, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1250;
    backdrop-filter: blur(3px);
}


    .notification-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }


.notification-panel {
    position: fixed;
    background: var(--surface);
    z-index: 1260;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}


.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}


    .notification-panel-header h3 {
        margin: 0;
        color: var(--text);
        font-size: 17px;
        font-weight: 700;
    }


    .notification-panel-header span {
        display: block;
        margin-top: 3px;
        color: var(--text-muted);
        font-size: 11px;
    }


.notification-close-button {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}


.notification-list {
    flex: 1;
    overflow-y: auto;
}


.notification-item {
    position: relative;
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}


    .notification-item:hover {
        background: var(--surface-soft);
    }


    .notification-item.unread {
        background: rgba(108, 99, 255, 0.045);
    }


        .notification-item.unread::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--primary);
        }


.notification-item-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: rgba(108, 99, 255, 0.10);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}


.notification-item-content {
    min-width: 0;
    flex: 1;
}


.notification-item-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
}


.notification-item-message {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}


.notification-item-date {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 10px;
}


.notification-unread-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--primary);
}


.notification-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}


.notification-read-all-button {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
}


    .notification-read-all-button:hover {
        color: var(--primary);
    }


.notification-empty {
    flex: 1;
    min-height: 250px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.notification-empty-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}


.notification-empty strong {
    color: var(--text);
    font-size: 14px;
}


.notification-empty span {
    max-width: 240px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}


.notification-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}


/* ========================================================= */
/* MOBILE */
/* ========================================================= */

@media (max-width: 700px) {

    .notification-panel {
        left: 0;
        right: 0;
        bottom: 0;
        height: min( 82vh, 680px );
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        transition: transform 0.30s ease;
        padding-bottom: env(safe-area-inset-bottom);
    }


        .notification-panel.active {
            transform: translateY(0);
        }


    .notification-panel-handle {
        width: 42px;
        height: 4px;
        margin: 9px auto 3px;
        border-radius: 99px;
        background: var(--border);
    }


    .notification-panel-header {
        padding: 13px 16px 14px;
    }


    .notification-list {
        -webkit-overflow-scrolling: touch;
    }


    .notification-item {
        padding: 14px 16px;
    }


    .notification-panel-footer {
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    }
}


/* ========================================================= */
/* DESKTOP */
/* ========================================================= */

@media (min-width: 701px) {

    .notification-panel {
        top: 74px;
        right: 22px;
        width: 390px;
        max-height: calc(100vh - 95px);
        border-radius: 16px;
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }


        .notification-panel.active {
            opacity: 1;
            transform: translateY(0) scale(1);
            pointer-events: auto;
        }


    .notification-panel-handle {
        display: none;
    }
}


/* ========================================================= */
/* BODY LOCK MOBILE */
/* ========================================================= */

body.notification-panel-open {
    overflow: hidden;
}

/* =========================================================
   NOTIFICATION CENTER - TASK GROUPS
   ========================================================= */

.notification-group {
    padding: 14px 16px 4px;
}

    .notification-group + .notification-group {
        border-top: 1px solid var(--border);
        margin-top: 6px;
    }

.notification-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
}

.notification-group-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

    .notification-group-title i {
        font-size: 13px;
    }

    .notification-group-title.overdue {
        color: var(--danger);
    }

    .notification-group-title.today {
        color: #e49a00;
    }

    .notification-group-title.tomorrow {
        color: var(--primary);
    }

.notification-group-count {
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
}

.notification-group-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notification-task-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    border: 1px solid transparent;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
}

    .notification-task-item:hover {
        background: var(--surface-soft);
        border-color: var(--border);
    }

    .notification-task-item.unread {
        background: var(--surface-soft);
    }

        .notification-task-item.unread:hover {
            box-shadow: 0 4px 14px rgba(20, 20, 40, 0.06);
        }

    .notification-task-item.read {
        opacity: 0.68;
    }

.notification-task-icon {
    width: 31px;
    height: 31px;
    min-width: 31px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.notification-task-item.overdue .notification-task-icon {
    background: rgba(220, 53, 69, 0.11);
    color: var(--danger);
}

.notification-task-item.today .notification-task-icon {
    background: rgba(228, 154, 0, 0.12);
    color: #d58c00;
}

.notification-task-item.tomorrow .notification-task-icon {
    background: rgba(108, 99, 255, 0.11);
    color: var(--primary);
}

.notification-task-content {
    min-width: 0;
    flex: 1;
}

.notification-task-top {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.notification-task-title {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-task-message {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.4;
}

.notification-task-meta {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 10px;
}

.notification-unread-dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.notification-empty {
    padding: 44px 24px;
    text-align: center;
}

.notification-empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 21px;
}

.notification-empty-title {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.notification-empty-text {
    max-width: 240px;
    margin: 6px auto 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}
@media (max-width: 700px) {

    .notification-group {
        padding-left: 13px;
        padding-right: 13px;
    }

    .notification-task-item {
        padding: 10px;
    }

    .notification-task-title {
        font-size: 12px;
    }

    .notification-task-message {
        font-size: 10.5px;
    }
}

.notification-task-arrow {
    display: flex;
    align-items: center;
    align-self: center;
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.65;
    transition: transform 0.18s ease;
}

.notification-task-item:hover
.notification-task-arrow {
    transform: translateX(2px);
}

.notification-task-due {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 10.5px;
}

    .notification-task-due i {
        font-size: 10px;
    }

.notification-task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.notification-task-tag {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 2px 7px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

    .notification-task-tag.priority-low {
        background: rgba(25, 135, 84, 0.10);
        color: #198754;
    }

    .notification-task-tag.priority-medium {
        background: rgba(228, 154, 0, 0.12);
        color: #c58200;
    }

    .notification-task-tag.priority-high {
        background: rgba(220, 53, 69, 0.10);
        color: var(--danger);
    }

.notification-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 3px 8px 3px 6px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
}

.notification-category-dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    border-radius: 50%;
    background: var( --notification-category-color, var(--primary) );
}

/* ========================================================= */
/* NOTIFICATION + TODO DETAIL */
/* ========================================================= */

body.notification-detail-open .todo-detail-overlay {
    z-index: 1250;
}

body.notification-detail-open .todo-detail-drawer {
    z-index: 1280;
}

/* ========================================================= */
/* EMAIL REMINDER */
/* ========================================================= */

.email-reminder-group {
    margin-top: 4px;
}

.email-reminder-option {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    transition: 0.18s ease;
}

    .email-reminder-option:has( #todoEmailReminder:checked ) {
        border-color: rgba(108, 99, 255, 0.35);
        background: rgba(108, 99, 255, 0.06);
    }

    .email-reminder-option .form-check {
        margin: 0;
    }

    .email-reminder-option .form-check-input {
        width: 18px;
        height: 18px;
        min-height: 18px !important;
        margin-top: 0;
        margin-right: 8px;
        flex-shrink: 0;
        cursor: pointer;
    }

    .email-reminder-option .form-check-label {
        margin: 0;
        color: var(--text);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
    }

    .email-reminder-option .form-check-input:checked {
        background-color: var(--primary);
        border-color: var(--primary);
    }

    .email-reminder-option .form-check-input:focus {
        box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
    }

    .email-reminder-option .form-check-input:disabled {
        cursor: not-allowed;
        opacity: 0.55;
    }

.email-reminder-settings {
    margin-top: 10px;
}

    .email-reminder-settings .todo-sub-label {
        margin-bottom: 6px;
    }

.email-reminder-verification-message,
.email-reminder-date-message {
    line-height: 1.45;
}

@media (max-width: 700px) {

    #todoModal {
        z-index: 1200;
    }

    .modal-backdrop {
        z-index: 1190;
    }
}

@media (max-width: 430px) {

    .email-reminder-option {
        min-height: 42px;
        padding: 9px 11px;
    }

        .email-reminder-option .form-check-label {
            font-size: 12px;
        }

    .email-reminder-settings {
        margin-top: 8px;
    }

    .email-reminder-verification-message,
    .email-reminder-date-message {
        font-size: 11px;
    }
}

/* ========================================================= */
/* FINAL MOBILE TODO MODAL FIX */
/* ========================================================= */

@media (max-width: 700px) {

    /*
     * Bootstrap'ın ortak backdrop z-index'i 1990 olduğu için
     * kategori modal'ları da backdrop'un üzerinde tutulmalı.
     */
    #categoryModal,
    #categoryManagementModal {
        z-index: 2000 !important;
    }

    /* ----------------------------------------------------- */
    /* Todo modal bottom-sheet                                */
    /* ----------------------------------------------------- */

    #todoModal {
        z-index: 2000 !important;
        padding: 0 !important;
    }

        #todoModal .modal-dialog {
            width: 100% !important;
            max-width: none !important;
            height: auto !important;
            margin: 0 !important;
            position: fixed !important;
            left: 0 !important;
            right: 0 !important;
            bottom: 0 !important;
            transform: translateY(100%) !important;
            transition: transform 0.28s cubic-bezier(.22, 1, .36, 1) !important;
        }

        #todoModal.show .modal-dialog {
            transform: translateY(0) !important;
        }

        #todoModal .modal-content {
            width: 100% !important;
            height: calc(100dvh - 10px) !important;
            max-height: calc(100dvh - 10px) !important;
            min-height: 0 !important;
            display: flex !important;
            flex-direction: column !important;
            margin: 0 !important;
            border: 0 !important;
            border-radius: 22px 22px 0 0 !important;
            background: var(--surface) !important;
            color: var(--text) !important;
            overflow: hidden !important;
        }


        /* ----------------------------------------------------- */
        /* Header                                                 */
        /* ----------------------------------------------------- */

        #todoModal .modal-header {
            position: relative !important;
            flex: 0 0 auto !important;
            padding: 20px 18px 13px !important;
            border-bottom: 1px solid var(--border) !important;
            background: var(--surface) !important;
        }

            #todoModal .modal-header::before {
                content: "";
                position: absolute;
                top: 7px;
                left: 50%;
                width: 38px;
                height: 4px;
                transform: translateX(-50%);
                border-radius: 999px;
                background: var(--border);
            }

        #todoModal .modal-title {
            padding-top: 5px !important;
            margin: 0 !important;
            font-size: 18px !important;
            font-weight: 700 !important;
            line-height: 1.2 !important;
        }

        #todoModal .btn-close {
            width: 36px !important;
            height: 36px !important;
            padding: 9px !important;
            margin: 0 !important;
            border-radius: 10px !important;
        }


        /* ----------------------------------------------------- */
        /* Body                                                   */
        /* ----------------------------------------------------- */

        #todoModal .modal-body {
            flex: 1 1 auto !important;
            min-height: 0 !important;
            padding: 18px !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            -webkit-overflow-scrolling: touch;
        }


        /* ----------------------------------------------------- */
        /* Form controls                                           */
        /* ----------------------------------------------------- */

        #todoModal input:not([type="checkbox"]),
        #todoModal textarea,
        #todoModal select {
            width: 100% !important;
            min-height: 46px !important;
            font-size: 16px !important;
        }

        #todoModal textarea {
            min-height: 110px !important;
        }


    /* ----------------------------------------------------- */
    /* EMAIL CHECKBOX - Bootstrap'tan bağımsız                */
    /* ----------------------------------------------------- */

    #todoEmailReminder {
        appearance: none !important;
        -webkit-appearance: none !important;
        position: static !important;
        width: 20px !important;
        min-width: 20px !important;
        max-width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        max-height: 20px !important;
        flex: 0 0 20px !important;
        margin: 0 9px 0 0 !important;
        padding: 0 !important;
        border: 1.5px solid #d5d5df !important;
        border-radius: 6px !important;
        background-color: var(--surface) !important;
        background-image: none !important;
        box-shadow: none !important;
        cursor: pointer;
        vertical-align: middle !important;
        transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
    }

        #todoEmailReminder:checked {
            background-color: var(--primary) !important;
            border-color: var(--primary) !important;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m3.2 8.2 3.1 3.1 6.5-6.6'/%3E%3C/svg%3E") !important;
            background-position: center !important;
            background-repeat: no-repeat !important;
            background-size: 14px 14px !important;
        }

        #todoEmailReminder:focus {
            outline: none !important;
            box-shadow: 0 0 0 3px rgba(108, 99, 255, .12) !important;
        }

        #todoEmailReminder:disabled {
            opacity: .5 !important;
            cursor: not-allowed !important;
        }

    .email-reminder-option {
        width: 100% !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        padding: 10px 12px !important;
        border: 1px solid var(--border) !important;
        border-radius: 10px !important;
        background: var(--surface-soft) !important;
    }

        .email-reminder-option .form-check {
            width: 100% !important;
            display: flex !important;
            align-items: center !important;
            margin: 0 !important;
            padding: 0 !important;
        }

        .email-reminder-option .form-check-label {
            margin: 0 !important;
            padding: 0 !important;
            color: var(--text) !important;
            font-size: 12px !important;
            font-weight: 600 !important;
            line-height: 20px !important;
            cursor: pointer;
        }


    /* ----------------------------------------------------- */
    /* Footer                                                 */
    /* ----------------------------------------------------- */

    #todoModal .modal-footer {
        flex: 0 0 auto !important;
        display: flex !important;
        gap: 10px !important;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom)) 18px !important;
        border-top: 1px solid var(--border) !important;
        background: var(--surface) !important;
    }

        #todoModal .modal-footer button {
            width: auto !important;
            min-width: 0 !important;
            min-height: 48px !important;
            flex: 1 1 0 !important;
            margin: 0 !important;
            border-radius: 10px !important;
        }


    /* ----------------------------------------------------- */
    /* Bottom navigation                                      */
    /* ----------------------------------------------------- */

    /*
       Todo modal açıkken alttaki navigation
       kesinlikle görünmemeli.
    */

    body:has(#todoModal.show) .mobile-bottom-nav {
        display: none !important;
    }

    body:has(#todoModal.show) {
        padding-bottom: 0 !important;
        overflow: hidden !important;
    }


    /* ----------------------------------------------------- */
    /* Backdrop                                                */
    /* ----------------------------------------------------- */

    .modal-backdrop {
        z-index: 1990 !important;
    }
}


/* ========================================================= */
/* SMALL PHONES                                               */
/* ========================================================= */

@media (max-width: 430px) {

    #todoModal .modal-body {
        padding: 16px !important;
    }

    #todoModal .modal-footer {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    #todoModal .form-group-modern {
        margin-bottom: 14px !important;
    }

    .email-reminder-option {
        min-height: 42px !important;
        padding: 9px 11px !important;
    }
}

/* ========================================================= */
/* CATEGORY MANAGEMENT */
/* ========================================================= */

.category-management-modal {
    max-height: min(760px, calc(100vh - 40px));
}


.category-management-subtitle {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}


.category-management-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}


    .category-management-toolbar > div {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }


    .category-management-toolbar strong {
        color: var(--text);
        font-size: 14px;
    }


    .category-management-toolbar span {
        color: var(--text-muted);
        font-size: 11px;
    }


.category-management-add-button {
    min-height: 38px;
    padding: 8px 14px;
    white-space: nowrap;
}


.category-management-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 470px;
    overflow-y: auto;
    padding-right: 2px;
}


.category-management-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}


    .category-management-item:hover {
        border-color: rgba(108, 99, 255, 0.25);
        transform: translateY(-1px);
    }


.category-management-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}


.category-management-dot {
    width: 12px;
    height: 12px;
    min-width: 12px;
    border-radius: 50%;
    background: var(--category-color, var(--primary));
    box-shadow: 0 0 0 4px color-mix( in srgb, var(--category-color, var(--primary)) 12%, transparent );
}


.category-management-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}


    .category-management-text strong {
        color: var(--text);
        font-size: 13px;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


    .category-management-text span {
        color: var(--text-muted);
        font-size: 10.5px;
    }


.category-management-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}


.category-management-action {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.18s ease;
}


    .category-management-action:hover {
        transform: translateY(-1px);
    }


    .category-management-action.edit:hover {
        color: var(--primary);
        border-color: rgba(108, 99, 255, 0.30);
        background: rgba(108, 99, 255, 0.06);
    }


    .category-management-action.delete:hover {
        color: var(--danger);
        border-color: rgba(220, 53, 69, 0.25);
        background: rgba(220, 53, 69, 0.06);
    }


    .category-management-action i {
        font-size: 13px;
    }


.category-management-loading,
.category-management-empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    color: var(--text-muted);
    text-align: center;
}


.category-management-loading {
    flex-direction: row;
}


.category-management-empty-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 20px;
    margin-bottom: 3px;
}


.category-management-empty strong {
    color: var(--text);
    font-size: 13px;
}


.category-management-empty span {
    max-width: 280px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}


.category-management-empty .secondary-button {
    margin-top: 6px;
}


/* ========================================================= */
/* CATEGORY MANAGEMENT - MOBILE */
/* ========================================================= */

@media (max-width: 700px) {

    #categoryManagementModal .modal-dialog {
        width: calc(100% - 20px);
        max-width: none;
        margin: 10px auto;
    }

    #categoryManagementModal .modal-content {
        max-height: calc(100dvh - 20px);
        overflow: hidden;
    }

    #categoryModal .modal-dialog {
        width: calc(100% - 24px);
        max-width: 420px;
        margin: 12px auto;
    }

    .category-management-modal {
        max-height: calc(100dvh - 20px);
    }


    .category-management-list {
        max-height: calc(100dvh - 250px);
    }


    .category-management-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }


    .category-management-add-button {
        width: 100%;
        justify-content: center;
    }


    .category-management-item {
        min-height: 64px;
        padding: 11px 12px;
    }


    .category-management-action {
        width: 38px;
        height: 38px;
    }
}


@media (max-width: 430px) {

    .category-management-modal {
        margin: 5px;
    }


        .category-management-modal .modal-body {
            padding: 14px;
        }


    .category-management-item {
        gap: 10px;
    }


    .category-management-text strong {
        max-width: 150px;
    }
}