* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Навигация */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: #34495e;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Карточки телефонов */
.phones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.phone-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.phone-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.phone-image {
    text-align: center;
    margin-bottom: 1rem;
}

.phone-image img {
    max-width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.no-image {
    font-size: 4rem;
    color: #bdc3c7;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 4px;
}

.phone-info h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

/* Статусы */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-в-ремонте { background: #f39c12; color: white; }
.status-починен { background: #27ae60; color: white; }
.status-на-запчасти { background: #e74c3c; color: white; }

/* Кнопки */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary { background: #3498db; }
.btn-primary:hover { background: #2980b9; }

.btn-secondary { background: #95a5a6; }
.btn-secondary:hover { background: #7f8c8d; }

.btn-warning { background: #f39c12; }
.btn-warning:hover { background: #e67e22; }

.btn-edit { background: #9b59b6; }
.btn-edit:hover { background: #8e44ad; }

/* Формы */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 2rem;
    text-align: center;
}

/* Дашборд */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin-top: 0.5rem;
}

.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Детальная страница телефона */
.phone-detail {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.phone-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.phone-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.phone-image-large img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.no-image-large {
    height: 400px;
    background: #ecf0f1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 3rem;
    color: #bdc3c7;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.specs-table td:first-child {
    font-weight: bold;
    width: 40%;
}

/* Проблемы */
.issue-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #e74c3c;
}

.issue-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.issue-list ul {
    list-style: none;
    padding-left: 0;
}

.issue-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.issue-list li:before {
    content: "🔧 ";
    margin-right: 0.5rem;
}

.no-issues {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Сообщения */
.flash-messages {
    margin-bottom: 1rem;
}

.flash-message {
    padding: 1rem;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .phones-grid {
        grid-template-columns: 1fr;
    }
    
    .phone-content {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .issue-header {
        flex-direction: column;
        align-items: flex-start;
    }
}