/* Calendar section */
#calendarSection {
    flex: 1;
    background: var(--surface-panel);
    padding: 24px;
    border-right: 1px solid var(--surface-border);
    min-width: 0;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sidebar {
    flex: 0 0 280px;
    background: var(--surface-panel);
    padding: 24px;
    border-right: 1px solid var(--surface-border);
    box-shadow: var(--surface-shadow);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
    align-self: stretch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar.hidden {
    display: none;
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

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

.channels-header h2 {
    font-size: 22px;
    color: var(--heading-color);
    font-weight: 700;
}

.icon-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-panel-muted);
    border: 1px solid var(--surface-border);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: rgba(80, 80, 80, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.icon-button:hover {
    background: var(--surface-panel);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.channels-list {
    list-style: none;
    margin-bottom: 15px;
}

.channels-list li {
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    background: var(--surface-panel);
    border: 1px solid var(--surface-border);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
    color: rgba(50, 50, 50, 0.9);
}

.channels-list li::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    border: 2px solid transparent;
    opacity: 0;
}

.channels-list li.channel-flash::after {
    animation: channelFlash 900ms ease;
}

@keyframes channelFlash {
    0% {
        opacity: 0;
        border-color: rgba(255, 205, 80, 0);
        box-shadow: 0 0 0 rgba(255, 205, 80, 0);
        transform: scale(0.98);
    }
    35% {
        opacity: 1;
        border-color: rgba(255, 205, 80, 0.8);
        box-shadow: 0 0 20px rgba(255, 205, 80, 0.45);
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        border-color: rgba(255, 205, 80, 0);
        box-shadow: 0 0 0 rgba(255, 205, 80, 0);
        transform: scale(1);
    }
}

.channels-list li:hover {
    background: #f8fafc;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.channels-list li.active {
    background: var(--primary-gradient);
    color: rgba(50, 50, 50, 0.9);
    border-color: rgba(168, 213, 226, 0.6);
    box-shadow: 0 15px 30px rgba(168, 213, 226, 0.35);
    transform: translateX(4px);
}

.channels-list li.channel-drag-over {
    background: rgba(102, 126, 234, 0.3);
    border: 2px dashed rgba(255, 255, 255, 0.6);
    padding: 12px;
}

.channels-list li.channel-draggable {
    cursor: move;
}

.channels-list li.channel-dragging {
    opacity: 0.5;
}

.channels-list li.channel-reorder-drag-over {
    background: rgba(102, 126, 234, 0.2);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
}

.channel-name {
    flex: 1;
    user-select: none;
    font-weight: 500;
}

.channel-task-count {
    font-size: 12px;
    color: rgba(80, 80, 80, 0.8);
    background: var(--surface-panel-muted);
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
    min-width: 22px;
    text-align: center;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.channels-list li.active .channel-task-count {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(50, 50, 50, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
}

.channels-list li.channel-separator {
    height: 2px !important;
    min-height: 2px !important;
    max-height: 2px !important;
    background: linear-gradient(90deg, transparent, rgba(200, 230, 245, 0.5), transparent) !important;
    margin: 12px 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: default;
    pointer-events: none;
    list-style: none;
    flex: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    align-items: unset;
    justify-content: unset;
    position: static;
}

.main-content {
    flex: 1;
    display: flex;
    gap: 0;
    min-width: 0;
}

.tasks-column {
    flex: 1;
    background: var(--surface-panel);
    padding: 24px;
    border-right: 1px solid var(--surface-border);
    min-width: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.task-detail {
    flex: 0 0 380px;
    background: var(--surface-panel-muted);
    padding: 24px;
    border-left: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    height: 100%;
    min-height: 0;
}

.task-detail::-webkit-scrollbar {
    width: 8px;
}

.task-detail::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.task-detail::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.task-detail::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.task-detail:empty::before {
    content: 'Выберите задачу, чтобы увидеть детали';
    display: block;
    color: rgba(150, 150, 150, 0.7);
    text-align: center;
    padding: 40px 20px;
}

.calendar-inspector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-inspector-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-inspector-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--heading-color);
    margin: 0;
}

.calendar-inspector-summary {
    margin: 0;
    font-size: 14px;
    color: rgba(100, 100, 100, 0.85);
}

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

.calendar-inspector-item {
    border: 1px solid rgba(230, 235, 243, 0.9);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--surface-panel);
    cursor: pointer;
    text-align: left;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-inspector-item:hover {
    border-color: rgba(168, 213, 226, 0.8);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.calendar-inspector-item.selected {
    border-color: rgba(74, 144, 226, 0.9);
    background: rgba(74, 144, 226, 0.12);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.18);
}

.calendar-inspector-item-title {
    font-weight: 600;
    color: var(--heading-color);
}

.calendar-inspector-item-meta {
    font-size: 13px;
    color: rgba(110, 110, 110, 0.85);
}

.calendar-inspector-empty {
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    background: var(--surface-panel);
    border: 1px dashed rgba(15, 23, 42, 0.12);
    color: rgba(120, 120, 120, 0.85);
}

.task-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

:root {
    --heading-color: var(--text-primary);
}

.task-detail-header h3 {
    font-size: 22px;
    color: var(--heading-color);
    font-weight: 700;
}

.detail-title-input {
    font-size: 20px;
    font-weight: 700;
    color: var(--heading-color);
    border: none;
    background: transparent;
    padding: 0;
    width: 100%;
    cursor: pointer;
    outline: none;
    line-height: 1.4;
    resize: none;
    overflow: hidden;
    min-height: 32px;
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-title-wrapper {
    position: relative;
    width: 100%;
}

.detail-title-wrapper::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface-panel, #fff));
}

.detail-title-wrapper[data-clamped="true"]::before {
    opacity: 1;
}

.detail-title-ellipsis {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 16px;
    color: rgba(80, 80, 80, 0.85);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface-panel, #fff));
    padding-left: 8px;
    display: none;
    pointer-events: none;
}

.detail-title-wrapper[data-clamped="true"] .detail-title-ellipsis {
    display: inline;
}

.task-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--surface-panel, #fff);
    border: 1px solid var(--surface-border, rgba(0, 0, 0, 0.08));
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    min-width: 220px;
    padding: 6px 0;
    display: none;
    backdrop-filter: blur(8px);
}

.task-context-menu.visible {
    display: block;
}

.task-context-menu.hidden {
    display: none;
}

.task-context-menu-content {
    display: flex;
    flex-direction: column;
}

.task-context-menu-item {
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--heading-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: background 0.2s ease, color 0.2s ease;
}

.task-context-menu-item:hover {
    background: rgba(82, 129, 247, 0.18);
    color: var(--heading-color);
}

.task-context-menu-item + .task-context-menu-item {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.task-context-menu-item.has-submenu {
    position: relative;
    padding-right: 28px;
}

.task-context-menu-label {
    flex: 1;
    font-weight: 500;
}

.task-context-menu-arrow {
    font-size: 14px;
    color: rgba(80, 80, 80, 0.65);
}

.task-context-submenu {
    position: absolute;
    top: -6px;
    left: calc(100% + 8px);
    min-width: 220px;
    background: var(--surface-panel, #fff);
    border: 1px solid var(--surface-border, rgba(0, 0, 0, 0.08));
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    padding: 6px 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.task-context-menu.submenu-left .task-context-submenu {
    left: auto;
    right: calc(100% + 8px);
    transform: translateX(-8px);
}

.task-context-submenu-list {
    max-height: 260px;
    overflow-y: auto;
}

.task-context-submenu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--heading-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-context-submenu-item:hover {
    background: rgba(82, 129, 247, 0.18);
    color: var(--heading-color);
}

.task-context-empty {
    padding: 10px 16px;
    font-size: 13px;
    color: rgba(90, 90, 90, 0.8);
}

.task-context-menu-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: inherit;
    opacity: 0.9;
}

.task-context-menu-item.submenu-open .task-context-submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.task-context-submenu-scroll {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--heading-color);
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.task-context-submenu-scroll:hover {
    background: rgba(82, 129, 247, 0.18);
    opacity: 1;
}

.task-context-submenu-label {
    flex: 1;
}

.detail-title-input:read-only {
    cursor: pointer;
}

.detail-title-input:not(:read-only) {
    cursor: text;
    border-bottom: 2px solid rgba(168, 213, 226, 0.6);
    padding-bottom: 4px;
    background: var(--surface-panel);
    padding: 8px;
    border-radius: 8px;
}

.close-detail-btn {
    background: var(--surface-panel);
    border: 1px solid var(--surface-border);
    font-size: 24px;
    color: rgba(80, 80, 80, 0.8);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.close-detail-btn:hover {
    background: var(--surface-panel-muted);
    color: rgba(50, 50, 50, 0.9);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.detail-subtitle {
    font-size: 14px;
    color: var(--heading-color);
    margin-top: 6px;
}

.detail-section-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 10px;
}

.detail-description {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    padding: 12px;
    border: 2px solid rgba(200, 230, 245, 0.8);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    background: var(--surface-panel);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-description:focus {
    outline: none;
    border-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.3), 0 4px 15px rgba(0, 0, 0, 0.08);
    background: var(--surface-panel);
}

.task-detail-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(200, 230, 245, 0.3);
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-panel);
    border: 1px solid rgba(200, 230, 245, 0.7);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(50, 50, 50, 0.9);
}

.toolbar-btn:hover {
    background: var(--surface-panel-muted);
    border-color: rgba(168, 213, 226, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.deadline-btn {
    align-self: flex-start;
}

.deadline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.deadline-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: currentColor;
}

#deadlineBtnText {
    font-weight: 500;
    color: var(--heading-color);
}

.detail-subtasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 12px;
    margin-top: 24px;
}

.detail-subtasks-header span {
    font-size: 15px;
    font-weight: 700;
    color: var(--heading-color);
}

.subtask-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid rgba(200, 230, 245, 0.8);
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--surface-panel);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
}

