/* ============================================
   ГЛОБАЛЬНОЕ ОТКЛЮЧЕНИЕ DARK MODE
   Переопределяет все dark: классы из Flowbite/Tailwind
   ============================================ */

/* Отключаем dark mode через media query */
@media (prefers-color-scheme: dark) {
    html, body {
        color-scheme: light !important;
    }
}

/* Принудительно светлая тема для всех элементов */
html {
    color-scheme: light !important;
}

/* Глобальное переопределение dark классов для таблиц */
.dark\:bg-gray-800,
.dark\:bg-gray-700,
.dark\:bg-gray-600,
.dark\:bg-gray-900,
[class*="dark:bg-gray"] {
    background-color: inherit !important;
}

.dark\:hover\:bg-gray-600:hover,
.dark\:hover\:bg-gray-700:hover,
.dark\:hover\:bg-gray-800:hover,
[class*="dark:hover:bg-gray"]:hover {
    background-color: #f9fafb !important;
}

.dark\:text-white,
.dark\:text-gray-400,
.dark\:text-gray-300,
.dark\:text-gray-200,
[class*="dark:text-"] {
    color: inherit !important;
}

.dark\:border-gray-700,
.dark\:border-gray-600,
[class*="dark:border-"] {
    border-color: #e5e7eb !important;
}

/* Основные стили страницы */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

/* Стили для страницы входа — светлая тема как в Flowbite */
html.login-light,
html.login-light body,
body.login-page-body,
.login-page-body .login-section,
.login-section.bg-gray-50 {
    background-color: #f9fafb !important;
    color: #111827;
}

.login-page-body {
    margin: 0;
    min-height: 100vh;
}

.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Три колонки: блок входа только в средней части */
.login-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
    align-items: center;
}

.login-third {
    min-height: 100vh;
}

.login-center {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .login-section-grid {
        grid-template-columns: 1fr;
    }
    .login-third {
        display: none;
    }
}

.login-card {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.login-card .login-input,
.login-input {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

.login-card .login-input::placeholder {
    color: #9ca3af;
}

.login-card .login-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
    outline: none;
}

.login-btn {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.login-btn:hover {
    background-color: #1d4ed8 !important;
}

.login-card label,
.login-card h1,
.login-card .text-gray-900 {
    color: #111827 !important;
}

.login-card .text-gray-500 {
    color: #6b7280 !important;
}

.login-card a.text-blue-600 {
    color: #2563eb !important;
}

.login-card a.text-blue-600:hover {
    text-decoration: underline;
}

/* Центрирование блока логина по видимой области */
.login-section-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-center-wrap {
    width: 100%;
    max-width: 28rem;
}

/* Компактные отступы формы логина */
.login-form-spacing {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.login-form-title {
    margin-bottom: 1.25rem;
}
.login-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.login-label {
    margin-bottom: 0.25rem;
}
.login-options-row {
    margin-top: 0;
}
.login-submit-btn {
    margin-top: 0.5rem;
}

body.login-page {
    margin: 0;
    min-height: 100vh;
}

.login-container {
    display: flex;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.login-form {
    width: 100%;
    max-width: 448px;
    padding: 0;
}

.main-content {
    display: flex;
    flex: 1;
}

.button-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
}

.create-button {
    margin-bottom: 1rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.table-container {
    width: 66.67vw;
    margin-top: 20px;
    overflow-x: auto;
}

.sm\:ml-64 {
    margin-left: 16rem;
}

nav.main-nav {
    position: fixed;
    top: 0;
    left: 5rem; /* только левый сайдбар с иконками 80px */
    right: 0;
    height: 48px;
    z-index: 50;
    background-color: white !important;
    border-bottom: 1px solid #e5e7eb;
    transition: left 0.3s ease-in-out;
}

/* Убираем padding-top от .py-2.5 (flowbite), чтобы не ломать отображение header */
nav.main-nav.py-2\.5 {
    padding-top: 0 !important;
}

/* Адаптация для мобильных */
@media (max-width: 639px) {
    .content-wrapper,
    nav.main-nav {
        margin-left: 0;
        left: 0;
    }
}

/* Переопределяем темный фон для nav.main-nav */
nav.main-nav.dark\:bg-gray-900,
nav.main-nav[class*="dark:bg-gray-900"] {
    background-color: white !important;
}

nav.main-nav .dark\:text-white,
nav.main-nav [class*="dark:text-white"] {
    color: #111827 !important;
}

/* ============================================
   FLOWBITE SIDEBAR
   ============================================ */

/* Левый сайдбар: только иконки, видим на экранах от 640px */
.sidebar-left {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 40 !important;
    height: 100vh !important;
    width: 5rem !important; /* 80px */
    transition: transform 0.3s ease-in-out !important;
    display: none !important; /* по умолчанию скрыт на узких экранах */
}
@media (min-width: 640px) {
    .sidebar-left {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* Правый сайдбар: поверх контента и header, строго справа от левого сайдбара */
#default-sidebar.sidebar-right-overlay,
.sidebar-right-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 5rem !important; /* сразу после левого сайдбара 80px, не перекрывая его */
    z-index: 60 !important; /* выше main-nav (50), чтобы не уходить под header */
    height: 100vh !important;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.08);
}
.sidebar-right-overlay.sidebar-right-visible {
    display: flex !important;
    flex-direction: column !important;
}

#icon-sidebar {
    width: 5rem !important; /* 80px */
    min-width: 5rem !important;
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}
#icon-sidebar a {
    text-decoration: none !important;
    color: inherit;
}

.sidebar-icon-btn {
    color: #9ca3af !important;
    transition: background-color 0.2s, color 0.2s;
}
.sidebar-icon-btn:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}
.sidebar-icon-btn:hover .sidebar-icon-btn-icon {
    color: #111827 !important;
}
.sidebar-icon-btn-active {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}
.sidebar-icon-btn-active .sidebar-icon-btn-icon {
    color: #111827 !important;
}
.sidebar-icon-btn:focus {
    outline: none;
}

#default-sidebar.sidebar-right-overlay,
#default-sidebar {
    width: 13rem !important;  /* 208px */
    min-width: 13rem !important;
    height: 100vh !important;
}
#default-sidebar .sidebar-link {
    padding: 0.5rem 0.375rem !important;
}
#default-sidebar .sidebar-icon {
    margin-right: 0.5rem !important;
}
#default-sidebar .sidebar-link-text {
    white-space: nowrap !important;
    overflow: visible !important;
}

.sidebar-modern {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 16rem !important;
    background-color: #f8f8f8 !important;
    z-index: 40 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

/* Верхний блок с компанией */
.sidebar-company-header {
    background-color: #eeeeee;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.company-icon-box {
    width: 32px;
    height: 32px;
    background-color: #4a5568;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.company-icon {
    color: #ffffff;
    font-size: 1rem;
}

.company-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.company-type {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.2;
}

.company-name {
    font-size: 0.875rem;
    color: #333333;
    font-weight: 600;
    line-height: 1.2;
}

.company-dropdown-icons {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    color: #9ca3af;
    font-size: 0.625rem;
    flex-shrink: 0;
}

/* Контент сайдбара */
.sidebar-content {
    flex: 1;
    padding: 0 1rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Секция меню */
.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Меню */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.75rem;
    color: #333333 !important;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 400;
    border-radius: 0.375rem;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
}

.sidebar-link.active {
    background-color: #ffffff;
    color: #333333 !important;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    color: #6b7280;
    flex-shrink: 0;
}

.sidebar-link.active .sidebar-icon {
    color: #333333;
}

.sidebar-text {
    flex: 1;
    color: inherit;
    font-weight: inherit;
}

/* Скроллбар для сайдбара */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 640px) {
    .sidebar-modern {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar-modern.open {
        transform: translateX(0);
    }
}

/* Переопределение для предотвращения применения dark-классов */
.sidebar-modern * {
    color: inherit !important;
}

.sidebar-modern a,
.sidebar-modern span {
    color: #333333 !important;
}

.sidebar-modern .sidebar-link.active,
.sidebar-modern .sidebar-link.active * {
    color: #333333 !important;
}

#default-sidebar a {
    text-decoration: none !important;
}

