/* CallOutcome — minimal custom styles */

/* Stats hero — donut + chip grid */
.stats-hero {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.stats-hero-inner {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}
.donut-chart {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.donut-hole {
    position: absolute;
    inset: 45px;
    border-radius: 50%;
    background: var(--pico-card-background-color, #1a1a2e);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.donut-total {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}
.donut-label {
    font-size: 0.7rem;
    color: var(--pico-muted-color);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.chip-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.6rem;
    flex: 1;
}
.stat-chip {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid;
    grid-column: span 2;
}
.chip-full {
    grid-column: span 6;
}
.chip-highlight {
    background: rgba(99, 230, 190, 0.08);
    border-left-width: 4px;
    padding: 0.9rem 1rem;
}
.chip-highlight .chip-val {
    font-size: 1.8rem;
}

/* Value breakdown tooltip on hover */
.value-breakdown {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--pico-card-background-color, #1a1a2e);
    border: 1px solid rgba(99, 230, 190, 0.25);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.chip-highlight:hover .value-breakdown {
    display: block;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    color: var(--pico-color);
}
.breakdown-row + .breakdown-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.chip-val {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}
.chip-lbl {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
    margin-top: 0.2rem;
}
@media (max-width: 576px) {
    .stats-hero-inner {
        flex-direction: column;
        gap: 1.25rem;
    }
    .donut-chart {
        width: 160px;
        height: 160px;
    }
    .donut-hole {
        inset: 28px;
    }
    .donut-total {
        font-size: 2rem;
    }
    .chip-grid {
        width: 100%;
    }
}

/* Flash messages */
article.flash-error {
    border-left: 4px solid var(--pico-color-red-500, #dc3545);
}
article.flash-success {
    border-left: 4px solid #28a745;
    background: rgba(40, 167, 69, 0.08);
}
article.flash-warning {
    border-left: 4px solid #ffc107;
}

/* Table tweaks */
table td, table th {
    font-size: 0.875rem;
}

/* Filter bar */
details form .grid {
    align-items: end;
}

/* Override button inline with select */
fieldset[role="group"] {
    margin-bottom: 0;
}

/* Status badges — pill style (dark-mode friendly) */
mark[class^="badge-"] {
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-booked     { background: rgba(40, 167, 69, 0.2);  color: #51cf66; }
.badge-not-booked { background: rgba(220, 53, 69, 0.2);  color: #ff6b6b; }
.badge-voicemail  { background: rgba(255, 165, 0, 0.2);  color: #ffa94d; }
.badge-missed     { background: rgba(255, 165, 0, 0.2);  color: #ffa94d; }
.badge-processing { background: rgba(255, 193, 7, 0.2);  color: #ffd43b; }
.badge-failed     { background: rgba(220, 53, 69, 0.2);  color: #ff6b6b; }
.badge-limit      { background: rgba(255, 165, 0, 0.2);  color: #ffa94d; }

/* Colour-tinted table rows */
tr.row-booked     { background: rgba(40, 167, 69, 0.06); }
tr.row-not-booked { background: rgba(220, 53, 69, 0.04); }
tr.row-missed     { background: rgba(255, 165, 0, 0.04); }

/* Table row hover */
table[role="grid"] tbody tr {
    transition: background 0.15s ease;
}
table[role="grid"] tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Filter panel */
.filter-panel summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0.5rem 0;
}
.filter-panel summary::-webkit-details-marker { display: none; }
.filter-panel summary::before {
    content: "\25B6";
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}
.filter-panel[open] summary::before {
    transform: rotate(90deg);
}
.filter-panel .grid {
    margin-top: 0.75rem;
}

/* Call detail cards */
.detail-card {
    border-left: 3px solid var(--pico-muted-border-color);
}
.detail-card-info {
    border-left-color: #63b3ed;
}
.detail-card-analysis {
    border-left-color: #51cf66;
}
.detail-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Usage limit warning banners */
.usage-banner {
    padding: 0.75rem 1rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.usage-banner.danger {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #ff6b6b;
}
.usage-banner.warning {
    background: rgba(255, 193, 7, 0.15);
    border: 1px solid rgba(255, 193, 7, 0.4);
    color: #ffd43b;
}
.usage-banner a {
    color: inherit;
    font-weight: bold;
}

/* Connection success card */
.connection-success {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--pico-border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.connection-success-title {
    font-weight: bold;
    font-size: 1.1rem;
    color: #51cf66;
    margin-bottom: 0.5rem;
}
.connection-success-title::before {
    content: "\2713  ";
}

/* Help guide for credential setup */
.help-guide {
    background: rgba(99, 179, 237, 0.08);
    border: 1px solid rgba(99, 179, 237, 0.25);
    border-radius: var(--pico-border-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
}
.help-guide summary {
    font-weight: bold;
    cursor: pointer;
    color: #63b3ed;
}
.help-guide ol {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}
.help-guide ol li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Importing banner */
.importing-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    background: rgba(99, 179, 237, 0.1);
    border: 1px solid rgba(99, 179, 237, 0.3);
    border-radius: var(--pico-border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.importing-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 179, 237, 0.2);
    border-top-color: #63b3ed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.importing-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: #63b3ed;
}
.importing-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}
.importing-progress {
    width: 100%;
    height: 6px;
    background: rgba(99, 179, 237, 0.15);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.importing-progress-bar {
    height: 100%;
    width: 30%;
    background: #63b3ed;
    border-radius: 3px;
    animation: importProgress 2s ease-in-out infinite;
}
@keyframes importProgress {
    0%   { width: 10%; margin-left: 0; }
    50%  { width: 40%; margin-left: 30%; }
    100% { width: 10%; margin-left: 90%; }
}
.importing-done {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--pico-border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    color: #51cf66;
}

/* Onboarding Wizard */
.wizard-step { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 576px) { .source-cards { grid-template-columns: 1fr; } }

.source-card { cursor: pointer; transition: border-color 0.2s; text-align: center; }
.source-card:hover, .source-card.selected { border-color: var(--pico-primary); }

.validation-error { color: var(--pico-color-red-500, #ff6b6b); font-size: 0.875rem; margin-top: 0.5rem; }
.validation-success { color: #51cf66; font-size: 0.875rem; margin-top: 0.5rem; }

.number-list label { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }

.partner-added { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
