:root {
    /* Палитра */
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f5f7fb;
    --text: #1b2330;
    --muted: #79828f;
    --border: #e4e8ef;
    --accent: #4f7cff;
    --accent-hover: #3a68ee;
    --accent-soft: #eef3ff;
    --green: #1faa6c;
    --green-soft: #e9f8f1;
    --amber: #e8a33d;
    --amber-soft: #fdf3e3;
    --danger: #e5484d;
    --danger-soft: #fdecec;

    /* Прочее */
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(20, 30, 50, .05), 0 2px 6px rgba(20, 30, 50, .06);
    --shadow-md: 0 6px 18px rgba(20, 30, 50, .10);
    --shadow-lg: 0 16px 48px rgba(20, 30, 50, .20);
    --ring: 0 0 0 3px rgba(79, 124, 255, .28);

    /* Обратная совместимость со старыми переменными */
    --color-black: var(--text);
    --color-white: #fff;
    --color-gray: var(--muted);
    --color-mgray: var(--accent-soft);
    --color-lgray: var(--surface);
    --color-green: var(--green);
    --shadow: var(--shadow-sm);
}

*,
*:before,
*:after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
}

html {
    overflow-y: scroll;
}

body,
html {
    width: 100%;
    min-height: 100%;
    min-width: 320px;
}

body {
    color: var(--text);
    background: var(--bg);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button {
    font-family: inherit;
}

::placeholder {
    color: var(--muted);
    opacity: .85;
}

/* Иконки */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Поля ввода — общий вид */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

/* ── Верхняя панель ──────────────────────────── */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.brand .icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.logout:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 24px 64px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ── Боковая панель ─────────────────────────── */
.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    height: calc(100vh - 108px);
    display: flex;
    flex-direction: column;
}

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

.content__top {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.tasks-addbutton a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(79, 124, 255, .35);
    transition: background .15s, transform .05s;
}

.tasks-addbutton a .icon {
    width: 20px;
    height: 20px;
}

.tasks-addbutton a:hover {
    background: var(--accent-hover);
}

.tasks-addbutton a:active {
    transform: translateY(1px);
}

.categories {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.categories__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
}

.categories__name .icon {
    width: 16px;
    height: 16px;
}

.categories__add {
    margin-top: 14px;
    display: flex;
    gap: 8px;
}

.categories__add input {
    display: block;
    height: 40px;
    width: 100%;
    min-width: 0;
    padding: 0 12px;
}

.categories__add button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 40px;
    border: none;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s;
}

.categories__add button:hover {
    background: #e1eaff;
}

.reset-filter-btn {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}

.reset-filter-btn .icon {
    width: 15px;
    height: 15px;
}

.reset-filter-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--muted);
}

.categories__list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cdd4df transparent;
}

.categories__list::-webkit-scrollbar {
    width: 8px;
}

.categories__list::-webkit-scrollbar-track {
    background: transparent;
}

.categories__list::-webkit-scrollbar-thumb {
    background: #d3d9e3;
    border-radius: 8px;
}

.categories__list::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.categories__item {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s, border-color .15s;
}

.categories__item:hover {
    cursor: pointer;
    background: var(--surface-2);
}

.categories__item.active {
    background: var(--accent-soft);
    border-color: rgba(79, 124, 255, .35);
}

.categories__item-icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.categories__item.active .categories__item-icon {
    color: var(--accent);
}

.categories__item > span {
    display: block;
    flex: 1;
    min-width: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.categories__item.active > span {
    color: var(--accent);
}

.categories__item input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
}

.categories__item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    opacity: 0;
    transition: opacity .15s;
}

.categories__item:hover .categories__item-actions,
.categories__item.active .categories__item-actions {
    opacity: 1;
}

.cat-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.cat-action .icon {
    width: 16px;
    height: 16px;
}

.cat-action:hover {
    background: rgba(0, 0, 0, .06);
    color: var(--text);
}

.cat-action--danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ── Заголовок и фильтры ─────────────────────── */
h1 {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    margin-right: auto;
}

.sort {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sort .icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--muted);
    pointer-events: none;
}

.sort select {
    height: 40px;
    padding: 0 34px 0 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2379828f' d='M6 8L1.5 3.5h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    -webkit-appearance: none;
    appearance: none;
}

.tag-filters {
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.tag-filters__icon {
    width: 18px;
    height: 18px;
    color: var(--muted);
    margin-top: 3px;
}

.tags,
.task-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tags .tag,
.task-tags .tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
    background: var(--surface);
    line-height: 1.5;
}

