/* ==========================================================================
   Задачник — оформление интерфейса.
   Светлая гамма, бирюзовый акцент, скруглённые карточки и пилюли-бейджи.
   Один файл, без сборщиков и препроцессоров.
   ========================================================================== */

:root {
    --bg:            #f3f7f8;
    --card:          #ffffff;
    --line:          #e6edef;
    --line-soft:     #eef3f5;
    --text:          #1f2a30;
    --muted:         #8b98a3;
    --accent:        #12b3a6;
    --accent-dark:   #0e9c91;
    --accent-soft:   #e6f7f5;
    --danger:        #d24b4b;
    --danger-soft:   #fdecec;
    --radius:        14px;
    --radius-sm:     9px;
    --shadow:        0 1px 2px rgba(24, 48, 56, .04), 0 4px 14px rgba(24, 48, 56, .04);
    --shadow-lg:     0 12px 40px rgba(24, 48, 56, .18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
.ta-right { text-align: right; justify-content: flex-end; }
.link { color: var(--accent-dark); }
.req { color: var(--danger); font-style: normal; }

/* ------------------------------------------------------------------ шапка */
.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo__mark {
    width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(140deg, var(--accent), #0aa08f);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(18, 179, 166, .28);
}
.logo__mark--lg { width: 42px; height: 42px; border-radius: 13px; }
.logo__text { font-weight: 650; font-size: 15.5px; letter-spacing: -.01em; }

.mainmenu { display: flex; gap: 4px; margin-right: auto; }
.mainmenu__link {
    padding: 7px 13px; border-radius: 8px; color: var(--muted);
    font-size: 13.5px; font-weight: 500; text-decoration: none;
    transition: background .15s, color .15s;
}
.mainmenu__link:hover { background: var(--line-soft); color: var(--text); text-decoration: none; }
.mainmenu__link.is-active { background: var(--accent-soft); color: var(--accent-dark); }

.topbar__user { display: flex; align-items: center; gap: 12px; }
.userbox { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.userbox:hover { text-decoration: none; }
.userbox__info { display: flex; flex-direction: column; line-height: 1.25; }
.userbox__name { font-size: 13px; font-weight: 600; }
.userbox__role { font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------------- контейнер */
.page { max-width: 1320px; margin: 0 auto; padding: 24px; min-height: calc(100vh - 62px - 58px); }

.pagehead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; }
.pagehead__title { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.pagehead__count {
    display: inline-block; margin-left: 6px; padding: 2px 9px; border-radius: 999px;
    background: var(--line-soft); color: var(--muted); font-size: 12.5px; font-weight: 600;
    vertical-align: middle;
}
.pagehint { color: var(--muted); margin: -6px 0 18px; max-width: 760px; }

.breadcrumbs { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* -------------------------------------------------------------- карточки */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}
.card__head {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 20px; border-bottom: 1px solid var(--line-soft);
}
.card__title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.card__count {
    padding: 1px 8px; border-radius: 999px; background: var(--line-soft);
    color: var(--muted); font-size: 12px; font-weight: 600;
}
.card__body { padding: 20px; }
.card--form .card__body { padding-top: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* --------------------------------------------------------------- кнопки */
.btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(18, 179, 166, .25); }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--line-soft); }
.btn--danger { background: var(--card); border-color: #f2d5d5; color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--block { width: 100%; }
.btn:disabled, .btn.is-loading { opacity: .6; cursor: default; }

.linkbtn {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
    color: var(--text); cursor: pointer; text-align: left;
}
.linkbtn:hover { color: var(--accent-dark); }

/* ---------------------------------------------------------------- поля */
.field { display: block; margin-bottom: 15px; }
.field__label {
    display: block; margin-bottom: 6px;
    font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em;
}
.input, .select {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: #fff; color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(18, 179, 166, .13);
}
.input--area { resize: vertical; min-height: 90px; }
.input--inline { padding: 6px 10px; }
.input--narrow { width: 80px; }
.select {
    appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b98a3' stroke-width='3' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 11px center;
}
.colorpick {
    width: 46px; height: 32px; padding: 2px; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; cursor: pointer;
}
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.form-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; margin-bottom: 15px; font-size: 13.5px; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.switch--sm { margin: 0; }

.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.checklist__item {
    display: flex; align-items: center; gap: 8px; padding: 8px 11px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px;
}
.checklist__item:hover { background: var(--line-soft); }
.checklist__item input { accent-color: var(--accent); }

/* ------------------------------------------------------- панель фильтров */
.filterbar {
    display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 18px;
}
.filterbar__field { display: flex; flex-direction: column; min-width: 190px; }
.filterbar__label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 5px;
}
.filterbar__chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 11px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent-dark);
    font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.chip:hover { background: #d8f2ef; text-decoration: none; }
.chip__x { font-size: 15px; line-height: 1; opacity: .7; }
.filterbar__reset { color: var(--muted); font-size: 12.5px; }

/* -------------------------------------------------------- шапка таблицы */
.tablehead {
    display: grid; gap: 14px; align-items: center;
    padding: 11px 20px; border-bottom: 1px solid var(--line-soft);
    background: #fbfdfd;
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.tablehead--tasks  { grid-template-columns: minmax(0, 1fr) 130px 140px 160px 150px 140px; }
.tablehead--users  { grid-template-columns: minmax(0, 1fr) 150px 150px 130px 80px 120px; }
.tablehead--dict   { grid-template-columns: minmax(0, 1fr) 110px 110px 90px 220px; }
.tablehead--status { grid-template-columns: minmax(0, 1fr) 90px 110px 90px 80px 300px; }

/* ---------------------------------------------------------- список задач */
.tasklist { display: block; }

.taskrow {
    display: grid; grid-template-columns: minmax(0, 1fr) 130px 140px 160px 150px 140px;
    gap: 14px; align-items: center;
    padding: 13px 20px 13px 17px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 3px solid transparent;
    color: inherit; text-decoration: none;
    transition: background .13s, border-color .13s;
}
.taskrow:last-child { border-bottom: 0; }
.taskrow:hover {
    background: #f7fcfc;
    border-left-color: var(--row-color, var(--accent));
    text-decoration: none;
}
.taskrow__title { font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.taskrow__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.taskrow__cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.taskrow__author { gap: 9px; }
.taskrow__authorname {
    font-size: 13px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------ бейджи и статусы */
.tag {
    display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px;
    background: var(--line-soft); color: var(--muted); font-size: 11.5px; font-weight: 500;
}
.tag--id { background: #eef4fb; color: #5b7fa6; font-weight: 600; }
.tag--soft { background: #fff6e8; color: #b3752a; }

.pill {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.pill { flex: none; }
.pill--muted { background: #f1f5f6; color: #6c7c86; }
.pill--accent { background: var(--accent-soft); color: var(--accent-dark); }
.pill--role-admin   { background: #efe9fd; color: #6b46d6; }
.pill--role-chief   { background: #e6f7f5; color: #0e9c91; }
.pill--role-manager { background: #eef4fb; color: #4d7ba8; }

.status {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 11px; border-radius: 999px;
    background: #f4f8f9; color: #56656e; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.status--lg { font-size: 13px; padding: 6px 14px; }
.status__dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--status-color, var(--muted)); flex: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #8b98a3) 18%, transparent);
}

/* --------------------------------------------------------------- аватары */
.avatar { border-radius: 50%; object-fit: cover; background: var(--accent-soft); flex: none; display: block; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--md { width: 38px; height: 38px; }
.avatar--letters {
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent-dark); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.avatar--md.avatar--letters { font-size: 13px; }

.avatar-group__label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 16px 0 8px;
}
.avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.avatar-pick {
    width: 46px; height: 46px; padding: 2px; border-radius: 50%;
    border: 2px solid transparent; background: none; cursor: pointer; line-height: 0;
    transition: border-color .15s, transform .15s;
}
.avatar-pick img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.avatar-pick:hover { transform: translateY(-1px); border-color: #cfe9e6; }
.avatar-pick.is-selected { border-color: var(--accent); }
.avatar-grid--compact .avatar-pick { width: 40px; height: 40px; }

/* ------------------------------------------------------------- фотография */
.avatar--lg { width: 100px; height: 100px; border-radius: 22px; }
.avatar--lg.avatar--letters { font-size: 30px; }

.photobox__row { display: flex; gap: 20px; align-items: flex-start; }
.photobox__current .avatar { border: 1px solid var(--line); }
.photobox__controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.photobox__controls .hint { flex-basis: 100%; margin: 0; max-width: 420px; }
.photobox__controls .btn { cursor: pointer; }

/* display:flex перебивает встроенное правило браузера для hidden — возвращаем его явно */
.cropper[hidden] { display: none; }
.cropper {
    display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
    margin-top: 16px; padding: 16px;
    background: #fbfdfd; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
/* Затемнение вокруг рамки делает огромная тень самой рамки, обрезанная сценой */
.cropper__stage {
    position: relative; line-height: 0; overflow: hidden; border-radius: 8px;
    user-select: none; -webkit-user-select: none; touch-action: none;
}
.cropper__stage img { display: block; max-width: 340px; max-height: 300px; }
.cropper__frame {
    position: absolute; cursor: move;
    border: 2px solid #fff; border-radius: 18px;
    box-shadow: 0 0 0 9999px rgba(20, 35, 40, .55);
}
.cropper__handle {
    position: absolute; right: -8px; bottom: -8px; width: 17px; height: 17px;
    border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.cropper__side { display: flex; flex-direction: column; gap: 10px; }
.cropper__label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.cropper__preview {
    width: 100px; height: 100px; border-radius: 22px;
    background-color: #eef2f4; background-repeat: no-repeat; border: 1px solid var(--line);
}
.cropper__side .hint { max-width: 200px; margin: 0; }
.cropper__actions { display: flex; gap: 8px; }

.modal__section { padding: 18px 20px; border-top: 1px solid var(--line-soft); }

/* ------------------------------------------------------------ исполнители */
/* Аватарки наезжают друг на друга — так несколько человек занимают мало места. */
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .taskrow__authorname { margin-left: 8px; }
.avatar--more {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--line-soft); color: var(--muted); font-size: 10.5px; font-weight: 700;
}

.assignees { display: flex; flex-wrap: wrap; gap: 7px; }
.assignee {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 11px 4px 4px; border-radius: 999px;
    background: #f4f8f9; font-size: 12.5px; font-weight: 600;
}
.assignee--off { opacity: .55; text-decoration: line-through; }

/* Выбор исполнителей: карточки в строку с переносом, отмеченные подсвечиваются */
.peoplepick {
    display: flex; flex-wrap: wrap; gap: 8px;
    max-height: 220px; overflow-y: auto; padding: 2px;
}
.peoplepick__item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 13px 5px 9px; margin: 0;
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font-size: 13px; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: border-color .13s, background .13s;
}
.peoplepick__item:hover { background: var(--line-soft); }
.peoplepick__item input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; }
.peoplepick__item .avatar { flex: none; }
.peoplepick__item.is-checked { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------ статистика вверху */
.statsbar {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 18px;
}
.statsbar__title {
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px;
}
.statsbar__text { font-size: 13.5px; line-height: 2; }
.statsbar__link {
    display: inline-flex; align-items: center; gap: 7px; color: var(--text); text-decoration: none;
    padding: 3px 10px; border-radius: 999px; background: #f6f9fa;
}
.statsbar__link:hover { background: var(--accent-soft); text-decoration: none; }
.statsbar__link.is-current { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 0 0 1px #bfe9e4; }
.statsbar__total { color: var(--text); text-decoration: none; }
.statsbar__total:hover { color: var(--accent-dark); text-decoration: none; }
.statsbar__sep { color: var(--line); margin: 0 2px; }

/* ------------------------------------------------------- карточка задачи */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.task-main { min-width: 0; }

.task-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.task-title__text { margin: 0 0 12px; font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
.task-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.task-desc { font-size: 14.5px; line-height: 1.65; color: #2c3a42; }
.task-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.sideinfo { margin-bottom: 16px; }
.sideinfo__label {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 8px;
}
.sideinfo__value.author { display: flex; align-items: center; gap: 10px; font-weight: 600; }

.deflist { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0 0 16px; font-size: 13.5px; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; }

.quickstatus { padding-top: 14px; border-top: 1px solid var(--line-soft); }
.quickstatus .field__label { margin-bottom: 6px; }

/* ------------------------------------------------------------ вложения */
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fileitem {
    position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm);
    overflow: hidden; background: #fff;
}
.fileitem__preview { display: block; height: 104px; background: #f6f9fa; }
.fileitem__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fileitem__preview--doc { display: flex; align-items: center; justify-content: center; }
.fileitem__ext {
    font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--accent-dark);
    background: var(--accent-soft); padding: 8px 12px; border-radius: 8px;
}
.fileitem__info { padding: 9px 11px; border-top: 1px solid var(--line-soft); }
.fileitem__name {
    display: block; font-size: 12.5px; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fileitem__size { font-size: 11.5px; color: var(--muted); }
.fileitem__del { position: absolute; top: 6px; right: 6px; }
.fileitem__del button {
    width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(31, 42, 48, .55); color: #fff; font-size: 15px; line-height: 1;
}
.fileitem__del button:hover { background: var(--danger); }

.upload-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }

.dropzone {
    border: 1.5px dashed #cfdde1; border-radius: var(--radius-sm);
    padding: 20px; text-align: center; cursor: pointer; background: #fbfdfd;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone--compact { padding: 14px; margin-bottom: 12px; }
.dropzone__text { color: var(--muted); font-size: 13px; }
.dropzone__list { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.dropzone__file {
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    padding: 3px 9px; font-size: 12px; color: var(--text);
}

/* ------------------------------------------------------------------ чат */
.chat { padding: 16px 20px; max-height: 460px; overflow-y: auto; background: #fbfdfd; }
.chat__empty { text-align: center; padding: 20px 0; }

.msg { display: flex; gap: 10px; margin-bottom: 14px; align-items: flex-start; }
.msg--own { flex-direction: row-reverse; }
.msg__bubble {
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 9px 13px; max-width: 74%; box-shadow: 0 1px 2px rgba(24, 48, 56, .03);
}
.msg--own .msg__bubble { background: var(--accent-soft); border-color: #cdece8; }
.msg__meta { display: flex; gap: 10px; align-items: baseline; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.msg__meta b { color: var(--text); font-size: 12.5px; }
.msg__body { font-size: 14px; word-break: break-word; }
.msg__files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg__img { display: block; width: 130px; height: 92px; border-radius: 8px; overflow: hidden; }
.msg__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.filechip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 11px; border-radius: 8px; background: #fff; border: 1px solid var(--line);
    font-size: 12.5px; font-weight: 600; color: var(--text); text-decoration: none;
}
.filechip:hover { border-color: var(--accent); text-decoration: none; }
.filechip__size { color: var(--muted); font-weight: 500; }

.chatform { padding: 14px 20px; border-top: 1px solid var(--line-soft); background: #fff; }
.chatform__files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chatform__file {
    background: var(--line-soft); border-radius: 6px; padding: 3px 9px;
    font-size: 12px; color: var(--muted);
}
.chatform__row {
    display: flex; align-items: flex-end; gap: 10px;
    border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 12px;
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
.chatform__row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18, 179, 166, .12); }
.chatform__attach { display: flex; align-items: center; color: var(--muted); cursor: pointer; padding-bottom: 7px; }
.chatform__attach:hover { color: var(--accent-dark); }
.chatform__input {
    flex: 1; border: 0; outline: none; resize: none; font: inherit;
    padding: 8px 0; max-height: 160px; background: none; color: var(--text);
}
.chatform__send {
    width: 36px; height: 36px; border: 0; border-radius: 10px; flex: none;
    background: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 10px rgba(18, 179, 166, .25);
}
.chatform__send:hover { background: var(--accent-dark); }
.chatform__send:disabled { opacity: .6; cursor: default; }

/* ------------------------------------------------------- история (лента) */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; padding: 0 0 16px 22px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
    content: ''; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--line);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
    position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; border: 2px solid var(--accent);
}
.timeline__text { font-size: 13px; line-height: 1.5; }
.timeline__text s { color: var(--muted); }
.timeline__time { font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------- админ-таблицы */
.adminrow {
    display: grid; gap: 14px; align-items: center;
    padding: 11px 20px; border-bottom: 1px solid var(--line-soft);
}
.adminrow:last-child { border-bottom: 0; }
.adminrow:hover { background: #fafdfd; }
.adminrow--off { opacity: .55; }
.adminrow__cell { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.adminrow__user { gap: 11px; }
.adminrow__actions { gap: 7px; flex-wrap: wrap; }

.tablehead--users ~ .adminrow  { grid-template-columns: minmax(0, 1fr) 150px 150px 130px 80px 120px; }
.tablehead--dict ~ .adminrow   { grid-template-columns: minmax(0, 1fr) 110px 110px 90px 220px; }
.tablehead--status ~ .adminrow { grid-template-columns: minmax(0, 1fr) 90px 110px 90px 80px 300px; }

/* ------------------------------------------------------------- попапы */
body.has-modal { overflow: hidden; }

.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(24, 44, 52, .42); backdrop-filter: blur(1.5px); }
.modal__window {
    position: relative; z-index: 1; width: min(720px, calc(100% - 32px));
    margin: 42px 0; background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-height: calc(100vh - 84px); display: flex; flex-direction: column;
    animation: modal-in .16s ease-out;
}
@keyframes modal-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line-soft);
}
.modal__title { font-size: 15.5px; font-weight: 650; }
.modal__close {
    width: 30px; height: 30px; border: 0; border-radius: 8px; background: none;
    color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal__close:hover { background: var(--line-soft); color: var(--text); }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot {
    display: flex; justify-content: flex-end; gap: 10px;
    padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--line-soft);
}
.modal__error {
    background: var(--danger-soft); color: #a13232; border-radius: var(--radius-sm);
    padding: 10px 13px; font-size: 13px; margin-bottom: 14px;
}

/* ------------------------------------------------------------ сообщения */
.alert {
    padding: 11px 16px; border-radius: var(--radius-sm); margin-bottom: 16px;
    font-size: 13.5px; font-weight: 500; border: 1px solid transparent;
}
.alert--success { background: #e9f8ef; border-color: #c6ecd5; color: #17864b; }
.alert--error   { background: var(--danger-soft); border-color: #f6d3d3; color: #a13232; }

.emptybox { padding: 46px 20px; text-align: center; }
.emptybox__title { font-weight: 650; margin-bottom: 5px; }
.emptybox__text { color: var(--muted); font-size: 13.5px; }

.errorbox { max-width: 420px; margin: 12vh auto; text-align: center; }
.errorbox__code { font-size: 58px; font-weight: 700; color: var(--accent); line-height: 1; }
.errorbox__text { color: var(--muted); margin: 10px 0 22px; }

/* ------------------------------------------------------------ пагинация */
.pager { display: flex; gap: 6px; margin: -4px 0 18px; }
.pager__item {
    min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--card); border: 1px solid var(--line); color: var(--text);
    font-size: 13px; font-weight: 600; text-decoration: none;
}
.pager__item:hover { border-color: var(--accent); text-decoration: none; }
.pager__item.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --------------------------------------------------------------- вход */
.loginpage { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
             background: radial-gradient(1200px 600px at 50% -10%, #e9f7f5, var(--bg)); }
.loginbox {
    width: 100%; max-width: 380px; background: var(--card);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px;
}
.loginbox__logo { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.loginbox__title { font-size: 18px; font-weight: 700; }
.loginbox__sub { font-size: 13px; color: var(--muted); }
.loginbox__note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

/* -------------------------------------------------------------- футер */
.footer { border-top: 1px solid var(--line); background: var(--card); }
.footer__inner {
    max-width: 1320px; margin: 0 auto; padding: 19px 24px;
    display: flex; gap: 9px; color: var(--muted); font-size: 12.5px;
}
.footer__dot { opacity: .6; }

/* ----------------------------------------------------------- адаптив */
@media (max-width: 1180px) {
    .task-layout { grid-template-columns: 1fr; }

    /* Узкий экран: оставляем название, исполнителей и статус.
       Колонки и ячейки прячем парами, иначе сетка разъезжается. */
    .tablehead--tasks, .taskrow { grid-template-columns: minmax(0, 1fr) 150px 140px; }
    .tablehead--tasks span:nth-child(2),
    .tablehead--tasks span:nth-child(3),
    .tablehead--tasks span:nth-child(4),
    .taskrow > *:nth-child(2),
    .taskrow > *:nth-child(3),
    .taskrow > *:nth-child(4) { display: none; }
}

@media (max-width: 760px) {
    .topbar__inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
    .mainmenu { order: 3; width: 100%; overflow-x: auto; }
    .page { padding: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .tablehead { display: none; }
    .taskrow, .adminrow { grid-template-columns: 1fr !important; gap: 8px; }
    .taskrow__cell.ta-right { justify-content: flex-start; }
    .userbox__info { display: none; }
    .msg__bubble { max-width: 88%; }
}