.subtask-input:focus {
    outline: none;
    border-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.3), 0 4px 15px rgba(0, 0, 0, 0.08);
    background: var(--surface-panel);
}

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

.content-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.content-header h2 {
    font-size: 28px;
    color: var(--heading-color);
    font-weight: 800;
}

.content-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    flex-wrap: wrap;
}

#todayAssistantBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#todayAssistantBtn .loader {
    margin-left: 4px;
}

.task-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(200, 230, 245, 0.8);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-input::placeholder {
    color: rgba(100, 100, 100, 0.6);
}

.task-input:focus {
    outline: none;
    border-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.3), 0 4px 15px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

:root:not([data-theme="dark"]) .task-input {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root:not([data-theme="dark"]) .task-input::placeholder {
    color: rgba(100, 100, 100, 0.6);
}

:root:not([data-theme="dark"]) .task-input:focus {
    border-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.3), 0 4px 15px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
}

:root[data-theme="dark"] .task-input {
    background: rgba(15, 23, 42, 0.92);
    color: var(--text-primary);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.75);
}

:root[data-theme="dark"] .task-input::placeholder {
    color: rgba(226, 232, 240, 0.65);
}

:root[data-theme="dark"] .task-input:focus {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 24px 55px rgba(2, 6, 23, 0.85);
    background: rgba(15, 23, 42, 0.98);
}

