body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    width: 100%;
    min-height: 100vh;
}

/* Мобильные стили (до 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        padding: 0 15px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .top-nav {
        justify-content: space-between;
        width: 100%;
        padding: 10px 0;
    }

    .nav-btn {
        margin: 5px 0;
        width: 100%;
        text-align: center;
    }

    .main-nav {
        flex-direction: column;
        gap: 10px;
        padding: 0;
    }

    .tickets-table th, 
    .tickets-table td,
    .users-table th,
    .users-table td {
        padding: 8px 2px;
        font-size: 13px;
    }

    .form-container,
    .auth-form {
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .ticket-grid {
        grid-template-columns: 1fr;
    }

    .detail-item {
        flex-direction: column;
    }

    .detail-value {
        max-width: 100%;
        text-align: left;
        margin-top: 5px;
    }

    .problem-description {
        max-width: 100%;
    }

    .chat-form {
        flex-direction: column;
    }

    .chat-form input {
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .chat-form button {
        width: 100%;
        border-radius: 4px;
    }

    .report-form .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .header-logo {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .system-title {
        font-size: 1.5rem;
    }
}

/* Планшеты (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 95%;
    }

    .tickets-table th, 
    .tickets-table td,
    .users-table th,
    .users-table td {
        padding: 8px 3px;
        font-size: 14px;
    }

    .ticket-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Общие улучшения для мобильных устройств */
