/**
 * post-call-modal.css — shell modal post-apel (dark theme, aliniat la centrala.js)
 */

.post-call-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.post-call-modal-overlay--crm {
    z-index: 9600;
}

.post-call-modal {
    background: #1e293b;
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.post-call-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 28px 0;
}

.post-call-modal__title {
    color: #f1f5f9;
    font-size: 1.15rem;
    margin: 0 0 4px;
    font-weight: 600;
}

.post-call-modal__subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.post-call-modal__close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 4px;
}

.post-call-modal__close:hover {
    color: #cbd5e1;
}

.post-call-modal__body {
    padding: 20px 28px;
    overflow-y: auto;
}

.post-call-modal__footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 0 28px 24px;
}

.post-call-modal__section {
    margin-bottom: 16px;
}

/* Secțiuni colapsabile <details> din modalul post-apel */
.pcm-details {
    border: 1px solid #334155;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.pcm-details__summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    background: rgba(255, 255, 255, 0.03);
}

.pcm-details__summary::-webkit-details-marker { display: none; }

.pcm-details__summary::after {
    content: '▼';
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.5;
    transition: transform 0.2s;
}

details[open] > .pcm-details__summary::after {
    transform: rotate(180deg);
}

.pcm-details > *:not(summary) {
    padding: 0 16px 14px;
}

.pcm-details--nested {
    border: none;
    border-top: 1px dashed #334155;
    border-radius: 0;
    margin-bottom: 0;
}

.pcm-details__summary--sm {
    padding: 8px 0;
    font-size: 0.8rem;
    background: transparent;
}

.pcm-details--nested > *:not(summary) {
    padding: 0;
}

.post-call-modal__section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.post-call-modal__section-title {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.post-call-modal__contact {
    background: #0f172a;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.post-call-modal__contact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.post-call-modal__contact-badge {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.post-call-modal__contact-badge--ok {
    color: #4ade80;
}

.post-call-modal__contact-badge--warn {
    color: #f59e0b;
}

.post-call-modal__lead-name {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 1rem;
}

.post-call-modal__lead-company,
.post-call-modal__lead-duration,
.post-call-modal__contact-hint {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 4px;
}

.post-call-modal__link {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.post-call-modal__notice {
    background: #1e3a5f;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    color: #cbd5e1;
    font-size: 0.88rem;
    line-height: 1.45;
}

.post-call-modal__notice--preserved {
    background: #064e3b;
    border-color: #059669;
    color: #a7f3d0;
}

.post-call-modal__transcript {
    background: #0f172a;
    border-radius: 12px;
    padding: 14px;
}

.post-call-modal__transcript-body {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 140px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.post-call-modal__muted {
    color: #475569;
    font-style: italic;
}

.post-call-modal__badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
}

.post-call-modal__badge--ok {
    background: #064e3b;
    color: #4ade80;
}

.post-call-modal__badge--err {
    background: #450a0a;
    color: #f87171;
}

.post-call-modal__badge--pending {
    background: #1e3a5f;
    color: #60a5fa;
}

.post-call-modal__notes {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-radius: 10px;
    padding: 12px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 80px;
}

.post-call-modal__outcomes--buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-call-modal__outcome-btn {
    background: #334155;
    border: 2px solid transparent;
    color: #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.post-call-modal__outcome-btn:hover {
    background: #3f4f63;
}

.post-call-modal__outcome-btn--active {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #93c5fd;
}

.post-call-modal__outcomes--radio {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.post-call-modal__outcome-radio {
    cursor: pointer;
}

.post-call-modal__outcome-radio input {
    display: none;
}

.post-call-modal__outcome-radio-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
    min-height: 100%;
}

.post-call-modal__outcome-radio input:checked + .post-call-modal__outcome-radio-content {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.post-call-modal__outcome-radio:hover .post-call-modal__outcome-radio-content {
    background: rgba(255, 255, 255, 0.08);
}

.post-call-modal__outcome-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.post-call-modal__outcome-label {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 0.85rem;
}

.post-call-modal__outcome-desc {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 4px;
}

.post-call-modal__btn {
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
}

.post-call-modal__btn--primary {
    background: #059669;
    color: #fff;
}

.post-call-modal__btn--primary:hover {
    background: #047857;
}

.post-call-modal__btn--secondary {
    background: #334155;
    color: #94a3b8;
}

.post-call-modal__btn--ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #334155;
}

.post-call-modal__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
}

.post-call-modal__field-label {
    color: #94a3b8;
    font-size: 0.75rem;
    display: block;
    margin-bottom: 4px;
}

.post-call-modal__select {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #f1f5f9;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.post-call-modal__activity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.post-call-modal__erp-body {
    background: #0f172a;
    border-radius: 10px;
    padding: 12px;
    font-size: 0.85rem;
}

.post-call-modal__erp-single strong {
    color: #f1f5f9;
}

.post-call-modal__erp-actions {
    margin-top: 12px;
}

.post-call-modal__erp-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.post-call-modal__erp-action-btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.82rem;
}

.post-call-modal__erp-hint {
    margin-top: 8px;
    font-size: 0.75rem;
    line-height: 1.4;
}

.post-call-modal__erp-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.post-call-modal__btn--sm {
    padding: 8px 14px;
    font-size: 0.82rem;
}

.post-call-modal__erp-picker {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.post-call-modal__erp-picker-card {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
    max-width: 440px;
    padding: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.post-call-modal__erp-picker-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: #f1f5f9;
}

.post-call-modal__erp-picker-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
}

