/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* Шапка */
header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Основной контент */
main {
    flex: 1;
    padding: 30px;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    height: 100%;
}

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

/* Секция формы */
.form-section {
    background: #f8fafc;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.form-section h2 {
    color: #4f46e5;
    margin-bottom: 25px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    flex: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #64748b;
    color: white;
    flex: 1;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #64748b;
    border: 2px solid #e2e8f0;
    flex: 1;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

.btn-edit {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Секция списка */
.list-section {
    background: white;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.list-header {
    padding: 25px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.list-header h2 {
    color: #4f46e5;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Статистика */
.stats {
    display: flex;
    gap: 30px;
    padding: 20px 25px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-weight: 500;
}

.stat-item i {
    color: #4f46e5;
    font-size: 1.2rem;
}

/* Таблица */
.table-container {
    flex: 1;
    overflow-x: auto;
    padding: 0 25px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

thead {
    background: #f8fafc;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

tbody tr {
    transition: all 0.2s;
}

tbody tr:hover {
    background: #f8fafc;
}

.actions-cell {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* Состояние пустого списка */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    display: none;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #64748b;
}

/* Подвал */
footer {
    padding: 20px 40px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

footer p {
    color: #64748b;
}

.status {
    padding: 8px 16px;
    background: #10b981;
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status.error {
    background: #ef4444;
}

.status.warning {
    background: #f59e0b;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    color: #ef4444;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: flex-end;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .form-section,
    .list-header {
        padding: 20px;
    }
    
    .stats {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .table-container {
        padding: 0 20px;
    }
    
    th, td {
        padding: 10px;
    }
    
    footer {
        padding: 15px 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

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

tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Стили для телефона */
.phone-number {
    direction: ltr;
    unicode-bidi: embed;
}

/* Стили для длинного текста */
.address-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .address-cell {
        max-width: 150px;
    }
}