#default-sidebar ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

#default-sidebar li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Сайдбар — светлая тема как в Flowbite, без тёмного фона при hover/focus */
.sidebar-light,
.sidebar-light > div {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
}

.sidebar-link {
    color: #111827 !important;
}

.sidebar-link:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

.sidebar-link:focus {
    outline: none;
    background-color: #f3f4f6 !important;
    color: #111827 !important;
    box-shadow: none !important;
}

.sidebar-link-active {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

.sidebar-link-active:hover,
.sidebar-link-active:focus {
    background-color: #e5e7eb !important;
    color: #111827 !important;
}

.sidebar-icon {
    color: #9ca3af !important;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link-active .sidebar-icon,
.sidebar-icon-active {
    color: #111827 !important;
}

.sidebar-toggle-btn:hover {
    background-color: #f3f4f6 !important;
}

.sidebar-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #e5e7eb !important;
}

.content-wrapper {
    margin-top: 64px;
    margin-left: 5rem; /* только левый сайдбар 80px; правый — поверх контента */
    transition: margin-left 0.3s ease-in-out;
    margin-right: 0;
    margin-bottom: 0;
    padding: 0;
    width: calc(100% - 5rem);
    flex: 1;
    box-sizing: border-box;
}

/* Страница проекта: убираем зазор между шапкой и вкладками (main-nav 48px). Дублируется inline в project.php для надёжности. */
body.project-page .content-wrapper {
    margin-top: 48px !important;
}

/* Страницы Проекты и Задачи: компактная шапка (как на странице проекта) */
.content-wrapper.projects-tasks-content {
    margin-top: 48px !important;
}

/* Адаптация для мобильных */
@media (max-width: 639px) {
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
}

/* Обеспечиваем правильное отображение двухколоночного layout */
.task-content-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1.5rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
    align-items: flex-start !important;
}

.task-left-column {
    width: 66.666667% !important;
    flex: 0 0 66.666667% !important;
    max-width: 66.666667% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

.task-right-column {
    width: 33.333333% !important;
    flex: 0 0 33.333333% !important;
    max-width: 33.333333% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

@media screen and (min-width: 1024px) {
    .task-content-layout {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }
    
    .task-left-column {
        width: 66.666667% !important;
        flex: 0 0 66.666667% !important;
        max-width: 66.666667% !important;
        min-width: 0 !important;
        order: 1 !important;
    }
    
    .task-right-column {
        width: 33.333333% !important;
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
        min-width: 0 !important;
        order: 2 !important;
    }
}

/* Стили для диаграммы Ганта */
.gantt-container {
    font-family: 'Inter', sans-serif;
    height: calc(100vh - 200px);
    overflow: hidden;
    background-color: #f9fafb;
    font-size: 14px;
    margin-top: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: white;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    height: 40px;
}

#gantt-wrapper {
    display: flex;
    height: calc(100% - 48px);
    width: 100%;
    overflow: hidden;
}

#gantt-left-panel {
    width: 45%;
    min-width: 450px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

#gantt-task-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

#gantt-divider {
    width: 6px;
    background-color: #e5e7eb;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background-color 0.2s;
    position: relative;
    z-index: 10;
}

#gantt-divider:hover {
    background-color: #3b82f6;
}

#gantt-divider::before {
    content: "⋮";
    color: #9ca3af;
    font-size: 10px;
}

#gantt-divider:hover::before {
    color: #1f2937;
}

#gantt-right-panel {
    width: 55%;
    min-width: 550px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#gantt-scroll-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
}

#gantt-time-header {
    height: 45px;
    min-height: 45px;
    position: sticky;
    top: 0;
    background-color: #f1f5f9;
    border-bottom: 2px solid #d1d5db;
    z-index: 15;
}

#gantt-grid-container {
    position: relative;
}

.gantt-task-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.gantt-task-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #e2e8f0;
}

.gantt-task-table th {
    padding: 0;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 45px;
    font-size: 13px;
}

.gantt-task-table td {
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    height: 40px;
}

.gantt-task-row {
    cursor: pointer;
    transition: background-color 0.2s;
    height: 40px;
}

.gantt-task-row:hover {
    background-color: #eff6ff;
}

.gantt-task-row.active {
    background-color: #dbeafe;
}

.gantt-task-edit-form {
    display: none;
    background-color: #f8fafc;
}

.gantt-task-edit-form.active {
    display: table-row;
}

.gantt-cell-content {
    padding: 8px 4px;
    height: 100%;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
}

.gantt-task-key-cell {
    width: 10%;
}

.gantt-task-key-cell .gantt-cell-content {
    justify-content: center;
    text-align: center;
}

.gantt-task-name-cell {
    width: 35%;
}

.gantt-task-name {
    font-weight: 500;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 13px;
}

.gantt-task-key {
    font-weight: 600;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 12px;
}

.gantt-task-resp-cell {
    width: 12%;
}

.gantt-task-resp {
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 13px;
}

.gantt-task-date-cell {
    width: 9%;
}

.gantt-task-date {
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 12px;
}

.gantt-task-duration-cell, .gantt-task-effort-cell {
    width: 7%;
}

.gantt-task-duration-cell .gantt-cell-content,
.gantt-task-effort-cell .gantt-cell-content {
    justify-content: center;
}

.gantt-task-duration, .gantt-task-effort {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 13px;
    text-align: center;
}

.gantt-edit-btn-cell {
    width: 6%;
    min-width: 36px;
}

.gantt-edit-btn-cell .gantt-cell-content {
    justify-content: center;
    padding: 0;
}

.gantt-bar {
    position: absolute;
    height: 30px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 3px;
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    cursor: move;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: left 0.3s, width 0.3s, background-color 0.3s;
    border-left: 2px solid rgba(255,255,255,0.5);
    border-right: 2px solid rgba(255,255,255,0.5);
    z-index: 5;
    margin-top: 5px;
}

.gantt-bar:hover {
    filter: brightness(110%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.gantt-time-scale-container {
    position: absolute;
    top: 0;
    left: 0;
    height: 45px;
    display: flex;
    flex-direction: column;
}

.gantt-months-row {
    height: 22px;
    display: flex;
    border-bottom: 1px solid #cbd5e1;
}

.gantt-days-row {
    height: 23px;
    display: flex;
}

.gantt-month-header {
    font-weight: 600;
    background-color: #e2e8f0;
    border-right: 1px solid #cbd5e1;
    padding: 0 4px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    height: 22px;
}

.gantt-day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    border-right: 1px solid #e5e7eb;
    font-size: 12px;
    background-color: #f8fafc;
    position: relative;
    height: 23px;
}

.gantt-day-cell.weekend {
    background-color: #fee2e2;
    color: #dc2626;
}

.gantt-day-cell.today {
    background-color: #dbeafe;
    font-weight: 600;
}

.gantt-day-cell::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e5e7eb;
}

.gantt-grid {
    position: relative;
}

.gantt-grid-row {
    height: 40px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    background-color: white;
}

.gantt-grid-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: #f0f0f0;
    z-index: 0;
}

.gantt-grid-line.weekend {
    background-color: #ffe4e4;
}

.gantt-task-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    font-size: 13px;
}

.gantt-form-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.gantt-row-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.gantt-grid-row:nth-child(even) .gantt-row-bg {
    background-color: #f9fafb;
}

.gantt-grid-row:nth-child(odd) .gantt-row-bg {
    background-color: white;
}

.gantt-time-label {
    font-size: 9px;
    color: #666;
    position: absolute;
    bottom: 1px;
    left: 1px;
}

.gantt-bar-content {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-weight: 500;
}

