html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-feature-settings: 'liga' 1, 'kern' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 0;
}

.page:has(.home-page) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* KPI executivo: painel único sem scroll (estilo Power BI) */
.page:has(.kpi-page) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.content-panel:has(.kpi-page) {
    background: #f3f2f1 !important;
    overflow: hidden;
    min-height: 0;
}

.content:has(.kpi-page) {
    padding: 0.35rem 0.5rem 0.45rem !important;
    overflow: hidden;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.main-shell:has(.kpi-page) {
    height: calc(100vh - 0px);
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-shell:has(.kpi-page) .content-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.main-shell:has(.kpi-page) .content {
    flex: 1;
    min-height: 0;
}

/* KPI tela cheia: oculta menu lateral e barra superior */
.page:has(.kpi-page--fullscreen) .sidebar,
.page:has(.kpi-page--fullscreen) .top-panel {
    display: none !important;
}

.page:has(.kpi-page--fullscreen) {
    background: #f3f2f1;
}

.page:has(.kpi-page--fullscreen) .main-area {
    width: 100%;
}

.page:has(.kpi-page--fullscreen) .main-shell {
    padding: 0;
    gap: 0;
    background: #f3f2f1;
}

.page:has(.kpi-page--fullscreen) .content-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #f3f2f1 !important;
}

.page:has(.kpi-page--fullscreen) .content:has(.kpi-page) {
    padding: 0.35rem 0.5rem 0.45rem !important;
}

.kpi-page--fullscreen {
    margin: 0 !important;
    min-height: 100%;
}

/* KPI visual corporativo — fundo escuro no shell */
.content-panel:has(.kpi-page--corporate) {
    background: #0f1c2e !important;
}

.page:has(.kpi-page--corporate) .main-shell {
    background: #0f1c2e;
}

.page:has(.kpi-page--corporate.kpi-page--fullscreen),
.page:has(.kpi-page--corporate.kpi-page--fullscreen) .main-shell,
.page:has(.kpi-page--corporate.kpi-page--fullscreen) .content-panel {
    background: #0a1628 !important;
}

/* Editar/Cadastrar serviço: painel inteiro cinza, sem frame branco ao rolar */
.content-panel:has(.novo-servico-page) {
    background: #f7f8fa !important;
}

.content:has(.novo-servico-page) {
    padding: 0 !important;
    background: #f7f8fa !important;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#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,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhd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ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 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: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

#app {
    min-height: 100vh;
}

/* Evita “pulo” horizontal quando o Blazor monta conteúdo e a barra de rolagem aparece/some */
html.siam-splash-active,
html.siam-splash-active body {
    overflow: hidden;
    height: 100%;
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    contain: layout style paint;
    will-change: opacity;
}

.splash-screen--done {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.splash-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: clamp(1rem, 3vw, 2rem);
}

.splash-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    max-width: min(88vw, 590px);
}

