/* ==============================================
   STYLE.CSS - Основные стили системы управления заявками
   ФИНАЛЬНАЯ ВЕРСИЯ
   Вкладки: Новые, В работе, Архив
   Минималистичный дизайн заявок: №, Автор, Район
   Вкладки в детализации: Чат, Тест 1, Тест 2 (с подчеркиванием)
   ============================================== */

:root {
    /* Основные цвета */
    --primary-color: #2ea6ff;
    --secondary-color: #6c757d;
    --success-color: #34c759;
    --danger-color: #ff3b30;
    --warning-color: #ff9500;
    --info-color: #5ac8fa;
    
    /* Темная тема (по умолчанию) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    
    /* Размеры */
    --sidebar-width-desktop: 300px;
    --sidebar-width-mobile: 210px;
    --header-height: 60px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="pink"] {
    --bg-primary: #1a1625;
    --bg-secondary: #2a2438;
    --bg-tertiary: #3a324b;
    --text-primary: #ffffff;
    --text-secondary: #d8c3ff;
    --text-muted: #a394c2;
    --border-color: #4a3f5c;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --primary-color: #ff6b9d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* Контейнер */
.container {
    display: flex;
    height: 100vh;
}

/* Сайдбар - десктопная версия */
.sidebar {
    width: var(--sidebar-width-desktop);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10000;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.sidebar-header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Кнопки в хедере сайдбара */
.settings-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.settings-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: none; /* На десктопе скрыта */
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 20px;
    height: 20px;
    justify-content: center;
}

.menu-line {
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

/* ==============================================
   ВКЛАДКИ В ШТОРКЕ (оригинальные стили)
   ============================================== */

/* Вкладки в 1 ряд */
.sidebar-tabs-container {
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    flex-shrink: 0;
}

.sidebar-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.tab-row.single-row {
    display: flex;
    gap: 0.5rem;
}

.sidebar-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    border-radius: var(--border-radius);
}

.sidebar-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.sidebar-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Кнопка создания на вкладке "Новые" */
.tab-create-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
    margin: 1rem auto;
    justify-content: center;
    width: calc(100% - 2rem);
    max-width: 250px;
}

.tab-create-btn:hover {
    background: #1e90ff;
}

/* Списки */
.zayavki-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.users-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Элементы заявок - МИНИМАЛИСТИЧНЫЙ ДИЗАЙН (№, Автор, Район) */
.zayavka-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--border-radius);
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.zayavka-item:hover {
    background: var(--bg-tertiary);
}

.zayavka-item.new {
    border-left-color: var(--primary-color);
}

.zayavka-item.in_progress {
    border-left-color: var(--warning-color);
}

.zayavka-item.completed {
    border-left-color: var(--success-color);
}

.zayavka-item.rejected {
    border-left-color: var(--danger-color);
}

/* Информация о заявке (три строки: №, Автор, Район) */
.zayavka-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.zayavka-number {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.zayavka-author {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.zayavka-district {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Статус заявки (ТОЛЬКО для архива) */
.zayavka-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    height: fit-content;
}

.status-new {
    background: rgba(46, 166, 255, 0.2);
    color: var(--primary-color);
}

.status-in_progress {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning-color);
}

.status-completed {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success-color);
}

.status-rejected {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger-color);
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
    background: var(--bg-secondary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
}

/* ==============================================
   ДЕТАЛИ ЗАЯВКИ (общие стили)
   ============================================== */

.zayavka-detail {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.zayavka-detail-header {
    padding: 1.5rem 2rem 0 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.zayavka-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: left;
}

.zayavka-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.meta-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.meta-text {
    color: var(--text-primary);
    flex: 1;
    font-size: 0.9rem;
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
}

/* ==============================================
   ВКЛАДКИ В ДЕТАЛИЗАЦИИ (как в шторке - подчеркивание)
   ============================================== */

/* Контейнер вкладок в детализации */
.zayavka-detail-tabs {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    flex-shrink: 0;
}

.detail-tab-row {
    display: flex;
    gap: 0;
    background: none;
}

.detail-tab-row.single-row {
    display: flex;
    gap: 0;
}

.detail-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 0;
    position: relative;
}

.detail-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
    background: none;
}

.detail-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.detail-tab:hover:not(.active) {
    border-bottom-color: var(--border-color);
}

/* Контент вкладок */
.detail-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.detail-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==============================================
   СТИЛИ ДЛЯ ЧАТА
   ============================================== */

.chat-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    min-height: 300px;
    max-height: 500px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chat-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.chat-empty-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.chat-empty-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
}

