:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-primary: #1f3a5f;
    --color-focus: #0b5fff;
    --space: 1rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Видимый фокус — критично для клавиатурной навигации */
*:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

/* Ссылка "Пропустить к содержимому": видна только при фокусе */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: var(--space);
    background: var(--color-primary);
    color: #fff;
    z-index: 100;
}
.skip-link:focus {
    left: 0;
}

header, footer {
    padding: var(--space);
    background: #f2f5f9;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space);
}

.logo { font-weight: bold; color: var(--color-primary); text-decoration: none; }

main {
    padding: var(--space);
    max-width: 1200px;
    margin: 0 auto;
}

/* Уважение к системной настройке "снизить анимацию" */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Формы */
.field {
    margin-bottom: var(--space);
}
.field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.field input {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}

button {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button:hover {
    background: #16294a;
}

.form-errors {
    padding: var(--space);
    margin-bottom: var(--space);
    background: #fde8e8;
    border: 2px solid #b91c1c;
    border-radius: 4px;
    color: #7f1d1d;
}

.logout-form {
    display: inline;
    margin: 0;
}
.logout-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}
.nav-menu {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.nav-menu a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
}
.nav-menu a:hover {
    background: #e2e8f0;
    text-decoration: underline;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-grid {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    flex-wrap: wrap;
}
.card-grid li a {
    display: block;
    padding: 1.5rem 2rem;
    background: #f2f5f9;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}
.card-grid li a:hover {
    background: #e2e8f0;
}
/* Скрытие визуально, но доступно скрин-ридеру */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.status-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: var(--space);
}
.status-filter a {
    padding: 0.4rem 0.8rem;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-primary);
}
.status-filter a[aria-current="true"] {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem;
    border-bottom: 1px solid #e2e8f0;
}
.data-table th {
    background: #f2f5f9;
}

