/*
 * Общие стили модалок/попапов CRM. Раньше дублировались в <style> внутри отдельных
 * blade-страниц (interviews-workspace, interview-calendar-widget и т.д.) с расхождениями
 * в названиях классов (crm-modal-* / crm-calendar-modal-*) — собраны в одном месте.
 *
 * .crm-modal-card  — большая карточка (Карточка собеседования, Карточка лида).
 * .crm-popup-card  — маленький попап для быстрого выбора 1-3 полей, не растягивается
 *                    под размер крупной карточки.
 */

.crm-modal-overlay {
    background: rgba(3, 7, 18, .62) !important;
    backdrop-filter: blur(2px);
}

.crm-modal-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 72rem;
    max-height: calc(100vh - 1.5rem);
    overflow: hidden;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
}

.dark .crm-modal-card {
    background: #18181b;
}

.crm-popup-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 24rem;
    max-height: calc(100vh - 1.5rem);
    overflow: hidden;
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .35);
}

.dark .crm-popup-card {
    background: #18181b;
}

.crm-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    padding: 1rem;
}

.crm-modal-panel {
    border-radius: .75rem;
    background: #f9fafb;
    padding: .75rem;
}

.dark .crm-modal-panel {
    background: rgba(255, 255, 255, .05);
}

.crm-modal-field {
    min-width: 0;
}

.crm-modal-label {
    display: block;
    margin-bottom: .25rem;
    font-size: .72rem;
    font-weight: 600;
    color: #6b7280;
}

.dark .crm-modal-label {
    color: #9ca3af;
}

.crm-main-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: .5rem;
}

.crm-interview-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 140px) minmax(0, 110px) minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: .5rem;
}

.crm-status-row {
    display: flex !important;
    align-items: end;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .125rem;
}

.crm-status-row > label {
    flex: 0 0 auto;
}

.crm-service-row {
    display: flex !important;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .125rem;
}

.crm-service-row > div {
    flex: 1 0 9rem;
    min-width: 0;
}

.crm-stage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    transition: opacity 150ms ease;
}

.crm-stage-badge:hover {
    opacity: .82;
}

.crm-stage-badge:disabled {
    cursor: wait;
    opacity: .6;
}

.crm-stage-badge--empty {
    background-color: #f3f4f6 !important;
    color: #4b5563 !important;
}

.dark .crm-stage-badge--empty {
    background-color: hsla(0, 0%, 100%, .1) !important;
    color: #d1d5db !important;
}

.crm-stage-badge--done {
    background-color: #d1fae5 !important;
    color: #047857 !important;
}

.dark .crm-stage-badge--done {
    background-color: rgba(16, 185, 129, .18) !important;
    color: #6ee7b7 !important;
}

.crm-stage-badge--not_done {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.dark .crm-stage-badge--not_done {
    background-color: rgba(239, 68, 68, .18) !important;
    color: #fca5a5 !important;
}

.crm-stage-badge--due {
    background-color: #ffedd5 !important;
    color: #c2410c !important;
}

.dark .crm-stage-badge--due {
    background-color: rgba(249, 115, 22, .2) !important;
    color: #fdba74 !important;
}

@media (min-width: 640px) {
    .crm-modal-card,
    .crm-popup-card {
        max-height: calc(100vh - 3rem);
    }
}

@media (max-width: 900px) {
    .crm-interview-grid,
    .crm-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
