.is-invalid {
    border: 1px solid red !important;
}




.diagram-container {
    width: 100%;
    height: 600px;
    border: 1px solid #DFE5EF;  Just visual 
}

 Estilo base para los puertos 
.diagram-port {
    position: absolute;
    width: 10px;
    height: 15px;
    background-color: black;
    transform: translate(-50%, -50%);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer
}

.diagram-container {
    width: 100%;
    height: 600px;
    border: 1px solid #DFE5EF; /* Just visual */
}

/* Estilo base para los puertos */
.diagram-port {
    position: absolute;
    width: 10px;
    height: 15px;
    background-color: black;
    transform: translate(-50%, -50%);
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer
}

    /* Puerto superior */
    .diagram-port.top {
        border-top-left-radius: 50%;
        border-top-right-radius: 50%;
        top: -5px; /* Posicionado justo fuera del borde superior */
        left: 50%; /* Centrado horizontalmente */
    }

    /* Puerto inferior */
    .diagram-port.bottom {
        border-bottom-left-radius: 50%;
        border-bottom-right-radius: 50%;
        bottom: -5px; /* Posicionado justo fuera del borde inferior */
        left: 50%; /* Centrado horizontalmente */
    }

    /* Puerto izquierdo */
    .diagram-port.left {
        border-top-left-radius: 50%;
        border-bottom-left-radius: 50%;
        left: -5px; /* Posicionado justo fuera del borde izquierdo */
        top: 50%; /* Centrado verticalmente */
        transform: translate(-50%, -50%);
    }

    /* Puerto derecho */
    .diagram-port.right {
        border-top-right-radius: 50%;
        border-bottom-right-radius: 50%;
        right: -5px; /* Posicionado justo fuera del borde derecho */
        top: 50%; /* Centrado verticalmente */
        transform: translate(50%, -50%);
    }

    .diagram-port:hover {
        background-color: gray;
        /* transform: scale(1.1);*/
    }


#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ── Blazor startup splash ──────────────────────────────────────── */
/* app.css is render-blocking so these styles are guaranteed to load
   before the splash renders. Bootstrap variables (--bs-primary etc.)
   are also already resolved here since bootstrap.min.css loads first. */

#tc-splash {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bs-body-bg);
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Content block: logo + dots + pct — sits at ~28 vh to match the login page header */
#tc-splash .tc-splash-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin-top: 28vh;
    animation: tc-rise 0.6s cubic-bezier(.22,.68,0,1.2) both;
}

#tc-splash .tc-logo {
    width: 200px;
    max-width: 55vw;
}

/* ── Three pulsing dots ── */
#tc-splash .tc-dots {
    display: flex;
    gap: 9px;
    align-items: center;
}
#tc-splash .tc-dots span {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bs-primary);
    animation: tc-dot 1.3s ease-in-out infinite;
}
#tc-splash .tc-dots span:nth-child(1) { animation-delay: 0s;    }
#tc-splash .tc-dots span:nth-child(2) { animation-delay: 0.18s; }
#tc-splash .tc-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes tc-dot {
    0%, 75%, 100% { opacity: 0.15; transform: scale(0.8);  }
    35%           { opacity: 1;    transform: scale(1.15); }
}

/* Percentage label under dots */
#tc-splash .tc-pct {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--bs-secondary-color);
}
#tc-splash .tc-pct::after {
    content: var(--blazor-load-percentage-text, "0%");
}

/* ── Thin progress bar pinned to the bottom edge ── */
#tc-splash .tc-bar-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bs-border-color);
    overflow: hidden;
}
#tc-splash .tc-bar-fill {
    height: 100%;
    width: calc(var(--blazor-load-percentage, 0) * 1%);
    background: linear-gradient(
        90deg,
        color-mix(in srgb, var(--bs-primary) 50%, var(--bs-body-bg)),
        var(--bs-primary)
    );
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease;
}

@keyframes tc-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);     }
}

/* Legacy loading-progress kept hidden in case Blazor internals need it */
.loading-progress { display: none; }
.loading-progress-text { display: none; }
/* ── end splash ─────────────────────────────────────────────────── */

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* SMS Phone Search header compact layout (rendered via SectionContent) */
.phone-search-header {
    gap: 1rem;
}