.priority {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid;
}
.priority--low    { background: #f0f9ff; color: #075985; border-color: #7dd3fc; }
.priority--medium { background: #f0fdf4; color: #166534; border-color: #86efac; }
.priority--high   { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.priority--urgent { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

.overdue-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1.5rem;
    margin: var(--space) 0;
}
.task-meta dt { font-weight: 600; }
.task-meta dd { margin: 0; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: var(--space);
}

.btn-primary-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}
.btn-primary-link:hover { background: #16294a; }

.btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}

.model-form { max-width: 600px; }
.model-form input[type="text"],
.model-form input[type="date"],
.model-form textarea,
.model-form select {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}

.help-text {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0.25rem 0 0;
}
.field-error {
    color: #991b1b;
    font-weight: 600;
    margin: 0.25rem 0 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.messages { margin-bottom: var(--space); }
.message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 2px solid;
}
.message--success { background: #f0fdf4; color: #166534; border-color: #86efac; }
.message--error   { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.message--info    { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid;
}
.status-badge--backlog     { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.status-badge--planned     { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.status-badge--in_progress { background: #fefce8; color: #854d0e; border-color: #fde047; }
.status-badge--review      { background: #faf5ff; color: #6b21a8; border-color: #d8b4fe; }
.status-badge--done        { background: #f0fdf4; color: #166534; border-color: #86efac; }

.status-actions {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.status-actions h2 {
    font-size: 1.1rem;
    margin-top: 0;
}
.status-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.inline-form { display: inline; margin: 0; }
.status-btn {
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: 0.5rem 1rem;
    font-weight: 600;
}
.status-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.view-switch {
    display: inline-flex;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    overflow: hidden;
}
.view-btn {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    background: #fff;
}
.view-btn[aria-current="page"] {
    background: var(--color-primary);
    color: #fff;
}

.board-hint {
    color: #4b5563;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    align-items: flex-start;
}
.board-column {
    flex: 0 0 280px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.75rem;
}
.column-heading {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.column-count {
    background: var(--color-primary);
    color: #fff;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.85rem;
}
.column-tasks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-height: 40px;
}
.column-empty {
    color: #94a3b8;
    font-style: italic;
    padding: 0.5rem;
    text-align: center;
}

.board-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 0.75rem;
}
.priority-edge--low    { border-left-color: #7dd3fc; }
.priority-edge--medium { border-left-color: #86efac; }
.priority-edge--high   { border-left-color: #fdba74; }
.priority-edge--urgent { border-left-color: #fca5a5; }

.card-title {
    display: block;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.card-title:hover { text-decoration: underline; }

.card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.4rem;
}
.card-assignee {
    font-size: 0.85rem;
    color: #475569;
}
.card-due {
    font-size: 0.85rem;
    color: #475569;
    margin: 0.3rem 0 0;
}
.card-due--overdue {
    color: #991b1b;
    font-weight: 600;
}

.move-menu {
    margin-top: 0.6rem;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.5rem;
}
.move-menu summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.2rem;
}
.move-options {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.4rem;
}
.move-btn {
    width: 100%;
    text-align: left;
    background: #f8fafc;
    color: var(--color-primary);
    border: 1px solid #cbd5e1;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.move-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.archived-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: #e2e8f0;
    color: #475569;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5rem;
}
.card-archive-form {
    display: block;
    margin-top: 0.4rem;
}
.board-card[draggable="true"] {
    cursor: grab;
}
.board-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}
.column-tasks.drag-over {
    outline: 3px dashed var(--color-primary);
    outline-offset: 2px;
    background: #e0e7ff;
    border-radius: 6px;
}

/* Убираем эффекты перетаскивания при "снизить анимацию" */
@media (prefers-reduced-motion: reduce) {
    .board-card.dragging { opacity: 1; }
}
.comments {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.comment-list {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.comment {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.comment-author {
    font-weight: 600;
    color: var(--color-primary);
}
.comment-date {
    font-size: 0.8rem;
    color: #64748b;
}
.comment-text {
    color: #1e293b;
}
.comment-text p { margin: 0 0 0.5rem; }
.comment-text p:last-child { margin-bottom: 0; }

.no-comments {
    color: #64748b;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.comment-form {
    max-width: 600px;
}
.comment-form textarea {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.3rem;
    border-radius: 4px;
}
.bell-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #dc2626;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.notification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.notification-item--unread {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.notification-link {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    text-decoration: none;
    color: var(--color-text);
}
.notification-link:hover .notification-text {
    text-decoration: underline;
}
.notification-text {
    font-weight: 500;
    color: var(--color-primary);
}
.notification-date {
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
}
.unread-dot {
    width: 10px;
    height: 10px;
    background: #2563eb;
    border-radius: 50%;
    flex-shrink: 0;
}
.task-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}
.link-group {
    margin-bottom: 1rem;
}
.link-group h3 {
    font-size: 1rem;
    margin: 0 0 0.5rem;
}
.link-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.link-group li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.link-group--warning {
    background: #fff7ed;
    border: 1px solid #fdba74;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.link-group--warning h3 {
    color: #9a3412;
}

.existing-links {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.existing-links li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}
.link-remove-btn {
    background: #fff;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
}
.link-remove-btn:hover {
    background: #991b1b;
    color: #fff;
}

.add-link {
    margin-top: 1rem;
}
.add-link summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.4rem;
}
.link-add-form {
    max-width: 500px;
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.link-add-form select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}
.filter-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.filter-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-row--actions {
    margin-top: 1rem;
    justify-content: space-between;
    align-items: center;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1 1 160px;
}
.filter-field--search {
    flex: 2 1 240px;
}
.filter-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}
.filter-field input,
.filter-field select {
    padding: 0.5rem;
    font-size: 0.95rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
}
.filter-checkbox input {
    width: 1.1rem;
    height: 1.1rem;
}
.filter-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.result-count {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 1rem;
    font-weight: 600;
}
.stat-cards {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.stat-card {
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
}
.stat-card:hover {
    border-color: var(--color-primary);
    background: #f1f5f9;
}
.stat-card--alert {
    background: #fef2f2;
    border-color: #fca5a5;
}
.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-primary);
}
.stat-card--alert .stat-number {
    color: #991b1b;
}
.stat-label {
    font-size: 0.9rem;
    color: #475569;
    margin-top: 0.25rem;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.task-section {
    margin-bottom: 1.5rem;
}
.task-section--overdue h2 {
    color: #991b1b;
}
.my-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.my-task-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.my-task-title {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}
.my-task-title:hover { text-decoration: underline; }
.my-task-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.my-task-date {
    font-size: 0.85rem;
    color: #475569;
}
.my-task-date--overdue {
    color: #991b1b;
    font-weight: 600;
}
.empty-state {
    padding: 2rem;
    text-align: center;
    color: #475569;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
}
.checklist {
    margin: 1.5rem 0;
}
.checklist h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.checklist-progress-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.checklist-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
    max-width: 400px;
}
.checklist-bar-fill {
    height: 100%;
    background: #16a34a;
    transition: width 0.2s;
}
@media (prefers-reduced-motion: reduce) {
    .checklist-bar-fill { transition: none; }
}

.checklist-items {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 600px;
}
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
}
.checklist-toggle-form { flex: 1; }
.checklist-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.2rem;
    cursor: pointer;
    color: var(--color-text);
    text-align: left;
    font-size: 1rem;
}
.checklist-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}
.checklist-item--done .checklist-checkbox {
    background: #16a34a;
    border-color: #16a34a;
}
.checklist-item--done .checklist-text {
    text-decoration: line-through;
    color: #94a3b8;
}
.checklist-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.checklist-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}
.checklist-empty {
    color: #94a3b8;
    font-style: italic;
}
.checklist-add-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
}
.checklist-add-form input {
    flex: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}
.tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}
.tag--small {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
}
.tag-list, .card-tags {
    display: inline-flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
}
.card-tags {
    margin-top: 0.4rem;
}

/* Чекбоксы тегов в форме */
.model-form ul#id_tags {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}
.model-form ul#id_tags li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.model-form ul#id_tags input {
    width: auto;
}
.story-points {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #ede9fe;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}
.story-points--small {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
}
.mention {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-weight: 600;
}
.mention-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.3rem 0 0;
}
.activity {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.activity-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.4rem 0.6rem;
    border-left: 2px solid #e2e8f0;
    font-size: 0.9rem;
}
.activity-actor {
    font-weight: 600;
    color: var(--color-primary);
}
.activity-desc {
    color: #334155;
}
.activity-time {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-left: auto;
}
.no-activity {
    color: #94a3b8;
    font-style: italic;
}
.attachments {
    margin: 1.5rem 0;
}
.attachment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 600px;
}
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
}
.attachment-link {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    flex: 1;
    min-width: 150px;
}
.attachment-link:hover .attachment-name {
    text-decoration: underline;
}
.attachment-size {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 400;
}
.attachment-meta {
    font-size: 0.8rem;
    color: #64748b;
}
.attachment-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.attachment-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}
.no-attachments {
    color: #94a3b8;
    font-style: italic;
}
.attachment-upload-form {
    max-width: 600px;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.attachment-upload-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.upload-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.4rem 0;
}
.subtasks {
    margin: 1.5rem 0;
}
.subtasks h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.subtasks-progress {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.subtask-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 700px;
}
.subtask-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}
.subtask-title {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    flex: 1;
    min-width: 150px;
}
.subtask-title:hover { text-decoration: underline; }
.subtask-assignee {
    font-size: 0.85rem;
    color: #475569;
}
.subtask-date {
    font-size: 0.85rem;
    color: #475569;
}
.subtask-date--overdue {
    color: #991b1b;
    font-weight: 600;
}
.no-subtasks {
    color: #94a3b8;
    font-style: italic;
}
.subtask-add-form {
    display: flex;
    gap: 0.5rem;
    max-width: 700px;
}
.subtask-add-form input {
    flex: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}