.tags .tag:hover {
    cursor: pointer;
    border-color: var(--accent);
    color: var(--accent);
}

.tags .tag.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Список задач ────────────────────────────── */
.tasks {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.tasks__item {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    border-radius: var(--radius);
    transition: box-shadow .15s, border-color .15s;
}

.tasks__item:hover {
    box-shadow: var(--shadow-md);
}

.tasks__item.active {
    border-color: var(--accent);
    box-shadow: var(--ring);
}

/* Идущая задача — мягкий фон и зелёная полоса слева */
.tasks__item[data-status="running"] {
    background: var(--green-soft);
    border-color: rgba(31, 170, 108, .35);
    box-shadow: inset 4px 0 0 var(--green), var(--shadow-sm);
}

.tasks__item-wrapper {
    display: flex;
    gap: 18px;
}

.tasks__item-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tasks__head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tasks__category {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Бейдж статуса задачи */
.task-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.task-status:before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.task-status.is-running {
    color: var(--green);
    background: rgba(31, 170, 108, .14);
}

.task-status.is-paused {
    color: var(--amber);
    background: var(--amber-soft);
}

.task-status.is-finished {
    color: var(--accent);
    background: var(--accent-soft);
}

.task-status.is-new,
.task-status.is-stopped {
    color: var(--muted);
    background: var(--surface-2);
}

.tasks__name {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 8px;
    font-size: 17px;
    line-height: 1.3;
    font-weight: 700;
    word-break: break-word;
}

.tasks__copy {
    flex: none;
    display: inline-flex;
    align-items: center;
    color: #9aa0a6;
    opacity: .7;
    transition: color .15s, opacity .15s;
}

.tasks__copy:hover {
    color: var(--accent);
    opacity: 1;
}

.tasks__copy .icon {
    width: 16px;
    height: 16px;
}

.tasks__description {
    margin-top: 6px;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
}

.tasks__item-bottom {
    flex-grow: 1;
    display: flex;
    align-items: flex-end;
    padding-top: 16px;
    gap: 8px;
}

.tasks__item-bottom a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.tasks__item-bottom a .icon {
    width: 15px;
    height: 15px;
}

.tasks__more:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.tasks__delete:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.tasks__item-right {
    width: 196px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.tasks__item-timer {
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.tasks__item[data-status="running"] .tasks__item-timer .timer-value {
    color: var(--green);
}

.timer-edit {
    display: inline-flex;
    color: var(--muted);
    opacity: .55;
    transition: opacity .15s, color .15s;
}

.timer-edit .icon {
    width: 16px;
    height: 16px;
}

.timer-edit:hover {
    opacity: 1;
    color: var(--accent);
}

/* Форма ручной правки времени */
.timer-edit-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.timer-edit-fields {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.timer-edit-fields label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    line-height: 1;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
}

.timer-edit-fields input {
    width: 42px;
    padding: 6px 2px;
    text-align: center;
    -moz-appearance: textfield;
}

.timer-edit-fields input::-webkit-outer-spin-button,
.timer-edit-fields input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.timer-edit-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.timer-edit-buttons button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter .15s;
}

.timer-edit-buttons button .icon {
    width: 18px;
    height: 18px;
}

.timer-edit-buttons button:first-child {
    background: var(--green);
    color: #fff;
}

.timer-edit-buttons button:last-child {
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
}

.timer-edit-buttons button:hover {
    filter: brightness(.96);
}

/* Кнопки управления таймером */
.tasks__item-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.timer-btn {
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    transition: transform .05s, box-shadow .15s, background .15s, color .15s, border-color .15s;
}

.timer-btn .icon {
    width: 20px;
    height: 20px;
}

.timer-btn:hover {
    box-shadow: var(--shadow-md);
}

.timer-btn:active {
    transform: translateY(1px);
}

.timer-btn--start {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.timer-btn--start .icon {
    margin-left: 2px;
}

.timer-btn--start:hover {
    background: #1a945d;
}

.timer-btn--pause {
    background: var(--amber);
    border-color: var(--amber);
    color: #fff;
}

.timer-btn--pause:hover {
    background: #d8922f;
}

.timer-btn--stop:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Пустое состояние */
.tasks-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.tasks-empty .icon {
    width: 44px;
    height: 44px;
    color: var(--border);
}

.tasks-empty p {
    color: var(--muted);
    font-size: 15px;
}

.tasks-empty a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.tasks-empty a:hover {
    text-decoration: underline;
}

/* ── Форма задачи (боковая панель) ───────────── */
.task-form {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 560px;
    max-width: 100%;
    background: var(--surface);
    z-index: 120;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    overflow-y: auto;
}

.task-form__close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 34px;
    height: 34px;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 50%;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.task-form__close:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.task-form__title {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    padding-right: 44px;
}

.task-form__item {
    margin-top: 16px;
}

.task-form__name {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 16px;
    font-weight: 600;
}

.task-form__categories {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    cursor: pointer;
}

.task-form__description {
    display: block;
    width: 100%;
    height: 200px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.5;
}

.task-form__tags > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 8px;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.selected-tags .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-size: 13px;
}

.selected-tags .tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(79, 124, 255, .18);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.selected-tags .tag button .icon {
    width: 11px;
    height: 11px;
}

.selected-tags .tag button:hover {
    background: var(--accent);
    color: #fff;
}

.task-form__tags input[type="text"] {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 14px;
}

.tag-suggestions {
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    background: var(--surface);
}

.tag-suggestions .suggestion {
    padding: 10px 14px;
    cursor: pointer;
    transition: background .12s, color .12s;
}

.tag-suggestions .suggestion:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.task-form__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79, 124, 255, .35);
    transition: background .15s, transform .05s;
}

.task-form__button:hover {
    background: var(--accent-hover);
}

.task-form__button:active {
    transform: translateY(1px);
}

/* Перетаскивание задач (ручная сортировка) */
.drag-handle {
    display: flex;
    align-items: flex-start;
    padding-top: 2px;
    margin: -2px 2px 0 -4px;
    color: var(--muted);
    opacity: .35;
    cursor: grab;
    transition: opacity .15s;
    touch-action: none; /* старт перетаскивания с ручки на тач, без прокрутки */
}

.tasks__item:hover .drag-handle {
    opacity: .7;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle .icon {
    width: 20px;
    height: 20px;
}

/* Перетаскиваемая карточка превращается в пунктирный плейсхолдер на своём месте */
.tasks__item.dragging {
    border: 2px dashed var(--accent);
    background: var(--accent-soft);
    box-shadow: none;
}

.tasks__item.dragging .tasks__item-wrapper {
    visibility: hidden;
}

/* Плавное раздвигание соседних карточек при перестановке */
.task-list-move {
    transition: transform .22s ease;
}

/* Во время перетаскивания не выделяем текст и показываем нужный курсор */
body.dragging-active {
    user-select: none;
    -webkit-user-select: none;
    cursor: grabbing;
}

/* ── Уведомления (тосты) ─────────────────────── */
.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100% - 40px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    max-width: 380px;
    padding: 13px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-weight: 500;
    animation: toast-in .25s ease;
}

.toast .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast--success {
    border-left-color: var(--green);
}

.toast--success .icon {
    color: var(--green);
}

.toast--error {
    border-left-color: var(--danger);
}

.toast--error .icon {
    color: var(--danger);
}

.toast--info {
    border-left-color: var(--accent);
}

.toast--info .icon {
    color: var(--accent);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Модальное окно подтверждения ────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 210;
    background: rgba(20, 30, 50, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fade-in .15s ease;
}

.modal {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    animation: modal-in .2s ease;
}

.modal__text {
    font-size: 16px;
    line-height: 1.45;
    color: var(--text);
}

.modal__actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal__btn {
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.modal__btn--ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.modal__btn--ghost:hover {
    background: #eceff4;
}

.modal__btn--danger {
    background: var(--danger);
    color: #fff;
}

.modal__btn--danger:hover {
    background: #d23b40;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Адаптив ─────────────────────────────────── */
@media (max-width: 860px) {
    .container {
        flex-direction: column;
        padding: 18px 16px 40px;
    }

    .sidebar {
        width: 100%;
        position: static;
        height: auto;
    }

    .categories__list {
        max-height: 45vh;
    }

    .content {
        width: 100%;
    }

    .task-form {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .topbar__inner {
        padding: 0 16px;
    }

    .tasks__item-wrapper {
        flex-direction: column;
    }

    .tasks__item-right {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 14px;
        padding-top: 16px;
        border-top: 1px solid var(--border);
    }

    .tasks__item[data-status="running"] .tasks__item-right {
        border-top-color: rgba(31, 170, 108, .3);
    }
}