.post-call-modal__erp-search-results {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    font-size: 0.82rem;
}

.post-call-modal__erp-search-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-bottom: 1px solid #1e293b;
}

.post-call-modal__erp-search-row:last-child {
    border-bottom: none;
}

.post-call-modal__erp-search-row-main strong {
    color: #f1f5f9;
    font-size: 0.85rem;
}

@media (max-width: 560px) {
    .post-call-modal__erp-actions-grid {
        grid-template-columns: 1fr;
    }

    .post-call-modal__activity-grid {
        grid-template-columns: 1fr;
    }

    .post-call-modal__outcomes--radio {
        grid-template-columns: 1fr;
    }

    .post-call-modal__footer {
        flex-direction: column-reverse;
    }

    .post-call-modal__btn {
        width: 100%;
    }
}

/* ------------------------------------------------------------------
   Light-theme guard — light-theme.css loads after this file and sets
   body/label/input colors with !important, which breaks dark modal text.
   Exclus .pcm-light: când overlay-ul are această clasă, guard-ul nu se aplică
   și modul CRM primește tema light din light-theme.css.
   ------------------------------------------------------------------ */
.post-call-modal-overlay:not(.pcm-light) .post-call-modal {
    background: #1e293b !important;
    color: #f1f5f9 !important;
}

.post-call-modal-overlay:not(.pcm-light) .post-call-modal label {
    color: inherit !important;
}

.post-call-modal-overlay:not(.pcm-light) .post-call-modal__contact,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__transcript,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-body,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-search-results,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-picker-card {
    background: #0f172a !important;
}

.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-picker-card {
    background: #1e293b !important;
}

.post-call-modal-overlay:not(.pcm-light) strong,
.post-call-modal-overlay:not(.pcm-light) p {
    color: inherit !important;
}

.post-call-modal-overlay:not(.pcm-light) .post-call-modal__title { color: #f1f5f9 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__subtitle { color: #64748b !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__close { color: #64748b !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__close:hover { color: #cbd5e1 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__section-title { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__contact-badge--ok { color: #4ade80 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__contact-badge--warn { color: #f59e0b !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__lead-name { color: #f1f5f9 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__lead-company,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__lead-duration,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__contact-hint { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__link {
    background: transparent !important;
    color: #3b82f6 !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__link:hover {
    color: #60a5fa !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__notice { color: #cbd5e1 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__notice--preserved { color: #a7f3d0 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__transcript-body { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__muted { color: #64748b !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__badge--ok { color: #4ade80 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__badge--err { color: #f87171 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__badge--pending { color: #60a5fa !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-btn {
    color: #cbd5e1 !important;
    background: #334155 !important;
    border-color: transparent !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-btn--active {
    color: #93c5fd !important;
    background: #1e3a5f !important;
    border-color: #3b82f6 !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-radio-content {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-radio input:checked + .post-call-modal__outcome-radio-content {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #3b82f6 !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-label { color: #f1f5f9 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__outcome-desc { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__btn--primary { color: #fff !important; background: #059669 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__btn--secondary {
    color: #94a3b8 !important;
    background: #334155 !important;
    border: none !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__btn--ghost {
    color: #94a3b8 !important;
    background: transparent !important;
    border: 1px solid #334155 !important;
}
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__field-label { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-single strong { color: #f1f5f9 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-picker-head { color: #f1f5f9 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-picker-check { color: #94a3b8 !important; }
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__erp-search-row-main strong { color: #f1f5f9 !important; }

.post-call-modal-overlay:not(.pcm-light) .post-call-modal__notes,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal__select,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal input:not([type="hidden"]),
.post-call-modal-overlay:not(.pcm-light) .post-call-modal textarea,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal select {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.post-call-modal-overlay:not(.pcm-light) .post-call-modal__notes::placeholder,
.post-call-modal-overlay:not(.pcm-light) .post-call-modal textarea::placeholder {
    color: #64748b !important;
}

/* ------------------------------------------------------------------
   WhatsApp history — scroll container + "Scroll to latest" button
   ------------------------------------------------------------------ */
.pc-wa-history-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.pc-wa-scroll-btn {
    display: none;
    background: #334155;
    color: #94a3b8;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1.5;
}

.pc-wa-scroll-btn:hover {
    background: #3f4f63;
    color: #cbd5e1;
}

/* ------------------------------------------------------------------
   MOBILE RESPONSIVENESS AUDIT (2026-07) — reguli STRICT ADITIVE
   La 390px lățimea utilă a modalului era 390 - 40 (overlay) - 56 (body)
   = 294px; reducem padding-urile și liniarizăm grilele inline 2-col.
   ------------------------------------------------------------------ */
@media (max-width: 480px) {
    .post-call-modal-overlay {
        padding: 10px;
    }

    .post-call-modal {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .post-call-modal__header {
        padding: 16px 16px 0;
    }

    .post-call-modal__body {
        padding: 14px 16px;
    }

    .post-call-modal__footer {
        padding: 0 16px 16px;
    }

    /* Panoul reminder (postCallReminderShared) și formularul „Creează lead"
       (centrala.js → #pcContactSection) folosesc grile inline 1fr 1fr —
       la <480px devin 1 coloană ca datetime/select să rămână utilizabile. */
    #pcReminderPanel div[style*="grid-template-columns:1fr 1fr"],
    #pcContactSection div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* ERP picker (căutare client) — padding overlay redus */
    .post-call-modal__erp-picker {
        padding: 10px;
    }
}