.task-input:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    opacity: 0.6;
}

.add-btn {
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.tasks-column {
    position: relative;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Делаем область списка визуально и кликабельно больше, чтобы было удобно тянуть рамку */
    min-height: 240px;
}

.tasks-selection-box {
    border: 1px dashed rgba(74, 144, 226, 0.8);
    background: rgba(74, 144, 226, 0.12);
    pointer-events: none;
    position: absolute;
    z-index: 10;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border-left: 4px solid rgba(168, 213, 226, 0.8);
    cursor: grab;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.task-item.task-highlight {
    animation: calendarHighlight 1.2s ease;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.5), 0 8px 20px rgba(66, 133, 244, 0.15);
}

.task-item.selected {
    border-left-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 4px rgba(168, 213, 226, 0.3), 0 8px 25px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(4px);
}

.task-item.dragging {
    opacity: 0.6;
    transform: rotate(2deg);
}

.task-item.drag-over {
    border: 2px dashed rgba(168, 213, 226, 0.8);
    background: rgba(168, 213, 226, 0.2);
}

@keyframes calendarHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.6), 0 8px 20px rgba(66, 133, 244, 0.2);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.3), 0 6px 16px rgba(66, 133, 244, 0.15);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0), 0 4px 12px rgba(0, 0, 0, 0.05);
    }
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: rgba(200, 230, 201, 0.8);
    cursor: default;
    background: rgba(200, 230, 201, 0.2);
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: rgba(120, 120, 120, 0.7);
}

.task-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid rgba(200, 230, 201, 0.6);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-checkbox:hover {
    border-color: rgba(200, 230, 201, 0.9);
    transform: scale(1.1);
}

.task-checkbox:checked {
    background: var(--success-gradient);
    border-color: rgba(200, 230, 201, 1);
    box-shadow: 0 4px 15px rgba(200, 230, 201, 0.4);
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.subtask-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    color: rgba(100, 150, 180, 0.9);
    flex-shrink: 0;
    opacity: 1;
}

.subtask-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.task-title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    color: rgba(50, 50, 50, 0.9);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-inline-edit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.task-inline-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 15px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.95);
    color: inherit;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.task-inline-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.65);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

