* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Шапка */
.header {
    background: #dc2626;
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.logo p {
    font-size: 14px;
    opacity: 0.9;
}

.phone {
    font-size: 18px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid white;
    border-radius: 3px;
}

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

/* Элементы управления */
.controls {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #e5e5e5;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn:hover {
    background: #ddd;
}

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

.btn-primary:hover {
    background: #b91c1c;
}

.btn.active {
    background: #dc2626;
    color: white;
}

.status-filters {
    display: flex;
    gap: 10px;
}

/* Поиск */
.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
}

/* Таблица */
.table-container {
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f8f8;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    border-bottom: 2px solid #eee;
}

td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background: #f9f9f9;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-принят {
    background: #fee2e2;
    color: #991b1b;
}

.status-в работе {
    background: #fef3c7;
    color: #92400e;
}

.status-готов {
    background: #dcfce7;
    color: #166534;
}

.status-выдан {
    background: #e0e7ff;
    color: #3730a3;
}

/* Действия */
.btn-action {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 2px;
    margin-right: 5px;
}

.edit {
    background: #3b82f6;
    color: white;
}

.print {
    background: #10b981;
    color: white;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.pagination a {
    padding: 5px 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

.pagination a.active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

/* Форма */
.order-form {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Сообщения */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
/* Добавляем в style.css */

/* Стили для столбца с мастером */
.table-master {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Адаптивность для таблицы с новым столбцом */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 1000px;
    }
}

/* Стили для фильтра мастера */
.filter-master {
    display: flex;
    flex-direction: column;
}

/* Иконка мастера */
.master-icon {
    color: #dc2626;
    margin-right: 5px;
}

/* Статус мастера */
.master-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-top: 3px;
}

.master-active {
    background: #dcfce7;
    color: #166534;
}

.master-inactive {
    background: #fee2e2;
    color: #991b1b;
}
/* Добавляем в конец файла */

/* Статистика по филиалам */
.branch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.branch-stat-card {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #dc2626;
}

.branch-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.branch-name {
    font-weight: bold;
    color: #dc2626;
    font-size: 16px;
}

.branch-total {
    background: #dc2626;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.branch-status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
}

.branch-status-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
}

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

.branch-status-count {
    font-weight: bold;
}

/* Фильтры поиска */
.search-filters {
    background: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #666;
    font-size: 14px;
}

.filter-select, .filter-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-select:focus, .filter-input:focus {
    border-color: #dc2626;
    outline: none;
}

.filter-select {
    background: white;
    cursor: pointer;
}

/* Адаптивность */
@media (max-width: 768px) {
    .branch-stats {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .status-filters {
        flex-wrap: wrap;
    }
}

/* Анимация загрузки */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-container {
    animation: fadeIn 0.3s ease-out;
}

/* Эффекты при наведении */
.branch-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* Стили для пустых результатов */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

/* Лоадер для AJAX */
.loader {
    display: none;
    text-align: center;
    padding: 20px;
}

.loader.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Добавляем в style.css */

/* Шапка с телефонами */
.phone-info {
    text-align: center;
}

.company-phone {
    font-size: 18px;
    font-weight: bold;
    color: #dc2626;
    margin-bottom: 5px;
}

.admin-phone {
    font-size: 14px;
    color: #666;
}

.user-details {
    text-align: right;
}

.user-phone {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Адаптивность для шапки */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .phone-info {
        order: 3;
    }
    
    .user-info {
        order: 2;
        flex-direction: column;
        align-items: center;
    }
    
    .user-details {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* Стили для квитанции */
.contact-info {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #dc2626;
}

.phone-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.phone-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #dee2e6;
}

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

.phone-label {
    font-weight: 600;
    color: #495057;
}

.phone-value {
    font-weight: 700;
    color: #dc2626;
}