/* === CUSTOM ADMIN STYLES === */

/* Улучшенные карточки и контейнеры */
.card, .module {
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Улучшенные таблицы */
#result_list {
    border-radius: 8px;
    overflow: hidden;
}

#result_list th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 12px 16px !important;
}

#result_list td {
    padding: 14px 16px !important;
    vertical-align: middle;
}

#result_list tr:hover td {
    background-color: rgba(168, 85, 247, 0.04) !important;
}

/* Улучшенные кнопки */
.button, button, input[type="submit"], input[type="button"] {
    border-radius: 8px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.button:hover, button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Кнопка удаления - яркая и заметная */
.deletelink, .inline-deletelink, a.deletelink {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s ease !important;
}

.deletelink:hover, .inline-deletelink:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: scale(1.02);
}

/* Кнопка удаления изображения */
.clearable-file-input .file-clear,
.clearable-file-input input[type="checkbox"],
input[type="checkbox"].clear,
.file-upload .clear,
a[href*="clear"] {
    background: #ef4444 !important;
    color: white !important;
    padding: 4px 10px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    cursor: pointer !important;
}

/* Чекбокс "Очистить" для изображений */
.clearable-file-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clearable-file-input label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.clearable-file-input label:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Улучшенные формы */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    padding: 10px 14px !important;
    transition: all 0.2s ease !important;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1) !important;
    outline: none !important;
}

/* Fieldsets */
fieldset {
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    background: #fafafa;
}

fieldset legend,
fieldset h2 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    padding: 0 12px !important;
    background: white;
    border-radius: 4px;
}

/* Inline формы (галерея изображений) */
.inline-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.inline-group h2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 14px 16px !important;
    margin: 0 !important;
    font-size: 13px !important;
}

.inline-related {
    border-bottom: 1px solid #f3f4f6;
    padding: 16px !important;
}

.inline-related:last-child {
    border-bottom: none;
}

/* Кнопка "Добавить ещё" */
.add-row a {
    color: #a855f7 !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(168, 85, 247, 0.08);
    border-radius: 8px;
    transition: all 0.2s;
}

.add-row a:hover {
    background: rgba(168, 85, 247, 0.15);
}

/* Статусы заказов */
.field-status select option[value="new"],
td:contains("new") {
    color: #3b82f6;
}

/* Изображения в списке */
.field-image img,
.field-photo img,
.field-logo img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Сайдбар */
#nav-sidebar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
}

/* Хлебные крошки */
.breadcrumbs {
    background: transparent !important;
    padding: 16px 0 !important;
    font-size: 13px;
}

/* Сообщения */
.messagelist .success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-radius: 8px !important;
}

.messagelist .error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-radius: 8px !important;
}

.messagelist .warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border-radius: 8px !important;
}

/* Пагинация */
.paginator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.paginator a {
    padding: 8px 14px;
    border-radius: 6px;
    background: #f3f4f6;
    transition: all 0.2s;
}

.paginator a:hover {
    background: #a855f7;
    color: white;
}

/* Фильтры */
#changelist-filter {
    border-radius: 12px;
    background: white;
    border: 1px solid #e5e7eb;
}

#changelist-filter h2 {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 14px 16px;
    margin: 0;
    border-radius: 12px 12px 0 0;
    font-size: 13px;
    font-weight: 600;
}

#changelist-filter h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 12px 16px 8px;
    margin: 0;
}

#changelist-filter ul {
    padding: 0 16px 12px;
}

#changelist-filter li {
    padding: 6px 0;
}

#changelist-filter a {
    color: #374151;
    transition: color 0.2s;
}

#changelist-filter a:hover,
#changelist-filter li.selected a {
    color: #a855f7;
}

/* Скрываем лишние элементы для упрощения интерфейса */
.object-tools {
    margin-bottom: 16px !important;
}

/* Улучшенный вид чекбоксов */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #a855f7;
}

/* Тёмная тема для модальных окон */
.modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.messagelist li {
    animation: fadeIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    #result_list th,
    #result_list td {
        padding: 10px 8px !important;
        font-size: 13px;
    }
    
    fieldset {
        padding: 12px !important;
    }
}