:root[data-theme="dark"] .task-inline-input {
    background: rgba(17, 24, 39, 0.95);
    color: rgba(226, 232, 240, 0.95);
    border-color: rgba(148, 163, 184, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.task-inline-parent {
    flex-shrink: 0;
    font-size: 14px;
    color: rgba(100, 116, 139, 0.95);
    white-space: nowrap;
}

:root[data-theme="dark"] .task-inline-parent {
    color: rgba(156, 163, 175, 0.9);
}

.subtask-title-editable {
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: rgba(50, 50, 50, 0.9);
}

.subtask-title-editable:hover {
    background: rgba(255, 255, 255, 0.5);
}

.subtask-title-editable[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.7);
    outline: 2px solid rgba(168, 213, 226, 0.6);
    outline-offset: -2px;
}

.task-deadline {
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.task-deadline.deadline-normal {
    color: #4285f4;
    background: rgba(66, 133, 244, 0.1);
}

.task-deadline.deadline-urgent {
    color: #ea4335;
    background: rgba(234, 67, 53, 0.1);
    font-weight: 600;
}

.task-title-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-channel-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(50, 50, 50, 0.9);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-badge {
    background: rgba(168, 213, 226, 0.4);
    color: rgba(50, 50, 50, 0.9);
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(168, 213, 226, 0.5);
    cursor: default;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-badge.origin {
    cursor: default;
}

.task-badge.toggle-today {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    color: rgba(50, 50, 50, 0.9);
}

.task-badge.toggle-today:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.task-badge.toggle-today.active {
    background: rgba(255, 245, 157, 0.6);
    color: rgba(50, 50, 50, 0.9);
    box-shadow: 0 4px 15px rgba(255, 245, 157, 0.4);
}

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

.completed-section {
    margin-top: 28px;
    border-top: 1px solid rgba(200, 230, 245, 0.5);
    padding-top: 20px;
}

.completed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--heading-color);
    font-size: 15px;
    margin-bottom: 14px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.completed-header:hover {
    background: rgba(255, 255, 255, 0.4);
}

.completed-header span {
    font-weight: 700;
}

.task-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.task-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.task-btn.delete {
    background: rgba(255, 204, 188, 0.8);
    color: rgba(150, 80, 60, 0.9);
    border: 1px solid rgba(255, 204, 188, 0.6);
    box-shadow: 0 4px 15px rgba(255, 204, 188, 0.3);
}

.task-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(80, 80, 80, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-icon-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.task-item:hover .task-icon-btn {
    opacity: 1;
}

.today-btn {
    background-color: transparent !important;
    font-size: 22px;
    opacity: 0;
    filter: brightness(1);
}

.today-btn.active {
    opacity: 0.8;
    filter: brightness(1.2);
}

.task-item:hover .today-btn {
    opacity: 1;
    background-color: transparent;
}

.task-item:hover .today-btn:hover {
    background: rgba(255, 245, 157, 0.5);
    border: 1px solid rgba(255, 245, 157, 0.7);
    border-radius: 10px;
    transform: scale(1.15);
}

.task-item:hover .today-btn.active {
    opacity: 1;
    filter: brightness(1.1);
    background: rgba(255, 245, 157, 0.6);
}

.task-icon-btn[data-tooltip] {
    position: relative;
}

.task-icon-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1000;
    opacity: 1;
    transition: none;
    animation: tooltipFadeIn 0.1s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.task-icon-btn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
    opacity: 1;
    transition: none;
    animation: tooltipFadeIn 0.1s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: rgba(255, 255, 255, 0.6);
    padding: 36px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.7);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 24px;
    color: var(--text-primary);
    font-weight: 800;
}

.modal-content p {
    margin-bottom: 28px;
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(200, 230, 245, 0.8);
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.modal-content input:focus {
    outline: none;
    border-color: rgba(168, 213, 226, 1);
    box-shadow: 0 0 0 3px rgba(168, 213, 226, 0.3), 0 4px 15px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 1);
}

.modal-content input::placeholder {
    color: rgba(100, 100, 100, 0.6);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.today-assistant-modal {
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
}

.today-assistant-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.today-assistant-summary {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.today-assistant-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
    color: var(--text-secondary);
}

.today-assistant-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.today-assistant-item {
    border: 1px solid rgba(200, 230, 245, 0.8);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.today-assistant-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.today-assistant-item-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.today-assistant-priority {
    font-weight: 700;
    color: rgba(74, 144, 226, 0.9);
    font-size: 14px;
    margin-bottom: 4px;
}

.today-assistant-channel {
    font-size: 13px;
    color: rgba(90, 90, 90, 0.9);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.today-assistant-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.today-assistant-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(240, 246, 255, 0.9);
    color: rgba(74, 144, 226, 0.9);
}

.today-assistant-badge.warning {
    background: rgba(255, 230, 210, 0.9);
    color: rgba(200, 120, 60, 0.9);
}

.today-assistant-reason {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.today-assistant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: rgba(90, 90, 90, 0.9);
}

.today-assistant-remove-btn {
    border: none;
    background: rgba(255, 244, 244, 0.9);
    color: rgba(200, 80, 80, 0.9);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.today-assistant-remove-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 80, 80, 0.2);
}

.today-assistant-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    padding: 20px 0;
}

.today-assistant-feedback-modal {
    max-width: 520px;
}

.today-assistant-feedback-input {
    width: 100%;
    min-height: 150px;
    border-radius: 14px;
    border: 2px solid rgba(200, 230, 245, 0.9);
    padding: 16px;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
}

.today-assistant-feedback-input:focus {
    outline: none;
    border-color: rgba(74, 144, 226, 0.7);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.today-assistant-empty .btn-secondary {
    margin-top: 12px;
}

.btn-primary {
    padding: 12px 24px;
    background: rgba(74, 144, 226, 0.9);
    color: white;
    border: 1px solid rgba(74, 144, 226, 0.6);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: rgba(74, 144, 226, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.import-status {
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
}

.import-status:empty {
    display: none;
    padding: 0;
    border: none;
    background: transparent;
}

.import-status:not(:empty) {
    display: block;
}

.import-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -10px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.import-hint code {
    font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

:root[data-theme="dark"] .import-status:not(:empty) {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.5);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.7);
}

/* Dark theme overrides */
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] #calendarSection,
:root[data-theme="dark"] .tasks-column,
:root[data-theme="dark"] .task-detail {
    background: var(--surface-panel);
    border-color: rgba(148, 163, 184, 0.2);
    box-shadow: var(--surface-shadow);
}

:root[data-theme="dark"] .task-detail {
    background: var(--surface-panel-muted);
}

:root[data-theme="dark"] .channels-list li {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(71, 85, 105, 0.6);
    color: var(--text-primary);
}

:root[data-theme="dark"] .channels-list li:hover {
    background: rgba(30, 41, 59, 0.9);
}

:root[data-theme="dark"] .channels-list li.active {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 20px 45px rgba(59, 130, 246, 0.35);
}

:root[data-theme="dark"] .channel-task-count,
:root[data-theme="dark"] .task-channel-badge,
:root[data-theme="dark"] .task-badge {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(71, 85, 105, 0.5);
    color: var(--text-primary);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.7);
}

:root[data-theme="dark"] .task-item {
    background: rgba(15, 23, 42, 0.95);
    border-left-color: rgba(59, 130, 246, 0.65);
    border: 1px solid rgba(15, 23, 42, 0.9);
    box-shadow: 0 25px 45px rgba(2, 6, 23, 0.85);
}

:root[data-theme="dark"] .task-item.selected {
    background: rgba(37, 99, 235, 0.25);
}

:root[data-theme="dark"] .task-item.completed {
    background: rgba(34, 197, 94, 0.12);
    border-left-color: rgba(34, 197, 94, 0.6);
}

:root[data-theme="dark"] .task-title,
:root[data-theme="dark"] .subtask-title-editable,
:root[data-theme="dark"] .task-deadline,
:root[data-theme="dark"] .detail-section-label,
:root[data-theme="dark"] .task-detail-header h3 {
    color: var(--text-primary);
}

:root[data-theme="dark"] .detail-subtitle,
:root[data-theme="dark"] .calendar-inspector-summary,
:root[data-theme="dark"] .calendar-inspector-item-meta,
:root[data-theme="dark"] .task-title-wrapper small,
:root[data-theme="dark"] .detail-description::placeholder {
    color: var(--text-secondary);
}

:root[data-theme="dark"] .task-checkbox {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(94, 109, 139, 0.8);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.65);
}

