/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Шапка */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 10px 20px;
    text-decoration: none;
    color: white;
    background-color: #34495e;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.tab:hover {
    background-color: #455a64;
}

.tab.active {
    background-color: #3498db;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-link {
    color: white;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

/* Основной контент */
.main-content {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Формы */
.form-section {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[readonly] {
    background-color: #f5f5f5;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Таблицы */
.data-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th {
    background-color: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

.data-table tr:hover {
    background-color: #f9f9f9;
}

.data-table tr.overdue {
    background-color: #ffebee;
}

.data-table tr.overdue:hover {
    background-color: #ffcdd2;
}

/* Фильтры */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-tab {
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}

.filter-tab:hover {
    background-color: #f5f5f5;
}

.filter-tab.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Заголовок страницы */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

h1, h2 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Авторизация */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #ecf0f1;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* Галерея */
.gallery {
    margin-top: 20px;
}

.gallery-main {
    text-align: center;
    margin-bottom: 15px;
}

.gallery-main img {
    max-width: 100%;
    max-height: 500px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumbs .thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.gallery-thumbs .thumb:hover {
    border-color: #3498db;
}

.gallery-thumbs .thumb.active {
    border-color: #3498db;
    border-width: 3px;
}

/* Автодополнение */
.suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.form-group {
    position: relative;
}

/* Блоки изделий */
.item-block {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Администрирование */
.admin-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-block {
    background: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-block h2 {
    margin-bottom: 10px;
}

.admin-block p {
    margin-bottom: 15px;
    color: #666;
}

/* Печать */
.print-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: white;
}

.print-section {
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.print-section h2 {
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.print-item {
    margin-bottom: 20px;
    padding: 10px;
    background: #f9f9f9;
}

.print-image {
    max-width: 100%;
    margin: 10px 0;
}

@media print {
    .header, .form-actions, .btn {
        display: none;
    }
    
    .print-container {
        box-shadow: none;
    }
}

/* Инлайн формы */
.inline-form {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.inline-form input[type="text"] {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.inline-form label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}
