/* ============================================
   CSS для панели администратора
   ============================================ */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #dee2e6;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 5px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-color);
    color: var(--dark-color);
}

/* Страница входа */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0052a3 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.login-box p {
    color: var(--secondary-color);
    margin-bottom: 30px;
}

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

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--secondary-color);
}

.login-footer .link {
    color: var(--primary-color);
    text-decoration: none;
}

/* Админ панель */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-navbar {
    grid-column: 1 / -1;
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.admin-navbar-brand h2 {
    margin: 0;
    font-size: 20px;
}

.admin-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.admin-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.admin-menu a:hover,
.admin-menu a.active {
    opacity: 0.8;
}

/* Боковое меню */
.admin-sidebar {
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--dark-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--light-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.sidebar-menu span {
    margin-right: 10px;
}

/* Основной контент */
.admin-content {
    padding: 30px;
    overflow-y: auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 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: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
}

.stats-mini {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: var(--radius);
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-mini .label {
    color: var(--secondary-color);
}

.stat-mini .value {
    font-weight: bold;
    font-size: 18px;
    color: var(--primary-color);
}

/* Таблицы */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background: var(--light-color);
    font-weight: 600;
}

.table th {
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    font-size: 14px;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: var(--light-color);
}

.table code {
    background: var(--light-color);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    background: var(--primary-color);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 30px;
    font-size: 16px;
    width: 100%;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    color: var(--primary-color);
}

/* Формы */
.admin-form {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.settings-form {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.help-text {
    font-size: 12px;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 15px;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--secondary-color);
    font-size: 12px;
}

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

.form-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.form-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

/* Алерты */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: var(--light-color);
    color: var(--secondary-color);
}

/* Детали заявки */
.request-detail {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.detail-card {
    margin-bottom: 30px;
}

.detail-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: start;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: var(--secondary-color);
}

.detail-row .value {
    color: var(--dark-color);
}

.detail-row .value a {
    color: var(--primary-color);
}

.detail-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Последние заявки */
.recent-requests {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    margin: 0;
    font-size: 20px;
}

/* Быстрые действия */
.quick-actions {
    margin-top: 30px;
}

.quick-actions h2 {
    margin-bottom: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--dark-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.action-card:hover {
    background: var(--light-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.action-icon {
    font-size: 32px;
}

.action-text {
    font-weight: 500;
}

/* Информация о системе */
.system-info {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 30px;
}

.system-info h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

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

.info-item {
    padding: 15px;
    background: var(--light-color);
    border-radius: var(--radius);
}

.info-item .label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.info-item .value {
    display: block;
    color: var(--dark-color);
    word-break: break-all;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--secondary-color);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .admin-container {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-navbar {
        flex-direction: column;
        gap: 10px;
    }

    .admin-menu {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        gap: 10px;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
    }

    .page-header .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .admin-content {
        padding: 15px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .login-box {
        padding: 20px;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Стили для галереи изображений (админ)
   ============================================ */

.images-gallery {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.images-gallery h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--dark-color);
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.image-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.image-item:hover {
    transform: translateY(-2px);
}

.image-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-item .btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    padding: 5px 8px;
    font-size: 12px;
    opacity: 0.9;
}

.image-item:hover .btn {
    opacity: 1;
}

