/* Unanswered KB question highlight */
.kb-qa-item.unanswered {
  border-left: 4px solid rgba(239, 68, 68, 0.85); /* red-500 */
  box-shadow: inset -2px 0 10px rgba(239, 68, 68, 0.25);
}
.kb-qa-item.unanswered:hover {
  box-shadow: inset -2px 0 14px rgba(239, 68, 68, 0.35);
}

/* Unanswered QA table row highlight */
table.table tbody tr.unanswered {
  border-left: 4px solid rgba(239, 68, 68, 0.85);
  box-shadow: inset -2px 0 10px rgba(239, 68, 68, 0.25);
}
table.table tbody tr.unanswered:hover {
  box-shadow: inset -2px 0 14px rgba(239, 68, 68, 0.35);
}
/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Стили для превью файла */
.file-preview {
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-info i {
    color: #6b7280;
    font-size: 1.25rem;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
}

.file-size {
    color: #6b7280;
    font-size: 0.875rem;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #059669;
    font-size: 0.875rem;
    font-weight: 500;
}

.text-success {
    color: #059669;
}

/* Стили для предпросмотра файла */
.file-preview-modal {
    width: 100%;
    max-width: 100%;
    height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.preview-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.preview-header h3 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.preview-header p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 0.5rem 0;
}

/* Стили для скроллбара в модалке */
.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Стили для элементов управления зумом в модалке прототипа */
.zoom-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
}

.zoom-controls button {
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    min-width: 28px;
    transition: all 0.2s ease;
}

.zoom-controls button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.zoom-controls button:active {
    background: #f3f4f6;
    transform: scale(0.95);
}

.zoom-controls span {
    padding: 4px 6px;
    font-size: 11px;
    color: #6b7280;
    min-width: 35px;
    text-align: center;
    font-weight: 500;
}

/* Стили для контейнера изображения прототипа */
.prototype-image-container {
    position: relative;
    overflow: auto;
    max-height: 400px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prototype-image-wrapper {
    position: relative;
    display: inline-block;
    cursor: grab;
    transition: cursor 0.2s ease;
}

.prototype-image-wrapper:active {
    cursor: grabbing;
}

.prototype-image-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
    display: block;
    transition: transform 0.2s ease;
}

