/* Стили админ панели */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg-light);
}

/* Боковая панель */
.admin-sidebar {
    width: 260px;
    background: var(--text-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.2rem;
    font-weight: bold;
    position: relative;
}

.sidebar-close {
    display: none;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left: 3px solid var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item.logout {
    color: var(--danger-color);
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.badge {
    background: var(--danger-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* Основной контент */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Хедер админки */
.admin-header {
    background: var(--bg-color);
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Контент админки */
.admin-content {
    flex: 1;
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 2rem;
    color: var(--text-color);
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Карточки */
.card {
    background: var(--bg-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

/* Таблицы */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.table-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background: #d1fae5;
    color: #065f46;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

/* Действия */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: var(--bg-light);
    color: var(--text-color);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-icon.btn-danger:hover {
    background: var(--danger-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Формы в админке */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.current-image {
    margin-bottom: 1rem;
}

.current-image img {
    max-width: 200px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.existing-images {
    margin-top: 1rem;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.image-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    transition: opacity 0.3s, transform 0.3s;
    padding: 5px;
}

.image-item:hover {
    transform: translateY(-2px);
}

.image-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-item:hover img {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-item span {
    font-size: 0.8rem;
    color: var(--text-light);
    word-break: break-all;
    max-width: 100px;
}

.delete-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4), 0 0 0 0 rgba(239, 68, 68, 0.5);
    padding: 0;
    margin: 0;
}

.delete-image-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.6), 0 0 0 4px rgba(239, 68, 68, 0.2);
    border-color: #fee2e2;
}

.delete-image-btn:active {
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.delete-image-btn i {
    transition: transform 0.3s;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.delete-image-btn:hover i {
    transform: scale(1.2);
}

.delete-image-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.delete-image-btn:disabled:hover {
    transform: scale(1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Секция дат туров */
.tour-dates-section {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.tour-dates-list {
    margin-bottom: 2rem;
}

.no-dates {
    color: var(--text-light);
    font-style: italic;
    padding: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

.tour-date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tour-date-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.date-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.date-info strong {
    color: var(--text-color);
    font-size: 1rem;
}

.date-separator {
    color: var(--text-light);
    font-weight: normal;
}

.date-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.date-status.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.date-status.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.date-status.status-completed {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.delete-date-btn {
    margin-left: auto;
}

.add-date-form {
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.add-date-form h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Детали заявки */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.detail-card {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.detail-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: var(--text-color);
}

.detail-item span {
    color: var(--text-light);
    text-align: right;
}

.price-large {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color) !important;
}

.status-form {
    margin-bottom: 2rem;
}

.status-select {
    width: 100%;
    margin-bottom: 1rem;
}

.tour-date-info {
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    display: inline-block;
}

/* Фильтры */
.filters-card {
    margin-bottom: 2rem;
}

.filters-form {
    margin: 0;
}

/* Страница входа */
.admin-login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.login-header p {
    color: var(--text-light);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.login-footer a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
}

/* Overlay для мобильных устройств */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .admin-content {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: block;
    }

    .admin-header {
        padding: 1rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .table-responsive {
        border-radius: 8px;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .data-table {
        font-size: 0.9rem;
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .table-image {
        width: 60px;
        height: 45px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .filters-form .form-row {
        flex-direction: column;
    }

    .filters-form .form-group {
        width: 100%;
    }

    .sidebar-header {
        padding: 1rem;
        padding-right: 3.5rem;
    }

    .sidebar-close {
        display: flex;
    }

    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .admin-content {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .card {
        padding: 0.75rem;
        border-radius: 8px;
    }

    .table-responsive {
        margin: 0 -0.75rem;
        padding: 0 0.75rem;
    }
    
    .data-table {
        font-size: 0.85rem;
        min-width: 550px;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }

    .table-image {
        width: 50px;
        height: 40px;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .sidebar-header {
        padding: 0.75rem;
        font-size: 1rem;
    }

    .sidebar-logo {
        width: 24px;
        height: 24px;
    }

    .nav-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }

    .stat-info p {
        font-size: 0.8rem;
    }

    .detail-card {
        padding: 1rem;
    }

    .detail-card h2 {
        font-size: 1.25rem;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .detail-item span {
        text-align: left;
    }
}

