/* static/css/style.css */

/* Общий фон и шрифты */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: auto;
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 32px;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary { background: white; color: #764ba2; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.2); }
.btn-secondary { background: rgba(255, 255, 255, 0.9); color: #333; }
.btn-secondary:hover { background: white; }
.btn-logout { background: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.3); }
.btn-logout:hover { background: rgba(255, 255, 255, 0.3); }

/* Карточки и виджеты */
.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
    border-left: 5px solid;
}

.stat-card:hover { transform: translateY(-5px); }
.stat-card.waiting { border-color: #ffc107; }
.stat-card.processing { border-color: #007bff; }
.stat-card.completed { border-color: #28a745; }

.stat-value { font-size: 36px; font-weight: bold; margin: 10px 0; color: #222; }
.stat-label { font-size: 13px; color: #666; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* Бейджи статусов */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    display: inline-block;
}

.status-new { background: #6c757d; }
.status-assigned { background: #007bff; }
.status-processing { background: #d68a00; }
.status-completed { background: #28a745; }
.status-active { background: #28a745; }
.status-archived { background: #6c757d; }

.action-btn {
    display: inline-block;
    padding: 6px 14px;
    background: #764ba2;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}
.action-btn:hover { background: #5a387e; }

/* Переопределение DataTables */
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable thead th {
    background: #f8f9fa;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
    text-align: left;
}
table.dataTable tbody td {
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
table.dataTable tbody tr:hover { background: #f8f9fa; }

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 6px 12px !important;
    margin: 0 2px !important;
    border-radius: 6px !important;
    border: 1px solid transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #764ba2 !important;
    color: white !important;
    border: 1px solid #764ba2 !important;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: #764ba2; }

@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: 1fr; }
}


/* Стили для форм */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: #fff;
}

.form-control:focus {
    border-color: #764ba2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.1);
}

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

/* Адаптация под мобильные устройства */
@media (max-width: 768px) {
    body {
        padding: 10px; /* Уменьшаем отступы по краям */
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px;
    }

    /* Улучшаем вид раскрытой строки в DataTables */
    table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before {
        background-color: #764ba2 !important; /* Фиолетовый цвет кнопки "+" */
        border: 2px solid white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        top: 10px;
    }
    
    table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before {
        background-color: #dc3545 !important; /* Красный цвет кнопки "-" при раскрытии */
    }
    
    /* Делаем шрифт в раскрытом списке чуть крупнее для удобства чтения */
    ul.dtr-details {
        font-size: 14px;
        padding-left: 10px;
    }
    
    ul.dtr-details li {
        border-bottom: 1px solid #eee;
        padding: 8px 0;
    }
}
