/* Дополнительные стили для дашборда */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Анимация загрузки */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Стили для таблиц */
table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem; /* Уменьшаем размер шрифта для лучшего отображения */
}

/* Улучшаем отображение таблиц на MacBook 14" */
.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Оптимизация для MacBook 14" (1440px ширина) */
@media (min-width: 1440px) {
    .container {
        max-width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    table {
        font-size: 0.7rem;
    }
    
    th, td {
        padding: 0.25rem 0.5rem !important;
    }
    
    .text-xs {
        font-size: 0.7rem;
    }
}

/* Стили для графиков */
canvas {
    max-height: 400px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    .px-3 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Стили для модального окна со списком сделок */
.deals-modal-backdrop {
    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;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.deals-modal-backdrop:not(.hidden) {
    opacity: 1;
}

.deals-modal-backdrop.hidden {
    display: none;
}

.deals-modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
}

.deals-modal-backdrop:not(.hidden) .deals-modal {
    transform: scale(1);
}

.deals-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10;
}

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

.deals-modal-title {
    padding: 20px 24px 16px;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111;
    border-bottom: 1px solid #e5e7eb;
}

.deals-modal-list {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 80px);
}

.deals-modal-list a {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #2563eb;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.deals-modal-list a:hover {
    background-color: #eff6ff;
    border-color: #3b82f6;
}

.deals-modal-list a:active {
    background-color: #dbeafe;
}

.deals-modal-list .deal-item {
    font-size: 0.9rem;
    line-height: 1.5;
}

.deals-modal-list .deal-id {
    font-weight: 600;
    color: #1e40af;
}

.deals-modal-list .deal-title {
    color: #374151;
    margin-top: 4px;
}

/* Курсор указатель для кликабельных элементов */
.clickable-deals,
.deal-count,
.deal-number {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-deals:hover,
.deal-count:hover,
.deal-number:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}