.gantt-header-title {
    display: flex;
    align-items: center;
}

.gantt-header-title h1 {
    font-size: 1.25rem;
}

#gantt-addTaskBtn {
    font-size: 13px;
    padding: 6px 12px;
}

.gantt-edit-task-btn {
    font-size: 12px;
    padding: 4px;
}

.gantt-input, .gantt-select {
    font-size: 13px !important;
    padding: 6px 10px !important;
}

.gantt-form-actions button {
    font-size: 13px;
    padding: 6px 12px;
}

th.gantt-task-key-cell .gantt-cell-content {
    justify-content: center;
}

/* Стили для страницы деталей задачи (task_detail.php) */
:root {
    --jira-blue: #0052cc;
    --jira-gray: #f4f5f7;
    --jira-text: #172b4d;
    --jira-text-light: #5e6c84;
}

.task-detail-container {
    background-color: var(--jira-gray);
    color: var(--jira-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    min-height: calc(100vh - 64px);
}

.task-header {
    background-color: white;
    border-radius: 8px;
    box-shadow: none;
    border-bottom: none;
}

/* Тэги задачи: отступы между бейджами и чипами */
.tags-display .tag-badge {
    margin-right: 4px;
    margin-bottom: 4px;
}

#editTagsModalChips .tag-chip {
    margin-right: 4px;
    margin-bottom: 4px;
}

.task-key {
    color: var(--jira-text-light);
    font-weight: 500;
}

.task-summary {
    font-weight: 600;
    color: var(--jira-text);
}

.section-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(9, 30, 66, 0.15);
    border: 1px solid #dfe1e6;
}