.parent-link {
    background: #f1f5f9;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.column-heading--over {
    color: #991b1b;
}
.column-count--over {
    background: #dc2626;
}
.wip-warning {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    margin: 0 0 0.75rem;
}
.workload-hint {
    color: #475569;
    margin-bottom: 1rem;
}
.unassigned-note {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
}
.workload-table th[scope="row"] {
    background: #f8fafc;
}
.workload-name {
    text-align: left;
    font-weight: 600;
}
.workload-bar-wrap {
    display: inline-block;
    width: 100px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 0.5rem;
}
.workload-bar {
    display: block;
    height: 100%;
    background: var(--color-primary);
}
.workload-num {
    font-weight: 600;
}
.workload-overdue {
    display: inline-block;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
    font-weight: 600;
}
.btn-danger, .btn-danger-link {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
}
.btn-danger:hover, .btn-danger-link:hover {
    background: #991b1b;
}

.delete-warning {
    background: #fef2f2;
    border: 2px solid #fca5a5;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: #7f1d1d;
    max-width: 600px;
}
.delete-warning ul {
    margin: 0.5rem 0;
}

.delete-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
}
.delete-summary p { margin: 0.3rem 0; }

.delete-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.bulk-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.bulk-select-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.bulk-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    cursor: pointer;
}
#selected-count {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}
.bulk-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.bulk-actions select {
    padding: 0.5rem;
    font-size: 0.95rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}
.col-check {
    width: 40px;
    text-align: center;
}
.task-check, #select-all {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}
.saved-filters {
    margin-bottom: 1rem;
}
.saved-filter-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.saved-filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}
.saved-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 0.2rem 0.3rem 0.2rem 0.75rem;
}
.saved-filter-chip a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}
.saved-filter-chip a:hover {
    text-decoration: underline;
}
.saved-filter-remove {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
    border-radius: 50%;
    line-height: 1;
}
.saved-filter-remove:hover {
    background: #dbeafe;
    color: #991b1b;
}
.save-filter-form summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    display: inline-block;
    padding: 0.3rem;
}
.save-filter-inline {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    max-width: 500px;
    flex-wrap: wrap;
}
.save-filter-inline input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    font-size: 0.95rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
}
.time-tracking {
    margin: 1.5rem 0;
}
.time-tracking h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.time-total {
    font-size: 0.9rem;
    font-weight: 600;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}