.file-info-section {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.file-info-section h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item span {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 500;
}

.file-content-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.file-content-section h4 {
    margin: 0 0 1rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.file-content-preview {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    width: 100%;
    min-height: 0;
}

.file-content-preview pre {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    margin-top: auto;
}

.preview-actions .btn {
    min-width: 120px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .preview-actions .btn {
        width: 100%;
    }
}

@media (max-width: 1024px) {
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

.hidden {
    display: none !important;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    white-space: nowrap;
}

.btn-primary {
    background-color: #6366f1;
    color: white;
}

.btn-primary:hover {
    background-color: #5855eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #5b6366;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn i {
    font-size: 0.875em;
}

/* Основное приложение */
.main-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-left h2 {
    color: #1f2937;
    font-weight: 600;
}

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

#user-info {
    color: #6b7280;
    font-size: 0.875rem;
}

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

/* Боковая панель */
.sidebar {
    width: 250px;
    background-color: white;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    margin: 0 0.5rem;
}

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

.nav-link.active {
    background-color: #6366f1;
    color: white;
}

/* Основная область контента */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-section h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.5rem;
}

/* Специальные стили для страницы компонентов */
.section-actions {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.design-system-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.design-system-selector label {
    margin: 0;
    white-space: nowrap;
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.design-system-selector .form-control {
    width: 250px;
    margin: 0;
    background-color: white;
    color: #1f2937;
}

.design-system-selector .form-control:focus {
    background-color: white;
    color: #1f2937;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Стили для раскрытых групп */
.group-content {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

/* Стили для свернутых групп */
.group-content.collapsed {
    display: none;
}

/* Стили для модалки базы знаний */
.file-preview {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.file-info i {
    color: #6c757d;
}

.file-name {
    font-weight: 500;
    color: #495057;
}

.file-size {
    color: #6c757d;
    font-size: 0.9em;
}

.file-status {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #28a745;
    font-size: 0.9em;
}

.form-help {
    color: #6c757d;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Стили для модалки с прокруткой */
.modal {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Стили для компонентов */
.components-list {
    padding: 1rem 1.5rem;
}

.component-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: white;
}

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

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

.component-info h5 {
    color: #1f2937;
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
}

.component-info p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
}

.component-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Дашборд */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-card h4 {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-card p {
    color: #1f2937;
    font-size: 2rem;
    font-weight: 700;
}

/* Списки элементов */
.items-list {
    background-color: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.item-card {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.item-info h4 {
    color: #1f2937;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.item-info p {
    color: #6b7280;
    font-size: 0.875rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Состояния загрузки, ошибок и пустые состояния */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #6b7280;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    margin: 0;
    font-size: 0.875rem;
    color: #9ca3af;
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #ef4444;
    text-align: center;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state p {
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    color: #9ca3af;
    text-align: center;
    min-height: 200px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

.empty-state p:last-child {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0;
}

/* Специальные стили для заблокированных состояний */
.empty-state.locked {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    color: #dc2626;
}

.empty-state.locked .empty-icon {
    color: #dc2626;
    opacity: 0.8;
}

.empty-state.locked p {
    color: #dc2626;
}

.empty-state.locked p:last-child {
    color: #ef4444;
}

/* Стили для информационных состояний */
.empty-state.info {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    color: #2563eb;
}

.empty-state.info .empty-icon {
    color: #2563eb;
    opacity: 0.8;
}

.empty-state.info p {
    color: #2563eb;
}

.empty-state.info p:last-child {
    color: #3b82f6;
}

/* Стили для состояния запрета доступа */
.empty-state.forbidden {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    color: #dc2626;
}

.empty-state.forbidden .empty-icon {
    color: #dc2626;
    opacity: 0.8;
}

.empty-state.forbidden p {
    color: #dc2626;
}

.empty-state.forbidden p:last-child {
    color: #ef4444;
}

/* Стили для иконки запрета доступа */
.empty-state.forbidden .empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Скрытие административных элементов для обычных пользователей */
.admin-only {
    display: none;
}

.user-admin .admin-only {
    display: block;
}

.user-admin .nav-link.admin-only {
    display: block;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Модальные окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Стили для модалки сравнения макетов */
.comparison-viewer .svg-container {
    position: relative;
}

.comparison-viewer .svg-controls-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 6px;
    z-index: 5;
    pointer-events: auto;
}

.comparison-viewer .comparison-controls {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

/* Формы */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background-color: white;
    color: #1f2937;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: white;
    color: #1f2937;
}

/* Состояния форм */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #1f2937;
}

.form-group.error .error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: #10b981;
    background-color: #f0fdf4;
    color: #1f2937;
}

/* Уведомления */
.notifications {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    max-width: calc(100vw - 2rem); /* предотвращаем выход за пределы экрана */
}

/* Форсируем поведение уведомлений внутри контейнера приложения,
   перекрывая возможные глобальные стили из других CSS */
#notifications {
    right: 0.75rem;
    left: auto;
    max-width: calc(100vw - 1.5rem);
    width: min(420px, calc(100vw - 1.5rem));
}

#notifications > .notification {
    position: relative !important; /* не fixed */
    right: auto !important;
    top: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.notification {
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #6366f1;
    max-width: min(420px, calc(100vw - 2rem));
    position: relative;
    box-sizing: border-box; /* учитываем padding в ширине */
    overflow: hidden; /* гарантируем, что контент не выпрыгнет */
}

.notification.success {
    border-left-color: #10b981;
}

.notification.error {
    border-left-color: #ef4444;
}

.notification.warning {
    border-left-color: #f59e0b;
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 100%;
}

.notification-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.notification-text h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.notification-text p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    overflow-wrap: anywhere; /* переносим длинные слова/URL */
    word-break: break-word;
}

/* Важное правило: разрешаем flex-элементу с текстом сжиматься внутри контейнера */
.notification-text {
    min-width: 0;
}

@media (max-width: 480px) {
    .notifications {
        top: 0.75rem;
        right: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }
    .notification {
        max-width: calc(100vw - 1.5rem);
    }
    #notifications > .notification {
        max-width: calc(100vw - 1.5rem);
        width: calc(100vw - 1.5rem) !important;
    }
}

.notification-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    line-height: 1;
}

.notification-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Анимации */
.ui-ready .dashboard-card,
.ui-ready .item-card,
.ui-ready .nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-ready .dashboard-card.animate-in,
.ui-ready .item-card.animate-in,
.ui-ready .nav-link.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Адаптивность */
@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }
    
    .sidebar {
        width: 200px;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        margin: 1rem;
    }
}

@media (max-width: 640px) {
    .app-main {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .nav-menu li {
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .nav-link {
        white-space: nowrap;
        margin: 0;
    }
} 

/* Стили для групп компонентов - УДАЛЕНО, используем стандартные */

/* Стили для форм */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    background-color: white;
    color: #1f2937;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: white;
    color: #1f2937;
}

/* Кнопки */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
} 

/* Стили для модальных окон */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
}

/* Стили для форм в модальных окнах */
.modal-form {
    width: 100%;
}

.modal-form .form-group {
    margin-bottom: 1.5rem;
}

.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.modal-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: white;
    color: #1f2937;
}

.modal-form .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
    background-color: white;
    color: #1f2937;
}