.field-label {
    color: var(--jira-text-light);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.field-value {
    color: var(--jira-text);
    font-size: 13px;
    min-height: 36px;
    padding: 6px 10px;
    border-radius: 3px;
    background-color: #fafbfc;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.field-value:hover {
    background-color: #ebecf0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Цвета статусов из настроек (Настройки → Стили badges). Fallback — дефолтные значения. */
.status-todo {
    background-color: var(--badge-todo-bg, #E0ECFF);
    color: var(--badge-todo-color, #143F85);
}

.status-progress {
    background-color: var(--badge-progress-bg, #D2E4FF);
    color: var(--badge-progress-color, #0052CC);
}

.status-done {
    background-color: var(--badge-done-bg, #C6F6D5);
    color: var(--badge-done-color, #046C4E);
}

.status-draft {
    background-color: var(--badge-draft-bg, #F3F4F6);
    color: var(--badge-draft-color, #4B5563);
}

.status-review {
    background-color: var(--badge-review-bg, #EDE9FE);
    color: var(--badge-review-color, #5B21B6);
}

.status-paused {
    background-color: var(--badge-paused-bg, #FFEDD5);
    color: var(--badge-paused-color, #C05621);
}

.status-cancelled {
    background-color: var(--badge-cancelled-bg, #FEE2E2);
    color: var(--badge-cancelled-color, #B91C1C);
}

/* Модалка «Изменить статус»: выравнивание колонок (бейдж в одну строку, описание на одной вертикали) */
.status-modal-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.status-modal-row {
    display: flex;
    align-items: center;
    min-height: 3rem;
}
.status-modal-cell {
    vertical-align: middle;
}
.status-modal-cell-badge {
    flex: 0 0 auto;
    min-width: 10rem;
    padding-left: 0.5rem;
    padding-right: 0.75rem;
}
.status-modal-cell-desc {
    flex: 1 1 auto;
    padding-right: 0.5rem;
}
#editStatusModal .status-modal-badge {
    white-space: nowrap;
}

/* Компактные бейджи статуса для header задачи */
.status-badge-header {
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.375rem 0.75rem !important;
    min-height: 2rem;
    border-radius: 0.5rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border: 1px solid !important;
    transition: all 0.2s !important;
}

.status-badge-header:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

/* Цвета header-бейджей из настроек (Стили badges) */
.status-todo-header {
    background-color: var(--badge-todo-bg, #E0ECFF) !important;
    border-color: var(--badge-todo-border, #143F85) !important;
    color: var(--badge-todo-color, #143F85) !important;
}

.status-progress-header {
    background-color: var(--badge-progress-bg, #D2E4FF) !important;
    border-color: var(--badge-progress-border, #0052CC) !important;
    color: var(--badge-progress-color, #0052CC) !important;
}

.status-done-header {
    background-color: var(--badge-done-bg, #C6F6D5) !important;
    border-color: var(--badge-done-border, #046C4E) !important;
    color: var(--badge-done-color, #046C4E) !important;
}

.status-draft-header {
    background-color: var(--badge-draft-bg, #F3F4F6) !important;
    border-color: var(--badge-draft-border, #4B5563) !important;
    color: var(--badge-draft-color, #4B5563) !important;
}

.status-review-header {
    background-color: var(--badge-review-bg, #EDE9FE) !important;
    border-color: var(--badge-review-border, #5B21B6) !important;
    color: var(--badge-review-color, #5B21B6) !important;
}

.status-paused-header {
    background-color: var(--badge-paused-bg, #FFEDD5) !important;
    border-color: var(--badge-paused-border, #C05621) !important;
    color: var(--badge-paused-color, #C05621) !important;
}

button#headerStatusField.status-cancelled-header,
.status-badge-header.status-cancelled-header {
    background-color: var(--badge-cancelled-bg, #FEE2E2) !important;
    border-color: var(--badge-cancelled-border, #B91C1C) !important;
    color: var(--badge-cancelled-color, #B91C1C) !important;
}

/* Priority icons - now using SVG, old circular styles removed */

.tab-content {
    display: block;
}

.tab-content.hidden {
    display: none !important;
}

[data-tab-target] {
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

[data-tab-target].active {
    border-bottom-color: #2563eb;
    color: #2563eb;
}

[data-tab-target]:not(.active) {
    color: #6b7280;
    border-bottom-color: transparent;
}

[data-tab-target]:not(.active):hover {
    color: #4b5563;
    border-bottom-color: #d1d5db;
}

.comment-item {
    transition: background-color 0.2s;
}

.comment-item:hover {
    background-color: #f9fafb;
}

.edit-comment-btn {
    transition: color 0.2s;
}

.activity-item {
    border-bottom: 1px solid #dfe1e6;
    padding: 10px 0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-user {
    font-weight: 600;
    color: var(--jira-text);
    font-size: 13px;
}

.activity-action {
    color: var(--jira-text-light);
    font-size: 13px;
}

.activity-time {
    color: #6b778c;
    font-size: 11px;
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #0052cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.user-avatar-small {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #5e6c84;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

.assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #0052cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.tag {
    background-color: #e4f0f6;
    color: #0747a6;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 11px;
    display: inline-block;
    margin-right: 3px;
    margin-bottom: 3px;
}

.description-text {
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
}

.edit-icon {
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
}

.field-container:hover .edit-icon {
    opacity: 1;
}

.related-task {
    padding: 6px 8px;
    border-left: 3px solid #deebff;
    background-color: #fafbfc;
    margin-bottom: 6px;
    border-radius: 3px;
    font-size: 13px;
}

.related-task:hover {
    background-color: #ebecf0;
}

.details-section {
    padding: 12px;
}

.compact-field {
    margin-bottom: 10px;
}

.assignee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.assignee-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.assignee-more {
    color: #5e6c84;
    font-size: 12px;
}

.watchers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.watcher-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.watcher-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #0052cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.watcher-more {
    color: #5e6c84;
    font-size: 12px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
}

.checkbox-option:hover {
    background-color: #f0f5ff;
}

.checkbox-option.selected {
    background-color: #e6f0ff;
    border-left: 3px solid #0052cc;
}

/* Явные стили для чекбокса в списке исполнителей */
.checkbox-option input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    appearance: checkbox !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    margin-right: 12px !important;
    cursor: pointer !important;
    accent-color: #2563eb !important;
    flex-shrink: 0 !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    border: 2px solid #d1d5db !important;
    border-radius: 4px !important;
    background-color: #fff !important;
}

.checkbox-option input[type="checkbox"]:checked {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

/* Стили для чекбоксов в модальном окне клонирования */
#cloneAttachments,
#cloneComments {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    cursor: pointer !important;
    accent-color: #2563eb !important;
    background-color: transparent !important;
    border: none !important;
}

#cloneAttachments:checked,
#cloneComments:checked {
    accent-color: #2563eb !important;
}

.jira-main-content {
    padding: 0.5rem;
}

/* Стили для страницы проекта */
.container {
    width: 100%;
    margin: 0 auto;
    background-color: #fff;
    padding-left: 4px;
    padding-right: 4px;
}

/* Уменьшенная высота блока контента под вкладками (в 2 раза по вертикали) */
#default-tab-content {
    width: 100%;
    position: relative;
}
#default-tab-content > [role="tabpanel"] {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    width: 100%;
    box-sizing: border-box;
}
/* Все верхнеуровневые табы проекта — ширина 100%, чтобы контент был 100% x auto (как у Обзор/Работы) */
#general,
#tasks-block,
#resources,
#documents,
#finance,
#team,
#risks,
#analytics,
#activity {
    width: 100% !important;
    box-sizing: border-box;
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    border-bottom: 1px solid #e0e0e0;
}

.title {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

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

.btn-link {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-link:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.btn-primary {
    background-color: #00bcd4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #00acc1;
}

.btn-primary.dropdown {
    background-color: #2196F3;
}

.btn-primary.dropdown:hover {
    background-color: #1976D2;
}

.btn-outline {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-more {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.dropdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.arrow {
    font-size: 10px;
}

/* Навигация */
.nav-tabs {
    display: flex;
    padding: 0 24px;
    gap: 24px;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.nav-item {
    padding: 12px 0;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover {
    color: #333;
}

.nav-item.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
    font-weight: 500;
}

/* Карточки */
.cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 12px;
}

/* Карточки в одну строку (страница проекта) */
.cards-section-one-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 0.75rem;
    padding: 12px;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.cards-section-one-row .card {
    flex: 1 1 0% !important;
    flex-grow: 1 !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: none !important;
    box-sizing: border-box;
}
/* Контейнер таба «Общее» и ряд карточек — на всю ширину */
#general {
    width: 100%;
    max-width: 100%;
    min-width: 0; /* чтобы во flex-родителе не держал ширину по контенту */
    box-sizing: border-box;
}
#general .cards-section-one-row {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}
#general .cards-section-one-row .card {
    flex: 1 1 0% !important;
    flex-grow: 1 !important;
    min-width: 0 !important;
    width: 0 !important;
    max-width: none !important;
}

.card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card-icon.blue {
    background-color: #2196F3;
    color: white;
}

.card-icon.card-icon-document {
    background-color: #E3F2FD;
    color: #1976D2;
    font-size: 20px;
}

.card-icon.card-icon-green {
    background-color: #4CAF50;
    color: white;
    font-size: 20px;
}

.card-icon.card-icon-white {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: #666;
    font-size: 20px;
}

.card-icon.card-icon-yellow-warning {
    background-color: #FFF9C4;
    color: #F57F17;
    font-size: 20px;
}

.card-icon.card-icon-purple {
    background-color: #E1BEE7;
    color: #7B1FA2;
    font-size: 20px;
}

.card-icon.card-icon-orange {
    background-color: #FF9800;
    color: white;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.card-icon.card-icon-gray-circle {
    background-color: #9E9E9E;
    color: white;
    font-size: 20px;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.card-icon.yellow {
    background-color: #FFC107;
}

.card-icon.gray {
    background-color: #e0e0e0;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Процесс */
.process-bar {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    background: linear-gradient(to right, #2196F3, #64B5F6);
    overflow-x: auto;
    gap: 8px;
}

.process-step {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
}

.process-step.active {
    background: #1976D2;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.process-arrow {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    padding: 0 4px;
    font-weight: bold;
}

/* Адаптивность для страницы проекта */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .cards-section {
        grid-template-columns: 1fr;
    }
    .cards-section-one-row {
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .process-bar {
        justify-content: flex-start;
    }
}

/* Этапы проекта — шевроны (под блоками на вкладке Общее) */
.project-stages-chevron-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    margin-left: 0;
    padding: 0 0 1rem 0;
    overflow-x: auto;
}
.project-stages-chevron-bar .stage-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 10px 18px;
    margin-left: -10px;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    flex-shrink: 0;
    clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}
.project-stages-chevron-bar .stage-chevron-first {
    margin-left: 0;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}
.project-stages-chevron-bar .stage-chevron-last {
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.project-stages-chevron-bar .stage-chevron-completed {
    background-color: #4CAF50;
    color: #fff;
}
.project-stages-chevron-bar .stage-chevron-current {
    background-color: #2196F3;
    color: #fff;
}
.project-stages-chevron-bar .stage-chevron-pending {
    background-color: #e0e0e0;
    color: #616161;
}
.project-stages-chevron-bar .stage-chevron-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Старые стили проекта (для обратной совместимости) */
.project-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Шапка проекта */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 12px;
}

.project-title {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    margin: 0;
}

.project-key-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    background-color: #2196F3;
    color: white;
    margin-right: 8px;
}

.project-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.project-btn-link {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
}

.project-btn-link:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.project-btn-primary {
    background-color: #00bcd4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
}

.project-btn-primary:hover {
    background-color: #00acc1;
}

.project-btn-outline {
    background: white;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.project-btn-outline:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.project-btn-more {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 8px;
    transition: color 0.2s;
}

.project-btn-more:hover {
    color: #333;
}

.project-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.project-arrow {
    font-size: 10px;
}

/* Навигация проекта */
.project-nav-tabs {
    display: flex;
    padding: 0 24px;
    gap: 24px;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
}

.project-nav-item {
    padding: 12px 0;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.project-nav-item:hover {
    color: #333;
}

.project-nav-item.active {
    color: #00bcd4;
    border-bottom-color: #00bcd4;
}

/* Карточки проекта */
.project-cards-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 24px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.project-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #ccc;
}

.project-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    color: white;
}

.project-card-icon-blue {
    background-color: #2196F3;
}

.project-card-icon-white {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    color: #666;
}

.project-card-icon-yellow {
    background-color: #FFC107;
}

.project-card-icon-gray {
    background-color: #e0e0e0;
    color: #666;
}

.project-card-content {
    flex: 1;
}

.project-card-title {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}

.project-card-subtitle {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Процесс проекта */
.project-process-bar {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    background: linear-gradient(to right, #2196F3, #64B5F6);
    overflow-x: auto;
    gap: 8px;
}

.project-process-step {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    white-space: nowrap;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s;
}

.project-process-step.active {
    background: white;
    color: #2196F3;
}

.project-process-arrow {
    color: white;
    font-size: 16px;
    padding: 0 4px;
    flex-shrink: 0;
}

/* Описание проекта */
.project-description-section {
    padding: 24px;
    border-top: 1px solid #e0e0e0;
}

.project-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.project-description-text {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Адаптивность для страницы проекта */
@media (max-width: 768px) {
    .project-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .project-cards-section {
        grid-template-columns: 1fr;
    }

    .project-process-bar {
        justify-content: flex-start;
    }

    .project-nav-tabs {
        gap: 12px;
    }
}

/* ============================================
   САМОПИСНЫЕ СТИЛИ ДЛЯ ЗАМЕНЫ TAILWIND/FLOWBITE
   ============================================ */

/* Flexbox утилиты */
.flex { display: flex !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.justify-end { justify-content: flex-end !important; }
.flex-1 { flex: 1 1 0% !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.inline-flex { display: inline-flex !important; }

/* Spacing - Gap */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }

/* Spacing - Space (для space-y, space-x) */
.space-y-2 > * + * { margin-top: 0.5rem !important; }
.space-y-3 > * + * { margin-top: 0.75rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-6 > * + * { margin-top: 0 !important; }
.space-x-3 > * + * { margin-left: 0.75rem !important; }

/* Padding */
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.p-5 { padding: 1.25rem !important; }
.p-6 { padding: 1.5rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.py-3 { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.ps-4 { padding-left: 1rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 0.75rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.ml-3 { margin-left: 0.75rem !important; }

/* Margin */
.m-4 { margin: 1rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.-mb-px { margin-bottom: -1px !important; }

/* Typography - Font */
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-light { font-weight: 300 !important; }

/* Typography - Text colors */
.text-gray-400 { color: #9ca3af !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-600 { color: #4b5563 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-900 { color: #111827 !important; }
.text-white { color: #ffffff !important; }
.text-blue-600 { color: #2563eb !important; }
.text-blue-700 { color: #1d4ed8 !important; }

/* Background colors */
.bg-white { background-color: #ffffff !important; }
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-gray-200 { background-color: #e5e7eb !important; }
.bg-gray-800 { background-color: #1f2937 !important; }
.bg-blue-50 { background-color: #eff6ff !important; }
.bg-blue-600 { background-color: #2563eb !important; }
.bg-blue-700 { background-color: #1d4ed8 !important; }
.bg-transparent { background-color: transparent !important; }

/* Border */
.border { border-width: 1px !important; }
.border-b { border-bottom-width: 1px !important; }
.border-t { border-top-width: 1px !important; }
.border-gray-100 { border-color: #f3f4f6 !important; }
.border-gray-200 { border-color: #e5e7eb !important; }
.border-gray-300 { border-color: #d1d5db !important; }
.border-blue-300 { border-color: #93c5fd !important; }
.border-transparent { border-color: transparent !important; }

/* Border radius */
.rounded { border-radius: 0.25rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-full { border-radius: 9999px !important; }
.rounded-t { border-top-left-radius: 0.25rem !important; border-top-right-radius: 0.25rem !important; }
.rounded-t-lg { border-top-left-radius: 0.5rem !important; border-top-right-radius: 0.5rem !important; }
.rounded-b { border-bottom-left-radius: 0.25rem !important; border-bottom-right-radius: 0.25rem !important; }

/* Width & Height */
.w-full { width: 100% !important; }
.w-6 { width: 1.5rem !important; }
.w-8 { width: 2rem !important; }
.h-5 { height: 1.25rem !important; }
.h-6 { height: 1.5rem !important; }
.h-8 { height: 2rem !important; }
.h-full { height: 100% !important; }
.max-w-2xl { max-width: 42rem !important; }
.max-w-md { max-width: 28rem !important; }

/* Display */
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.hidden { display: none !important; }

/* Position */
.fixed { position: fixed !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }

/* Z-index */
.z-10 { z-index: 10 !important; }
.z-50 { z-index: 50 !important; }

/* Overflow */
.overflow-y-auto { overflow-y: auto !important; }
.overflow-x-hidden { overflow-x: hidden !important; }

/* Shadow */
.shadow { box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }

/* Whitespace */
.whitespace-nowrap { white-space: nowrap !important; }
.whitespace-pre-wrap { white-space: pre-wrap !important; }

/* Text align */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

/* List */
.list-none { list-style-type: none !important; }

/* Divide (для разделителей) */
.divide-y > * + * { border-top-width: 1px !important; }
.divide-gray-100 > * + * { border-color: #f3f4f6 !important; }

/* Truncate */
.truncate { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

/* Hover states */
.hover\:bg-gray-50:hover { background-color: #f9fafb !important; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6 !important; }
.hover\:bg-gray-200:hover { background-color: #e5e7eb !important; }
.hover\:bg-blue-800:hover { background-color: #1e40af !important; }
.hover\:text-gray-900:hover { color: #111827 !important; }
.hover\:text-blue-600:hover { color: #2563eb !important; }
.hover\:text-blue-700:hover { color: #1d4ed8 !important; }
.hover\:underline:hover { text-decoration: underline !important; }
.hover\:border-gray-300:hover { border-color: #d1d5db !important; }

/* Focus states */
.focus\:outline-none:focus { outline: 2px solid transparent !important; outline-offset: 2px !important; }
.focus\:ring-4:focus { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.5) !important; }
.focus\:ring-blue-300:focus { box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.5) !important; }
.focus\:ring-gray-100:focus { box-shadow: 0 0 0 4px rgba(243, 244, 246, 0.5) !important; }
.focus\:ring-gray-200:focus { box-shadow: 0 0 0 4px rgba(229, 231, 235, 0.5) !important; }
.focus\:ring-3:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important; }
.focus\:ring-gray-300:focus { box-shadow: 0 0 0 4px rgba(209, 213, 219, 0.5) !important; }
.focus\:border-blue-500:focus { border-color: #3b82f6 !important; }
.focus\:border-blue-600:focus { border-color: #2563eb !important; }
.focus\:ring-blue-500:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5) !important; }
.focus\:ring-blue-600:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35) !important; }

/* Active state для вкладок */
.active { border-bottom-color: #2563eb !important; color: #2563eb !important; }

/* Screen reader only */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border-width: 0 !important; }

/* RTL support */
.rtl\:space-x-reverse { direction: rtl !important; }
.rtl\:space-x-reverse > * + * { margin-right: 0.75rem !important; margin-left: 0 !important; }

/* Self center */
.self-center { align-self: center !important; }

/* Responsive - md breakpoint */
@media (min-width: 768px) {
    .md\:flex-row { flex-direction: row !important; }
    .md\:items-center { align-items: center !important; }
    .md\:p-5 { padding: 1.25rem !important; }
    .md\:inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
    .md\:order-2 { order: 2 !important; }
    .md\:me-0 { margin-right: 0 !important; }
    .md\:space-y-6 > * + * { margin-top: 0 !important; }
}

/* Responsive - sm breakpoint */
@media (max-width: 640px) {
    .sm\:hidden { display: none !important; }
}

/* Модальные окна - кастомные стили */
[data-modal-backdrop] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

/* Стили для модальных окон task_detail.php */
#editDescriptionModal,
#editStatusModal,
#editAssigneeModal,
#editResponsibleModal,
#editPriorityModal,
#editDueDateModal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: calc(100% - 1rem);
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    #editDescriptionModal,
    #editStatusModal,
    #editAssigneeModal,
    #editResponsibleModal,
    #editPriorityModal,
    #editDueDateModal {
        height: 100%;
    }
}

/* Стили для dropdown меню */
#user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 12rem;
}

#user-dropdown.hidden {
    display: none;
}

/* Стили для кнопки drawer (мобильное меню) */
[data-drawer-target] {
    display: none;
}

@media (max-width: 639px) {
    [data-drawer-target] {
        display: inline-flex;
    }
}

.sidebar-drawer-overlay {
    pointer-events: none;
}
.sidebar-drawer-overlay:not(.hidden) {
    pointer-events: auto;
    left: 5rem; /* не перекрывать левый сайдбар */
}
@media (max-width: 639px) {
    .sidebar-drawer-overlay:not(.hidden) {
        left: 0;
    }
}

/* Дополнительные утилиты */
.h-\[calc\(100\%-1rem\)\] { height: calc(100% - 1rem) !important; }

/* Dark mode стили (для совместимости, но не используются активно) */
.dark\:bg-gray-700 { background-color: #374151 !important; }
.dark\:bg-gray-900 { background-color: #111827 !important; }
.dark\:text-white { color: #ffffff !important; }
.dark\:text-gray-400 { color: #9ca3af !important; }
.dark\:divide-gray-600 > * + * { border-color: #4b5563 !important; }
.dark\:hover\:bg-gray-600:hover { background-color: #4b5563 !important; }
.dark\:hover\:bg-gray-700:hover { background-color: #374151 !important; }
.dark\:hover\:text-white:hover { color: #ffffff !important; }
.dark\:text-gray-200 { color: #e5e7eb !important; }
.dark\:focus\:ring-gray-600:focus { box-shadow: 0 0 0 4px rgba(75, 85, 99, 0.5) !important; }

/* Переопределение для мобильных устройств - task_detail.php */
@media screen and (max-width: 767px) {
    .task-content-layout {
        flex-direction: column !important;
    }
    .task-left-column,
    .task-right-column {
        width: 100% !important;
        flex: 1 1 auto !important;
        max-width: 100% !important;
    }
}

/* ============================================
   ЛОКАЛЬНЫЕ ИКОНКИ (замена Font Awesome)
   ============================================ */

/* Базовые стили для иконок */
.fas, .far, .fab {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    width: 1em;
    height: 1em;
}

/* Иконка дома */
.fa-home::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath fill='currentColor' d='M575.8 255.5c0 18-15 32.1-32 32.1h-32l.7 160.2c0 2.7-.2 5.4-.5 8.1V472c0 22.1-17.9 40-40 40H456c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1H416 392c-22.1 0-40-17.9-40-40V448 384c0-17.7-14.3-32-32-32H256c-17.7 0-32 14.3-32 32v64 24c0 22.1-17.9 40-40 40H160 128.1c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2H104c-22.1 0-40-17.9-40-40V360c0-.9 0-1.9 .1-2.8V256H32c-17 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка папки */
.fa-folder::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C237.1 49.5 224.8 48 216 48H64C28.7 48 0 76.7 0 112V416c0 35.3 28.7 64 64 64z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка задач */
.fa-tasks::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.8s-12.8-2.9-17.2-7.8l-40-44.4c-8.9-9.9-8-25 1.8-33.9s25-8 33.9 1.8l22.8 25.3L118.2 38.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.8s-12.8-2.9-17.2-7.8l-40-44.4c-8.9-9.9-8-25 1.8-33.9s25-8 33.9 1.8l22.8 25.3L118.2 198.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H256c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H256c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H192c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка молнии */
.fa-bolt::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.1 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288H175.5L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.1-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H272.5L349.4 44.6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка chevron-up */
.fa-chevron-up::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M233.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L256 173.3 86.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка chevron-down */
.fa-chevron-down::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка редактирования */
.fa-edit::before, .fa-pencil-alt::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M471.6 21.7c-21.9-21.9-57.3-21.9-79.2 0L362.3 51.7l97.9 97.9 30.1-30.1c21.9-21.9 21.9-57.3 0-79.2L471.6 21.7zm-299.2 220c-6.1 6.1-10.8 13.6-13.5 21.9l-29.6 88.8c-2.9 8.6-.6 18.1 5.8 24.6s15.9 8.7 24.6 5.8l88.8-29.6c8.2-2.7 15.7-7.4 21.9-13.5L437.7 172.3 339.7 74.3 172.4 241.7zM96 64C43 64 0 107 0 160V416c0 53 43 96 96 96H352c53 0 96-43 96-96V320c0-17.7-14.3-32-32-32s-32 14.3-32 32v96c0 17.7-14.3 32-32 32H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H96z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка плюса */
.fa-plus::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка закрытия */
.fa-times::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='currentColor' d='M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка комментариев */
.fa-comments::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath fill='currentColor' d='M208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-1.8 1.6-3.3 2.9-4.3 3.7c-.5 .4-.9 .7-1.1 .8l-.2 .2 0 0 0 0C1 327.2-1.4 334.4 .8 340.9S6 350 12.5 353.2c12.2 6.2 30.4 12.8 52.3 19.5c93.1 28.5 186.2 35.7 280.3 37.8V464c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32V348.2c6.2-1.3 12.3-2.6 18.4-4.1c21.8-6.7 40.1-13.3 52.3-19.5c6.5-3.2 11-8.3 12.7-14.8s-.2-13.7-3.8-19.5l0 0 0 0-.2-.2c-.2-.2-.6-.4-1.1-.8c-1-.8-2.5-2-4.3-3.7c-3.6-3.3-8.5-8.1-13.3-14.3c-5.5-7-10.7-15.4-14.2-24.7C625.3 250.3 640 214.6 640 176c0-97.2-93.1-176-208-176S224 78.8 224 176c0 38.6 14.7 74.3 39.6 103.4c-3.5 9.4-8.7 17.7-14.2 24.7c-4.8 6.2-9.7 11-13.3 14.3c-4.6 4.1-10.4 7.3-17.4 9.6V352z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}


/* Иконка истории */
.fa-history::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-111-34.4c-9.9-6.7-23.3-3.8-30 6.1s-3.8 23.3 6.1 30C157.2 459.4 204.9 480 256 480c123.7 0 224-100.3 224-224S379.7 32 256 32C185.4 32 123.3 67.1 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка отправки */
.fa-paper-plane::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4l-64-25.5c-15.8-6.3-26.7-21.4-25.9-38.1s12.1-30.1 27.4-34.8L448 192 64 128 27.4 101.3C12.1 96.6 1.3 85.4 .5 68.7S11.4 38.4 27.2 32.1l416-160c10.1-3.9 21.5-2.4 30.1 3.8s13.8 15.6 15.4 26.7l64 416c1.5 9.7-2.2 19.4-8.9 26.3s-16.4 11.3-26.2 10.7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка информации */
.fa-info-circle::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка календаря */
.fa-calendar::before, .fa-calendar-alt::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка ссылки */
.fa-link::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath fill='currentColor' d='M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.9 10.3-17.9 30.3-7 45.2s30.3 17.9 45.2 7l1.6-1.1c32.1-22.1 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96c-31.5 31.5-82.5 31.5-114 0c-14.6-14.6-23.8-33.1-26.9-52.2c-2.1-12.8-11.9-23.5-24.7-25.6s-23.5 11.9-25.6 24.7c-4.4 27.1 1.9 54.5 17.5 74.1c20.5 23.5 50.1 36 80.7 36s60.2-12.5 80.7-36l96-96zm-186.5 67.9c-4.4 27.1 1.9 54.5 17.5 74.1c20.5 23.5 50.1 36 80.7 36s60.2-12.5 80.7-36l96-96c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.9 10.3-17.9 30.3-7 45.2s30.3 17.9 45.2 7l1.6-1.1c32.1-22.1 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114l-96 96c-31.5 31.5-82.5 31.5-114 0c-14.6-14.6-23.8-33.1-26.9-52.2c-2.1-12.8-11.9-23.5-24.7-25.6s-23.5 11.9-25.6 24.7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка файла */
.fa-file-alt::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 384 512'%3E%3Cpath fill='currentColor' d='M64 464c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16H224v80c0 17.7 14.3 32 32 32h80V448c0 8.8-7.2 16-16 16H64zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V154.5c0-17-6.7-33.3-18.7-45.3L274.7 18.7C262.7 6.7 246.5 0 229.5 0H64zm90.9 233.3c8.1-10.5 23.2-10.5 31.3 0l41.3 53.7 69-89.6c8.1-10.5 23.2-10.5 31.3 0l92.9 120.7c7.8 10.2 5.5 24.5-5.1 31.7s-24.2 5.6-31.3 0l-69-89.6l-41.3 53.7c-7.8 10.2-22.9 13.1-33.4 5.9s-13.1-22.9-5.9-33.4l41.3-53.7-69 89.6c-7.8 10.2-22.9 13.1-33.4 5.9s-13.1-22.9-5.9-33.4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка предупреждения */
.fa-exclamation-triangle::before, .fa-exclamation-circle::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка галочки */
.fa-check-circle::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка папки с плюсом */
.fa-folder-plus::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M64 480H448c35.3 0 64-28.7 64-64V192c0-35.3-28.7-64-64-64H288c-10.1 0-19.6-4.7-25.6-12.8L243.2 57.6C237.1 49.5 224.8 48 216 48H64C28.7 48 0 76.7 0 112V416c0 35.3 28.7 64 64 64zM232 344c0 13.3-10.7 24-24 24s-24-10.7-24-24V280H144c-13.3 0-24-10.7-24-24s10.7-24 24-24h40V192c0-13.3 10.7-24 24-24s24 10.7 24 24v40h40c13.3 0 24 10.7 24 24s-10.7 24-24 24H232v40z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка папки открытой */
.fa-folder-open::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath fill='currentColor' d='M88.7 223.8L0 375.8V96C0 60.7 28.7 32 64 32H181.5c17 0 33.3 6.7 45.3 18.7l26.5 26.5c12 12 28.3 18.7 45.3 18.7H416c35.3 0 64 28.7 64 64v32H144c-22.8 0-43.8 12.1-55.3 31.8zm27.6 16.1C122.1 230 132.6 224 144 224H544c11.5 0 22 6 27.6 15.9l61.7 112c5.9 10.7 5.9 23.6 0 34.3l-61.7 112c-5.6 9.9-16.1 15.9-27.6 15.9H144c-11.5 0-22-6-27.6-15.9L54.7 390.1c-5.9-10.7-5.9-23.6 0-34.3l61.6-111.9z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка корзины */
.fa-trash::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка сохранения */
.fa-save::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H282.5c-17 0-33.3 6.7-45.3 18.7L146.7 126.1 189.3 168.7c6.2 6.2 16.4 6.2 22.6 0L320 78.1V192c0 17.7 14.3 32 32 32h64V96c0-17.7-14.3-32-32-32H282.5c-8.5 0-16.6-3.4-22.6-9.4L209.4 14.1c-6-6-14.1-9.4-22.6-9.4H64zM48 432c0 8.8 7.2 16 16 16H384c8.8 0 16-7.2 16-16V256H48V432zM224 304a48 48 0 1 1 96 0 48 48 0 1 1 -96 0z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка диаграммы Ганта */
.fa-chart-gantt::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M32 32c17.7 0 32 14.3 32 32V400c0 8.8 7.2 16 16 16H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H80c-44.2 0-80-35.8-80-80V64C0 46.3 14.3 32 32 32zm96 96c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm96 64H352c17.7 0 32 14.3 32 32s-14.3 32-32 32H224c-17.7 0-32-14.3-32-32s14.3-32 32-32zm-96 64H256c17.7 0 32 14.3 32 32s-14.3 32-32 32H128c-17.7 0-32-14.3-32-32s14.3-32 32-32z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка корзины */
.fa-inbox::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='currentColor' d='M121.4 32C103.8 32 88.6 42.1 83.1 57.8L2.2 283.9C-3.4 299.6 1.9 317.1 16.1 326.7l46.9 27.1c15.2 8.8 34.7 3.4 43.5-11.7L144 264.9V456c0 13.3 10.7 24 24 24h152c13.3 0 24-10.7 24-24V264.9l37.5 77.2c8.8 15.2 28.3 20.5 43.5 11.7l46.9-27.1c14.2-8.2 19.5-25.7 13.9-42.8L428.9 57.8C423.4 42.1 408.2 32 390.6 32H121.4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Иконка трех точек */
.fa-ellipsis-h::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'%3E%3Cpath fill='currentColor' d='M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ============================================
   НОВЫЙ САЙДБАР (по образцу скриншота)
   ============================================ */

.sidebar-new {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 16rem;
    background-color: #f5f5f5;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Гарантируем темный цвет текста для всех элементов сайдбара */
.sidebar-new * {
    color: inherit;
}

.sidebar-new a,
.sidebar-new span,
.sidebar-new div {
    color: #374151 !important;
}

.sidebar-new .nav-item,
.sidebar-new .workspace-item {
    color: #374151 !important;
}

.sidebar-new .nav-text,
.sidebar-new .workspace-text {
    color: #374151 !important;
}

/* Заголовок сайдбара */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-company {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.company-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.company-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827 !important;
    flex: 1;
}

.company-dropdown {
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Поисковая строка */
.sidebar-search {
    position: relative;
    margin: 1rem;
    margin-bottom: 0.5rem;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.875rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 2.25rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-shortcut {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

/* Навигация */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    margin: 0;
}

.sidebar-new .nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #374151 !important;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    position: relative;
}

.sidebar-new .nav-text {
    color: #374151 !important;
}

.sidebar-new .nav-item.active .nav-text {
    color: #111827 !important;
}

.nav-item:hover {
    background-color: #f3f4f6;
}

.nav-item.active {
    background-color: #e5e7eb;
    color: #111827;
    font-weight: 500;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 1rem;
    color: #6b7280;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    color: #111827;
}

.nav-text {
    flex: 1;
}

.nav-badge {
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    min-width: 1.5rem;
    text-align: center;
}

/* Разделитель */
.sidebar-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 1rem;
}

/* Секция Workspace */
.sidebar-workspace {
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    user-select: none;
}

.workspace-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.workspace-dropdown {
    font-size: 0.75rem;
    color: #6b7280;
}

.workspace-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.workspace-list li {
    margin: 0;
}

.workspace-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #374151 !important;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.workspace-text {
    color: #374151 !important;
}

.workspace-item:hover {
    background-color: #f3f4f6;
}

.workspace-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    flex-shrink: 0;
}

.workspace-text {
    flex: 1;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 640px) {
    .sidebar-new {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar-new.open {
        transform: translateX(0);
    }
}

/* ============================================
   Стили для диаграммы Ганта
   ============================================ */

/* View Selector для Ганта */
.gantt-view-selector {
    background: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 16px;
    border-radius: 8px;
}

.gantt-view-btn {
    padding: 8px 16px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.gantt-view-btn:hover {
    background: #f8f8f8;
}

.gantt-view-btn.active {
    background: #f0f0f0;
    border-color: #999;
}

.gantt-action-btns {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.gantt-icon-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d0d0d0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.gantt-icon-btn:hover {
    background: #f8f8f8;
}

/* Project Section для Ганта */
.gantt-project-section {
    background: white;
    margin: 16px 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.gantt-project-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gantt-project-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gantt-color-indicator {
    width: 4px;
    height: 24px;
    border-radius: 2px;
}

.gantt-project-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.gantt-dropdown {
    padding: 4px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.gantt-header-actions {
    display: flex;
    gap: 8px;
}

/* Gantt Container */
.gantt-container {
    display: flex;
    overflow-x: auto;
}

.gantt-container .task-table {
    min-width: 550px;
    border-right: 1px solid #e0e0e0;
    background: #fafafa;
}

.gantt-container .task-table table {
    width: 100%;
    border-collapse: collapse;
}

.gantt-container .task-table thead {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.gantt-container .task-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.gantt-container .task-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #ececec;
    font-size: 13px;
    color: #333;
}

.gantt-container .task-table tbody tr:hover {
    background: #f9f9f9;
}

.gantt-container .avatar {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
}

.gantt-container .add-new {
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #4a9eff;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.gantt-container .add-new:hover {
    background: #f5f5f5;
}

/* Gantt Chart */
.gantt-container .gantt-chart {
    flex: 1;
    min-width: 800px;
    background: white;
    position: relative;
}

.gantt-container .gantt-header {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.gantt-container .week {
    flex: 1;
    border-right: 1px solid #e0e0e0;
}

.gantt-container .week:last-child {
    border-right: none;
}

.gantt-container .week-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.gantt-container .days {
    display: flex;
    background: white;
}

.gantt-container .days span {
    flex: 1;
    padding: 8px 4px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-right: 1px solid #f0f0f0;
}

.gantt-container .days span:last-child {
    border-right: none;
}

.gantt-container .gantt-bars {
    position: relative;
    padding: 12px 0;
    min-height: 240px;
}

.gantt-container .bar {
    position: absolute;
    height: 32px;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    margin: 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-container .bar:nth-child(1) { top: 10px; }
.gantt-container .bar:nth-child(2) { top: 50px; }
.gantt-container .bar:nth-child(3) { top: 90px; }
.gantt-container .bar:nth-child(4) { top: 130px; }
.gantt-container .bar:nth-child(5) { top: 170px; }
.gantt-container .bar:nth-child(6) { top: 210px; }

/* Темная тема для Ганта */
.dark .gantt-view-selector,
.dark .gantt-project-section {
    background: #1f2937;
    border-color: #374151;
}

.dark .gantt-project-title h2 {
    color: #f9fafb;
}

/* Темная тема для Ганта */
.dark .gantt-container .task-table {
    background: #111827;
    border-color: #374151;
}

.dark .gantt-container .task-table thead {
    background: #1f2937;
    border-color: #374151;
}

.dark .gantt-container .task-table th {
    color: #d1d5db;
}

.dark .gantt-container .task-table td {
    color: #e5e7eb;
    border-color: #374151;
}

.dark .gantt-container .task-table tbody tr:hover {
    background: #1f2937;
}

.dark .gantt-container .gantt-chart {
    background: #1f2937;
}

.dark .gantt-container .gantt-header {
    background: #111827;
    border-color: #374151;
}

.dark .gantt-container .week-title {
    color: #d1d5db;
    border-color: #374151;
}

.dark .gantt-container .days {
    background: #1f2937;
}

.dark .gantt-container .days span {
    color: #9ca3af;
    border-color: #374151;
}

.dark .gantt-container .bar {
    color: #f9fafb;
}

/* Адаптивность для Ганта */
@media (max-width: 768px) {
    .gantt-container {
        flex-direction: column;
    }
    
    .gantt-container .task-table {
        min-width: 100%;
    }
    
    .gantt-container .gantt-chart {
        min-width: 100%;
    }
}

/* ============================================
   СТИЛИ ДЛЯ ТАБЛИЦЫ ПРОЕКТОВ (projects.php)
   ============================================ */

/* Таблица проектов - светлая тема */
.projects-table-wrapper {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.projects-table-wrapper table {
    width: 100%;
    text-align: left;
    font-size: 0.875rem;
    color: #6b7280;
    background-color: white;
}

.projects-table-wrapper thead {
    font-size: 0.75rem;
    text-transform: uppercase;
    background-color: #f9fafb;
    color: #374151;
}

.projects-table-wrapper thead th {
    padding: 0.75rem 0.5rem;
    color: #374151;
    font-weight: 600;
}

.projects-table-wrapper tbody tr {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.15s ease;
}

.projects-table-wrapper tbody tr:hover {
    background-color: #f9fafb;
}

.projects-table-wrapper tbody td,
.projects-table-wrapper tbody th {
    padding: 1rem 0.5rem;
    color: #374151;
}

.projects-table-wrapper tbody td a {
    color: #111827;
    font-weight: 600;
    text-decoration: none;
}

.projects-table-wrapper tbody td a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Кнопки действий */
.projects-table-wrapper button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
}

.projects-table-wrapper button:hover {
    opacity: 0.7;
}

/* Отступ для задач, входящих в этап (вкладка Задачи → Список) */
#tasks-list-table-wrap .stage-task-row th,
#tasks-list-table-wrap .stage-task-row td {
    padding-left: 2.5rem;
}

/* Панель фильтра задач — всегда светлый фон и одинаковые поля */
.tasks-filter-bar,
.tasks-filter-bar select,
.tasks-filter-bar input.tasks-filter-value {
    background-color: #fff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}
.tasks-filter-bar input::placeholder {
    color: #6b7280 !important;
}
.tasks-filter-select {
    width: 8rem !important;
    min-width: 8rem !important;
    box-sizing: border-box;
}

/* ===== Analytics: Gantt Chart ===== */

.gantt-project-row {
    background: #f8fafc;
}
.gantt-project-row:hover {
    background: #f1f5f9;
}
.gantt-project-row .gantt-label-cell {
    background: inherit;
}

.gantt-stage-row {
    background: #ffffff;
    align-items: center;
    min-height: 36px;
}
.gantt-stage-row:hover {
    background: #f0f7ff;
}
.gantt-stage-row .gantt-label-cell {
    background: inherit;
}

/* Колонки в левой ячейке Ганта: код | длительность | исполнитель */
.gantt-task-cols {
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    overflow: hidden;
}
.gantt-col-code {
    flex: 0 0 auto;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-col-days {
    flex: 0 0 45px;
    text-align: right;
    padding: 0 6px;
}
.gantt-col-assignee {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Gantt link arrows */
.gantt-link-path {
    stroke: #94a3b8;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Gantt bar base (row height 28px) */
.gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    border-radius: 5px;
    overflow: hidden;
    cursor: default;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    z-index: 2;
}
.gantt-bar:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    z-index: 3;
    transform: translateY(-50%) scale(1.02);
}

/* Bar fill track */
.gantt-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Bar text */
.gantt-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
    pointer-events: none;
}

/* Completed / In progress / Not started — цвета из настроек (Стили badges: done, progress, draft) */
.gantt-bar-completed {
    background: var(--badge-done-bg, #dcfce7);
}
.gantt-bar-completed .gantt-bar-fill {
    background: var(--badge-done-color, #22c55e);
}
.gantt-bar-completed .gantt-bar-text {
    color: var(--badge-done-color, #166534);
}

.gantt-bar-progress {
    background: var(--badge-progress-bg, #dbeafe);
}
.gantt-bar-progress .gantt-bar-fill {
    background: var(--badge-progress-color, #3b82f6);
}
.gantt-bar-progress .gantt-bar-text {
    color: var(--badge-progress-color, #1e3a5f);
}

.gantt-bar-empty {
    background: var(--badge-draft-bg, #f1f5f9);
    border: 1px dashed var(--badge-draft-color, #94a3b8);
}
.gantt-bar-empty .gantt-bar-text {
    color: var(--badge-draft-color, #64748b);
}

/* Gantt scroll area */
.gantt-scroll-area {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.gantt-scroll-area::-webkit-scrollbar {
    height: 8px;
}
.gantt-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.gantt-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.gantt-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Кнопка «Добавить проект» / «Создать задачу» в шапке — в конце файла, чтобы синий фон не перебивался */
nav.main-nav a.header-create-btn,
a.header-create-btn {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: none !important;
}
nav.main-nav a.header-create-btn:hover,
a.header-create-btn:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* Выбранная кнопка подвкладки (Список/Диаграмма/Доска/Календарь) — при наведении остаётся синей, не белеет */
#tasks-tab-switcher .tasks-inner-tab-btn.bg-primary:hover,
#tasks-tab-switcher .tasks-inner-tab-btn[aria-selected="true"]:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Кнопки Дни/Недели/Месяцы в календаре — активная при наведении остаётся синей */
#calendar-view-mode-wrap .calendar-view-mode-btn.bg-primary:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Календарь проекта: выходные и праздники по производственному календарю */
.calendar-day-weekend {
    background-color: #f1f5f9 !important;
}
.calendar-day-weekend .cal-day-num,
.calendar-day-weekend .text-muted-foreground {
    color: #b91c1c !important;
}
.calendar-day-holiday {
    background-color: #fef2f2 !important;
}
.calendar-day-holiday .cal-day-num,
.calendar-day-holiday .text-muted-foreground {
    color: #dc2626 !important;
}

/* Календарь: полосы задач «сквозь дни» в сетке */
.cal-grid-7 {
    grid-auto-rows: minmax(28px, auto);
}
.cal-task-bar {
    min-height: 24px;
    align-self: stretch;
}