.phone-search-header > .d-flex:last-child {
    flex: 1;
    min-width: 0;
}

.phone-search-header h4 {
    white-space: nowrap;
    font-size: 1.1rem;
}

.phone-search-header .row.g-3 {
    row-gap: 0.45rem !important;
    column-gap: 0.25rem;
    --bs-gutter-x: 0.35rem;
    --bs-gutter-y: 0.45rem;
}

.phone-search-header #clientSelect {
    width: 176px;
    min-width: 176px;
    max-width: 176px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.phone-search-header #countrySelect {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
}

.phone-search-header #keyField {
    width: 148px;
    min-width: 148px;
    max-width: 148px;
}

.phone-search-header #startDate,
.phone-search-header #endDate {
    width: 132px;
    min-width: 132px;
    max-width: 132px;
}

.phone-search-header .btn {
    white-space: nowrap;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

@media (min-width: 1200px) {
    .phone-search-header .row.g-3 {
        flex-wrap: nowrap;
    }
}

@media (max-width: 1400px) {
    .phone-search-header #clientSelect {
        width: 164px;
        min-width: 164px;
        max-width: 164px;
    }

    .phone-search-header #countrySelect {
        width: 104px;
        min-width: 104px;
        max-width: 104px;
    }

    .phone-search-header #keyField {
        width: 138px;
        min-width: 138px;
        max-width: 138px;
    }

    .phone-search-header #startDate,
    .phone-search-header #endDate {
        width: 124px;
        min-width: 124px;
        max-width: 124px;
    }
}

/* ── SMS Campaign layout ──────────────────────────────────────── */
.sms-camp-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

@media (max-width: 900px) {
    .sms-camp-body {
        grid-template-columns: 1fr;
    }
}

.sms-camp-data-panel {
    /* occupies the left grid cell — width driven by grid */
}

.sms-camp-phone-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sms-camp-section {
    border-bottom: 1px solid #eef0f7;
    padding-bottom: 14px;
    margin-bottom: 14px;
}

    .sms-camp-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.sms-camp-section-title {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8d8fa9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sms-camp-field-label {
    font-size: .8rem;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.sms-camp-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #eef0f7;
    margin-top: 14px;
}

/* ── Phone silhouette ─────────────────────────────────────────── */
.sms-phone-device {
    position: relative;
    width: 340px;
    background: #1c1c2e;
    border-radius: 42px;
    border: 3px solid #3a3a5c;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(255,255,255,.05);
    padding: 52px 14px 40px;
    display: flex;
    flex-direction: column;
}

/* pill notch */
.sms-phone-device::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 7px;
    background: #3a3a5c;
    border-radius: 4px;
}

/* home indicator */
.sms-phone-device::after {
    content: '';
    position: absolute;
    bottom: 13px;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 5px;
    background: #3a3a5c;
    border-radius: 3px;
}

.sms-phone-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255,255,255,.55);
    font-size: .58rem;
    padding: 0 6px 8px;
}

.sms-phone-screen {
    background: #f2f2f7;
    border-radius: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 560px;
}

/* Chat header — iOS Messages style */
.sms-phone-chat-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e5;
    padding: 8px 10px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sms-phone-chat-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0a84ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    flex-shrink: 0;
}

.sms-phone-chat-header-name {
    font-size: .8rem;
    font-weight: 600;
    color: #1c1c1e;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Chat bubble area */
.sms-phone-chat-body {
    flex: 1;
    padding: 10px 10px 6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
}

.sms-phone-bubble {
    background: #e5e5ea;
    border-radius: 16px 16px 16px 4px;
    padding: 9px 13px;
    font-size: .85rem;
    color: #1c1c1e;
    max-width: 88%;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.55;
    min-height: 32px;
}

/* Input bar at the bottom of the phone screen */
.sms-phone-input-bar {
    background: #fff;
    border-top: 1px solid #e0e0e5;
    padding: 6px 8px;
    flex-shrink: 0;
}

.sms-phone-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sms-phone-input-field {
    flex: 1;
    background: #f2f2f7;
    border: 1px solid #d1d1d6;
    border-radius: 18px;
    padding: 9px 14px;
    font-size: .85rem;
    color: #1c1c1e;
    resize: none;
    min-height: 80px;
    max-height: 160px;
    overflow-y: auto;
    outline: none;
    line-height: 1.55;
    font-family: inherit;
}

    .sms-phone-input-field:focus {
        border-color: #0a84ff;
        background: #fff;
    }

    .sms-phone-input-field.is-invalid {
        border-color: #dc3545 !important;
    }

.sms-phone-input-toolbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

    .sms-phone-input-toolbar button {
        background: none;
        border: none;
        padding: 2px 4px;
        line-height: 1;
        color: #5e5ce6;
        cursor: pointer;
        font-size: 1.15rem;
    }

        .sms-phone-input-toolbar button:hover {
            color: #0a84ff;
        }

.sms-phone-input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 2px 0;
    border-top: 1px solid #e5e5ea;
    margin-top: 5px;
}