.splash-image {
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Logo Cidadão Online (horizontal) — centralizado na splash */
.splash-image--logo {
    display: block;
    width: 100%;
    max-width: min(88vw, 590px);
    max-height: min(47.5vh, 320px);
    filter: none;
    box-shadow: none;
}

.splash-progress {
    width: 100%;
    margin-top: clamp(1rem, 2.5vh, 1.35rem);
}

.splash-progress__track {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.splash-progress__fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

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;
}

input.form-control,
select.form-select,
select.form-control {
    min-height: 34px !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.4rem !important;
}

.btn {
    min-height: 34px !important;
    padding: 0.32rem 0.8rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.4rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
}

button[class*="btn"]:not(.btn-close),
.btn,
a.btn {
    background: #ffffff !important;
    color: #7367f0 !important;
    border: 1px solid #7367f0 !important;
    box-shadow: none !important;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease !important;
}

button[class*="btn"]:not(.btn-close):hover,
button[class*="btn"]:not(.btn-close):focus,
.btn:hover,
.btn:focus,
a.btn:hover,
a.btn:focus {
    background: rgba(115, 103, 240, 0.08) !important;
    color: #6558f5 !important;
    border-color: #6558f5 !important;
    box-shadow: none !important;
}

.btn-primary,
.btn-outline-primary,
button[class*="btn"]:not(.btn-close)[class*="--primary"],
button[class*="btn"]:not(.btn-close)[class*="--outline"],
a.btn-primary,
a.btn-outline-primary {
    background: #ffffff !important;
    color: #7367f0 !important;
    border-color: #7367f0 !important;
    box-shadow: none !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus,
button[class*="btn"]:not(.btn-close)[class*="--primary"]:hover,
button[class*="btn"]:not(.btn-close)[class*="--primary"]:focus,
button[class*="btn"]:not(.btn-close)[class*="--outline"]:hover,
button[class*="btn"]:not(.btn-close)[class*="--outline"]:focus,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-outline-primary:hover,
a.btn-outline-primary:focus {
    background: rgba(115, 103, 240, 0.08) !important;
    color: #6558f5 !important;
    border-color: #6558f5 !important;
    box-shadow: none !important;
}

.btn-sm,
.btn-group-sm > .btn {
    min-height: 30px !important;
    padding: 0.22rem 0.65rem !important;
    font-size: 0.82rem !important;
}

.btn .siam-icon,
button[class*="btn"]:not(.btn-close) .siam-icon,
a.btn .siam-icon {
    font-size: 0.95em;
    line-height: 1;
}

button[class*="btn"]:not(.btn-close),
a.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.55rem !important;
    min-height: 34px !important;
    border-radius: 0.45rem !important;
    padding: 0.32rem 0.8rem !important;
    border: 1px solid #7367f0 !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    font-size: 0.9rem !important;
}

[class*="btn__icon"] {
    width: 1rem !important;
    height: 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

[class*="btn__icon"] svg {
    width: 1rem !important;
    height: 1rem !important;
}

button[class*="btn"]:not(.btn-close)[class*="--outline"],
a[class*="btn"][class*="--outline"] {
    color: #7367f0 !important;
    background: #ffffff !important;
    border-color: rgba(115, 103, 240, 0.24) !important;
    box-shadow: none !important;
}

button[class*="btn"]:not(.btn-close)[class*="--outline"]:hover:not(:disabled),
a[class*="btn"][class*="--outline"]:hover {
    background: rgba(115, 103, 240, 0.08) !important;
}

button[class*="btn"]:not(.btn-close)[class*="--primary"],
a[class*="btn"][class*="--primary"] {
    background: #ffffff !important;
    color: #7367f0 !important;
    border-color: rgba(115, 103, 240, 0.24) !important;
    box-shadow: none !important;
}

button[class*="btn"]:not(.btn-close)[class*="--compact"],
button[class*="btn"]:not(.btn-close)[class*="--small"],
a[class*="btn"][class*="--compact"],
a[class*="btn"][class*="--small"] {
    min-height: 30px !important;
    padding: 0.22rem 0.65rem !important;
    font-size: 0.82rem !important;
}

.table {
    --bs-table-striped-bg: #f4f5f7;
    --bs-table-hover-bg: #eef1f4;
    --bs-table-border-color: #e6e9ee;
    margin-bottom: 0;
}

.table > thead {
    background: #f8f9fb;
}

.table > thead > tr > th {
    color: #6b7280 !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
    border-bottom-width: 1px !important;
    vertical-align: middle;
    border-bottom-color: #e6e9ee !important;
}

.table > tbody > tr > td {
    padding: 0.14rem 0.6rem !important;
    vertical-align: middle;
    border-bottom-color: #e6e9ee !important;
    line-height: 1.05;
    font-size: 0.88rem;
    font-weight: 400 !important;
}

.table > tbody > tr > td strong,
.table > tbody > tr > td b,
.table > tbody > tr > td .fw-bold,
.table > tbody > tr > td .badge {
    font-weight: 400 !important;
}

.table > tbody > tr > td [class$="__avatar"],
.table > tbody > tr > td [class*="__avatar"] {
    width: 2rem !important;
    height: 2rem !important;
    font-size: 0.72rem !important;
}

.table > tbody > tr > td [class$="__content"],
.table > tbody > tr > td [class*="__content"] {
    gap: 0.08rem !important;
}

.table > tbody > tr > td [class$="-item"],
.table > tbody > tr > td [class*="-item"] {
    gap: 0.55rem !important;
    min-width: 0 !important;
}

.table > tbody > tr:nth-of-type(odd) > * {
    background: #ffffff !important;
}

.table > tbody > tr:nth-of-type(even) > * {
    background: #f4f5f7 !important;
}

.table > tbody > tr:hover > * {
    background: #eef1f4 !important;
}

.table-action-icon {
    font-size: 0.86rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

[class$="pagination__actions"] > button {
    min-width: 2.5rem;
    justify-content: center;
}

[class$="pagination__actions"] > button .siam-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Toolbar buttons: ícone + texto em .visually-hidden */
.siam-btn-icon-only {
    gap: 0 !important;
    justify-content: center;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
    min-width: 2.5rem;
}

.siam-btn-icon-only .siam-icon {
    font-size: 1.1rem;
    line-height: 1;
}

[class$="-list-action"] .siam-icon,
[class$="-list-action-link"] .siam-icon,
.unidade-list-action .siam-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.auth-placeholder-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
}

.auth-placeholder-card {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

    .auth-placeholder-card h1 {
        margin-bottom: 0.75rem;
        color: #0f172a;
        font-weight: 700;
    }

    .auth-placeholder-card p {
        margin-bottom: 1.5rem;
        color: #64748b;
    }

/* Leaflet: ícone pin em divIcon (mapa regional) */
.leaflet-div-icon.siam-map-pin-icon {
    background: transparent !important;
    border: none !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
}

.siam-map-pin {
    line-height: 0;
}
