html, body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0d1117;
    color: #e6edf3;
}

.mud-typography,
.mud-button-root,
.mud-input,
.mud-input-control,
.mud-table,
.mud-select {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Não usar pa-* no MudMainContent: padding uniforme remove o offset da AppBar fixa. */
.mud-layout .servconnect-main-content {
    padding-top: calc(var(--mud-appbar-height, 56px) + 1rem);
}

@media (min-width: 960px) {
    .mud-layout .servconnect-main-content {
        padding-top: calc(var(--mud-appbar-height, 56px) + 1.5rem);
    }
}

.servconnect-gate-pending {
    pointer-events: none;
    opacity: 0.55;
}

/* Título acessível para leitores de tela e FocusOnNavigate (visual via MudText). */
.page-heading-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero-panel {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 50%, #0a1628 100%);
    border: 1px solid rgba(124, 252, 0, 0.15);
    border-radius: 16px;
}

.brand-title {
    font-weight: 700;
    line-height: 1.2;
}

.feature-card {
    background: rgba(22, 27, 34, 0.9) !important;
    border: 1px solid rgba(0, 191, 255, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 252, 0, 0.12);
}

.contrato-preview {
    max-height: 60vh;
    overflow-y: auto;
    background: #161b22;
    border-radius: 8px;
    color: #e6edf3;
}

.contrato-preview h1 {
    color: #7CFC00;
    font-size: 1.25rem;
}

.contrato-doc .aviso-legal {
    background: rgba(255, 193, 7, 0.12);
    border-left: 3px solid #ffc107;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.stat-card {
    border-left: 3px solid #7cfc00;
}

.prestador-acao-card {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.prestador-acao-card:hover {
    transform: translateY(-2px);
}

.servconnect-signature-wrap {
    width: 100%;
    max-width: 720px;
    margin: 0.25rem 0 0.75rem;
}

.servconnect-signature-wrap__hint {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #8b949e;
}

.servconnect-signature-canvas {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    height: 220px;
    border: 2px dashed rgba(124, 252, 0, 0.65);
    border-radius: 10px;
    background: #0a0e14;
    box-shadow: inset 0 0 0 1px #30363d;
    touch-action: none;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    cursor: crosshair;
}

@media (orientation: landscape) and (max-width: 960px) {
    .contrato-preview {
        max-height: 40vh;
    }

    .servconnect-signature-canvas {
        height: 260px;
    }
}

@media (min-width: 600px) {
    .servconnect-signature-canvas {
        height: 260px;
    }
}

@media (min-width: 960px) {
    .servconnect-signature-canvas {
        height: 280px;
    }
}

#blazor-error-ui {
    background: #f85149;
    color: #fff;
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #7cfc00;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    text-align: center;
    font-weight: bold;
    color: #7cfc00;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Carregando");
}

/* Agenda — layout responsivo (calendário + linha do tempo) */
.agenda-layout {
    align-items: stretch;
}

.agenda-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.agenda-panel--cal {
    justify-content: flex-start;
}

.agenda-panel--day {
    min-height: 22rem;
}

.agenda-mud-picker-wrap {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.agenda-mud-picker,
.agenda-mud-picker .mud-picker,
.agenda-mud-picker .mud-picker-static {
    width: 100%;
    max-width: 100%;
}

.agenda-mud-picker--landscape .mud-picker-static {
    min-height: 18rem;
}

.agenda-mud-picker .agenda-mud-day-busy button {
    position: relative;
    font-weight: 700;
}

.agenda-mud-picker .agenda-mud-day-busy button::after {
    content: "";
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #7cfc00;
    box-shadow: 0 0 6px rgba(124, 252, 0, 0.6);
}

.agenda-timeline {
    max-height: min(68vh, 640px);
    overflow-y: auto;
    border-top: 1px solid #21262d;
}

.agenda-timeline__row {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #21262d;
    min-height: 2.75rem;
}

.agenda-timeline__row--busy {
    background: rgba(0, 191, 255, 0.04);
}

.agenda-timeline__hour {
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b949e;
    padding-top: 0.35rem;
}

.agenda-timeline__slots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.agenda-timeline__empty {
    color: #484f58;
    font-size: 0.85rem;
    padding-top: 0.25rem;
}

.agenda-timeline__card {
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(124, 252, 0, 0.2);
    background: rgba(22, 27, 34, 0.95);
}

.agenda-timeline__card-body {
    flex: 1;
    min-width: 0;
}

@media (min-width: 960px) {
    .agenda-panel--day {
        min-height: 28rem;
    }

    .agenda-mud-picker--landscape .mud-picker-static {
        min-height: 20rem;
    }

    .agenda-timeline {
        max-height: calc(100vh - 13rem);
        min-height: 24rem;
    }

    .agenda-timeline__row {
        grid-template-columns: 4.25rem 1fr;
        min-height: 3rem;
        padding: 0.65rem 0;
    }

    .agenda-timeline__hour {
        font-size: 0.875rem;
    }
}

@media (min-width: 1280px) {
    .agenda-timeline {
        max-height: calc(100vh - 12rem);
    }
}

/* Contratos — ícones de ação maiores no celular */
@media (max-width: 959px) {
    .contratos-tabela .contratos-acoes {
        min-width: 12rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .contratos-tabela .contratos-acoes .mud-icon-button {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
        padding: 0.5rem;
        margin: 0.125rem;
    }

    .contratos-tabela .contratos-acoes .mud-icon-button .mud-icon-root {
        font-size: 1.5rem;
    }
}
