body {
    min-height: 100vh;
    background-color: var(--bs-secondary-bg);
}

.sa-navbar {
    background-color: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.sa-navbar .navbar-nav {
    --bs-navbar-nav-link-padding-x: 0.85rem;
}

.sa-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.sa-navbar .nav-link.active {
    color: var(--bs-emphasis-color);
    background-color: var(--bs-secondary-bg);
}

.sa-navbar .nav-actions .btn {
    min-height: 2.25rem;
    padding: 0.35rem 0.8rem;
}

.sa-connection {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    white-space: nowrap;
}

.brand-mark {
    display: inline-grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    color: #fff;
    background: #0d6efd;
    border-radius: 0.55rem;
}

.surface {
    height: 100%;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
}

.metric-value {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.metric-icon {
    display: inline-grid;
    width: 2.4rem;
    height: 2.4rem;
    place-items: center;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-radius: 0.6rem;
}

.status-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    background: var(--bs-success);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

.status-dot.offline {
    background: var(--bs-danger);
    box-shadow: 0 0 12px rgba(251, 113, 133, 0.6);
}

.empty-state {
    padding: 2.5rem 1rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

.availability {
    display: none;
}

.availability.show {
    display: block;
}

.chart-wrap {
    position: relative;
    min-height: 310px;
}

.distribution-row {
    display: grid;
    grid-template-columns: minmax(5rem, 1fr) 3fr auto;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.875rem;
}

.distribution-bar {
    height: 0.42rem;
    overflow: hidden;
    background: var(--bs-secondary-bg);
    border-radius: 99px;
}

.distribution-fill {
    height: 100%;
    background: var(--bs-primary);
    border-radius: inherit;
}

.progress-bar-cyan,
.progress-bar-violet {
    background-color: var(--bs-primary);
}

.alert-item {
    border-left: 3px solid var(--bs-warning);
    background: var(--bs-secondary-bg);
}

.alert-item.danger {
    border-left-color: var(--bs-danger);
}

.loading-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--bs-body-bg) 78%, transparent);
    border-radius: 0.75rem;
}

.transcript,
.live-text {
    min-height: 8rem;
    max-height: 55vh;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.75;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.6rem;
}

.dialogue-item,
.dialogue-row {
    border-left: 3px solid var(--speaker-color, var(--bs-primary));
    background: var(--bs-secondary-bg);
}

.speaker,
.speaker-badge {
    color: var(--speaker-color, var(--bs-primary));
    font-weight: 700;
}

.drop-zone {
    min-height: 13rem;
    padding: 2rem 1.25rem;
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-secondary-bg);
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.is-dragging,
.drop-zone:focus-visible {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.drop-zone.is-invalid {
    border-color: var(--bs-danger);
    background: var(--bs-danger-bg-subtle);
}

.upload-icon {
    display: inline-grid;
    width: 3.5rem;
    height: 3.5rem;
    place-items: center;
    color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    border-radius: 1rem;
}

.phase-step {
    position: relative;
    padding-left: 2.3rem;
    color: var(--bs-secondary-color);
}

.phase-step::before {
    position: absolute;
    top: 0.04rem;
    left: 0;
    display: grid;
    width: 1.55rem;
    height: 1.55rem;
    place-items: center;
    content: "";
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
}

.phase-step.is-active {
    color: var(--bs-body-color);
}

.phase-step.is-active::before {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.phase-step.is-complete::before {
    color: #fff;
    content: "\2713";
    background: var(--bs-success);
    border-color: var(--bs-success);
    font-weight: 800;
}

.live-text {
    min-height: 12rem;
    max-height: 25rem;
}

.live-text:empty::before {
    color: var(--bs-secondary-color);
    content: "Il testo preliminare apparirà qui durante la trascrizione.";
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0.75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

@media (max-width: 991.98px) {
    .chart-wrap {
        min-height: 260px;
    }
}
