/* Цветовая палитра (та же, что и на основном сайте) */
:root {
    --dark-teal: #1a3d3f;
    --almost-black: #1a1a1a;
    --dark-burgundy: #5a2a3a;
    --rich-crimson: #B93431;
    --dusty-pink: #c4a5a5;
    --light-beige: #f5e6d3;
    --cream: #faf8f3;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--cream);
    color: var(--almost-black);
    line-height: 1.6;
}

/* Экран авторизации */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--cream) 0%, var(--light-beige) 100%);
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(90, 42, 58, 0.15);
    max-width: 400px;
    width: 90%;
}

.login-container h1 {
    color: var(--dark-burgundy);
    margin-bottom: 30px;
    text-align: center;
    font-weight: 300;
    letter-spacing: 1px;
}

.login-hint {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--dusty-pink);
    text-align: center;
}

.security-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--dusty-pink);
    text-align: center;
    opacity: 0.8;
}

.lockout-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
}

/* Админ-панель */
.admin-panel {
    min-height: 100vh;
}

.admin-header {
    background-color: var(--dark-burgundy);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 1px;
}

.admin-session-info {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.admin-user-name {
    font-weight: 600;
}

.admin-user-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-main {
    padding: 40px 0;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Секции */
/* Навигация по разделам админ-панели */
.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--dusty-pink);
    padding-bottom: 10px;
}

.admin-nav-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--dark-burgundy);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: -12px;
}

.admin-nav-btn:hover {
    color: var(--rich-crimson);
}

.admin-nav-btn.active {
    color: var(--rich-crimson);
    border-bottom-color: var(--rich-crimson);
}

.admin-nav-btn.disabled,
.admin-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-bottom-color: transparent;
}

.admin-section {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.section-header h2 {
    color: var(--dark-burgundy);
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 400;
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: var(--rich-crimson);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 42, 58, 0.3);
}

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

.btn-secondary:hover {
    background-color: var(--rich-crimson);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Список товаров */
.products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.product-list-placeholder {
    text-align: center;
    color: var(--dusty-pink);
    padding: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border: 1px dashed rgba(90, 42, 58, 0.2);
}

.product-item {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px 14px;
    box-shadow: 0 3px 10px rgba(71, 0, 11, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(71, 0, 11, 0.14);
}

.product-item.archived {
    opacity: 0.55;
    border: 1px dashed rgba(71, 0, 11, 0.2);
}

.product-inline-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.product-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-beige);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(71, 0, 11, 0.08);
    flex-shrink: 0;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-placeholder {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--rich-crimson);
    text-transform: uppercase;
}

.product-inline-main {
    flex: 1;
    display: grid;
    gap: 10px;
}

.product-inline-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.product-inline-field label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    color: rgba(71, 0, 11, 0.55);
}

.product-inline-input,
.product-inline-select {
    width: 100%;
    border: 1px solid rgba(71, 0, 11, 0.15);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255, 249, 247, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.product-inline-input:focus,
.product-inline-select:focus {
    outline: none;
    border-color: var(--rich-crimson);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(185, 52, 49, 0.16);
}

.product-inline-price-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-inline-price-wrapper .currency {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-burgundy);
}