:root[data-theme="dark"] .detail-description,
:root[data-theme="dark"] .subtask-input,
:root[data-theme="dark"] .today-assistant-feedback-input,
:root[data-theme="dark"] .toolbar-btn,
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .today-assistant-empty,
:root[data-theme="dark"] .calendar-inspector-empty {
    background: #0b1220;
    border-color: rgba(56, 78, 120, 0.65);
    color: var(--text-primary);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.75);
}

:root[data-theme="dark"] .today-assistant-item {
    background: rgba(11, 18, 32, 0.92);
    border: 1px solid rgba(58, 78, 120, 0.75);
    box-shadow: 0 22px 45px rgba(2, 6, 23, 0.85);
}

:root[data-theme="dark"] .today-assistant-priority {
    color: rgba(191, 219, 254, 0.95);
}

:root[data-theme="dark"] .today-assistant-channel,
:root[data-theme="dark"] .today-assistant-meta {
    color: rgba(226, 232, 240, 0.8);
}

:root[data-theme="dark"] .today-assistant-badge {
    background: rgba(37, 99, 235, 0.2);
    color: rgba(219, 234, 254, 0.95);
}

:root[data-theme="dark"] .today-assistant-badge.warning {
    background: rgba(249, 115, 22, 0.25);
    color: rgba(254, 215, 170, 0.95);
}