.time-table {
    max-width: 700px;
    margin-bottom: 1rem;
}
.timelog-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}
.timelog-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}
.no-time {
    color: #94a3b8;
    font-style: italic;
}
.add-time {
    margin-top: 1rem;
}
.add-time summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.4rem;
}
.time-form {
    max-width: 600px;
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.time-inputs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}
.field--narrow {
    max-width: 90px;
}
.time-form input {
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
    width: 100%;
}
.snooze-note {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 0.5rem 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.link-button {
    background: none;
    border: none;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.reminders {
    margin: 1.5rem 0;
}
.reminder-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 600px;
}
.reminder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
}
.reminder-when {
    font-weight: 600;
    color: var(--color-primary);
}
.reminder-text { flex: 1; }
.reminder-sent {
    font-size: 0.75rem;
    color: #166534;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
}
.reminder-remove {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.reminder-remove:hover { color: #991b1b; }

.reminder-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.reminder-add summary, .snooze-add summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.4rem;
}
.reminder-form, .snooze-form {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-width: 400px;
}
.reminder-form input, .snooze-form input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.project-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.project-card {
    display: flex;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.project-color {
    width: 8px;
    flex-shrink: 0;
}
.project-color--inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
}
.project-body {
    padding: 1rem;
    flex: 1;
}
.project-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.3rem;
}
.project-name:hover { text-decoration: underline; }
.project-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    border: 1px solid;
}
.project-status--active { background: #f0fdf4; color: #166534; border-color: #86efac; }
.project-status--paused { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.project-status--done   { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.project-meta {
    font-size: 0.85rem;
    color: #475569;
    margin: 0.5rem 0;
}
.project-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.project-bar-fill {
    height: 100%;
    background: #16a34a;
}
.project-description {
    max-width: 700px;
    color: #334155;
}
.project-chip {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border: 2px solid;
    border-radius: 4px;
    text-decoration: none;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.3rem;
}
.row-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.link-button-danger {
    background: none;
    border: none;
    color: #991b1b;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}
.text-muted { color: #94a3b8; }
.stage-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.consent-yes {
    color: #166534;
    font-weight: 600;
}
.consent-no {
    color: #991b1b;
    font-weight: 600;
    background: #fef2f2;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #fca5a5;
}
.applicant-form { max-width: 700px; }
.applicant-form textarea,
.applicant-form input[type="text"],
.applicant-form input[type="email"],
.applicant-form input[type="url"],
.applicant-form input[type="date"],
.applicant-form input[type="number"],
.applicant-form select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.health-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
}
.health-notice p { margin: 0; color: #78350f; }
.health-subject {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.consent-hint {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
}
.consent-hint p { margin: 0; color: #1e3a8a; font-size: 0.9rem; }
.kb-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.kb-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.kb-title {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.05rem;
}
.kb-title:hover { text-decoration: underline; }
.kb-general-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #86efac;
    border-radius: 999px;
}
.kb-dept-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
}
.kb-date {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: auto;
}
.kb-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.kb-content {
    max-width: 750px;
    line-height: 1.7;
}
.kb-form { max-width: 750px; }
.kb-form input[type="text"],
.kb-form textarea {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.kb-visibility {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}
.kb-visibility legend {
    font-weight: 600;
    padding: 0 0.5rem;
}
.field--checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.kb-visibility ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}
.kb-visibility li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.import-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 700px;
}
.import-guide ol { margin: 0.5rem 0 0; padding-left: 1.5rem; }
.import-guide li { margin-bottom: 0.4rem; }
.table-scroll { overflow-x: auto; }
.import-confirm {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    max-width: 700px;
}
.applicant-history {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}
.add-interaction {
    margin-bottom: 1.5rem;
}
.add-interaction summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-primary);
    padding: 0.4rem;
}
.interaction-form {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-width: 600px;
}
.interaction-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.interaction-form textarea,
.interaction-form select,
.interaction-form input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
}
.interaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 700px;
}
.interaction-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-left-color: #cbd5e1;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}
.interaction-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}
.interaction-kind {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.interaction-kind--call { background: #f0fdf4; color: #166534; border-color: #86efac; }
.interaction-kind--meeting { background: #faf5ff; color: #6b21a8; border-color: #d8b4fe; }
.interaction-kind--email { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.interaction-date { font-size: 0.85rem; color: #475569; font-weight: 600; }
.interaction-author { font-size: 0.85rem; color: #64748b; }
.interaction-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}
.interaction-delete:hover { color: #991b1b; }
.no-interactions { color: #94a3b8; font-style: italic; }
.placements { margin-top: 2rem; padding-top: 1.5rem; border-top: 2px solid #e2e8f0; }
.placement-list { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.5rem; max-width: 700px; }
.placement-item { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 0.6rem 0.9rem; }
.placement-vacancy { flex: 1; font-weight: 600; color: var(--color-primary); text-decoration: none; min-width: 200px; }
.placement-vacancy:hover { text-decoration: underline; }
.placement-status-form select { padding: 0.35rem; border: 2px solid #6b7280; border-radius: 4px; }
.add-placement { margin-top: 1rem; }
.add-placement summary { cursor: pointer; font-weight: 600; color: var(--color-primary); padding: 0.4rem; }
.stat-card--success {
    background: #f0fdf4;
    border-color: #86efac;
}
.stat-card--success .stat-number {
    color: #166534;
}

.funnel {
    margin-top: 2rem;
}
.funnel-stage {
    text-align: left;
    font-weight: 600;
}
.funnel-stage a {
    color: var(--color-primary);
    text-decoration: none;
}
.funnel-stage a:hover {
    text-decoration: underline;
}
.funnel-count {
    font-weight: 700;
    font-size: 1.1rem;
    width: 100px;
}
.funnel-bar-cell {
    width: 50%;
}
.funnel-bar {
    display: block;
    height: 20px;
    background: var(--color-primary);
    border-radius: 4px;
    min-width: 2px;
}
.kb-category {
    margin-bottom: 2rem;
}
.kb-category h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.kb-cat-count {
    font-size: 0.8rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}
.kb-cat-tag {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
}
.kb-history-link {
    margin: -0.5rem 0 1.5rem;
}
.kb-history-link a {
    font-size: 0.9rem;
    color: #64748b;
}
.kb-current-version {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}
.kb-current-version h2 { margin-top: 0; font-size: 1.1rem; }
.version-notice {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.version-notice p { margin: 0; color: #78350f; }

.notification-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}
.notification-delete:hover {
    background: #fef2f2;
    color: #991b1b;
}

.xp-panel { margin-bottom: 2rem; }
.xp-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, #1f3a5f, #2c5282);
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    flex-wrap: wrap;
}
.xp-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    min-width: 90px;
}
.xp-level-num { font-size: 2rem; font-weight: 800; line-height: 1; }
.xp-level-title { font-size: 0.85rem; margin-top: 0.25rem; }
.xp-progress { flex: 1; min-width: 200px; }
.xp-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.xp-total { font-size: 1.3rem; font-weight: 700; }
.xp-to-next { font-size: 0.85rem; opacity: 0.85; }
.xp-bar {
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 999px;
    overflow: hidden;
}
.xp-bar-fill {
    height: 100%;
    background: #4ade80;
    border-radius: 999px;
    transition: width 0.3s;
}
@media (prefers-reduced-motion: reduce) {
    .xp-bar-fill { transition: none; }
}
.achievements-section { margin-top: 2rem; }
.achievement-grid {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.achievement-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #fff;
}
.achievement-badge--earned {
    border-color: #fbbf24;
    background: #fffbeb;
}
.achievement-badge--locked {
    opacity: 0.55;
    filter: grayscale(1);
}
.achievement-icon { font-size: 2.5rem; line-height: 1; }
.achievement-name { font-weight: 700; margin-top: 0.5rem; }
.achievement-desc { font-size: 0.85rem; color: #64748b; margin-top: 0.25rem; }

.mascot {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.mascot-figure {
    flex-shrink: 0;
    animation: mascot-bob 3s ease-in-out infinite;
}
@keyframes mascot-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.mascot-bubble {
    position: relative;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    padding: 0.75rem 1.1rem;
    font-size: 1rem;
    color: #1e293b;
    max-width: 400px;
}
.mascot-bubble::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid #cbd5e1;
}
.mascot-bubble::after {
    content: "";
    position: absolute;
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 8px solid #fff;
}

/* Уважаем настройку сниженной анимации: маскот не качается */
@media (prefers-reduced-motion: reduce) {
    .mascot-figure { animation: none; }
}

/* Ручная настройка "снизить анимацию" в профиле */
html[data-reduce-motion="true"] .mascot-figure { animation: none; }
html[data-reduce-motion="true"] .xp-bar-fill { transition: none; }
.settings-link {
    font-size: 1.2rem;
    text-decoration: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--color-primary);
}
.settings-link:hover { background: #e2e8f0; }

.mode-toggle {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    background: #fff;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 999px;
    cursor: pointer;
}
.mode-toggle:hover {
    background: var(--color-primary);
    color: #fff;
}

.settings-form { max-width: 600px; }
.settings-group {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.settings-group legend {
    font-weight: 700;
    padding: 0 0.5rem;
}
.settings-group ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.settings-group li label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}
/* Высококонтрастная тема */
html[data-theme="high_contrast"] {
    --color-bg: #000000;
    --color-text: #ffffff;
    --color-primary: #ffff00;
    --color-focus: #00ffff;
}
html[data-theme="high_contrast"] body {
    background: #000;
    color: #fff;
}
html[data-theme="high_contrast"] .data-table th {
    background: #1a1a1a;
}
html[data-theme="high_contrast"] a {
    color: #ffff00;
}

/* Тёмная тема */
html[data-theme="dark"] {
    --color-bg: #1a1a2e;
    --color-text: #e8e8e8;
}
html[data-theme="dark"] body {
    background: #1a1a2e;
    color: #e8e8e8;
}
html[data-theme="dark"] header,
html[data-theme="dark"] footer {
    background: #16213e;
}
.audit-action {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid;
}
.audit-action--view_health { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.audit-action--edit_health { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.audit-action--delete { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.audit-action--access_denied { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.pagination a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--color-primary);
    border-radius: 4px;
}
.pagination a:hover { background: var(--color-primary); color: #fff; }
.pagination-info { color: #64748b; font-size: 0.9rem; }
.report-block {
    margin-bottom: 2.5rem;
}
.report-note {
    color: #475569;
    margin-bottom: 0.75rem;
}
.report-num {
    font-weight: 700;
    font-size: 1.05rem;
    width: 120px;
}
.report-bar-cell {
    width: 45%;
}
.report-bar {
    display: block;
    height: 18px;
    background: #16a34a;
    border-radius: 4px;
    min-width: 2px;
}
.report-bar--alt {
    background: #2563eb;
}
.global-search {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.global-search input[type="search"] {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    width: 160px;
}
.global-search input[type="search"]:focus {
    width: 220px;
    border-color: var(--color-primary);
}
.global-search button {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
}
.global-search button:hover {
    background: #e2e8f0;
}

.search-group {
    margin-bottom: 2rem;
}
.search-group h2 {
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}
.search-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.search-list li {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}
.search-list a {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}
.search-list a:hover { text-decoration: underline; }
.search-meta {
    font-size: 0.85rem;
    color: #64748b;
}
.quick-create {
    position: relative;
}
.quick-create-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 700;
    list-style: none;
    user-select: none;
}
/* Убираем стандартный треугольник у summary */
.quick-create-btn::-webkit-details-marker { display: none; }
.quick-create-btn::marker { content: ""; }
.quick-create-btn:hover {
    background: #16294a;
}
.quick-create-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 180px;
    padding: 0.4rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.quick-create-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 4px;
    font-weight: 500;
}
.quick-create-menu a::before {
    content: "+ ";
    color: var(--color-primary);
    font-weight: 700;
}
.quick-create-menu a:hover {
    background: #eff6ff;
    color: var(--color-primary);
}
.public-page {
    background: #f1f5f9;
    min-height: 100vh;
    margin: 0;
}
.signup-container {
    max-width: 600px;
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.signup-intro {
    color: #475569;
    margin-bottom: 1.5rem;
}
.signup-form .field { margin-bottom: 1rem; }
.signup-form input[type="text"],
.signup-form input[type="email"],
.signup-form input[type="tel"],
.signup-form textarea {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
    border: 2px solid #6b7280;
    border-radius: 4px;
    font-family: inherit;
    box-sizing: border-box;
}
.field--consent {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
}
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 500;
}
.consent-label input { margin-top: 0.2rem; width: 1.2rem; height: 1.2rem; }
.consent-note {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.6rem 0 0;
}
.signup-submit {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.signup-submit:hover { background: #16294a; }
.signup-done { text-align: center; }
.signup-check {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    background: #16a34a;
    color: #fff;
    border-radius: 50%;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contract-status {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    border: 1px solid;
}
.contract-status--draft { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.contract-status--active { background: #f0fdf4; color: #166534; border-color: #86efac; }
.contract-status--expired { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.contract-status--terminated { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.contract-warn {
    font-size: 0.7rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    padding: 0.05rem 0.4rem;
    margin-left: 0.3rem;
}
.row-warning { background: #fffbeb; }
.dialog-list, .people-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dialog-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.dialog-item--unread { background: #eff6ff; border-color: #bfdbfe; }
.dialog-link {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.2rem 1rem;
    text-decoration: none;
    color: var(--color-text);
}
.dialog-name { font-weight: 700; color: var(--color-primary); }
.dialog-preview { color: #64748b; font-size: 0.9rem; grid-column: 1; }
.dialog-time { color: #94a3b8; font-size: 0.8rem; grid-row: 1; grid-column: 2; }
.dialog-badge {
    background: #dc2626; color: #fff; font-size: 0.75rem; font-weight: 700;
    min-width: 1.4rem; height: 1.4rem; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
}
.people-link {
    display: block; padding: 0.75rem 1rem; background: #fff;
    border: 1px solid #e2e8f0; border-radius: 8px;
    text-decoration: none; color: var(--color-primary); font-weight: 600;
}
.people-link:hover { background: #eff6ff; }

.thread {
    display: flex; flex-direction: column; gap: 0.5rem;
    max-width: 700px; margin-bottom: 1.5rem;
    padding: 1rem; background: #f8fafc; border-radius: 8px;
    max-height: 500px; overflow-y: auto;
}
.msg { display: flex; }
.msg--mine { justify-content: flex-end; }
.msg-bubble {
    max-width: 75%; padding: 0.6rem 0.9rem; border-radius: 12px;
}
.msg--mine .msg-bubble { background: #2563eb; color: #fff; }
.msg--theirs .msg-bubble { background: #fff; border: 1px solid #e2e8f0; }
.msg-text p { margin: 0; }
.msg-time { font-size: 0.7rem; opacity: 0.75; display: block; margin-top: 0.25rem; }
.no-msgs { color: #94a3b8; font-style: italic; text-align: center; }
.msg-form { display: flex; gap: 0.5rem; max-width: 700px; }
.msg-form textarea {
    flex: 1; padding: 0.6rem; font-size: 1rem;
    border: 2px solid #6b7280; border-radius: 4px; font-family: inherit;
}
.template-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.template-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 1rem; }
.template-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.template-title { font-weight: 700; color: var(--color-primary); }
.template-private { font-size: 0.7rem; background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; border-radius: 999px; padding: 0.05rem 0.5rem; }
.template-body-preview { color: #334155; font-size: 0.9rem; background: #f8fafc; padding: 0.6rem; border-radius: 6px; margin-bottom: 0.5rem; }
.template-actions { display: flex; gap: 0.75rem; font-size: 0.9rem; }
.template-picker { max-width: 700px; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.template-picker select { padding: 0.4rem; border: 2px solid #6b7280; border-radius: 4px; }
.challenge-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.challenge-card--won { background: #f0fdf4; border-color: #86efac; }
.challenge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.challenge-title { margin: 0; font-size: 1.15rem; }
.challenge-dates { font-size: 0.85rem; color: #64748b; }
.challenge-desc { color: #475569; margin: 0.5rem 0; }
.challenge-progress { margin: 0.75rem 0; }
.challenge-bar { height: 16px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 0.4rem; }
.challenge-bar-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #4ade80); border-radius: 999px; }
.challenge-count { font-size: 0.9rem; font-weight: 600; color: #334155; }
.challenge-reward { font-size: 0.9rem; color: #92400e; background: #fffbeb; padding: 0.4rem 0.6rem; border-radius: 6px; margin: 0.5rem 0 0; }
.challenge-badge-won { font-size: 0.85rem; font-weight: 700; color: #166534; }
.dashboard-challenge { margin-bottom: 2rem; }
.challenge-mini {
    display: block; text-decoration: none; color: var(--color-text);
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem;
}
.challenge-mini:hover { border-color: var(--color-primary); }
.challenge-mini-title { font-weight: 700; display: block; margin-bottom: 0.5rem; }
.challenge-mini-count { font-size: 0.85rem; color: #475569; }
.challenge-admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.leaders { margin-bottom: 2rem; }
.leaders-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.4rem; max-width: 500px;
}
.leader-item {
    display: flex; justify-content: space-between; align-items: center;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.6rem 1rem;
}
.leader-name { font-weight: 600; }
.leader-xp {
    font-weight: 700; color: #2563eb;
    background: #eff6ff; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.9rem;
}

.feed-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.4rem;
}
.feed-item {
    display: flex; align-items: center; gap: 0.75rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.6rem 0.9rem;
}
.feed-icon {
    flex-shrink: 0; width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: #f1f5f9; border-radius: 50%; font-size: 0.9rem;
}
.feed-text { flex: 1; }
.feed-time { font-size: 0.8rem; color: #94a3b8; white-space: nowrap; }
.dashboard-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.dashboard-block {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
}
.dashboard-block h2 {
    margin-top: 0;
    font-size: 1.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.dashboard-settings-link {
    text-align: right;
}
.dashboard-settings-link a {
    font-size: 0.9rem;
    color: #64748b;
}
.mini-funnel { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.mini-funnel a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.4rem 0.6rem; text-decoration: none; color: var(--color-text);
    border-radius: 4px;
}
.mini-funnel a:hover { background: #f1f5f9; }
.mini-funnel-count { font-weight: 700; color: var(--color-primary); }
.block-footer { margin: 0.75rem 0 0; font-size: 0.9rem; }
.block-count { font-weight: 700; margin: 0 0 0.5rem; }
.block-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.block-list li { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }
.block-list-meta { color: #64748b; font-size: 0.8rem; }
.block-empty { color: #94a3b8; font-style: italic; margin: 0; }
.resume-preview {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 2rem;
    max-width: 750px;
}
.resume-name { margin: 0 0 0.25rem; font-size: 1.6rem; }
.resume-position { color: #475569; font-size: 1.05rem; margin: 0 0 0.5rem; }
.resume-contacts {
    color: #64748b; font-size: 0.9rem;
    padding-bottom: 0.75rem; border-bottom: 2px solid #e2e8f0; margin-bottom: 1rem;
}
.resume-preview h3 {
    font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px;
    color: #334155; margin: 1.25rem 0 0.4rem;
    padding-bottom: 0.2rem; border-bottom: 1px solid #e2e8f0;
}
.resume-list-heading { font-size: 1rem; margin-top: 1rem; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.cal-title { margin: 0; font-size: 1.4rem; }

.content-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.content-calendar th {
    background: #f1f5f9; padding: 0.5rem; border: 1px solid #e2e8f0;
    font-size: 0.85rem; text-align: center;
}
.cal-cell {
    border: 1px solid #e2e8f0; vertical-align: top;
    height: 100px; padding: 0.3rem; background: #fff;
}
.cal-cell--empty { background: #f8fafc; }
.cal-cell--today { background: #eff6ff; }
.cal-day-num { font-size: 0.85rem; margin-bottom: 0.25rem; }
.cal-day-num a { color: #64748b; text-decoration: none; font-weight: 600; }
.cal-day-num a:hover { color: var(--color-primary); text-decoration: underline; }
.cal-post {
    display: block; font-size: 0.75rem; padding: 0.2rem 0.35rem; margin-bottom: 0.2rem;
    background: #f8fafc; border-left: 3px solid #94a3b8; border-radius: 3px;
    text-decoration: none; color: var(--color-text);
}
.cal-post:hover { background: #e2e8f0; }
.cal-post-title { display: block; font-weight: 600; }
.cal-post-channel { display: block; color: #64748b; font-size: 0.7rem; }
.cal-post--published { opacity: 0.6; }
.cal-post--cancelled { opacity: 0.45; text-decoration: line-through; }

.cal-legend { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: 0.85rem; }
.legend-label { font-weight: 600; }
.legend-item { display: flex; align-items: center; gap: 0.3rem; }
.legend-color { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.post-status {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid;
}
.post-status--idea { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.post-status--draft { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.post-status--ready { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.post-status--published { background: #f0fdf4; color: #166534; border-color: #86efac; }
.post-status--cancelled { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

.post-body { max-width: 700px; background: #f8fafc; padding: 1rem; border-radius: 8px; }
.status-form { margin: 1rem 0; display: flex; align-items: center; gap: 0.5rem; }
.status-form select { padding: 0.4rem; border: 2px solid #6b7280; border-radius: 4px; }
.outreach-status, .outreach-result {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid;
}
.outreach-status--new { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.outreach-status--contacted { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.outreach-status--responded { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.outreach-status--agreed { background: #f0fdf4; color: #166534; border-color: #86efac; }
.outreach-status--refused { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.outreach-status--paused { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

.outreach-result--sent { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.outreach-result--responded { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.outreach-result--agreed { background: #f0fdf4; color: #166534; border-color: #86efac; }
.outreach-result--refused { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.outreach-result--no_reply { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

.outreach-subject { font-weight: 600; margin: 0.3rem 0; }
.sprint-card {
    display: block; text-decoration: none; color: var(--color-text);
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 1rem 1.25rem; margin-bottom: 0.75rem;
}
.sprint-card:hover { border-color: var(--color-primary); }
.sprint-card--active { border-left: 4px solid #16a34a; }
.sprint-card--finished { opacity: 0.75; }
.sprint-card-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.sprint-name { font-weight: 700; font-size: 1.1rem; color: var(--color-primary); }
.sprint-dates { color: #64748b; font-size: 0.9rem; }
.sprint-goal { color: #475569; margin: 0.4rem 0; }
.sprint-goal-big {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;
    padding: 0.75rem 1rem; color: #1e3a8a; font-weight: 500; max-width: 800px;
}
.sprint-progress { margin-top: 0.6rem; }
.sprint-stats { font-size: 0.85rem; color: #475569; }
.sprint-summary { margin-bottom: 2rem; max-width: 800px; }
.sprint-summary .challenge-bar { margin-top: 0.75rem; }

.sprint-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.sprint-column { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.75rem; }
.sprint-col-head {
    font-size: 0.95rem; margin: 0 0 0.6rem; padding-bottom: 0.4rem;
    border-bottom: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 0.2rem;
}
.sprint-col-count { font-size: 0.75rem; color: #64748b; font-weight: 400; }
.sprint-task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.sprint-task {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 0.5rem 0.6rem; position: relative;
}
.sprint-task-title { font-weight: 600; color: var(--color-primary); text-decoration: none; font-size: 0.9rem; display: block; }
.sprint-task-meta { display: flex; gap: 0.5rem; align-items: center; font-size: 0.75rem; color: #64748b; margin-top: 0.3rem; flex-wrap: wrap; }
.sp-badge { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; border-radius: 999px; padding: 0.05rem 0.4rem; font-weight: 600; }
.sprint-task-empty { color: #cbd5e1; text-align: center; font-size: 0.85rem; }
.sprint-add-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; max-width: 700px; margin-top: 0.5rem; }
.sprint-add-form select { flex: 1; min-width: 200px; padding: 0.5rem; border: 2px solid #6b7280; border-radius: 4px; }
.burndown { margin: 2rem 0; max-width: 900px; }
.burndown-chart {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    padding: 1rem; overflow-x: auto;
}
.burndown-svg { width: 100%; height: auto; min-width: 500px; }
.burndown-legend { display: flex; gap: 1.5rem; margin-top: 0.75rem; font-size: 0.85rem; color: #475569; }
.legend-line { display: inline-block; width: 24px; height: 3px; vertical-align: middle; margin-right: 0.3rem; }
.legend-line--ideal { background: repeating-linear-gradient(90deg, #94a3b8 0 6px, transparent 6px 10px); }
.legend-line--actual { background: #2563eb; }
.burndown-table-toggle { margin-top: 1rem; }
.burndown-table-toggle summary { cursor: pointer; font-weight: 600; color: var(--color-primary); padding: 0.4rem; }
.invoice-status {
    display: inline-block; font-size: 0.75rem; font-weight: 600;
    padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid;
}
.invoice-status--draft { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.invoice-status--issued { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.invoice-status--partial { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.invoice-status--paid { background: #f0fdf4; color: #166534; border-color: #86efac; }
.invoice-status--cancelled { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.invoice-status--overdue { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.staff-inactive { opacity: 0.6; background: #f8fafc; }
.staff-inactive th { font-style: italic; }
.consent-alert {
    background: #fef2f2; border: 2px solid #fca5a5; border-left-width: 5px;
    border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; max-width: 800px;
}
.consent-alert p { margin: 0 0 0.5rem; color: #7f1d1d; }
.consent-alert p:last-child { margin-bottom: 0; }
.consent-alert--soft {
    background: #fffbeb; border-color: #fcd34d;
}
.consent-alert--soft p { color: #78350f; }

.consent-section { margin-bottom: 2rem; padding: 1rem 1.25rem; border-radius: 8px; }
.consent-section--critical { background: #fef2f2; border: 1px solid #fca5a5; }
.consent-section--warning { background: #fffbeb; border: 1px solid #fcd34d; }
.consent-section h2 { margin-top: 0; }
.consent-warning { font-size: 0.9rem; color: #7f1d1d; margin: 0.4rem 0; }
.all-good {
    background: #f0fdf4; border: 1px solid #86efac; border-radius: 8px;
    padding: 1rem 1.25rem; color: #166534; max-width: 700px;
}
.all-good p { margin: 0; }
.planning-summary {
    display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center;
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0.75rem 1rem; margin-bottom: 1.5rem;
}
.planning-warn { color: #92400e; font-size: 0.9rem; }
.planning-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .planning-columns { grid-template-columns: 1fr; } }
.planning-col { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem; }
.planning-col h2 { margin-top: 0; font-size: 1.1rem; }
.planning-controls {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.5rem 0; margin-bottom: 0.5rem; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap;
}
.planning-search { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.planning-search input { flex: 1; padding: 0.4rem; border: 2px solid #6b7280; border-radius: 4px; }
.planning-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; max-height: 500px; overflow-y: auto; }
.planning-item { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.5rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; }
.planning-check { flex-shrink: 0; padding-top: 0.15rem; }
.planning-body { flex: 1; }
.planning-title { font-weight: 600; color: var(--color-primary); text-decoration: none; font-size: 0.9rem; }
.planning-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; color: #64748b; margin-top: 0.25rem; }
.sp-badge--none { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

.sprint-task[draggable=true] { cursor: grab; }
.sprint-task.dragging { opacity: 0.5; }
.sprint-column.drop-target { background: #eff6ff; border-color: var(--color-primary); }
/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================ */

/* Бургер-меню: на десктопе скрыт, меню всегда развёрнуто */
.nav-toggle-btn {
    display: none;
    cursor: pointer;
    padding: 0.6rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    list-style: none;
    min-height: 44px;
    align-items: center;
    gap: 0.5rem;
}
.nav-toggle-btn::-webkit-details-marker { display: none; }
.nav-toggle-btn::marker { content: ""; }

@media (max-width: 768px) {
    /* Шапка в столбик */
    header .header-inner,
    .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    /* Показываем кнопку меню */
    .nav-toggle-btn { display: flex; }

    /* Меню разворачивается вертикально */
    .nav-toggle[open] .nav-menu {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        margin-top: 0.5rem;
        padding: 0.5rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
    }
    .nav-toggle:not([open]) .nav-menu { display: none; }
    .nav-menu li a {
        display: block;
        padding: 0.75rem;
        min-height: 44px;
        border-radius: 4px;
    }
    .nav-menu li a:hover { background: #e2e8f0; }

    /* Блок пользователя в строку с переносом */
    .nav-user {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        justify-content: space-between;
    }

    /* Поиск на всю ширину */
    .global-search { width: 100%; }
    .global-search input[type="search"] { flex: 1; width: auto; }
    .global-search input[type="search"]:focus { width: auto; }

    /* Заголовки страниц */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .header-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Кнопки крупнее и на всю ширину */
    .btn-primary-link,
    .btn-secondary,
    .btn-danger,
    button[type="submit"] {
        min-height: 44px;
        padding: 0.7rem 1rem;
    }
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    .form-actions button,
    .form-actions a {
        width: 100%;
        text-align: center;
    }

    /* Формы на всю ширину */
    .model-form,
    .applicant-form,
    .settings-form,
    .kb-form {
        max-width: 100%;
    }
    .field input,
    .field select,
    .field textarea {
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        font-size: 16px; /* меньше 16px вызывает автозум на iOS */
    }
    .field textarea { min-height: 80px; }

    /* Панели фильтров в столбик */
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .filter-field { width: 100%; }
    .filter-buttons { display: flex; gap: 0.5rem; }
    .filter-buttons button,
    .filter-buttons a { flex: 1; text-align: center; }

    /* Карточки статистики по две в ряд */
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    .stat-number { font-size: 1.4rem; }

    /* Дашборд — блоки в одну колонку */
    .dashboard-blocks { grid-template-columns: 1fr; }

    /* Доски и календарь — горизонтальная прокрутка */
    .board,
    .sprint-board,
    .content-calendar {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sprint-board { display: flex; gap: 0.75rem; }
    .sprint-column { min-width: 250px; flex-shrink: 0; }

    /* Маскот компактнее */
    .mascot { gap: 0.6rem; }
    .mascot-figure svg { width: 60px; height: 60px; }
    .mascot-bubble { font-size: 0.9rem; padding: 0.6rem 0.85rem; }

    /* Переписка */
    .msg-bubble { max-width: 85%; }
    .msg-form { flex-direction: column; }
    .msg-form button { width: 100%; }

    /* Планирование спринта — в одну колонку */
    .planning-columns { grid-template-columns: 1fr; }
}

/* Совсем узкие экраны */
@media (max-width: 480px) {
    body { padding: 0 0.5rem; }
    .stat-cards { grid-template-columns: 1fr; }
    h1 { font-size: 1.5rem; }
    .xp-card { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (max-width: 768px) {
    /* Таблицы с data-label превращаются в карточки */
    .data-table thead { display: none; }
    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td,
    .data-table th {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .data-table tr {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
    .data-table td,
    .data-table th {
        border: none;
        padding: 0.35rem 0;
        text-align: left;
    }
    .data-table td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
    }
    .data-table th[scope="row"] {
        font-size: 1.05rem;
        font-weight: 700;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
        margin-bottom: 0.4rem;
    }
    .data-table .row-actions {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        padding-top: 0.5rem;
        border-top: 1px solid #e2e8f0;
        margin-top: 0.4rem;
    }
    .data-table .col-check { display: inline-block; width: auto; }

    /* Календарь оставляем таблицей — он смысловой */
    .content-calendar thead { display: table-header-group; }
    .content-calendar,
    .content-calendar tbody,
    .content-calendar tr,
    .content-calendar td,
    .content-calendar th {
        display: revert;
    }
    .content-calendar { min-width: 600px; }
    .cal-cell { height: 70px; font-size: 0.8rem; }
}
.totp-setup { max-width: 600px; }
.totp-setup h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.totp-qr {
    display: block; width: 220px; height: 220px;
    border: 8px solid #fff; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin: 1rem 0;
}
.totp-manual { margin: 1rem 0; }
.totp-manual summary { cursor: pointer; color: var(--color-primary); font-weight: 600; }
.totp-secret {
    font-family: monospace; font-size: 1.1rem; letter-spacing: 2px;
    background: #f1f5f9; padding: 0.75rem; border-radius: 6px;
    word-break: break-all; user-select: all;
}
.totp-input {
    font-size: 1.5rem !important; letter-spacing: 6px; text-align: center;
    font-family: monospace; max-width: 220px;
}
.confirm-box {
    max-width: 480px; margin: 2rem auto;
    background: #fff; border: 2px solid #e2e8f0; border-radius: 12px; padding: 2rem;
}