@media (max-width: 1024px) {
    .table-wrapper,
    .tickets-container {
        max-height: none;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    .nav-user-info {
        display: block;
        margin: 10px 0;
        text-align: center;
    }

    .message {
        max-width: 85%;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    /* Делаем все кнопки блочными и полноразмерными */
    .btn, .nav-btn, .create-btn, .edit-btn, .back-btn, 
    .nonedit-btn, .submit-btn, .nonsubmit-btn, .btn-danger,
    .edit-btnback, .report-bug-button button {
        display: block;
        width: 100%;
        margin: 8px 0;
        padding: 12px 10px;
        box-sizing: border-box;
    }

    /* Кнопки в таблице */
    .tickets-table .btn, 
    .users-table .btn {
        padding: 8px 10px;
        margin: 3px 0;
        font-size: 12px;
    }

    /* Кнопки действий */
    .ticket-actions {
        flex-direction: column;
    }

    .ticket-actions .btn {
        margin-right: 0;
        margin-bottom: 10px;
    }

    /* Кнопка отправки отчета */
    .report-bug-button {
        bottom: 20px;
        right: 20px;
    }

    .report-bug-button button {
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* ======================== */
/* АДАПТАЦИЯ ТАБЛИЦЫ ТИКЕТОВ */
/* ======================== */

/* Базовые стили таблицы */
.tickets-table, .users-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    /* Контейнер для таблицы с горизонтальным скроллом */
    .table-wrapper, .tickets-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 15px 0;
        border-radius: 5px;
    }

    /* Сама таблица */
    .tickets-table, .users-table {
        min-width: 600px; /* Фиксированная минимальная ширина */
    }

    /* Заголовки и ячейки */
    .tickets-table th, 
    .tickets-table td,
    .users-table th,
    .users-table td {
        padding: 8px 5px;
        font-size: 12px;
        text-align: center;
    }

    /* Кнопки в строках таблицы */
    .tickets-table .inline-form,
    .users-table .inline-form {
        display: block;
        margin: 5px 0;
    }

    /* Приоритеты в таблице */
    .priority-НИЗКИЙ,
    .priority-СРЕДНИЙ,
    .priority-ВЫСОКИЙ {
        font-size: 11px;
        white-space: nowrap;
    }
}

/* ========================== */
/* ДОПОЛНИТЕЛЬНЫЕ АДАПТАЦИИ */
/* ========================== */

@media (max-width: 768px) {
    /* Формы в таблице */
    .inline-form {
        display: block;
        margin-left: 0;
    }

    /* Чекбоксы */
    .checkbox-label {
        font-size: 13px;
    }

    /* Модальные окна */
    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 15px;
    }

    /* Карточки систем */
    .system-card {
        padding: 20px;
    }

    .system-card h2 {
        font-size: 2.5em;
    }
}

/* ======================= */
/* ОСОБЫЕ СЛУЧАИ ДЛЯ IOS */
/* ======================= */
@supports (-webkit-touch-callout: none) {
    /* Улучшаем отзывчивость на iOS */
    .btn, .nav-btn {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Увеличиваем область касания */
    .tickets-table .btn {
        min-height: 36px;
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 5px;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

h1, h2 {
    color: #2c3e50;
}

header nav {
    display: inline-block;
    float: right;
}

header nav a, header nav span {
    color: #333;
    text-decoration: none;
    margin-left: 15px;
}

.nav-btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid #3498db;
    flex: 0 0 auto; /* Добавляем */
    margin: 5px 0; /* Изменяем */
}

/* Сохраняем переносы строк в textarea */
textarea {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.nav-btn:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}
.table-wrapper {
    max-height: 600px;
    overflow-y: auto;
    /* border: 1px solid #e0e0e0; */
    border-radius: 8px;
    /* margin: 20px 0; */
}
.main-nav-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.main-nav-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    padding: 0 15px;
    flex-wrap: wrap;
}

.nav-user-info {
    margin-right: 15px;
    color: #2c3e50;
    font-weight: bold;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.create-btn {
    background-color: #3498db;
    color: white;
}

.create-btn:hover {
    background-color: #2980b9;
}

.edit-btn {
    background-color: #f39c12;
    color: white;
    border: none;
}

.back-btn {
    background-color: #f39c12;
    color: white;
    border: none;
}

.nonedit-btn {
    background-color: #f39c12;
    padding: 4px 20px;
    margin-top: 10px;
    color: white;
    border: none;
    cursor: pointer;
}

.edit-btn:hover {
    background-color: #e67e22;
}

.submit-btn {
    background-color: #2ecc71;
    color: white;
    border: none;
    cursor: pointer;
}
.nonsubmit-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: #27ae60;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

.test-mode-banner {
    background: #ff6b00;
    color: white;
    text-align: center;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.tickets-container {
    max-height: 540px; /* Фиксированная высота контейнера */
    overflow-y: auto;  /* Вертикальный скролл */
    /* border: 1px solid #e0e0e0; */
    border-radius: 8px;
    margin: 20px 0;
}

.tickets-table {
    width: 100%;
    border-collapse: collapse;
    /* margin-top: 20px; */
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative
}

.tickets-table th, .tickets-table td {
    padding: 10px 2px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-collapse: collapse;
}

.tickets-table th {
    background-color: #3498db;
    color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tickets-table tr:hover {
    background-color: #f1f1f1;
}

.form-container {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
    
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-groupcheck label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
    cursor: pointer;
}

.form-group input[type="login"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    /* padding: 1px; */
    border: 1px solid #b9b9b9;
    border-radius: 5px;
    font-size: 20px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    
}

/* Стили для приоритетов */
.priority-НИЗКИЙ {
    color: #2ecc71;
}

.priority-СРЕДНИЙ {
    color: #f39c12;
}

.priority-ВЫСОКИЙ {
    color: #e74c3c;
    font-weight: bold;
}

.alert {
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

footer {
    /* margin-top: 30px; */
    /* padding: 20px 0; */
    background: #f5f5f5;
    color: #333;
    text-align: center;
}

/* Стили для чата */
.ticket-chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.ticket-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 5px;
    max-width: 70%;
}

.my-message {
    background: #e3f2fd;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.other-message {
    background: #ffffff;
    margin-right: auto;
    border-bottom-left-radius: 0;
    /* box-shadow: 0 1px 1px rgba(0,0,0,0.1); */
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.sender {
    font-weight: bold;
    color: #3498db;
}

.time {
    color: #6c757d;
}

.message-text {
    word-wrap: break-word;
}

.no-messages {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.chat-form {
    display: flex;
    margin-bottom: 20px;
}

.chat-form input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px 0 0 4px;
}

.chat-form button {
    border-radius: 4px 4px 4px 4px;
    margin-top: 10px;
}

.edit-btnback {
    display: block;
    text-align: center;
    margin-top: 10px;
    background-color: white;
    color: rgb(133, 133, 133);
}

/*стиль для пользователей*/
.users-table {
    width: 100%;
    border-collapse: collapse;
    /* margin-top: 20px; */
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative
}


.users-table th {
    background-color: #3498db;
    color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.users-table th, .users-table td {
    padding: 10px 4px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

/* Делаем таблицы одинаковыми */
.tickets-table, .users-table {
    border-collapse: collapse;
    border: 1px solid var(--border-color);
}

.btn-danger{
    border: none;
    color: white;
    padding: 15px 15px;
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn-danger:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}
.inline-form {
    display: inline-block;
    margin-left: 5px;
}

.form-group small {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.auth-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 10px;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Стили для телефонного ввода */
input[type="tel"] {
    direction: ltr;
    text-align: left;
}

.systems-container {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 20px; */
    text-align: center;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    padding: 10px 0;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    margin: 20px 0;
}

.system-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px 20px 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    box-sizing: border-box;
}

.system-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.system-card .card-content {
    width: 100%;
}

.system-card h2 {
    font-size: 3.5em;
    margin: 0 0 15px;
    line-height: 1;
}

.system-card h3 {
    margin: 0 0 10px;
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
}

.system-card p {
    color: #666;
    line-height: 1.5;
    font-size: 14px;
    margin: 0;
}

/* ======================== */
/* АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ */
/* ======================== */

@media (max-width: 1024px) {
    .systems-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
}

/* ======================== */
/* АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ */
/* ======================== */

@media (max-width: 768px) {
    .systems-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .system-card {
        padding: 20px 15px;
        min-height: 160px;
    }
    
    .system-card h2 {
        font-size: 2.8em;
    }
    
    .system-card h3 {
        font-size: 14px;
    }
    
    .system-card p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .systems-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .system-card {
        padding: 15px 10px;
        min-height: 130px;
    }
    
    .system-card h2 {
        font-size: 2.2em;
        margin-bottom: 10px;
    }
    
    .system-card h3 {
        font-size: 12px;
    }
    
    .system-card p {
        font-size: 11px;
        display: none; /* Скрываем описание на самых маленьких экранах */
    }
}

.placeholder {
    text-align: center;
    padding: 50px;
    background: var(--card-bg);
    border-radius: 8px;
    margin: 50px 0;
}

.placeholder p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    /* margin-bottom: 30px; */
}

.logo {
    width: 120px;
    height: auto;
}

.system-title {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
    letter-spacing: 1px;
}

.systems-description {
    text-align: center;
    /* margin-bottom: 40px; */
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.auth-required {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 8px;
    margin: 50px auto;
    max-width: 500px;
}

.auth-required p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #666;
}

.ticket-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.info-block {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-block h3 {
    color: var(--primary-color);
    margin-top: 0;
}

.ticket-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Стили для истории сообщений */
.chat-history {
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Детали тикета */
.ticket-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-block {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-block.full-width {
    grid-column: 1 / -1;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.detail-value {
    text-align: right;
    max-width: 70%;
}

/* Стили статусов */
.status-closed {
    color: #28a745;
    font-weight: bold;
}

.priority-high {
    color: #dc3545;
}

.priority-medium {
    color: #ffc107;
}

.priority-low {
    color: #17a2b8;
}

/* Описание проблемы */
.problem-description {
    text-align: left;
    max-width: 70%;
    /* white-space: pre-line; */
    line-height: 1.6;
}

/* История сообщений */
.message-history {
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
}



/* Стили системы отчетов */
.report-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.report-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.submission-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.submission-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.submission-content {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.form-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 25px;
    background: var(--card-bg);
    
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.report-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.report-form .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Кнопка */
.report-bug-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.report-bug-button button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 20px;
    width: 60%;
    border-radius: 8px;
}

.close {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

.input-with-checkbox {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Основное поле ввода */
.input-main {
    flex: 1;
    min-width: 0; /* Фикс для переполнения */
}

/* Контейнер чекбокса */
.checkbox-container {
    flex-shrink: 0;
    margin-top: 24px; /* Выравнивание по вертикали */
}

/* Кастомный чекбокс */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 25px;
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid #3498db;
    border-radius: 4px;
}

.checkbox-label:hover input ~ .checkmark {
    background-color: #f0f8ff;
}

.checkbox-label input:checked ~ .checkmark {
    background-color: #3498db;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-text {
    margin-left: 5px;
    font-size: 14px;
    color: #444;
    white-space: nowrap;
}

/* Стили для фильтров */
.filter-container {
    position: relative;
    display: inline-block;
    margin: 10px 0;
  }
  
  .filter-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
  }
  
  .filter-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    display: none;
  }
  
  .filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }
  
  .modal-content {
    background: white;
    border-radius: 8px;
    width: 320px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalOpen 0.3s ease-out;
  }
  
  @keyframes modalOpen {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
  }
  
  .close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
  }
  
  .filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
  }
  
  .filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
  }
  
  .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
  }
  
  .status-open { background: #0099ff; }
  .status-pending { background: #fbff00; }
  .status-closed { background: #3cff00; }
  .status-canceled {background: #fc0303;}
  
  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #eee;
  }
  
  .apply-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  
  .reset-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
  }
  

  
  .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
  }
  
  .priority-high { background: #e74c3c; }
  .priority-medium { background: #f39c12; }
  .priority-low { background: #3498db; }
  
  /* Индикатор загрузки */
  #loadingIndicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1001;
  }
  
  .loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Сообщения */
  .message {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
  }
  
  .error-message {
    background: #f8d7da;
    color: #721c24;
  }
  
  .empty-message {
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
  }

/* ======================== */
/* СТИЛИ ДЛЯ ЖУРНАЛА ЗАЯВОК */
/* ======================== */

.contracts-container {
    max-height: 540px;
    overflow-y: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.contracts-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.contracts-table th {
    background-color: #3498db;
    color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contracts-table th, .contracts-table td {
    padding: 10px 5px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.contracts-table tr:hover {
    background-color: #f1f1f1;
}

/* Статусы для заявок */
.status-documents {
    background-color: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-review {
    background-color: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-revision {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-plan {
    background-color: #9b59b6;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-placement {
    background-color: #1abc9c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-placed {
    background-color: #2ecc71;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.status-contract {
    background-color: #34495e;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .contracts-table {
        min-width: 800px;
    }
    
    .contracts-table th, 
    .contracts-table td {
        padding: 8px 3px;
        font-size: 12px;
    }
}

/* Стили для детальной страницы */
.contract-details {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.contract-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.contract-block {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.contract-block.full-width {
    grid-column: 1 / -1;
}

.contract-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.contract-label {
    font-weight: 600;
    color: #666;
}

.contract-value {
    text-align: right;
    max-width: 70%;
}

.amount-value {
    font-weight: bold;
    color: #27ae60;
}

/* ======================== */
/* СТИЛИ ДЛЯ ЖУРНАЛА ЗАЯВОК */
/* ======================== */

/* Статусы заявок */
.status-documents {
    color: #2ecc71;
    font-weight: 500;
}

.status-review {
    color: #f39c12;
    font-weight: 500;
}

.status-revision {
    color: #e74c3c;
    font-weight: bold;
}

.status-plan {
    color: #9b59b6;
    font-weight: 500;
}

.status-placement {
    color: #1abc9c;
    font-weight: 500;
}

.status-placed {
    color: #27ae60;
    font-weight: 500;
}

.status-contract {
    color: #34495e;
    font-weight: 500;
}

/* Улучшенные стили для форм */
.form-container {
    max-width: 800px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.form-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select {
    background-color: white;
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* Кнопки в формах */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.form-actions .submit-btn {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.form-actions .submit-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.form-actions .edit-btnback {
    background: #95a5a6;
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
}

.form-actions .edit-btnback:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(149, 165, 166, 0.3);
}

/* Детальная страница */
.detail-block {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #ecf0f1;
}

.detail-block h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #3498db;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.detail-item {
    display: flex;
    margin: 15px 0;
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    width: 200px;
    flex-shrink: 0;
}

.detail-value {
    color: #2c3e50;
    flex-grow: 1;
}

/* Сумма в деталях */
.amount-highlight {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
    background: #e8f8f5;
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

/* Объект закупки в деталях */
.object-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    line-height: 1.6;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .form-container {
        padding: 20px;
        margin: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .submit-btn,
    .form-actions .edit-btnback {
        width: 100%;
    }
    
    .detail-item {
        flex-direction: column;
    }
    
    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* ======================== */
/* КАРТОЧКИ ДЛЯ ДЕТАЛЬНОЙ ИНФОРМАЦИИ */
/* ======================== */

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.detail-card h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3498db;
}

.detail-card h3 i {
    color: #3498db;
    width: 24px;
}

/* Информационные строки */
.info-row {
    display: flex;
    margin: 12px 0;
    padding: 5px 0;
    border-bottom: 1px dashed #edf2f7;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 200px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label i {
    width: 20px;
    color: #3498db;
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: #1e293b;
    font-size: 15px;
    font-weight: 500;
    padding-left: 20px;
}

/* Для длинного текста */
.info-text-block {
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 8px;
    line-height: 1.6;
    color: #334155;
    font-size: 15px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
}

/* Бейдж суммы */
.amount-badge {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .info-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .info-label {
        width: 100%;
    }
    
    .info-value {
        padding-left: 28px;
    }
    
    .detail-card {
        padding: 15px;
    }
}

/* ======================== */
/* СТИЛИ ДЛЯ КАРТОЧЕК ЗАЯВОК */
/* ======================== */

.contract-detail-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f6;
}

.contract-detail-card h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3498db;
}

.contract-detail-card h3 i {
    color: #3498db;
    font-size: 20px;
}

/* Строка информации */
.contract-info-row {
    display: flex;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
}

.contract-info-row:last-child {
    border-bottom: none;
}

/* Метка (левая часть) */
.contract-info-label {
    width: 180px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.contract-info-label i {
    width: 18px;
    color: #3498db;
    font-size: 14px;
}

/* Значение (правая часть) */
.contract-info-value {
    font-size: 15px;
    color: #0f172a;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
}

/* Для блока с длинным текстом */
.contract-text-block {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #1e293b;
    border: 1px solid #e9eef2;
    margin: 0;
}

/* Бейдж суммы */
.contract-amount {
    background: #059669;
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    display: inline-block;
}

/* Бейдж статуса */
.contract-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    margin-left: 15px;
}

/* Цвета статусов */
.status-blue { background: #3498db; }
.status-green { background: #10b981; }
.status-yellow { background: #f59e0b; }
.status-red { background: #ef4444; }
.status-purple { background: #8b5cf6; }
.status-teal { background: #14b8a6; }
.status-gray { background: #64748b; }

/* Кнопки действий */
.contract-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #eef2f6;
    flex-wrap: wrap;
}

.contract-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
}

.contract-btn i {
    font-size: 16px;
}

.contract-btn-primary {
    background: #3498db;
    color: white;
}

.contract-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.contract-btn-success {
    background: #10b981;
    color: white;
}

.contract-btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.contract-btn-warning {
    background: #f59e0b;
    color: white;
}

.contract-btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.contract-btn-danger {
    background: #ef4444;
    color: white;
}

.contract-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.contract-btn-secondary {
    background: #94a3b8;
    color: white;
}

.contract-btn-secondary:hover {
    background: #64748b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.3);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .contract-detail-card {
        padding: 18px;
    }
    
    .contract-info-row {
        flex-direction: column;
        gap: 6px;
        padding: 10px 0;
    }
    
    .contract-info-label {
        width: 100%;
    }
    
    .contract-info-value {
        padding-left: 26px;
    }
    
    .contract-actions {
        flex-direction: column;
    }
    
    .contract-btn {
        width: 100%;
    }
    
    .contract-status-badge {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* ======================== */
/* КНОПКИ ДЛЯ ФОРМ ЗАЯВОК */
/* ======================== */

/* Контейнер для кнопок в формах */
.form-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Базовый стиль кнопок */
.form-btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: normal;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: background-color 0.3s;
    min-width: 150px;
}

/* Кнопка сохранения/создания */
.form-btn-save {
    background-color: #2ecc71;
    color: white;
}

.form-btn-save:hover {
    background-color: #27ae60;
}

/* Кнопка отмены */
.form-btn-cancel {
    background-color: #f39c12;
    color: white;
}

.form-btn-cancel:hover {
    background-color: #e67e22;
}

/* Кнопка возврата к списку */
.form-btn-back {
    background-color: #3498db;
    color: white;
}

.form-btn-back:hover {
    background-color: #2980b9;
}

/* Для мобильных */
@media (max-width: 768px) {
    .form-buttons {
        flex-direction: column;
    }
    
    .form-btn {
        width: 100%;
    }
}

/* Центрирование кнопок в формах */
.form-container .form-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Отступы для кнопок в таблице */
.tickets-table td .edit-btn {
    margin: 0 5px;
    display: inline-block;
}

.tickets-table td a:first-child {
    margin-left: 0;
}

.tickets-table td a:last-child {
    margin-right: 0;
}

/* Закругленные кнопки действий в таблице */
.tickets-table td .edit-btn {
    border-radius: 20px;
    padding: 6px 12px;
    margin: 0 4px;
    display: inline-block;
    transition: all 0.2s ease;
}

.tickets-table td .edit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ======================== */
/* СТИЛИ ДЛЯ ФИЛЬТРА */
/* ======================== */

.filter-section {
    margin: 20px 0;
    position: relative;
}

.filter-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.filter-modal {
    display: none;
    position: absolute;
    top: 45px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 320px;
    z-index: 1000;
    border: 1px solid #e9ecef;
    padding: 0;
}

.filter-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.close-filter {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #95a5a6;
}

.filter-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.initiator-list, .status-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.initiator-item, .status-item {
    margin-bottom: 8px;
}

.initiator-item label, .status-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
}

.filter-footer {
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.filter-apply {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.filter-reset {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.active-filters {
    margin: 10px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-tag {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.filter-tag i {
    cursor: pointer;
    color: #e74c3c;
}

/* ======================== */
/* СТИЛИ ДЛЯ БАГ-ТРЕКЕРА */
/* ======================== */

.bug-tracker-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.bug-tracker-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #dc3545;
    border: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 24px;
    animation: pulse 2s infinite;
}

.bug-tracker-btn:hover {
    transform: scale(1.1) rotate(90deg);
    background: #c82333;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

.bug-tracker-btn i {
    transition: transform 0.3s ease;
}

.bug-tracker-btn:hover i {
    transform: rotate(90deg);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Модальное окно для баг-трекера */
.bug-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.bug-modal.show {
    display: flex;
}

.bug-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bug-modal-header {
    padding: 20px 25px;
    background: #dc3545;
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bug-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bug-modal-header h3 i {
    font-size: 24px;
}

.bug-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.bug-modal-close:hover {
    opacity: 1;
}

.bug-modal-body {
    padding: 25px;
}

.bug-form-group {
    margin-bottom: 20px;
}

.bug-form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.bug-form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    min-height: 120px;
    resize: vertical;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.bug-form-group textarea:focus {
    outline: none;
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.bug-form-group small {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 13px;
}

.bug-user-info {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #dc3545;
}

.bug-user-info i {
    color: #dc3545;
    font-size: 20px;
}

.bug-user-info span {
    color: #2c3e50;
    font-weight: 500;
}

.bug-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.bug-btn-submit {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bug-btn-submit:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

.bug-btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bug-btn-cancel:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Для мобильных */
@media (max-width: 768px) {
    .bug-tracker-button {
        bottom: 20px;
        right: 20px;
    }
    
    .bug-tracker-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .bug-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .bug-modal-footer {
        flex-direction: column;
    }
    
    .bug-btn-submit,
    .bug-btn-cancel {
        width: 100%;
        justify-content: center;
    }
}

/* ======================== */
/* СТИЛИ ДЛЯ УЧЁТА ТЕХНИКИ */
/* ======================== */

.tech-assets-container {
    max-height: 540px;
    overflow-y: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.tech-assets-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.tech-assets-table th {
    background-color: #3498db;
    color: #f1f1f1;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tech-assets-table th, .tech-assets-table td {
    padding: 10px 5px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.tech-assets-table tr:hover {
    background-color: #f1f1f1;
}

/* QR-код */
.qr-code-container {
    position: relative;
    display: inline-block;
}

.qr-code-img {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.qr-code-img:hover {
    transform: scale(1.1);
}

.qr-code-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    border: 1px solid #e0e0e0;
}

.qr-code-popup.show {
    display: block;
}

.qr-code-popup img {
    width: 200px;
    height: 200px;
}

/* Типы техники */
.asset-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.asset-type-pc { background-color: #3498db; }
.asset-type-monitor { background-color: #2ecc71; }
.asset-type-printer { background-color: #e74c3c; }
.asset-type-laptop { background-color: #9b59b6; }
.asset-type-other { background-color: #95a5a6; }

/* Статусы */
.asset-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
}

.asset-status-active { background-color: #2ecc71; }
.asset-status-repair { background-color: #f39c12; }
.asset-status-decommissioned { background-color: #e74c3c; }
.asset-status-storage { background-color: #3498db; }

/* Инвентарный номер */
.inventory-badge {
    background-color: #34495e;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
}

/* Фикс для статусов в таблице */
.tech-assets-table td .asset-status {
    white-space: nowrap !important;
    display: inline-block !important;
    width: auto !important;
    min-width: auto !important;
    padding: 4px 12px !important;
}

/* Увеличим минимальную ширину для ячейки статуса */
.tech-assets-table td:nth-child(10) {
    min-width: 120px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .contract-detail-card {
        padding: 10px !important;
    }
    
    .qr-code {
        width: 150px !important;
        height: 150px !important;
    }
    
    .contract-info-value {
        font-size: 13px !important;
    }
    
    .asset-status,
    .inventory-badge {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }
}

/* Фикс для ячейки типа */
.tech-assets-table td:first-child + td {
    white-space: nowrap !important;
    min-width: 100px;
}

.asset-type-badge {
    display: inline-block;
    white-space: nowrap;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Цвета для новых типов */
.asset-type-mfu { background: #9b59b6; color: white; }
.asset-type-server { background: #34495e; color: white; }
.asset-type-network { background: #1abc9c; color: white; }

/* Общие фиксы для таблицы */
.tech-assets-table td {
    white-space: nowrap;
    padding: 8px 5px;
}

/* Для мобильных */
@media (max-width: 768px) {
    .tech-assets-table {
        min-width: 1200px; /* Увеличиваем для горизонтального скролла */
    }
    
    .asset-type-badge {
        font-size: 11px;
        padding: 3px 8px;
    }
}

/* ======================== */
/* СТИЛИ ДЛЯ ФИЛЬТРА ТЕХНИКИ */
/* ======================== */

.tech-filter-section {
    margin: 20px 0;
    position: relative;
}

.tech-filter-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tech-filter-btn:hover {
    background: #2980b9;
}

.tech-filter-badge {
    background: #e74c3c;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
}

.tech-filter-modal {
    display: none;
    position: absolute;
    top: 45px;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    width: 320px;
    z-index: 1000;
    border: 1px solid #e2e8f0;
}

.tech-filter-modal.show {
    display: block;
}

.tech-filter-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tech-filter-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1e293b;
}

.tech-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.tech-filter-close:hover {
    color: #ef4444;
}

.tech-filter-body {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.tech-filter-group {
    margin-bottom: 20px;
}

.tech-filter-group h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.tech-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tech-filter-item {
    margin-bottom: 8px;
}

.tech-filter-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
}

.tech-filter-item input[type="checkbox"] {
    accent-color: #3498db;
    width: 16px;
    height: 16px;
    margin: 0;
}

.tech-filter-footer {
    padding: 15px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.tech-filter-apply {
    background: #2ecc71;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.tech-filter-apply:hover {
    background: #27ae60;
}

.tech-filter-reset {
    background: #94a3b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.tech-filter-reset:hover {
    background: #64748b;
}