:root[data-theme="dark"] .today-assistant-remove-btn {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: rgba(254, 202, 202, 0.95);
}

:root[data-theme="dark"] .btn-secondary:hover,
:root[data-theme="dark"] .toolbar-btn:hover {
    background: #162036;
}

:root[data-theme="dark"] .calendar-inspector-item {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(56, 78, 120, 0.6);
    color: var(--text-primary);
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.7);
}

:root[data-theme="dark"] .task-icon-btn,
:root[data-theme="dark"] .today-btn,
:root[data-theme="dark"] .task-btn,
:root[data-theme="dark"] .task-actions .task-icon-btn,
:root[data-theme="dark"] .channel-actions .btn-secondary {
    background: rgba(18, 28, 46, 0.9);
    border-color: rgba(71, 85, 105, 0.6);
    color: var(--text-primary);
    box-shadow: 0 15px 30px rgba(2, 6, 23, 0.75);
}

:root[data-theme="dark"] .task-btn.delete,
:root[data-theme="dark"] .btn-danger {
    background: rgba(248, 113, 113, 0.15) !important;
    border-color: rgba(248, 113, 113, 0.5) !important;
    color: #fecaca !important;
}

:root[data-theme="dark"] .modal-content {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 40px 80px rgba(2, 6, 23, 0.9);
    color: var(--text-primary);
}

:root[data-theme="dark"] .modal-content p,
:root[data-theme="dark"] .modal-warning,
:root[data-theme="dark"] .modal-consequences {
    color: var(--text-secondary);
}

:root[data-theme="dark"] .loader-text {
    color: var(--text-secondary);
}

:root[data-theme="dark"] .task-detail::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

:root[data-theme="dark"] .task-detail::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.9);
}

:root[data-theme="dark"] .calendar-container {
    background: var(--surface-panel);
}

:root[data-theme="dark"] .calendar-header-main h2,
:root[data-theme="dark"] .calendar-day-header-main {
    color: var(--heading-color);
}

:root[data-theme="dark"] .calendar-nav-btn-large {
    border: 1px solid rgba(71, 85, 105, 0.6);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    box-shadow: 0 15px 30px rgba(2, 6, 23, 0.75);
}

:root[data-theme="dark"] .calendar-nav-btn-large:hover {
    background: rgba(37, 99, 235, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
    box-shadow: 0 25px 45px rgba(2, 6, 23, 0.9);
}

:root[data-theme="dark"] .calendar-day-cell {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.5);
    box-shadow: 0 25px 45px rgba(2, 6, 23, 0.85);
    color: var(--text-primary);
}

:root[data-theme="dark"] .calendar-day-cell:hover,
:root[data-theme="dark"] .calendar-day-cell.selected {
    background: rgba(37, 99, 235, 0.25);
    box-shadow: 0 30px 60px rgba(2, 6, 23, 0.9);
}

:root[data-theme="dark"] .calendar-day-cell.other-month {
    opacity: 0.35;
    background: rgba(15, 23, 42, 0.55);
}

:root[data-theme="dark"] .calendar-day-cell.today {
    border: 2px solid rgba(59, 130, 246, 0.8);
    background: rgba(37, 99, 235, 0.3);
    box-shadow: 0 20px 45px rgba(37, 99, 235, 0.35);
}

:root[data-theme="dark"] .calendar-day-number {
    color: var(--heading-color);
}

:root[data-theme="dark"] .calendar-day-count {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.2);
}

:root[data-theme="dark"] .calendar-day-count.empty {
    opacity: 0.35;
}