.chat-message {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: linear-gradient(135deg, var(--primary-color), #1e90ff);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(46, 166, 255, 0.2);
}

.system-message {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.system-message .message-sender {
    color: var(--warning-color);
}

.user-message .message-sender {
    color: rgba(255, 255, 255, 0.9);
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: right;
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 166, 255, 0.2);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    padding: 0.75rem 1.5rem;
    white-space: nowrap;
    border-radius: 20px;
    font-weight: 500;
}

/* ==============================================
   СТИЛИ ДЛЯ ТЕСТОВЫХ ВКЛАДОК
   ============================================== */

.test-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
}

.test-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.test-info {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.test-info p {
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.test-info strong {
    color: var(--text-primary);
    min-width: 120px;
    font-weight: 500;
}

.test-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-item {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.test-note {
    background: rgba(46, 166, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin-top: 2rem;
}

.test-note p {
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 0.9rem;
}

.test-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.test-actions .btn {
    flex: 1;
    min-width: 160px;
}

/* Кнопки действий заявки */
.zayavka-detail-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.zayavka-detail-actions .btn {
    min-width: 180px;
    font-weight: 500;
}

/* Форма создания заявки */
.form-container {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 2rem;
}

.form-title {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 166, 255, 0.2);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Поиск */
.search-container {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-text {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-subtext {
    font-size: 0.9rem;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 11000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 90%;
    max-width: 500px;
    max-height: 90%;
    overflow: hidden;
    animation: modalAppear 0.2s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-weight: 600;
    font-size: 1.2rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Скроллбар */
.zayavki-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.zayavka-detail::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.detail-tab-content::-webkit-scrollbar {
    width: 4px;
}

.zayavki-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.zayavka-detail::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.detail-tab-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.zayavki-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.zayavka-detail::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.detail-tab-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.zayavki-list::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.zayavka-detail::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.detail-tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Оверлей */
.sidebar-overlay {
    display: none;
}

/* ==============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================== */

@media (max-width: 768px) {
    /* Общие стили */
    .zayavka-item {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .zayavka-number {
        font-size: 0.9rem;
    }
    
    .zayavka-author {
        font-size: 0.8rem;
    }
    
    .zayavka-district {
        font-size: 0.75rem;
    }
    
    .zayavka-status {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    /* Детализация заявки */
    .zayavka-detail-header {
        padding: 1rem 1rem 0 1rem;
    }
    
    .zayavka-detail-title {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .zayavka-detail-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .meta-item {
        font-size: 0.85rem;
        gap: 0.4rem;
    }
    
    .meta-icon {
        font-size: 0.9rem;
        width: 18px;
    }
    
    /* Вкладки в детализации */
    .zayavka-detail-tabs {
        padding: 0 1rem;
    }
    
    .detail-tab {
        padding: 0.8rem 0.3rem;
        font-size: 0.85rem;
        min-height: 45px;
        border-bottom-width: 2px;
    }
    
    /* Контент вкладок */
    .detail-tab-content {
        padding: 1rem;
    }
    
    /* Чат */
    .chat-container {
        height: calc(100vh - 250px);
        min-height: 250px;
        max-height: 400px;
    }
    
    .chat-messages {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .chat-message {
        max-width: 85%;
        padding: 0.6rem 0.8rem;
    }
    
    .message-text {
        font-size: 0.9rem;
    }
    
    .chat-input-container {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .chat-input {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .chat-send-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Тестовые вкладки */
    .test-content {
        padding: 1rem;
    }
    
    .test-content h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .test-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .stat-item {
        padding: 1rem;
    }
    
    .test-info p {
        flex-direction: column;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .test-info strong {
        min-width: auto;
        font-size: 0.85rem;
    }
    
    /* Кнопки действий */
    .zayavka-detail-actions {
        flex-direction: column;
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .zayavka-detail-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .test-actions .btn {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Общие стили */
    .zayavka-item {
        padding: 0.5rem;
        gap: 0.4rem;
    }
    
    .zayavka-number {
        font-size: 0.85rem;
    }
    
    .zayavka-author {
        font-size: 0.75rem;
    }
    
    .zayavka-district {
        font-size: 0.7rem;
    }
    
    .zayavka-status {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
    
    /* Вкладки в детализации */
    .detail-tab {
        font-size: 0.8rem;
        padding: 0.7rem 0.2rem;
        min-height: 40px;
    }
    
    /* Чат */
    .chat-empty-icon {
        font-size: 2.5rem;
    }
    
    .chat-empty-text {
        font-size: 1rem;
    }
    
    .chat-empty-subtext {
        font-size: 0.8rem;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .chat-input-container {
        flex-direction: column;
    }
    
    .chat-send-btn {
        width: 100%;
    }
    
    /* Статус баджи */
    .status-badge {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
}