/**
 * SafIT (СафИТ) CRM System
 * Основные стили в стиле Telegram
 */

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.header {
    background-color: var(--safit-bg);
    border-bottom: 1px solid var(--safit-border);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
}

.nav-item {
    padding: 8px 16px;
    border-radius: 8px;
    background-color: var(--safit-bg-secondary);
    color: var(--safit-text);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 300px;
    background-color: var(--safit-bg-secondary);
    border-radius: 12px;
    padding: 16px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--safit-border);
}

.kanban-column-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-count {
    background-color: var(--safit-bg);
    color: var(--safit-text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.kanban-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Task Card */
.task-card {
    background-color: var(--safit-bg);
    border-radius: 8px;
    padding: 12px;
    cursor: move;
    border: 1px solid var(--safit-border);
    transition: all 0.2s ease;
    position: relative;
}

.task-card:hover {
    box-shadow: 0 2px 8px var(--safit-shadow);
    transform: translateY(-2px);
}

.task-card.dragging {
    opacity: 0.5;
}

.task-card-title {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.task-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--safit-text-secondary);
}

.task-priority {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.task-priority.priority-low {
    background-color: var(--priority-low);
}

.task-priority.priority-medium {
    background-color: var(--priority-medium);
}

.task-priority.priority-high {
    background-color: var(--priority-high);
}

.task-priority.priority-critical {
    background-color: var(--priority-critical);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--safit-border);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    background-color: var(--safit-bg);
    color: var(--safit-text);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--safit-bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--safit-text-secondary);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.badge-secondary {
    background-color: var(--safit-bg-secondary);
    color: var(--safit-text);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--safit-border);
    border-top-color: var(--tg-theme-button-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex {
    display: flex;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        min-width: 100%;
    }
    
    .container {
        padding: 8px;
    }
}


