/* ============================================================================
   СТАТУСЫ И ПАНЕЛИ ДЕЙСТВИЙ
   ============================================================================ */

/* ----------------------------------------------------------------------------
   Цветовые переменные для статусов
   ---------------------------------------------------------------------------- */
:root {
    /* Синий статус (в процессе, оплачено) */
    --status-blue-bg: rgba(219, 234, 254, 0.4);
    --status-blue-bg-option: rgba(219, 234, 254, 0.5);
    --status-blue-border: rgba(16, 100, 209, 0.4);
    --status-blue-text: #1064d1;
    
    /* Зеленый статус (средства получены, подтверждение оплаты) */
    --status-green-bg: rgba(209, 250, 229, 0.4);
    --status-green-bg-option: rgba(209, 250, 229, 0.5);
    --status-green-bg-confirmation: rgba(209, 250, 229, 0.6);
    --status-green-border: rgba(34, 197, 94, 0.4);
    --status-green-border-confirmation: rgba(34, 197, 94, 0.5);
    --status-green-text: #166534;
    
    /* Желтый статус (завершено) */
    --status-yellow-bg: rgba(254, 243, 199, 0.4);
    --status-yellow-bg-option: rgba(254, 243, 199, 0.5);
    --status-yellow-border: rgba(234, 179, 8, 0.4);
    --status-yellow-text: #854d0e;
    
    /* Оранжевый статус (возврат) */
    --status-orange-bg: rgba(255, 237, 213, 0.4);
    --status-orange-bg-option: rgba(255, 237, 213, 0.5);
    --status-orange-border: rgba(249, 115, 22, 0.4);
    --status-orange-text: #9a3412;
    
    /* Красный статус (отклонено) */
    --status-red-bg: rgba(254, 226, 226, 0.4);
    --status-red-bg-option: rgba(254, 226, 226, 0.5);
    --status-red-border: rgba(239, 68, 68, 0.4);
    --status-red-text: #991b1b;
    
    /* Общие цвета */
    --status-hover-bg: rgba(139, 92, 246, 0.1);
    --status-select-bg: #ffffff;
    --status-select-border: rgba(16, 100, 209, 0.3);
    --status-select-hover-bg: #f9fafb;
    --status-select-focus-shadow: rgba(16, 100, 209, 0.1);
}

/* ----------------------------------------------------------------------------
   Базовые стили для выпадающего списка статусов
   ---------------------------------------------------------------------------- */
.status-select {
    /* Размеры */
    min-width: 180px;
    max-width: 200px;
    padding: 0.75rem 1rem;
    
    /* Внешний вид */
    border-radius: 6px;
    border-width: 2px;
    border-color: var(--status-select-border);
    background-color: var(--status-select-bg);
    color: var(--brand-text);
    
    /* Типографика */
    font-size: 0.9375rem;
    line-height: 1.5rem;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    
    /* Интерактивность */
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Дополнительные настройки */
    background-image: none;
    color-scheme: light;
    accent-color: #8b5cf6;
}

.status-select:hover {
    background-color: var(--status-select-hover-bg);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--status-select-focus-shadow);
}

.status-select:focus {
    outline: none;
    background-color: var(--status-select-bg);
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px var(--status-select-focus-shadow);
    color-scheme: light;
}

/* ----------------------------------------------------------------------------
   Стили для опций в выпадающем списке
   ---------------------------------------------------------------------------- */
.status-select option {
    background-color: var(--status-select-bg);
    color: var(--brand-text);
    padding: 10px 14px;
    font-size: 0.9375rem;
    text-align: left;
    border: none;
}

.status-select option.status-option {
    padding-left: 24px;
}

.status-select option:hover {
    background-color: var(--status-hover-bg);
}

.status-select option:checked {
    background: inherit;
    color: inherit;
}

/* Цвета опций по значениям статусов - убраны, используется единый дизайн */
.status-select option[value="in_progress"],
.status-select option[value="quoted"],
.status-select option[value="payment_assigned"],
.status-select option[value="funds_received"],
.status-select option[value="payment_confirmation"],
.status-select option[value="paid"],
.status-select option[value="completed"],
.status-select option[value="return"],
.status-select option[value="rejected"] {
    background-color: var(--status-select-bg);
    color: var(--brand-text);
}

/* ----------------------------------------------------------------------------
   Цветовое оформление выбранного статуса - убрано, используется единый дизайн
   ---------------------------------------------------------------------------- */
.status-select.status-in-progress,
.status-select[data-current-status="in_progress"],
.status-select.status-paid,
.status-select[data-current-status="paid"],
.status-select.status-funds-received,
.status-select[data-current-status="funds_received"],
.status-select.status-payment-confirmation,
.status-select[data-current-status="payment_confirmation"],
.status-select.status-completed,
.status-select[data-current-status="completed"],
.status-select.status-return,
.status-select[data-current-status="return"],
.status-select.status-rejected,
.status-select[data-current-status="rejected"] {
    background-color: var(--status-select-bg);
    border-color: var(--status-select-border);
    color: var(--brand-text);
}

/* ----------------------------------------------------------------------------
   Панель действий
   ---------------------------------------------------------------------------- */
