* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1115;
    color: #e6e8eb;
    line-height: 1.5;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #171a21;
    border-bottom: 1px solid #242836;
}

header h1 { font-size: 20px; }
.user-info { display: flex; gap: 12px; align-items: center; color: #8b93a7; }

main {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 24px;
}

section { margin-bottom: 32px; }

h2 { font-size: 14px; color: #8b93a7; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

input, textarea, select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #171a21;
    border: 1px solid #242836;
    border-radius: 6px;
    color: #e6e8eb;
    font-family: inherit;
    font-size: 14px;
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4a8fe7;
}

button {
    padding: 10px 16px;
    background: #4a8fe7;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}
button:hover { background: #3a7bd5; }

.btn-ghost {
    background: transparent;
    color: #8b93a7;
    padding: 4px 8px;
    font-size: 14px;
}
.btn-ghost:hover { color: #e6e8eb; background: transparent; }

.btn-secondary {
    display: inline-block;
    padding: 10px 16px;
    background: transparent;
    color: #8b93a7;
    border: 1px solid #242836;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.btn-secondary:hover { color: #e6e8eb; border-color: #4a8fe7; }

/* Вкладки — компактные */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #242836;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    color: #8b93a7;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.tabs a:hover { color: #e6e8eb; }

.tabs a.active {
    color: #e6e8eb;
    border-bottom-color: #4a8fe7;
}

.tab-count {
    background: #242836;
    color: #8b93a7;
    font-size: 10px;
    padding: 0px 6px;
    border-radius: 8px;
    font-weight: 500;
    line-height: 16px;
    min-width: 16px;
    text-align: center;
}

.tabs a.active .tab-count {
    background: #4a8fe7;
    color: #fff;
}

/* Два ряда вкладок */
.tabs-status { margin-bottom: 4px; }
.tabs-assignee {
    margin-bottom: 16px;
    border-bottom: 1px solid #242836;
}

.tabs-assignee a {
    font-size: 12px;
    padding: 6px 10px;
    color: #5a6377;
}

.tabs-assignee a.active {
    color: #e6e8eb;
    border-bottom-color: #8b5cf6;
}

.tabs-assignee a.active .tab-count {
    background: #8b5cf6;
    color: #fff;
}

/* Задачи */
.task {
    background: #171a21;
    border: 1px solid #242836;
    border-left: 3px solid #4a8fe7;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.task.status-done { opacity: 0.7; }

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

.task-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.task h3 { font-size: 16px; margin-bottom: 0; }

/* Многострочное описание */
.task-desc {
    color: #8b93a7;
    font-size: 14px;
    margin: 12px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.task-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #5a6377;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

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

.btn-icon {
    background: transparent;
    border: none;
    color: #5a6377;
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
    text-decoration: none;
    border-radius: 4px;
    line-height: 1;
}
.btn-icon:hover { color: #e6e8eb; background: #242836; }

.status-form { display: flex; gap: 6px; flex-wrap: wrap; }

.status-form button {
    background: transparent;
    color: #8b93a7;
    border: 1px solid #242836;
    padding: 4px 12px;
    font-size: 12px;
}

.status-form button.active { background: #4a8fe7; color: #fff; border-color: #4a8fe7; }

.empty { color: #5a6377; font-style: italic; }

/* Логин */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #171a21;
    border: 1px solid #242836;
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
}

.login-card h1 { text-align: center; margin-bottom: 24px; font-size: 24px; }

.error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Форма в ряд */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.form-row select,
.form-row input {
    margin-bottom: 0;
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Приоритеты */
.task.priority-high { border-left-color: #ef4444; }
.task.priority-medium { border-left-color: #f59e0b; }
.task.priority-low { border-left-color: #3b82f6; }

.task.status-отложено.priority-high,
.task.status-отложено.priority-medium,
.task.status-отложено.priority-low {
    border-left-color: #8b5cf6;
    opacity: 0.85;
}

.task.status-done.priority-high,
.task.status-done.priority-medium,
.task.status-done.priority-low {
    border-left-color: #4caf50;
}

.priority-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.priority-badge.priority-high { background: #ef4444; color: #fff; }
.priority-badge.priority-medium { background: #f59e0b; color: #fff; }
.priority-badge.priority-low { background: #3b82f6; color: #fff; }

.status-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    background: #242836;
    color: #8b93a7;
    white-space: nowrap;
}

.status-badge.status-in_progress { background: #1e3a5f; color: #60a5fa; }
.status-badge.status-todo { background: #242836; color: #8b93a7; }
.status-badge.status-отложено { background: #3b1f5f; color: #c084fc; }
.status-badge.status-done { background: #1e3a1e; color: #4caf50; }

.due-date.overdue { color: #ef4444; font-weight: 500; }
.due-date.overdue::before { content: "⚠ "; }
