* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    margin: 0;
    padding: 16px 24px;
    min-height: 100vh;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 0 16px;
    border-bottom: 1px solid #e5e5e5;
}

.header-center {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.header-center h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.today-info { display: flex; align-items: center; gap: 12px; }
#todayDate { font-size: 14px; color: #666; font-weight: 400; }

.task-count-badge {
    background: #1a1a1a;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mini-calendar { min-width: 220px; margin: 0; }

.mini-calendar-title {
    text-align: center;
    font-size: 11px;
    font-weight: 400;
    color: #1a1a1a;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    text-align: center;
}

.mini-calendar-header {
    font-size: 8px;
    font-weight: 600;
    color: #999;
    padding: 1px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.mini-calendar-day {
    font-size: 9px;
    color: #1a1a1a;
    padding: 1px 0;
    cursor: pointer;
    position: relative;
    line-height: 1.2;
    border-radius: 4px;
    transition: background 0.15s;
}

.mini-calendar-day:hover { background: rgba(0,0,0,0.05); }
.mini-calendar-day.empty { color: transparent; cursor: default; }
.mini-calendar-day.empty:hover { background: transparent; }
.mini-calendar-day.other-month { color: #ccc; }

.mini-calendar-day.today {
    background: #4f46e5;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-weight: 600;
    font-size: 8px;
}

.mini-calendar-day.today:hover { background: #4338ca; }

.mini-calendar-day.has-tasks::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #4f46e5;
}

.mini-calendar-day.today.has-tasks::after { background: white; }

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover { background: #e0e0e0; }

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr) 1fr;
    gap: 0;
    margin-bottom: 32px;
}

.day { padding: 0 10px; border-right: 1px solid #f0f0f0; position: relative; }
.day:last-child { border-right: none; }

.weekend-column {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #f0f0f0;
}

.weekend-day { flex: 1; padding: 0 10px; position: relative; }
.weekend-day:first-child { border-bottom: 1px solid #f0f0f0; }

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    margin-bottom: 0;
    border-bottom: 2px solid #1a1a1a;
}

.day.today .day-header { border-bottom-color: #4f46e5; }
.day-date { font-size: 16px; font-weight: 700; color: #1a1a1a; }
.day.today .day-date { color: #4f46e5; }
.day.weekend .day-date { color: #999; }
.day-name { font-size: 13px; color: #999; font-weight: 400; }
.day.today .day-name { color: #4f46e5; font-weight: 600; }

.tasks {
    display: flex;
    flex-direction: column;
    gap: 0;
    cursor: pointer;
    min-height: 280px;
    background-image: linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
    background-size: 100% 40px;
    background-position: 0 0;
}

.weekend-day .tasks { min-height: 160px; }

.task {
    height: 40px;
    padding: 0 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
    cursor: pointer;
    position: relative;
    background: transparent;
    flex-shrink: 0;
}

.task:hover { background: rgba(0,0,0,0.03); border-radius: 4px; }
.task.dragging { opacity: 0.4; }
.task.completed .task-text { text-decoration: line-through; color: #999; }
.task.completed .task-time { text-decoration: line-through; color: #bbb; }

.task-time { font-size: 13px; font-weight: 600; color: #666; white-space: nowrap; min-width: 45px; }

.task-text {
    flex: 1;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-color-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.task-color-dot.red { background: #e74c3c; }
.task-color-dot.orange { background: #f39c12; }
.task-color-dot.yellow { background: #f1c40f; }
.task-color-dot.green { background: #2ecc71; }
.task-color-dot.blue { background: #3498db; }
.task-color-dot.purple { background: #9b59b6; }

.task .delete-btn {
    background: none; border: none; color: #ccc; cursor: pointer;
    font-size: 16px; padding: 0 4px; opacity: 0; transition: opacity 0.2s;
}
.task:hover .delete-btn { opacity: 1; }
.task .delete-btn:hover { color: #e74c3c; }

.task-checkbox {
    width: 16px; height: 16px; border: 2px solid #ddd; border-radius: 4px;
    cursor: pointer; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; transition: all 0.2s;
}
.task-checkbox:hover { border-color: #4f46e5; }
.task.completed .task-checkbox { background: #4f46e5; border-color: #4f46e5; }
.task.completed .task-checkbox::after { content: '✓'; color: white; font-size: 11px; font-weight: bold; }

.task-input-container {
    height: 40px; padding: 0 8px; background: transparent;
    display: flex; align-items: center; position: relative; flex-shrink: 0;
}

.task-input-row { display: flex; gap: 8px; align-items: center; flex: 1; max-width: 100%; }

.task-input-row input[type="time"] {
    width: 80px; padding: 0 8px; border: 1px solid #e0e0e0; border-radius: 6px;
    font-size: 13px; font-family: inherit; outline: none; background: white; color: #333; height: 28px;
}
.task-input-row input[type="time"]:focus { border-color: #4f46e5; }

.task-input {
    flex: 1; padding: 0 8px; border: 1px solid #e0e0e0; border-radius: 6px;
    font-size: 14px; font-family: inherit; outline: none; background: white; height: 28px;
}
.task-input:focus { border-color: #4f46e5; }
.task-input::placeholder { color: #bbb; }

.color-trigger {
    width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
    border: 2px solid #ddd; flex-shrink: 0; transition: all 0.2s;
}
.color-trigger:hover { transform: scale(1.1); border-color: #999; }

.color-dropdown {
    position: absolute; top: 42px; left: 8px; background: white;
    border: 1px solid #e0e0e0; border-radius: 8px; padding: 8px;
    display: flex; gap: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 100;
}
.color-dropdown .color-dot {
    width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
    border: 2px solid transparent; transition: all 0.2s;
}
.color-dropdown .color-dot:hover { transform: scale(1.2); }

.day.drag-over { background: #f5f3ff; border-radius: 4px; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.task { animation: slideIn 0.2s ease; }

.someday-section {
    margin-top: 32px; padding-top: 20px; border-top: 1px solid #e5e5e5; position: relative;
}
.someday-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.someday-title { font-size: 18px; font-weight: 600; color: #999; margin: 0; }

.someday-menu-btn {
    background: none; border: none; font-size: 24px; color: #999;
    cursor: pointer; padding: 4px 12px; border-radius: 6px; transition: all 0.2s; letter-spacing: 2px;
}
.someday-menu-btn:hover { background: rgba(0,0,0,0.05); color: #1a1a1a; }

.someday-dropdown {
    position: absolute; top: 50px; right: 24px; background: #e8e8f5;
    border: 1px solid #d0d0e0; border-radius: 8px; padding: 8px 0;
    min-width: 180px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); z-index: 100; display: none;
}
.someday-dropdown.show { display: block; }
.someday-dropdown-item { padding: 10px 16px; cursor: pointer; font-size: 14px; color: #1a1a1a; transition: background 0.15s; }
.someday-dropdown-item:hover { background: rgba(0,0,0,0.05); }
.someday-dropdown-item.delete-col { color: #e74c3c; }

.someday-columns { display: flex; gap: 24px; overflow-x: auto; padding-bottom: 16px; }
.someday-column { flex: 1; min-width: 200px; max-width: 300px; background: #fafafa; border-radius: 12px; padding: 16px; position: relative; }
.someday-column-tasks {
    display: flex; flex-direction: column; gap: 0; min-height: 120px;
    background-image: linear-gradient(to bottom, #e5e5e5 1px, transparent 1px);
    background-size: 100% 40px; background-position: 0 0; cursor: pointer;
}
.someday-column-tasks .task { background: transparent; }
.someday-column.drag-over-col { background: #f0f0ff; }

/* ===== МЕНЮ КАЛЕНДАРЕЙ ===== */
.calendar-menu {
    position: fixed; top: 80px; right: 24px; width: 320px; background: #e8e8f5;
    border-radius: 16px; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 2000; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s;
}
.calendar-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.calendar-menu-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #d0d0e0;
}
.calendar-menu-title { font-size: 18px; font-weight: 700; color: #1a1a1a; }
.calendar-menu-close {
    background: none; border: none; font-size: 18px; color: #666;
    cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: all 0.2s;
}
.calendar-menu-close:hover { background: rgba(0,0,0,0.05); color: #1a1a1a; }
.calendar-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.calendar-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: rgba(255,255,255,0.5); border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.calendar-item:hover { background: rgba(255,255,255,0.8); }
.calendar-item.active { background: rgba(79, 70, 229, 0.2); border: 1px solid #4f46e5; }
.calendar-item-icon { font-size: 20px; }
.calendar-item-name { flex: 1; font-size: 14px; color: #1a1a1a; font-weight: 500; }
.calendar-item-delete {
    background: none; border: none; color: #ccc; cursor: pointer;
    font-size: 16px; padding: 0 4px; opacity: 0; transition: all 0.2s;
}
.calendar-item:hover .calendar-item-delete { opacity: 1; }
.calendar-item-delete:hover { color: #e74c3c; }
.add-calendar-btn {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: transparent; border: 1px dashed #999; border-radius: 8px;
    cursor: pointer; font-size: 14px; color: #666; font-family: inherit; transition: all 0.2s; width: 100%;
}
.add-calendar-btn:hover { border-color: #4f46e5; color: #4f46e5; background: rgba(79, 70, 229, 0.05); }
.calendar-menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calendar-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 16px 12px; background: rgba(255,255,255,0.5); border: none;
    border-radius: 12px; cursor: pointer; font-size: 13px; color: #1a1a1a; font-family: inherit; transition: all 0.2s;
}
.calendar-action-btn:hover { background: rgba(255,255,255,0.8); }
.action-icon { font-size: 24px; }

/* ===== ПОИСК ===== */
.search-modal {
    position: fixed; top: 80px; right: 24px; width: 400px; max-height: 600px;
    background: white; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2000; opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.3s; display: flex; flex-direction: column;
}
.search-modal.show { opacity: 1; visibility: visible; transform: translateY(0); }
.search-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid #e5e5e5; }
.search-input {
    flex: 1; padding: 10px 16px; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 15px; font-family: inherit; outline: none; background: white; color: #1a1a1a;
}
.search-input:focus { border-color: #4f46e5; }
.search-input::placeholder { color: #999; }
.search-close {
    background: none; border: none; font-size: 20px; color: #666;
    cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: all 0.2s;
}
.search-close:hover { background: rgba(0,0,0,0.05); color: #1a1a1a; }
.search-results { overflow-y: auto; max-height: 500px; padding: 8px 0; }
.search-result-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    cursor: pointer; transition: background 0.15s; border-left: 3px solid transparent;
}
.search-result-item:hover { background: rgba(79, 70, 229, 0.05); border-left-color: #4f46e5; }
.search-result-date { font-size: 12px; color: #999; min-width: 80px; font-weight: 500; }
.search-result-content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.search-result-text { font-size: 14px; color: #1a1a1a; font-weight: 500; }
.search-result-text mark { background: #fef08a; padding: 0 2px; border-radius: 2px; }
.search-result-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #999; }
.search-no-results { padding: 32px 16px; text-align: center; color: #999; font-size: 14px; display: none; }
.search-no-results.show { display: block; }

/* ===== ОКНО НАСТРОЕК ===== */
.settings-modal {
    position: fixed;
    top: 80px;
    right: 24px;
    width: 360px;
    max-height: 70vh;
    background: #f0f0f5;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.dark-mode .settings-modal {
    background: #1a1a2e;
}

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

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .settings-header {
    border-bottom-color: #2a2a2a;
}

.settings-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

body.dark-mode .settings-title {
    color: #fff;
}

.settings-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.settings-close-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #1a1a1a;
}

body.dark-mode .settings-close-btn {
    color: #999;
}

body.dark-mode .settings-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.settings-content {
    overflow-y: auto;
    max-height: calc(70vh - 60px);
    padding: 8px 0;
}

.settings-section {
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .settings-section {
    border-bottom-color: #2a2a2a;
}

.settings-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

body.dark-mode .settings-section-header {
    color: #e5e5e5;
}

.settings-section-header:hover {
    background: rgba(0,0,0,0.05);
}

body.dark-mode .settings-section-header:hover {
    background: rgba(255,255,255,0.05);
}

.section-arrow {
    font-size: 18px;
    color: #999;
    transition: transform 0.3s;
}

.settings-section.open .section-arrow {
    transform: rotate(90deg);
}

.settings-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255,255,255,0.3);
}

body.dark-mode .settings-section-content {
    background: rgba(255,255,255,0.03);
}

.settings-section.open .settings-section-content {
    max-height: 500px;
    padding: 12px 20px 20px;
}

.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .settings-option {
    border-bottom-color: #2a2a2a;
}

.settings-option:last-child {
    border-bottom: none;
}

.option-label {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

body.dark-mode .option-label {
    color: #e5e5e5;
}

.option-select {
    padding: 6px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #1a1a1a;
    cursor: pointer;
    outline: none;
    min-width: 120px;
}

body.dark-mode .option-select {
    background: #0f0f0f;
    border-color: #2a2a2a;
    color: #fff;
}

.settings-section-title {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 12px;
    font-weight: 600;
}

.themes-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .themes-list {
    border-color: #2a2a2a;
}

.theme-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    color: #1a1a1a;
}

body.dark-mode .theme-item {
    color: #e5e5e5;
}

.theme-item:hover {
    background: rgba(0,0,0,0.05);
}

body.dark-mode .theme-item:hover {
    background: rgba(255,255,255,0.05);
}

.theme-item:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

body.dark-mode .theme-item:not(:last-child) {
    border-bottom-color: #2a2a2a;
}

.theme-item.active {
    background: rgba(79, 70, 229, 0.1);
}

body.dark-mode .theme-item.active {
    background: rgba(129, 140, 248, 0.1);
}

.theme-item.active .theme-check {
    color: #4f46e5;
    font-weight: bold;
}

.settings-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #1a1a1a;
}

body.dark-mode .settings-info {
    background: rgba(129, 140, 248, 0.1);
    color: #e5e5e5;
}

.settings-info-sub {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.settings-placeholder {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.option-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

body.dark-mode .option-group-title {
    color: #fff;
}

.option-radio {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 8px;
}

body.dark-mode .option-radio {
    border-color: #2a2a2a;
    color: #e5e5e5;
}

.option-radio:hover {
    background: rgba(0,0,0,0.03);
}

body.dark-mode .option-radio:hover {
    background: rgba(255,255,255,0.03);
}

.option-radio.active {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
}

.option-radio.active::after {
    content: '✓';
    float: right;
    color: #4f46e5;
    font-weight: bold;
}

/* ===== МОДАЛЬНОЕ ОКНО РЕДАКТИРОВАНИЯ ===== */
.task-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); display: flex; align-items: center;
    justify-content: center; z-index: 3000; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.task-modal-overlay.active { opacity: 1; visibility: visible; }
.task-modal {
    background: #f0f0f5; border-radius: 16px; width: 90%; max-width: 600px;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: scale(0.9); transition: transform 0.3s;
}
.task-modal-overlay.active .task-modal { transform: scale(1); }
.task-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px 16px; border-bottom: 1px solid #e0e0e0;
}
.task-modal-date { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #666; }
.task-modal-actions { display: flex; gap: 8px; }
.task-modal-action-btn {
    background: none; border: none; font-size: 18px; cursor: pointer;
    color: #666; padding: 6px; transition: all 0.2s; border-radius: 6px;
}
.task-modal-action-btn:hover { color: #1a1a1a; background: rgba(0,0,0,0.05); }
.task-modal-action-btn.delete:hover { color: #e74c3c; }
.task-modal-body { padding: 24px; }
.task-modal-title-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.task-modal-title {
    flex: 1; font-size: 22px; font-weight: 600; border: none; background: transparent;
    outline: none; color: #1a1a1a; font-family: inherit; min-height: 32px; padding: 4px 0; line-height: 1.3;
}
.task-modal-title:empty::before { content: attr(data-placeholder); color: #999; }
.task-modal-title b, .task-modal-title strong { font-weight: 700; }
.task-modal-title i, .task-modal-title em { font-style: italic; }
.task-modal-title ul, .task-modal-title ol { margin: 8px 0; padding-left: 24px; }
.task-modal-checkbox {
    width: 28px; height: 28px; border: 2px solid #ddd; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s; flex-shrink: 0;
}
.task-modal-checkbox:hover { border-color: #4f46e5; }
.task-modal-checkbox.completed { background: #4f46e5; border-color: #4f46e5; }
.task-modal-checkbox.completed::after { content: '✓'; color: white; font-size: 16px; font-weight: bold; }
.formatting-toolbar {
    display: flex; gap: 4px; padding: 12px 0;
    border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; margin-bottom: 20px;
}
.format-btn {
    background: none; border: none; font-size: 15px; cursor: pointer; color: #666;
    padding: 6px 10px; border-radius: 4px; transition: all 0.2s; font-weight: 600; user-select: none;
}
.format-btn:hover { background: rgba(0,0,0,0.05); color: #1a1a1a; }
.format-btn.active { background: rgba(0,0,0,0.1); color: #4f46e5; }
.task-modal-field { margin-bottom: 16px; }
.task-modal-field-label {
    font-size: 12px; color: #999; margin-bottom: 8px; display: block;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500;
}
.task-modal-time-input {
    width: 100%; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 14px; font-family: inherit; outline: none; background: white; color: #1a1a1a; box-sizing: border-box;
}
.task-modal-time-input:focus { border-color: #4f46e5; }
.task-modal-color-picker { display: flex; gap: 8px; }
.task-modal-color-dot {
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    border: 3px solid transparent; transition: all 0.2s;
}
.task-modal-color-dot:hover { transform: scale(1.15); }
.task-modal-color-dot.selected { border-color: #1a1a1a; }
.task-modal-color-dot.red { background: #e74c3c; }
.task-modal-color-dot.orange { background: #f39c12; }
.task-modal-color-dot.yellow { background: #f1c40f; }
.task-modal-color-dot.green { background: #2ecc71; }
.task-modal-color-dot.blue { background: #3498db; }
.task-modal-color-dot.purple { background: #9b59b6; }
.task-modal-textarea {
    width: 100%; min-height: 80px; padding: 12px; border: 1px solid #e0e0e0;
    border-radius: 8px; font-size: 14px; font-family: inherit; resize: vertical;
    outline: none; background: white; color: #1a1a1a; box-sizing: border-box;
}
.task-modal-textarea:focus { border-color: #4f46e5; }
.task-modal-textarea::placeholder { color: #999; }
.subtasks-list { margin-top: 8px; }
.subtask-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.subtask-checkbox {
    width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 4px;
    cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.subtask-checkbox.checked { background: #4f46e5; border-color: #4f46e5; }
.subtask-checkbox.checked::after { content: '✓'; color: white; font-size: 12px; font-weight: bold; }
.subtask-text { flex: 1; font-size: 14px; color: #1a1a1a; }
.subtask-text.completed { text-decoration: line-through; color: #999; }
.subtask-delete { background: none; border: none; color: #ccc; cursor: pointer; font-size: 18px; padding: 0 4px; }
.subtask-delete:hover { color: #e74c3c; }
.add-subtask-btn { background: none; border: none; color: #4f46e5; font-size: 14px; cursor: pointer; padding: 8px 0; font-family: inherit; }
.add-subtask-btn:hover { text-decoration: underline; }

/* ===== ТЁМНАЯ ТЕМА ===== */
body.dark-mode { background-color: #0f0f0f; color: #e5e5e5; }
body.dark-mode .header-main { border-bottom-color: #2a2a2a; }
body.dark-mode .header-center h1 { color: #fff; }
body.dark-mode .icon-btn { background: #2a2a2a; color: #fff; }
body.dark-mode .icon-btn:hover { background: #3a3a3a; }
body.dark-mode #todayDate { color: #999; }
body.dark-mode .task-count-badge { background: #fff; color: #0f0f0f; }
body.dark-mode .day { border-right-color: #1f1f1f; }
body.dark-mode .weekend-column { border-left-color: #1f1f1f; }
body.dark-mode .weekend-day:first-child { border-bottom-color: #1f1f1f; }
body.dark-mode .day-header { border-bottom-color: #fff; }
body.dark-mode .day.today .day-header { border-bottom-color: #818cf8; }
body.dark-mode .day-date { color: #fff; }
body.dark-mode .day.today .day-date { color: #818cf8; }
body.dark-mode .day.weekend .day-date { color: #666; }
body.dark-mode .day-name { color: #666; }
body.dark-mode .day.today .day-name { color: #818cf8; }
body.dark-mode .tasks { background-image: linear-gradient(to bottom, #1f1f1f 1px, transparent 1px); background-size: 100% 40px; background-position: 0 0; }
body.dark-mode .task-time { color: #999; }
body.dark-mode .task-text { color: #e5e5e5; }
body.dark-mode .task.completed .task-text { color: #666; }
body.dark-mode .task .delete-btn { color: #555; }
body.dark-mode .task .delete-btn:hover { color: #ff6b6b; }
body.dark-mode .task-input-row input[type="time"], body.dark-mode .task-input { background: #1a1a1a; border-color: #2a2a2a; color: #fff; }
body.dark-mode .task-input-row input[type="time"]:focus, body.dark-mode .task-input:focus { border-color: #818cf8; }
body.dark-mode .color-trigger { border-color: #555; }
body.dark-mode .day.drag-over { background: #1a1a2e; }
body.dark-mode .mini-calendar-title { color: #fff; }
body.dark-mode .mini-calendar-header { color: #666; }
body.dark-mode .mini-calendar-day { color: #e5e5e5; }
body.dark-mode .mini-calendar-day:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .mini-calendar-day.other-month { color: #444; }
body.dark-mode .mini-calendar-day.today { background: #818cf8; }
body.dark-mode .mini-calendar-day.today:hover { background: #6366f1; }
body.dark-mode .mini-calendar-day.has-tasks::after { background: #818cf8; }
body.dark-mode .mini-calendar-day.today.has-tasks::after { background: white; }
body.dark-mode .calendar-menu { background: #1a1a2e; }
body.dark-mode .calendar-menu-header { border-bottom-color: #2a2a3e; }
body.dark-mode .calendar-menu-title { color: #fff; }
body.dark-mode .calendar-menu-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.dark-mode .calendar-item { background: rgba(255,255,255,0.05); }
body.dark-mode .calendar-item:hover { background: rgba(255,255,255,0.1); }
body.dark-mode .calendar-item.active { background: rgba(129, 140, 248, 0.2); border-color: #818cf8; }
body.dark-mode .calendar-item-name { color: #e5e5e5; }
body.dark-mode .calendar-action-btn { background: rgba(255,255,255,0.05); color: #e5e5e5; }
body.dark-mode .calendar-action-btn:hover { background: rgba(255,255,255,0.1); }
body.dark-mode .search-modal { background: #1a1a2e; }
body.dark-mode .search-header { border-bottom-color: #2a2a3e; }
body.dark-mode .search-input { background: #0f0f0f; border-color: #2a2a2a; color: #fff; }
body.dark-mode .search-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.dark-mode .search-result-item:hover { background: rgba(129, 140, 248, 0.1); }
body.dark-mode .search-result-date { color: #666; }
body.dark-mode .search-result-text { color: #e5e5e5; }
body.dark-mode .search-no-results { color: #666; }
body.dark-mode .task-modal { background: #1a1a2e; }
body.dark-mode .task-modal-header { border-bottom-color: #2a2a2a; }
body.dark-mode .task-modal-title { color: #fff; }
body.dark-mode .task-modal-action-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
body.dark-mode .formatting-toolbar { border-color: #2a2a2a; }
body.dark-mode .format-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.dark-mode .format-btn.active { background: rgba(129, 140, 248, 0.2); color: #818cf8; }
body.dark-mode .task-modal-time-input { background: #0f0f0f; border-color: #2a2a2a; color: #fff; }
body.dark-mode .task-modal-color-dot.selected { border-color: #fff; }
body.dark-mode .task-modal-textarea { background: #0f0f0f; border-color: #2a2a2a; color: #fff; }
body.dark-mode .subtask-item { border-bottom-color: #1f1f1f; }
body.dark-mode .subtask-text { color: #e5e5e5; }
body.dark-mode .someday-menu-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
body.dark-mode .someday-dropdown { background: #1a1a2e; border-color: #2a2a3e; }
body.dark-mode .someday-dropdown-item { color: #e5e5e5; }
body.dark-mode .someday-dropdown-item:hover { background: rgba(255,255,255,0.05); }
body.dark-mode .someday-column { background: #1a1a2e; }
body.dark-mode .someday-column-tasks { background-image: linear-gradient(to bottom, #2a2a3e 1px, transparent 1px); }
body.dark-mode .someday-column.drag-over-col { background: #252540; }

@media (max-width: 900px) {
    body { padding: 12px; }
    .header-main { flex-direction: column; gap: 12px; padding: 8px 0 12px; }
    .header-right { width: 100%; justify-content: center; }
    .week-grid { grid-template-columns: 1fr; gap: 20px; }
    .weekend-column { flex-direction: row; border-left: none; border-top: 1px solid #f0f0f0; }
    .weekend-day:first-child { border-bottom: none; border-right: 1px solid #f0f0f0; }
    .day { border-right: none; border-bottom: 1px solid #f0f0f0; padding: 12px 0; }
    .day:last-child { border-bottom: none; }
    .header-center h1 { font-size: 24px; }
    .someday-columns { flex-direction: column; }
    .someday-column { max-width: 100%; }
    .search-modal, .calendar-menu, .settings-modal { width: calc(100% - 48px); right: 24px; }
}