.action-panel {
    position: fixed;
    top: 120px;
    right: 1.5rem;
    left: auto;
    z-index: 1000;
    
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    
    padding: 1.25rem;
    width: auto;
    max-width: none;
    
    background: #ffffff;
    border: 2px solid rgba(16, 100, 209, 0.3);
    border-radius: 1.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.action-panel.compact {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
    box-sizing: border-box;
}

.action-panel #editModeButtons,
.action-panel #viewModeButtons {
    flex-direction: column;
    gap: 0.75rem;
}

/* ----------------------------------------------------------------------------
   Кнопки панели действий
   ---------------------------------------------------------------------------- */
/* Геометрия panel-button задаётся в buttons.css; здесь только панель */
.action-panel .panel-button {
    min-width: 170px;
}

/* Явное правило для ссылок с классом panel-button, чтобы они использовали тот же шрифт */
.action-panel a.panel-button {
    font-family: inherit !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

.panel-button-primary {
    color: #fff;
    background: var(--brand-red-dark);
    box-shadow: none;
}

.panel-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.panel-button-secondary {
    color: var(--brand-text);
    background: rgba(249, 250, 251, 0.9);
    border: 2px solid rgba(16, 100, 209, 0.3);
}

.panel-button-secondary:hover {
    transform: translateY(-2px);
    background: #ffffff;
    border-color: rgba(16, 100, 209, 0.5);
    color: var(--brand-text);
}

.panel-button-accent {
    color: #fff;
    background: #f01245;
    box-shadow: none;
}

.panel-button-accent:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.panel-button-tertiary {
    color: #fff;
    background: rgba(16, 100, 209, 0.25);
    border: 1px solid rgba(16, 100, 209, 0.5);
}

.panel-button-tertiary:hover {
    transform: translateY(-2px);
    background: rgba(16, 100, 209, 0.4);
    border-color: rgba(16, 100, 209, 0.7);
}

/* ----------------------------------------------------------------------------
   Панель статусов действий
   ---------------------------------------------------------------------------- */
.status-actions {
    position: sticky;
    top: 5.5rem;
    left: 0;
    right: 0;
    z-index: 1099;
    
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    
    width: 100%;
    padding: 0.75rem 2rem;
    
    background: linear-gradient(120deg, rgba(7, 6, 20, 0.95), rgba(39, 7, 30, 0.9));
    border-bottom: 1px solid rgba(215, 38, 61, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.status-save-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    
    padding: 0.75rem 1.5rem;
    
    font-size: 0.95rem;
    font-weight: 600;
    
    color: #fff;
    background-image: linear-gradient(135deg, var(--brand-red), var(--brand-purple), var(--brand-blue));
    border: none;
    border-radius: 999px;
    box-shadow: none;
    
    cursor: pointer;
    transition: transform 0.2s ease;
}

.status-save-button:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.status-save-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ----------------------------------------------------------------------------
   Панель фильтров статусов
   ---------------------------------------------------------------------------- */
.status-filter-panel {
    display: flex;
    gap: 0.75rem;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
}

.status-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    padding: 0.65rem 1.25rem;
    
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-text);
    text-decoration: none;
    
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-filter-button:hover {
    background: #e5e7eb;
    border-color: rgba(16, 100, 209, 0.3);
    color: var(--brand-blue);
    transform: translateY(-1px);
}

.status-filter-button.active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
    box-shadow: none;
}

.status-filter-button.active:hover {
    background: #0d4fa0;
    border-color: #0d4fa0;
    transform: translateY(-1px);
}

/* ----------------------------------------------------------------------------
   Адаптивность
   ---------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .status-actions {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }
    
    .status-filter-panel {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 2rem;
        height: auto;
        min-height: auto;
        overflow: visible;
    }
    
    .status-filter-button {
        padding: 0.55rem 1rem;
        font-size: 0.85rem;
    }
    
    .action-panel {
        flex-direction: row;
        flex-wrap: wrap;
        right: 1rem;
        left: 1rem;
        top: auto;
        bottom: 1rem;
        transform: none;
        padding: 0.75rem 1rem;
        width: auto;
        min-width: auto;
        max-width: none;
        gap: 0.5rem;
        border-radius: 16px;
    }
    
    .action-panel.compact {
        width: auto;
        min-width: auto;
        max-width: none;
    }
    
    .action-panel .panel-button {
        min-width: unset;
        flex: 1 1 calc(50% - 0.25rem);
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
    
    .status-select {
        min-width: 160px;
        max-width: 180px;
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .status-actions {
        flex-direction: column;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
        top: auto;
        position: relative;
    }
    
    .status-save-button {
        width: 100%;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }
    
    .status-filter-panel {
        flex-wrap: wrap;
        gap: 0.375rem;
        margin-top: 1.5rem;
    }
    
    .status-filter-button {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: calc(50% - 0.25rem);
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        text-align: center;
    }
    
    .action-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        padding: 0.875rem 1rem;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .action-panel .panel-button {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: calc(50% - 0.25rem);
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    
    .status-select {
        min-width: 140px;
        max-width: 160px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .status-filter-panel {
        gap: 0.25rem;
        margin-top: 1.25rem;
    }
    
    .status-filter-button {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 0.45rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .action-panel {
        padding: 0.75rem 0.625rem;
        gap: 0.375rem;
    }
    
    .action-panel .panel-button {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .status-select {
        min-width: 120px;
        max-width: 140px;
        padding: 0.4rem 0.625rem;
        font-size: 0.75rem;
    }
}