.modal-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.modal-form .form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn {
    min-width: 120px;
}

/* Адаптивность для модальных окон */
@media (max-width: 640px) {
    .modal {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
} 

/* Улучшенные стили для компонентов - УДАЛЕНО */

/* Стили для компонентов внутри групп */
.group-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.components-list {
    margin-top: 0.5rem;
}

.components-list .item-card {
    margin: 0.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.components-list .item-card:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.components-list .item-info small {
    display: inline-block;
    margin-top: 0.5rem;
} 

/* Адаптивность для страницы компонентов */
@media (max-width: 768px) {
    .section-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .design-system-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .design-system-selector .form-control {
        width: 100%;
    }
    
    .action-buttons {
        justify-content: stretch;
    }
    
    .action-buttons .btn {
        flex: 1;
    }
} 

/* Глобальные стили для всех полей ввода */
input, textarea, select {
    background-color: white !important;
    color: #1f2937 !important;
}

input:focus, textarea:focus, select:focus {
    background-color: white !important;
    color: #1f2937 !important;
}

input:active, textarea:active, select:active {
    background-color: white !important;
    color: #1f2937 !important;
} 

/* Стили для модальных окон редактирования */
.modal-form .form-group {
    margin-bottom: 1.5rem;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.modal-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: white;
    color: #1f2937;
}

.modal-form .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
    background-color: white;
    color: #1f2937;
}

.modal-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.form-actions .btn {
    min-width: 120px;
} 

/* Стили для правил */
.rule-content-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Стили для таблиц */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Стили для ячеек с текстом */
.table-cell-content {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.table-cell-question {
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
}

.table-cell-answer {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Стили для кнопки "Показать полностью" */
.btn-link {
    background: none;
    border: none;
    color: #6366f1;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.btn-link:hover {
    color: #4f46e5;
    text-decoration: none;
}

.btn-link:focus {
    outline: none;
    color: #4f46e5;
}

/* Стили для кнопок действий в таблице */
.table-actions {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.table-actions .btn {
    padding: 0 !important;
    font-size: 0.75rem;
    min-width: 24px !important;
    width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    line-height: 1;
    box-sizing: border-box;
}

.table-actions .btn i {
    font-size: 0.7rem;
}

/* Адаптивность для кнопок действий */
@media (max-width: 640px) {
    .table-actions {
        gap: 1px;
    }
    
    .table-actions .btn {
        padding: 0 !important;
        font-size: 0.7rem;
        min-width: 20px !important;
        width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        max-height: 20px !important;
    }
    
    .table-actions .btn i {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .table-actions .btn {
        padding: 0 !important;
        font-size: 0.65rem;
        min-width: 18px !important;
        width: 18px !important;
        height: 18px !important;
        min-height: 18px !important;
        max-height: 18px !important;
    }
    
    .table-actions .btn i {
        font-size: 0.6rem;
    }
}

/* Стили для модального окна просмотра вопроса-ответа */
.qa-view-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-top: 4px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.qa-status {
    margin-top: 4px;
}

.qa-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 4px;
}

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

/* Адаптивность для таблиц */
@media (max-width: 768px) {
    .table thead th,
    .table tbody td {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .table-cell-answer {
        font-size: 0.8rem;
    }
    
    .table tbody td:first-child {
        min-width: 150px;
        max-width: 200px;
    }
    
    .table tbody td:nth-child(2) {
        min-width: 200px;
        max-width: 300px;
    }
}

@media (max-width: 640px) {
    .table thead th,
    .table tbody td {
        padding: 6px;
        font-size: 0.75rem;
    }
    
    .table-cell-answer {
        font-size: 0.75rem;
    }
    
    .table tbody td:first-child {
        min-width: 120px;
        max-width: 150px;
    }
    
    .table tbody td:nth-child(2) {
        min-width: 150px;
        max-width: 200px;
    }
    
    .table thead th:nth-child(3),
    .table tbody td:nth-child(3) {
        width: 120px;
    }
    
    .table thead th:nth-child(4),
    .table tbody td:nth-child(4) {
        width: 100px;
    }
}

@media (max-width: 480px) {
    .table-responsive {
        font-size: 0.7rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 4px;
    }
    
    .table tbody td:first-child {
        min-width: 100px;
        max-width: 120px;
    }
    
    .table tbody td:nth-child(2) {
        min-width: 120px;
        max-width: 150px;
    }
    
    .table thead th:nth-child(3),
    .table tbody td:nth-child(3) {
        width: 100px;
    }
    
    .table thead th:nth-child(4),
    .table tbody td:nth-child(4) {
        width: 90px;
    }
    
    .switch {
        width: 40px;
        height: 20px;
    }
    
    .slider:before {
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
    }
    
    input:checked + .slider:before {
        transform: translateX(20px);
    }
}

/* Стили для переключателя (toggle switch) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider:hover {
    box-shadow: 0 0 1px #2196F3;
}

.rule-text-input,
.rule-file-input {
    flex: 1;
}

.rule-text-input textarea {
    min-height: 120px;
    resize: vertical;
}

.rule-file-input input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.375rem;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.rule-file-input input[type="file"]:hover {
    border-color: #9ca3af;
    background-color: #f3f4f6;
}

.rule-file-input input[type="file"]:focus {
    border-color: #667eea;
    background-color: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Стили для отображения параметров сетки */
.grid-rule-display {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
}

.grid-parameter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.grid-parameter:last-child {
    border-bottom: none;
}

.grid-parameter label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.grid-parameter span {
    font-weight: 500;
    color: #1f2937;
    background-color: #e5e7eb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.rule-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: white;
}

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

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

.rule-info {
    flex: 1;
}

.rule-info h5 {
    margin: 0 0 0.5rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.rule-info p {
    margin: 0 0 0.5rem 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.4;
}

.rule-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rules-list {
    padding: 1rem 1.5rem;
}

/* Стили для групп правил */
.rules-groups-list .group-content {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    overflow: hidden;
}

.rules-groups-list .rules-list {
    padding: 1rem 1.5rem;
}

.rules-groups-list .rule-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: white;
}

.rules-groups-list .rule-item:last-child {
    border-bottom: none;
}

.rules-groups-list .rule-item:hover {
    background-color: #f9fafb;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .rule-content-inputs {
        flex-direction: column;
    }
    
    .rule-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .rule-actions {
        justify-content: flex-start;
    }
} 

/* Стили для анализа компонентов */
.ca-comparison-table {
    margin-top: 1rem;
}

.ca-comparison-table table {
    font-size: 0.875rem;
}

.ca-comparison-table th,
.ca-comparison-table td {
    vertical-align: top;
    word-break: break-word;
}

.ca-comparison-table th:last-child,
.ca-comparison-table td:last-child {
    text-align: center;
}

.ca-comparison-table .fa-check {
    color: #2e7d32;
}

.ca-comparison-table .fa-times {
    color: #c62828;
}

.ca-item-header {
    transition: background-color 0.2s ease;
}

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

.ca-item-body {
    background-color: #fafbfc;
}

/* Адаптивность для таблицы сравнения */
@media (max-width: 768px) {
    .ca-comparison-table {
        overflow-x: auto;
    }
    
    .ca-comparison-table table {
        min-width: 600px;
    }
} 

/* Стили для кнопок этапов анализа */
.btn-success {
    background-color: #38a169 !important;
    border-color: #38a169 !important;
    color: white !important;
}

.btn-success:hover {
    background-color: #2f855a !important;
    border-color: #2f855a !important;
}

.btn-danger {
    background-color: #e53e3e !important;
    border-color: #e53e3e !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #c53030 !important;
    border-color: #c53030 !important;
}

.btn-warning {
    background-color: #f59e0b !important;
    border-color: #f59e0b !important;
    color: white !important;
}

.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #d97706 !important;
}

.btn-info {
    background-color: #3182ce !important;
    border-color: #3182ce !important;
    color: white !important;
}

.btn-info:hover {
    background-color: #2c5aa0 !important;
    border-color: #2c5aa0 !important;
}

.check-tab-btn.active {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
}

/* Стили для пагинации результатов анализа */
.ca-pagination {
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ca-pagination .btn {
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.ca-pagination .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ca-pagination .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Стили для модального окна результатов анализа */
.modal-body {
    max-height: 80vh;
    overflow-y: auto;
}

.check-results {
    max-height: none;
}

.ca-list {
    max-height: none;
}

.ca-item-body {
    max-height: none;
    overflow: visible;
}

/* Обеспечиваем правильный скролл для длинного контента */
.modal-content {
    max-height: 98vh;
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    max-height: 75.3vh;
    padding-right: 8px; /* Компенсируем скроллбар */
}

/* Принудительно устанавливаем скролл для модального окна */
.modal {
    overflow: hidden;
}

.modal-dialog {
    max-height: 90vh;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
}

.modal-content {
    max-height: 98vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    flex-shrink: 0;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 20px;
    max-height: calc(90vh - 120px); /* Вычитаем высоту header и footer */
}

.modal-footer {
    flex-shrink: 0;
} 

/* Специальные стили для результатов анализа */
.check-results {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.check-results .form-group {
    flex-shrink: 0;
}

#check-tabs {
    flex-shrink: 0;
}

#check-tab-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(90vh - 300px); /* Вычитаем высоту всех элементов */
}

.ca-list {
    max-height: none;
}

.ca-item-body {
    max-height: none;
    overflow: visible;
} 

/* Модальное окно - исправляем скролл */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* Специальные стили для модалки просмотра макета */
.modal-overlay.layout-preview-modal .modal {
    max-height: 85vh;
    max-width: 95vw;
}

.modal-overlay.layout-preview-modal .modal-body {
    max-height: calc(85vh - 120px);
    overflow: hidden;
    padding: 20px 24px;
}

/* Стили для кнопки "Назад" в модалке просмотра */
.modal-overlay.layout-preview-modal .back-to-results-btn {
    background-color: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 36px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-overlay.layout-preview-modal .back-to-results-btn:hover {
    background-color: #5b6366;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Анимация для спиннера */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px 0 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(90vh - 140px); /* Вычитаем высоту header и отступы */
}

.modal-footer {
    padding: 0 24px 20px 24px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

/* Специальные стили для результатов анализа */
.check-results {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.check-results .form-group {
    flex-shrink: 0;
}

#check-tabs {
    flex-shrink: 0;
}

#check-tab-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(90vh - 300px); /* Вычитаем высоту всех элементов */
}

.ca-list {
    max-height: none;
}

.ca-item-body {
    max-height: none;
    overflow: visible;
} 

/* Стили для пагинации */
.ca-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Специальные стили для модалки загрузки компонентов */
#component-upload-modal .modal {
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#component-upload-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: calc(90vh - 120px);
    padding: 1.5rem;
}

#component-upload-modal #recognition-results {
    max-height: none;
    overflow: visible;
}

#component-upload-modal #components-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.ca-pagination button {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 40px;
}

.ca-pagination button:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ca-pagination button:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.ca-pagination .btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.ca-pagination .btn-primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.ca-page-info {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    color: #1976d2;
    font-size: 14px;
}

/* Стили для табов AI настроек */
.tabs-container {
    margin-top: 1rem;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: #374151;
    background-color: #f9fafb;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background-color: #f8fafc;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для промптов с переменными */
.prompt-container {
    position: relative;
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.prompt-container {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem;
    background: #ffffff;
    margin-bottom: 1.5rem;
}

.prompt-field {
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.prompt-field:last-child {
    margin-bottom: 0;
}

.prompt-field:first-child {
    background: transparent;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.prompt-main-label {
    display: block;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.prompt-field-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
    width: auto;
}

.prompt-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Стили для модалки просмотра компонентов */
.modal {
    max-height: 90vh;
    overflow-y: auto;
}

.component-viewer {
    max-height: 70vh;
    overflow-y: auto;
}

.cv-panel {
    max-height: 300px;
    overflow-y: auto;
}

.code-textarea {
    min-height: 200px;
    max-height: 300px;
    resize: vertical;
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    background-color: transparent;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline-secondary {
    color: #6b7280;
    border-color: #d1d5db;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    color: #374151;
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.btn-outline-info {
    color: #0ea5e9;
    border-color: #0ea5e9;
    background-color: transparent;
}

.btn-outline-info:hover {
    color: white;
    background-color: #0ea5e9;
    border-color: #0ea5e9;
} 