:root[data-theme="dark"] .calendar-day-tasks {
    color: var(--text-primary);
}

:root[data-theme="dark"] .calendar-day-more {
    color: var(--text-secondary);
}

:root[data-theme="dark"] .calendar-task-item {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.6);
}

:root[data-theme="dark"] .calendar-task-item.completed {
    background: rgba(34, 197, 94, 0.18);
    color: rgba(187, 247, 208, 0.8);
    border-left-color: rgba(34, 197, 94, 0.7);
}

:root[data-theme="dark"] .calendar-task-item.deadline-normal {
    border-left-color: rgba(59, 130, 246, 0.9);
    background: rgba(59, 130, 246, 0.25);
    color: var(--text-primary);
}

:root[data-theme="dark"] .calendar-loading,
:root[data-theme="dark"] .calendar-error {
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.5);
    box-shadow: 0 25px 45px rgba(2, 6, 23, 0.8);
}

:root[data-theme="dark"] .calendar-header,
:root[data-theme="dark"] .calendar-header span,
:root[data-theme="dark"] #calendarMonthYear,
:root[data-theme="dark"] .calendar-day-header {
    color: var(--heading-color);
}

:root[data-theme="dark"] .calendar-nav-btn {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.6);
    color: var(--text-primary);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.7);
}

:root[data-theme="dark"] .calendar-nav-btn:hover {
    background: rgba(37, 99, 235, 0.3);
    border-color: rgba(96, 165, 250, 0.6);
}

:root[data-theme="dark"] .deadline-dropdown {
    background: var(--surface-panel);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 30px 70px rgba(2, 6, 23, 0.85);
}

:root[data-theme="dark"] .calendar-day {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(71, 85, 105, 0.5);
    color: var(--text-primary);
}

:root[data-theme="dark"] .calendar-day:hover {
    background: rgba(30, 41, 59, 0.9);
}

:root[data-theme="dark"] .calendar-day.prev-month,
:root[data-theme="dark"] .calendar-day.next-month {
    color: var(--text-secondary);
    background: rgba(15, 23, 42, 0.7);
}

:root[data-theme="dark"] .calendar-day.selected {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.35);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .main-content {
        flex-direction: column;
    }

    .task-detail {
        flex: 0 0 auto;
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        max-height: 50vh;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .logo {
        font-size: 48px;
    }

    .subtitle {
        font-size: 18px;
    }
}

/* Loader styles */
.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(168, 213, 226, 0.3);
    border-top: 3px solid rgba(168, 213, 226, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 16px;
}

.loader-text {
    color: rgba(80, 80, 80, 0.9);
    font-size: 15px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loader-small {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.initial-loader.hidden {
    display: none;
}

/* Channel actions */
.channel-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.channel-actions .btn-secondary {
    background: rgba(255, 204, 188, 0.9);
    color: rgba(150, 80, 60, 0.9);
    border: 1px solid rgba(255, 204, 188, 0.7);
}

.channel-actions .btn-secondary:hover {
    background: rgba(255, 204, 188, 1);
    box-shadow: 0 8px 25px rgba(255, 204, 188, 0.5);
}

/* Modal warning styles */
.modal-warning {
    color: rgba(200, 100, 80, 0.9);
    font-weight: 700;
    margin-top: 16px;
    font-size: 15px;
}

.modal-consequences {
    margin-top: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.btn-danger {
    background: rgba(255, 204, 188, 0.9) !important;
    color: rgba(150, 80, 60, 0.9) !important;
    border: 1px solid rgba(255, 204, 188, 0.7) !important;
    box-shadow: 0 4px 15px rgba(255, 204, 188, 0.4) !important;
}

.btn-danger:hover {
    background: rgba(255, 204, 188, 1) !important;
    box-shadow: 0 8px 25px rgba(255, 204, 188, 0.5) !important;
}

.assistant-chat-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(200, 230, 245, 0.5);
}

#assistantChatSoon {
    opacity: 0.7;
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    color: rgba(120, 120, 120, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Deadline Dropdown Styles */
.deadline-dropdown {
    position: fixed;
    z-index: 1000;
    background: var(--surface-panel);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    box-shadow: var(--surface-shadow);
    padding: 16px;
    min-width: 280px;
}

.deadline-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deadline-calendar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: rgba(50, 50, 50, 0.9);
}

.calendar-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(200, 230, 245, 0.6);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(168, 213, 226, 0.8);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(100, 100, 100, 0.7);
    padding: 6px 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(50, 50, 50, 0.9);
    transition: all 0.2s ease;
    background: var(--surface-panel);
    border: 1px solid var(--surface-border);
}

.calendar-day:hover {
    background: var(--surface-panel-muted);
}

.calendar-day.prev-month,
.calendar-day.next-month {
    color: var(--text-secondary);
    background: var(--surface-panel-muted);
}

.calendar-day.today {
    background: rgba(168, 213, 226, 0.4);
    font-weight: 600;
}

.calendar-day.selected {
    background: rgba(168, 213, 226, 0.9);
    color: rgba(50, 50, 50, 0.95);
    font-weight: 600;
}

.deadline-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgba(200, 230, 245, 0.3);
}