.product-inline-tag-control {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.product-tag-badge {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.product-inline-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.product-inline-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filters-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    color: rgba(71, 0, 11, 0.55);
}

.product-inline-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.product-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(71, 0, 11, 0.18);
    background: rgba(255, 249, 247, 0.8);
    font-size: 0.72rem;
    color: var(--dark-burgundy);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.product-category-chip input {
    display: none;
}

.product-category-chip.selected {
    background: var(--rich-crimson);
    border-color: var(--rich-crimson);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(185, 52, 49, 0.25);
}

.product-inline-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.product-inline-actions .btn-small {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-inline-actions .btn-small:last-child:nth-child(odd) {
    flex-basis: 100%;
}

.product-inline-status {
    position: absolute;
    top: 10px;
    left: 14px;
    background: rgba(71, 0, 11, 0.92);
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.product-inline-status.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-inline-status.error {
    background: rgba(220, 53, 69, 0.92);
}

.filters-hint {
    font-size: 0.68rem;
    color: rgba(71, 0, 11, 0.4);
}

.badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.badge-archived {
    background-color: var(--dusty-pink);
    color: white;
}

.badge-out-of-stock {
    background-color: #dc3545;
    color: white;
}

.badge-in-stock {
    background-color: #28a745;
    color: white;
}

.badge-exclusive {
    background-color: var(--dark-teal);
    color: white;
}

.badge-last-in-stock {
    background-color: var(--rich-crimson);
    color: white;
}

/* Управление галереей */
.gallery-section {
    margin-top: 40px;
}

.gallery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.gallery-item-admin {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.gallery-item-admin:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(90, 42, 58, 0.15);
}

.gallery-item-preview {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--light-beige);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item-preview img,
.gallery-item-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-item-info-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.gallery-item-info h3 {
    font-size: 1.05rem;
    color: var(--dark-burgundy);
    margin: 0;
    font-weight: 600;
}

.gallery-item-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge-image,
.badge-video,
.badge-upload,
.badge-external {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: white;
}

.badge-image { background: var(--dark-teal); }
.badge-video { background: var(--rich-crimson); }
.badge-upload { background: #28a745; }
.badge-external { background: #6c757d; }

.gallery-item-url {
    font-size: 0.82rem;
    color: var(--dusty-pink);
    word-break: break-all;
    font-family: monospace;
}

.gallery-item-meta {
    font-size: 0.85rem;
    color: var(--almost-black);
    opacity: 0.65;
}

.gallery-item-meta a {
    color: var(--dark-burgundy);
    text-decoration: none;
}

.gallery-item-meta a:hover {
    text-decoration: underline;
}

.gallery-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    width: 160px;
}

.gallery-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.form-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.form-group-header label {
    margin-bottom: 0;
}

.gallery-picker-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    z-index: 1200;
}

.gallery-picker-modal-overlay.open {
    display: flex;
}

.gallery-picker-dialog {
    background: #fff;
    border-radius: 16px;
    width: min(900px, 90vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    overflow: hidden;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.22);
}

.gallery-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.gallery-picker-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--dark-burgundy);
}

.gallery-picker-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--dusty-pink);
}

.gallery-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
    min-height: 220px;
    max-height: 60vh;
}

.gallery-picker-empty {
    text-align: center;
    color: #666;
    padding: 40px 0;
}

.gallery-picker-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-picker-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.gallery-picker-item.selected {
    border-color: var(--dark-burgundy);
}

.picker-thumb {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f2f2f2;
}

.picker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.picker-meta {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.picker-meta strong {
    font-size: 0.95rem;
    color: var(--almost-black);
}

.picker-meta span {
    font-size: 0.8rem;
    color: var(--dusty-pink);
}

.picker-overlay {
    position: absolute;
    inset: 0;
    background: rgba(90, 42, 58, 0.65);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-picker-item.selected .picker-overlay {
    opacity: 1;
}

.gallery-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.users-section .section-hint {
    color: var(--dusty-pink);
    margin-bottom: 20px;
}

.admin-users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.admin-user-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(26, 61, 63, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(26, 61, 63, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26, 61, 63, 0.12);
}

.admin-user-card.inactive {
    opacity: 0.7;
}

.admin-user-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.admin-user-info {
    flex: 1 1 200px;
    min-width: 0;
}

.admin-user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: flex-start;
    margin-left: auto;
    flex: 0 1 160px;
}

.admin-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-burgundy);
}

.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.role-badge {
    background: rgba(90, 42, 58, 0.12);
    color: var(--rich-crimson);
}

.status-badge {
    background: rgba(26, 61, 63, 0.1);
    color: var(--dark-teal);
}

.status-badge.inactive {
    background: rgba(220, 53, 69, 0.15);
    color: #c82333;
}