.sms-phone-input-meta .form-check-label {
    font-size: .8rem;
    color: #3c3c43;
    font-weight: 500;
}

.sms-phone-input-meta .form-check-input {
    width: .9rem;
    height: .9rem;
}

.sms-phone-len-badge {
    font-size: .72rem;
    font-style: italic;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f2f2f7;
    border: 1px solid #e5e5ea;
}

.sms-phone-input-bar .text-success   { color: #16a34a !important; }
.sms-phone-input-bar .text-danger    { color: #dc2626 !important; }
.sms-phone-input-bar .text-danger-2  { color: #d97706 !important; }

/* ── SMS test send preview (in modal) ───────────────────────────── */
.sms-test-preview {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
}
.sms-test-preview-label {
    font-size: .72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 6px;
}
.sms-test-preview-body {
    font-size: .88rem;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.55;
    max-height: 120px;
    overflow-y: auto;
}

/* ── Shared campaign success icon ───────────────────────────────── */
.camp-success-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #dcfce7;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto;
}
.camp-success-icon i { font-size: 1.5rem; color: #16a34a; }

/* ── File upload area (shared: email + SMS campaigns) ───────────── */
.camp-file-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    min-height: 52px;
    transition: border-color .15s, background .15s;
}
.camp-file-area.has-file {
    border-style: solid;
    border-color: #a3c4f3;
    background: #f0f7ff;
}
.camp-file-area.border-danger { border-color: #dc3545 !important; border-style: solid; }
.camp-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.camp-file-upload-icon { font-size: 1.1rem; color: #94a3b8; flex-shrink: 0; }
.camp-file-placeholder { font-size: .8rem; color: #94a3b8; }
.camp-file-excel-icon  { font-size: 1.4rem; color: #217346; flex-shrink: 0; }
.camp-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.camp-file-name {
    font-size: .82rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.camp-file-stats { font-size: .72rem; color: #64748b; }
.camp-file-actions { display: flex; gap: 4px; flex-shrink: 0; }
.camp-file-btn-browse {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #374151;
    font-size: .78rem;
    padding: 3px 10px;
}
.camp-file-btn-browse:hover { background: #f1f5f9; }
.camp-file-btn-preview {
    border: 1px solid #217346;
    background: #fff;
    color: #217346;
    font-size: 1rem;
    padding: 2px 7px;
    line-height: 1;
}
.camp-file-btn-preview:hover:not(:disabled) { background: #e8f5ee; }
.camp-file-btn-preview:disabled { opacity: .35; border-color: #cbd5e1; color: #94a3b8; cursor: default; }

/* ── Voice campaign – TTS ────────────────────────────────── */
.voice-tts-counter {
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    transition: color .2s;
}
.voice-tts-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: .82rem;
    margin-top: 6px;
}
.voice-tts-preview-label {
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    flex-shrink: 0;
}
.voice-tts-preview-text { color: #1e293b; }
.voice-generating-state {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: #64748b;
    padding: 6px 0 10px;
}

/* ── Voice campaign – audio player ──────────────────────── */
.voice-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
}
.voice-audio-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #16a34a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .1s;
}
.voice-audio-btn:hover { background: #15803d; transform: scale(1.07); }
.voice-audio-btn:active { transform: scale(.95); }
.voice-audio-btn-stop {
    background: #ef4444;
    width: 28px;
    height: 28px;
    font-size: .8rem;
}
.voice-audio-btn-stop:hover { background: #dc2626; }
.voice-audio-progress { flex: 1; }
.voice-audio-time {
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    color: #64748b;
    white-space: nowrap;
}
.voice-audio-sep { margin: 0 2px; color: #cbd5e1; }

/* Page header title */
.ng-page-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    letter-spacing: -.01em;
}

/* ── Shared UI utilities (marca blanca — no hardcoded values) ──────── */

/* Empty-state decorative icon */
.ng-empty-icon {
    font-size: 2.5rem;
    opacity: .3;
}

/* Tight badge used for roles and channel chips */
.ng-badge-sm {
    font-size: .68rem;
    font-weight: 500;
}

/* Loading placeholder card minimum height */
.ng-loading-card {
    min-height: 180px;
}

/* Beta / preview inline label */
.ng-beta-badge {
    font-size: .6rem;
}

/* Page-size <select> in paginated tables */
.ng-page-size-select {
    width: 90px;
}

/* ── Campaign – recipient tag chips ─────────────────────────────────── */

/* Tag chip inside the free-form tag input */
.ng-campaign-tag {
    cursor: pointer;
    font-size: small;
    text-transform: none;
}

/* SMS tag chip (smaller, inside the tag control box) */
.ng-tag-badge {
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    font-size: .72rem;
}

/* Form-control wrapper that hosts tag chips */
.ng-tag-control {
    height: auto;
    min-height: 28px;
    padding-top: 3px;
    padding-bottom: 3px;
}

/* Inline field error (below inputs) */
.ng-field-error {
    font-size: .68rem;
    color: var(--bs-danger, #dc3545);
    padding-top: 3px;
}

/* Modal hint / helper text */
.ng-hint {
    font-size: .75rem;
    margin-top: 4px;
}

/* Shortcode / variable dropdown item */
.ng-shortcode-item {
    cursor: pointer;
    font-size: .85rem;
}

/* ── Voice Campaign ─────────────────────────────────────────────────── */

/* Audio/music file icon color */
.ng-audio-file-icon {
    color: var(--bs-purple, #7c3aed);
}

/* Thin upload progress bar */
.ng-progress-thin {
    height: 4px;
}

/* ── SMS Campaign – phone preview silhouette ─────────────────────────── */

.sms-phone-status-icon  { font-size: .62rem; }
.sms-phone-carrier-icon { font-size: .75rem; }
.sms-phone-bubble-placeholder {
    opacity: .35;
    font-style: italic;
}

/* ── Modals ─────────────────────────────────────────────────────────── */

.modal-sm-420 { max-width: 420px; }
.modal-sm-440 { max-width: 440px; }

/* ── SMS Dashboard ──────────────────────────────────────────────────── */

.ng-dashboard-filter-select { max-width: 220px; }

/* Icon box in stat cards needs a stable min-width */
.ng-stat-icon-wrap { min-width: 42px; }

/* Chart.js containers — require explicit height for canvas sizing */
.ng-chart-xs { position: relative; height: 240px; }
.ng-chart-sm { position: relative; height: 260px; }
.ng-chart-md { position: relative; height: 280px; }
/* ── end UI utilities ────────────────────────────────────────────────── */

/* ── White-label color tokens ───────────────────────────────────────── */
:root {
    --color-excel-green:       #217346;   /* Excel-format file icon        */
    --color-success-highlight: #16a34a;   /* Upload / inline success state  */
    --color-border-light:      #e9ecef;   /* Subtle card/section border     */
    --color-text-dark:         #374151;   /* Dark card title text           */
    --color-text-muted-alt:    #64748b;   /* Secondary descriptive text     */
}

/* ── Interactive cursor ─────────────────────────────────────────────── */
.ng-clickable { cursor: pointer; }

/* ── Font-size scale (marca blanca — override in theme) ─────────────── */
.ng-fs-70  { font-size: .70rem;  }
.ng-fs-75  { font-size: .75rem;  }
.ng-fs-80  { font-size: .80rem;  }
.ng-fs-82  { font-size: .82rem;  }
.ng-fs-85  { font-size: .85rem;  }
.ng-fs-90  { font-size: .90rem;  }
.ng-fs-11  { font-size: 11px;    }
.ng-fs-140 { font-size: 1.4rem;  }
.ng-fs-185 { font-size: 1.85rem; }
.ng-fs-220 { font-size: 2.2rem;  }

/* ── White-label color helper classes ───────────────────────────────── */
.ng-text-excel-green    { color: var(--color-excel-green);       }
.ng-text-success-hl     { color: var(--color-success-highlight); }
.ng-text-dark-title     { color: var(--color-text-dark);         }

/* ── Additional modal widths ─────────────────────────────────────────── */
.modal-sm-400 { max-width: 400px; }
.modal-sm-460 { max-width: 460px; }
.modal-sm-480 { max-width: 480px; }

/* ── Select / input width helpers ───────────────────────────────────── */
.ng-select-80  { width:  80px; }
.ng-select-100 { width: 100px; }
.ng-select-220 { max-width: 220px; }

/* ── Dimension helpers ───────────────────────────────────────────────── */
.ng-min-w-260  { min-width: 260px; }
.ng-min-w-46   { min-width:  46px; }
.ng-btn-w-20   { width:      20px; }

/* ── Progress bar heights ────────────────────────────────────────────── */
.ng-progress-sm  { height: 6px; }
.ng-progress-xs  { height: 2px; }

/* ── Card / section border ───────────────────────────────────────────── */
.ng-card-section {
    border: 1px solid var(--color-border-light, #e9ecef);
    border-radius: 8px;
}

/* ── Emoji picker container ─────────────────────────────────────────── */
.ng-emoji-picker {
    width: 20rem;
    height: 20rem;
    overflow-y: scroll;
}

/* ── Layout minimum height ───────────────────────────────────────────── */
.ng-layout-min { min-height: 680px; }

/* ── Textarea with icon inside ───────────────────────────────────────── */
.ng-textarea-icon { padding-right: 60px; }

/* ── Tag / badge control variants ───────────────────────────────────── */
.ng-tag-control-sm {
    height: auto;
    min-height: 26px;
    padding-top: 2px;
    padding-bottom: 2px;
}
/* ── end color tokens + extended utilities ──────────────────────────── */

/* ── File preview modal (shared component) ──────────────────────────── */
.fpm-content { display: flex; flex-direction: column; max-height: 85vh; }

.fpm-header { flex-shrink: 0; padding: 12px 16px; gap: 10px; }
.fpm-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fpm-icon { font-size: 1.5rem; color: #217346; flex-shrink: 0; }
.fpm-title { font-size: .95rem; font-weight: 600; margin: 0; }
.fpm-meta { font-size: .72rem; color: #6c757d; }

.fpm-body { flex: 1; min-height: 0; overflow: hidden; padding: 0; }

.fpm-table-wrap {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 0 16px 16px;
}

.fpm-table {
    border-collapse: collapse;
    font-size: .82rem;
    white-space: nowrap;
    width: max-content;
    min-width: 100%;
}

.fpm-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
    color: #334155;
    font-weight: 600;
    font-size: .78rem;
    padding: 8px 14px;
    border-bottom: 2px solid #e2e8f0;
}

.fpm-table tbody tr:nth-child(even) { background: #fafbfc; }
.fpm-table tbody tr:hover { background: #eef2ff; }
.fpm-table tbody td {
    padding: 6px 14px;
    border-bottom: 1px solid #f0f2f5;
    color: #334155;
}

.fpm-empty {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 40px 20px;
    font-size: .875rem; color: #94a3b8;
}
.fpm-empty i { font-size: 1.2rem; }

/* ── Integration preview modal (Voice Report) ───────────────────────── */
.ipm-content { display: flex; flex-direction: column; max-height: 85vh; }

.ipm-header { flex-shrink: 0; padding: 12px 16px; gap: 10px; align-items: center; }
.ipm-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.ipm-icon { font-size: 1.4rem; color: #ff8a3d; flex-shrink: 0; }
.ipm-title { font-size: .95rem; font-weight: 600; margin: 0; color: #1e293b; }
.ipm-meta { font-size: .72rem; color: #6c757d; display: block; }
.ipm-count-badge {
    font-size: .72rem;
    font-weight: 600;
    color: #4f46e5;
    background: #eef2ff;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.ipm-body { flex: 1; min-height: 0; overflow: hidden; padding: 0; }

.ipm-table-wrap {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 0 16px 16px;
}

.ipm-table {
    border-collapse: collapse;
    font-size: .82rem;
    width: 100%;
}

.ipm-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
    color: #334155;
    font-weight: 600;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 10px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.ipm-table tbody tr:nth-child(even) { background: #fafbfc; }
.ipm-table tbody tr:hover { background: #eef2ff; }
.ipm-table tbody td {
    padding: 8px 14px;
    border-bottom: 1px solid #f0f2f5;
    color: #334155;
    vertical-align: middle;
}

.ipm-phone { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.ipm-message { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ipm-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.ipm-badge-success { background: #dcfce7; color: #166534; }
.ipm-badge-danger  { background: #fee2e2; color: #991b1b; }
.ipm-badge-warning { background: #fef3c7; color: #92400e; }
.ipm-badge-info    { background: #dbeafe; color: #1e40af; }
.ipm-badge-muted   { background: #f1f5f9; color: #475569; }

.ipm-empty {
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 10px; padding: 50px 20px;
    font-size: .875rem; color: #94a3b8;
}
.ipm-empty i { font-size: 1.4rem; }

/* ── Campaign dashboard modal (Voice Report) ────────────────────────── */
.cdm-content { display: flex; flex-direction: column; max-height: 90vh; }

.cdm-header { flex-shrink: 0; padding: 12px 16px; gap: 10px; align-items: center; }
.cdm-title-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cdm-icon { font-size: 1.4rem; color: #ff8a3d; flex-shrink: 0; }
.cdm-title { font-size: .95rem; font-weight: 600; margin: 0; color: #1e293b; }
.cdm-meta { font-size: .72rem; color: #6c757d; display: block; margin-top: 2px; }
.cdm-meta-name { font-weight: 600; color: #475569; }
.cdm-meta-date { color: #6c757d; }
.cdm-meta-sep { margin: 0 6px; color: #cbd5e1; }
.cdm-meta-status { font-weight: 700; }
.cdm-actions { flex-shrink: 0; }

.cdm-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 20px; }

/* Summary cards grid */
.cdm-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.cdm-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #94a3b8;
    border-radius: 6px;
}

.cdm-card-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    font-weight: 600;
}

.cdm-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.1;
}

.cdm-card-success { border-left-color: #16a34a; }
.cdm-card-success .cdm-card-value { color: #166534; }
.cdm-card-warning { border-left-color: #f59e0b; }
.cdm-card-warning .cdm-card-value { color: #92400e; }
.cdm-card-danger  { border-left-color: #dc2626; }
.cdm-card-danger  .cdm-card-value { color: #991b1b; }
.cdm-card-rejected { border-left-color: #be123c; }
.cdm-card-rejected .cdm-card-value { color: #9f1239; }
.cdm-card-partial { border-left-color: #7c3aed; }
.cdm-card-partial .cdm-card-value { color: #6d28d9; }
.cdm-card-invalid { border-left-color: #64748b; }
.cdm-card-invalid .cdm-card-value { color: #475569; }
.cdm-card-info    { border-left-color: #2563eb; }
.cdm-card-info    .cdm-card-value { color: #1d4ed8; }

/* Charts row: pie (left) + matching breakdown legend (right) */
.cdm-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

@media (max-width: 768px) {
    .cdm-charts { grid-template-columns: 1fr; }
}

/* Breakdown legend — color swatches match both the cards and the pie slices */
.cdm-breakdown {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
}

.cdm-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cdm-legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 7px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: .8rem;
}

.cdm-legend-item:last-child { border-bottom: none; }

.cdm-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.cdm-legend-label { color: #334155; font-weight: 500; }
.cdm-legend-count { color: #1e293b; font-weight: 700; font-variant-numeric: tabular-nums; }
.cdm-legend-pct {
    color: #64748b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 48px;
    text-align: right;
}

.cdm-chart-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px 16px;
}

.cdm-chart-title {
    font-size: .8rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 8px;
}

.cdm-canvas-wrap {
    position: relative;
    height: 240px;
}

.cdm-empty {
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 10px; padding: 50px 20px;
    font-size: .875rem; color: #94a3b8;
}
.cdm-empty i { font-size: 1.4rem; }