.deadline-clear-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(200, 230, 245, 0.6);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.deadline-clear-btn:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(168, 213, 226, 0.8);
}

/* Channel urgent deadline highlight */
.channels-list li.has-urgent-deadline {
    border-left: 4px solid #ea4335;
    background: rgba(234, 67, 53, 0.1);
    animation: pulse-urgent 2s ease-in-out infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        background: rgba(234, 67, 53, 0.1);
    }
    50% {
        background: rgba(234, 67, 53, 0.15);
    }
}

/* Calendar Styles */
.calendar-container {
    width: 100%;
    min-height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.4);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
    box-sizing: border-box;
    align-items: stretch;
    justify-content: flex-start;
}

.calendar-container > .calendar-grid-main {
    width: 100%;
}

.calendar-header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    flex-shrink: 0;
    width: 100%;
}

.calendar-header-main h2 {
    font-size: 28px;
    font-weight: 800;
    color: rgba(50, 50, 50, 0.9);
    flex: 1;
    text-align: center;
    margin: 0;
}

.calendar-nav-btn-large {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(200, 230, 245, 0.6);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 24px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(50, 50, 50, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.calendar-nav-btn-large:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(168, 213, 226, 0.8);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.calendar-grid-main {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 14px;
    width: 100%;
    flex: 1 1 auto;
    min-height: 620px;
    align-items: stretch;
}

.calendar-day-header-main {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: rgba(100, 100, 100, 0.8);
    padding: 12px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day-cell {
    min-height: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    font-size: 16px;
    font-weight: 600;
    color: rgba(50, 50, 50, 0.9);
    cursor: default;
    overflow: hidden;
}

.calendar-day-cell:hover,
.calendar-day-cell.selected {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.calendar-day-cell.other-month {
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.2);
}

.calendar-day-cell.today {
    border: 2px solid rgba(168, 213, 226, 0.8);
    background: rgba(168, 213, 226, 0.2);
    box-shadow: 0 4px 15px rgba(168, 213, 226, 0.2);
}

.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 600;
    color: rgba(50, 50, 50, 0.9);
}

.calendar-day-count {
    font-size: 11px;
    font-weight: 600;
    color: rgba(120, 120, 120, 0.85);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 2px 6px;
}

.calendar-day-count.empty {
    opacity: 0.5;
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    min-height: 0;
    margin-top: 4px;
}

.calendar-day-more {
    font-size: 12px;
    font-weight: 600;
    color: rgba(120, 120, 120, 0.8);
    text-align: right;
}

.calendar-task-item {
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    background: rgba(255, 255, 255, 0.6);
    color: rgba(50, 50, 50, 0.9);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.calendar-task-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-task-item.completed {
    background: rgba(200, 230, 201, 0.5);
    color: rgba(100, 100, 100, 0.8);
    text-decoration: line-through;
    border-left-color: rgba(200, 230, 201, 0.8);
}

.calendar-task-item.deadline-normal {
    border-left-color: rgba(66, 133, 244, 0.8);
    background: rgba(66, 133, 244, 0.1);
    color: rgba(50, 50, 50, 0.9);
}

.calendar-task-item.deadline-urgent {
    border-left-color: #ea4335;
    background: rgba(234, 67, 53, 0.15);
    color: #ea4335;
    font-weight: 600;
}

.calendar-task-item.deadline-overdue {
    border-left-color: #ea4335;
    background: rgba(234, 67, 53, 0.2);
    color: #ea4335;
    font-weight: 700;
}

.calendar-day-cell::-webkit-scrollbar {
    width: 4px;
}

.calendar-day-cell::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.calendar-day-cell::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.calendar-day-cell::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.calendar-loading,
.calendar-error {
    grid-column: span 7;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: rgba(80, 80, 80, 0.85);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    text-align: center;
    padding: 16px;
}

.calendar-error {
    color: #ea4335;
}