.admin-user-meta {
    font-size: 0.85rem;
    color: rgba(26, 26, 26, 0.7);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-user-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.empty-placeholder {
    margin-top: 20px;
    padding: 40px;
    text-align: center;
    background: rgba(245, 230, 211, 0.3);
    border: 1px dashed rgba(26, 61, 63, 0.2);
    border-radius: 12px;
    color: rgba(26, 26, 26, 0.6);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 8px;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .gallery-picker-dialog {
        width: 95vw;
        padding: 18px;
    }

    .gallery-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .gallery-item-admin {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-item-actions {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Выбор размера ячейки */
.size-selector {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.size-option {
    flex: 1;
    cursor: pointer;
}

.size-option input[type="radio"] {
    display: none;
}

.size-preview {
    border: 2px solid var(--dusty-pink);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background-color: var(--light-beige);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.size-option input[type="radio"]:checked + .size-preview {
    border-color: var(--rich-crimson);
    background-color: rgba(185, 52, 49, 0.1);
    transform: scale(1.05);
}

.size-preview.small {
    height: 60px;
}

.size-preview.medium {
    height: 100px;
}

.size-preview.large {
    height: 140px;
}

.size-preview span {
    color: var(--dark-burgundy);
    font-weight: 500;
}

/* Управление заказами */
.orders-section {
    margin-top: 0;
}

.orders-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.stat-badge.stat-new {
    background-color: #28a745;
}

.stat-badge.stat-processing {
    background-color: #ffc107;
    color: #333;
}

.stat-badge.stat-completed {
    background-color: #17a2b8;
}

.orders-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.orders-filters .filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--dusty-pink);
    background: white;
    color: var(--dark-burgundy);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.orders-filters .filter-btn:hover {
    border-color: var(--rich-crimson);
    color: var(--rich-crimson);
}

.orders-filters .filter-btn.active {
    background-color: var(--rich-crimson);
    color: white;
    border-color: var(--rich-crimson);
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.order-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(90, 42, 58, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-beige);
}

.order-info h3 {
    color: var(--dark-burgundy);
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.order-date {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.order-customer {
    color: var(--almost-black);
    font-size: 0.9rem;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.order-status.order-status-new {
    background-color: #28a745;
    color: white;
}

.order-status.order-status-processing {
    background-color: #ffc107;
    color: #333;
}

.order-status.order-status-completed {
    background-color: #17a2b8;
    color: white;
}

.order-status.order-status-cancelled {
    background-color: #dc3545;
    color: white;
}

.order-body {
    margin-bottom: 15px;
}

.order-items-preview {
    margin-bottom: 10px;
}

.order-item-preview {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-beige);
    font-size: 0.9rem;
}

.order-more-items {
    color: var(--dusty-pink);
    font-size: 0.85rem;
    margin-top: 5px;
}

.order-total {
    text-align: right;
    font-size: 1.1rem;
    color: var(--rich-crimson);
    margin-top: 10px;
}

.order-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.order-status-select {
    padding: 8px 12px;
    border: 2px solid var(--dusty-pink);
    border-radius: 6px;
    background: white;
    color: var(--dark-burgundy);
    font-size: 0.9rem;
    cursor: pointer;
}

.order-status-select:focus {
    outline: none;
    border-color: var(--rich-crimson);
}

.order-notify {
    font-size: 0.85rem;
    color: rgba(26, 26, 26, 0.68);
}

/* Модальное окно заказа */
.order-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.order-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.order-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--dark-burgundy);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.order-modal-close:hover {
    background: var(--light-beige);
}

.order-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section {
    padding: 20px;
    background: var(--light-beige);
    border-radius: 8px;
}

.detail-section h3 {
    color: var(--dark-burgundy);
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 500;
}

.detail-section p {
    margin-bottom: 8px;
    color: var(--almost-black);
    line-height: 1.6;
}

.detail-section a {
    color: var(--rich-crimson);
    text-decoration: none;
}

.detail-section a:hover {
    text-decoration: underline;
}

.order-items-detail {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-item-detail {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.order-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-beige);
}

.order-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-info {
    flex: 1;
}

.order-item-info h4 {
    color: var(--dark-burgundy);
    margin-bottom: 8px;
    font-size: 1rem;
}

.order-item-info p {
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Настройка Telegram */
.telegram-config-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.telegram-config-section h3 {
    color: var(--dark-burgundy);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.telegram-config {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.telegram-status {
    padding: 12px;
    background: var(--light-beige);
    border-radius: 6px;
    margin-top: 10px;
}

.telegram-config .form-group {
    margin-bottom: 0;
}

.telegram-config .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.telegram-config .form-group small a {
    color: var(--rich-crimson);
    text-decoration: none;
}

.telegram-config .form-group small a:hover {
    text-decoration: underline;
}

/* Настройка Email */
.email-config-section {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.email-config-section h3 {
    color: var(--dark-burgundy);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.email-config {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.email-config .form-group,
.email-config .form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.email-config .form-group-inline {
    flex-direction: row;
    gap: 20px;
}

.email-config .form-group-inline .form-group {
    flex: 1;
}

.email-config .form-group small {
    color: #666;
    font-size: 0.85rem;
}

.email-status {
    padding: 12px;
    background: var(--light-beige);
    border-radius: 6px;
    margin-top: 5px;
    color: var(--dark-burgundy);
}

.email-config-section {
    margin-bottom: 40px;
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.notification-actions .btn {
    flex: 1 1 220px;
    min-width: 190px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Секция безопасности и 2FA */
.security-section {
    padding: 20px;
}

.security-config {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.two-factor-section h3 {
    color: var(--dark-burgundy);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.two-factor-status {
    padding: 15px;
    background: var(--light-beige);
    border-radius: 8px;
    margin-bottom: 20px;
}

.two-factor-status p {
    margin: 0;
    color: var(--almost-black);
    font-weight: 500;
}

.qrcode-container {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin: 20px 0;
    border: 2px solid var(--dusty-pink);
}

.qrcode-container img {
    display: block;
    margin: 0 auto;
}

.secret-key-input {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 1px;
    background: var(--light-beige);
    padding: 12px;
    border: 2px solid var(--dusty-pink);
    border-radius: 8px;
    width: 100%;
    margin-top: 10px;
}

.success-message {
    color: #28a745;
    font-weight: 500;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    margin-bottom: 15px;
}

#twoFactorCode {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-align: center;
    width: 150px;
    margin: 0 auto;
    display: block;
}

#twoFactorCode::placeholder {
    letter-spacing: 3px;
}

/* Форма */
.product-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-burgundy);
    font-weight: 500;
    font-size: 0.95rem;
}

.rich-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--dusty-pink);
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

.toolbar-btn {
    border: 1px solid rgba(90, 42, 58, 0.25);
    background: white;
    color: var(--dark-burgundy);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toolbar-btn span {
    font-weight: 600;
    font-size: 0.9rem;
}

.toolbar-btn:hover,
.toolbar-btn:focus-visible {
    outline: none;
    background: rgba(90, 42, 58, 0.08);
    border-color: var(--dark-burgundy);
}

.toolbar-select {
    border: 1px solid rgba(90, 42, 58, 0.25);
    border-radius: 6px;
    padding: 6px 10px;
    background: white;
    color: var(--dark-burgundy);
    font-size: 0.85rem;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(90, 42, 58, 0.2);
}

.toolbar-color {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: 1px solid rgba(90, 42, 58, 0.25);
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.toolbar-color input[type="color"] {
    width: 36px;
    height: 30px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.toolbar-color input[type="color"]::-webkit-color-swatch {
    border: none;
}

.toolbar-color input[type="color"]::-moz-color-swatch {
    border: none;
}

.rich-text-editor {
    border: 2px solid var(--dusty-pink);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: var(--cream);
    min-height: 220px;
    padding: 16px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dark-burgundy);
    overflow-y: auto;
}

.rich-text-editor:focus-visible {
    outline: none;
    border-color: var(--dark-burgundy);
    box-shadow: 0 0 0 3px rgba(90, 42, 58, 0.12);
}

.rich-text-editor:empty::before {
    content: attr(data-placeholder);
    color: rgba(90, 42, 58, 0.45);
    font-style: italic;
}

.rich-text-editor p {
    margin: 0 0 12px;
}

.rich-text-editor p:last-child {
    margin-bottom: 0;
}

.rich-text-editor ul,
.rich-text-editor ol {
    margin: 0 0 12px 20px;
    padding-left: 20px;
}

.rich-text-editor ul {
    list-style: disc;
}

.rich-text-editor ol {
    list-style: decimal;
}

.icon-align-left,
.icon-align-center,
.icon-align-right {
    display: block;
    width: 16px;
    height: 12px;
    position: relative;
}

.icon-align-left::before,
.icon-align-center::before,
.icon-align-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(currentColor 2px, transparent 2px), linear-gradient(currentColor 2px, transparent 2px), linear-gradient(currentColor 2px, transparent 2px);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: top, center, bottom;
}

.icon-align-center::before {
    background-position: top center, center center, bottom center;
}

.icon-align-right::before {
    background-position: top right, center right, bottom right;
}

.icon-clear-format::before {
    content: 'Tx';
    font-weight: 600;
    font-size: 0.8rem;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--dusty-pink);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: var(--cream);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dark-burgundy);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--dusty-pink);
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.categories-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
    padding: 15px;
    background-color: var(--light-beige);
    border-radius: 8px;
}

.category-checkbox {
    padding: 10px 15px;
    background-color: white;
    border: 2px solid var(--dusty-pink);
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.category-checkbox:hover {
    border-color: var(--dark-burgundy);
    background-color: rgba(90, 42, 58, 0.05);
}

.category-checkbox input:checked + span {
    color: var(--dark-burgundy);
    font-weight: 600;
}

.category-checkbox input:checked ~ span,
.category-checkbox:has(input:checked) {
    border-color: var(--dark-burgundy);
    background-color: rgba(90, 42, 58, 0.1);
}

/* Специальные цвета для категорий */
.category-checkbox[for*="harry-potter"] {
    border-color: #8B4513;
}

.category-checkbox[for*="harry-potter"]:has(input:checked) {
    background-color: rgba(139, 69, 19, 0.1);
    border-color: #8B4513;
}

.category-checkbox[for*="autumn"] {
    border-color: #D2691E;
}

.category-checkbox[for*="autumn"]:has(input:checked) {
    background-color: rgba(210, 105, 30, 0.1);
    border-color: #D2691E;
}

.category-checkbox[for*="new-year"] {
    border-color: #CD5C5C;
}

.category-checkbox[for*="new-year"]:has(input:checked) {
    background-color: rgba(205, 92, 92, 0.1);
    border-color: #CD5C5C;
}

.category-checkbox[for*="candles"] {
    border-color: #B8860B;
}

.category-checkbox[for*="candles"]:has(input:checked) {
    background-color: rgba(184, 134, 11, 0.1);
    border-color: #B8860B;
}

.category-checkbox[for*="gift-sets"] {
    border-color: #9370DB;
}

.category-checkbox[for*="gift-sets"]:has(input:checked) {
    background-color: rgba(147, 112, 219, 0.1);
    border-color: #9370DB;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--dark-burgundy);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--dusty-pink);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--dark-burgundy);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.notification.success {
    background-color: #28a745;
}

.notification.error {
    background-color: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .admin-header-content {
        flex-direction: column;
        gap: 15px;
    }

    .admin-actions {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .products-list {
        grid-template-columns: 1fr;
    }

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

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

.notifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 24px;
}

.telegram-config-card,
.email-config-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 16px 45px rgba(90, 42, 58, 0.08);
    border: 1px solid rgba(90, 42, 58, 0.08);
}

.notifications-section .section-hint {
    font-size: 0.9rem;
    color: var(--dusty-pink);
    margin-bottom: 18px;
}

.notifications-section .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.notifications-section .form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-burgundy);
}

.notifications-section .form-group input,
.notifications-section .form-group select {
    border: 1px solid rgba(90, 42, 58, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.95);
}

.notifications-section .form-group small {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--dusty-pink);
    line-height: 1.4;
}

.notifications-section .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.config-status {
    background: rgba(90, 42, 58, 0.05);
    border-radius: 10px;
    padding: 14px 16px;
    margin: 18px 0 12px;
    font-size: 0.9rem;
    color: var(--dark-burgundy);
}

.notification-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.notification-actions .btn {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .notifications-grid {
        grid-template-columns: 1fr;
    }
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--dark-burgundy);
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--rich-crimson);
}

.gallery-section-actions {
    display: flex;
    gap: 12px;
}

.gallery-tabs {
    display: inline-flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 999px;
    padding: 6px;
    margin-bottom: 16px;
}

.gallery-tab {
    border: none;
    background: transparent;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--dark-burgundy);
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-tab.active {
    background: var(--dark-burgundy);
    color: #fff;
    box-shadow: 0 6px 16px rgba(90, 42, 58, 0.25);
}

.gallery-tab:hover {
    background: rgba(90, 42, 58, 0.1);
}

.gallery-collection-hint {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

