:root {
    --app-primary: #0f3d5e;
    --app-primary-hover: #0c314c;
    --app-accent: #c9a227;
    --app-success: #1f7a4d;
    --app-warning: #b45309;
    --app-danger: #b42318;
    --app-info: #176b87;
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-border: #e2e8ee;
    --app-text: #1a2330;
    --app-text-muted: #5b6775;
    --app-radius: .5rem;
    --app-shadow: 0 1px 2px rgba(15, 61, 94, .06);
    --bs-primary: #0f3d5e;
    --bs-primary-rgb: 15, 61, 94;
    --bs-secondary-color: #5b6775;
    --bs-body-color: #1a2330;
    --bs-body-bg: #f4f6f8;
    --bs-border-color: #e2e8ee;
    --bs-border-radius: .5rem;
    --bs-link-color: #0f3d5e;
    --bs-link-hover-color: #0c314c;
}

html, body {
    min-height: 100%;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--app-text);
    background: var(--app-bg);
}

a, .btn-link {
    color: var(--app-primary);
}

a:hover, .btn-link:hover {
    color: var(--app-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--app-text);
    font-weight: 600;
    letter-spacing: -.015em;
}

.btn {
    min-height: 2.25rem;
    padding: .42rem .8rem;
    border-radius: var(--app-radius);
    font-size: .875rem;
    font-weight: 600;
}

.btn-sm {
    min-height: 2rem;
    padding: .3rem .65rem;
    font-size: .8125rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #fff;
    background-color: var(--app-primary-hover);
    border-color: var(--app-primary-hover);
}

.btn-outline-primary {
    color: var(--app-primary);
    border-color: #9aafbd;
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--app-primary);
    border-color: var(--app-primary);
}

.btn-danger {
    background: var(--app-danger);
    border-color: var(--app-danger);
}

.btn:disabled,
.form-control:disabled,
.form-select:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.btn:focus-visible,
.btn-link:focus-visible,
.nav-link:focus-visible,
.form-control:focus,
.form-select:focus,
.form-check-input:focus,
[tabindex]:focus-visible {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .2rem rgba(15, 61, 94, .18);
    outline: 0;
}

.form-control,
.form-select {
    min-height: 2.25rem;
    padding: .42rem .65rem;
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    color: var(--app-text);
    font-size: .875rem;
}

.form-control::placeholder {
    color: #8a96a3;
}

.form-label {
    margin-bottom: .35rem;
    color: #344050;
    font-size: .8125rem;
    font-weight: 600;
}

.form-text {
    color: var(--app-text-muted);
    font-size: .78rem;
}

.form-check {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.form-check-input {
    margin: 0;
}

.content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.valid.modified:not([type=checkbox]) {
    border-color: var(--app-success);
}

.invalid {
    border-color: var(--app-danger);
}

.validation-message {
    margin-top: .25rem;
    color: var(--app-danger);
    font-size: .78rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNT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MjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

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

:root {
    --navy: var(--app-primary);
    --gold: var(--app-accent);
}

.hero-card {
    background: linear-gradient(135deg, var(--app-primary), #1a5a82);
    color: #fff;
    padding: 2.25rem;
    border-radius: .875rem;
}

.hero-card h1 {
    color: #fff;
    font-size: 2rem;
    max-width: 36rem;
}

.eyebrow {
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .75rem;
    color: #c9a227;
}

.hero-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.2rem;
}

.info-card, .panel, .app-card {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--app-shadow);
}

.stepper {
    display: flex;
    gap: .35rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
}

.step {
    flex: 0 0 auto;
    border: 1px solid var(--app-border);
    background: var(--app-surface);
    color: var(--app-text-muted);
    border-radius: var(--app-radius);
    padding: .55rem .75rem;
    font-size: .8125rem;
    font-weight: 600;
}

.step.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #fff;
}

.alert-cotacao {
    background: #fff8eb;
    border: 1px solid #f0d39a;
    color: #7a3c06;
    border-radius: var(--app-radius);
    padding: .75rem 1rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header__title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
}

.page-header__subtitle {
    margin: .35rem 0 0;
    color: var(--app-text-muted);
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.breadcrumb {
    margin-bottom: .4rem;
    font-size: .78rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #94a0ad;
}

.table-shell {
    overflow: hidden;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.table-responsive {
    scrollbar-width: thin;
}

.app-table {
    margin: 0;
    min-width: 560px;
    vertical-align: middle;
}

.app-table > :not(caption) > * > * {
    padding: .7rem .85rem;
    border-bottom-color: #edf1f4;
}

.app-table thead th {
    background: #f8fafb;
    color: #52606e;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table tbody tr:hover > * {
    background: #f9fbfc;
}

.table-action {
    font-size: .8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.empty-state {
    padding: 2.5rem 1.25rem;
    color: var(--app-text-muted);
    text-align: center;
}

.empty-state__icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto .75rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf3f6;
    color: var(--app-primary);
    font-size: 1.25rem;
}

.empty-state h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
}

.app-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: 0 0 1rem;
    padding: .75rem .9rem;
    border: 1px solid;
    border-radius: var(--app-radius);
    font-size: .875rem;
}

.app-alert--danger { color: #7a271a; background: #fff3f1; border-color: #f0b8b0; }
.app-alert--success { color: #155e3b; background: #eefaf3; border-color: #a9ddbf; }
.app-alert--warning { color: #7a3c06; background: #fff8eb; border-color: #f0d39a; }
.app-alert--info { color: #15556b; background: #eff9fc; border-color: #afd9e5; }

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    background: #edf3f6;
    color: var(--app-primary);
    font-size: .75rem;
    font-weight: 700;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    min-height: 9rem;
    color: var(--app-text-muted);
}

.app-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid #cbd7df;
    border-top-color: var(--app-primary);
    border-radius: 50%;
    animation: app-spin .7s linear infinite;
}

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .85rem;
}

.section-heading h2,
.section-heading h5 {
    margin: 0;
    font-size: 1rem;
}

.repeater-item {
    padding: .85rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fbfcfd;
}

.composition-card {
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: 1rem;
    background: var(--bs-body-bg);
}

.composition-headline {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    align-items: baseline;
    margin-bottom: .85rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--bs-border-color);
    font-size: .95rem;
}

.composition-headline--child {
    margin-bottom: .6rem;
    padding-bottom: .5rem;
    border-bottom: 0;
    font-size: .9rem;
}

.composition-headline--nested {
    margin: .35rem 0 0 1.25rem;
    color: var(--app-text-muted);
}

.composition-children-title {
    margin: 0 0 .5rem;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--app-text-muted);
}

.composition-group-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--bs-border-color);
}

.composition-group-totals span {
    display: block;
    margin-bottom: .15rem;
    color: var(--app-text-muted);
    font-size: .75rem;
}

.composition-card .cotacao-select {
    min-width: 0;
    width: 100%;
}

.composition-child {
    padding: .75rem 0 .75rem .75rem;
    border-top: 1px dashed var(--bs-border-color);
}

.composition-child:first-child {
    border-top: 1px dashed var(--bs-border-color);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.summary-item {
    padding: .85rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
}

.summary-item span {
    display: block;
    margin-bottom: .25rem;
    color: var(--app-text-muted);
    font-size: .75rem;
}

.summary-item--total {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 8%, #fff);
}

.summary-item small {
    display: block;
    margin-top: .35rem;
    color: var(--app-text-muted);
    font-size: .75rem;
}

.summary-item--action {
    width: 100%;
    text-align: left;
    background: #fff;
    cursor: pointer;
}

.summary-item--action:hover {
    border-color: var(--app-primary);
}

.app-dialog {
    width: min(92vw, 430px);
    z-index: 1051;
    margin: auto;
    padding: 0;
    border: 1px solid var(--app-border);
    border-radius: .75rem;
    background: var(--app-surface);
    box-shadow: 0 20px 50px rgba(15, 35, 48, .2);
}

.app-dialog--wide {
    width: min(92vw, 720px);
}

.app-dialog__body {
    padding: 1.25rem;
}

.app-dialog__body h2 {
    margin: 0 0 .5rem;
    font-size: 1.1rem;
}

.app-dialog__body p {
    margin: 0;
    color: var(--app-text-muted);
}

.app-dialog__section {
    margin: 1rem 0 .4rem;
    font-size: .85rem;
    font-weight: 600;
}

.app-dialog__table {
    width: 100%;
    font-size: .875rem;
    border-collapse: collapse;
}

.app-dialog__table th,
.app-dialog__table td {
    padding: .4rem 0;
    border-bottom: 1px solid var(--app-border);
}

.app-dialog__table th {
    color: var(--app-text-muted);
    font-weight: 600;
}

.app-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    padding: .85rem 1.25rem;
    border-top: 1px solid var(--app-border);
    background: #f8fafb;
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 35, 48, .4);
}

.nav-tabs {
    gap: .25rem;
    border-bottom-color: var(--app-border);
}

.nav-tabs .nav-link {
    color: var(--app-text-muted);
    font-weight: 600;
    border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.nav-tabs .nav-link.active {
    color: var(--app-primary);
    border-color: var(--app-border) var(--app-border) var(--app-surface);
}

@media (max-width: 767.98px) {
    .content {
        padding-top: 1rem;
        padding-bottom: 1.5rem;
    }

    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header__actions > .btn,
    .page-header__actions > a {
        flex: 1;
    }

    .hero-card {
        padding: 1.5rem;
    }

    .hero-card h1 {
        font-size: 1.55rem;
    }

    .hero-actions {
        flex-direction: column;
    }
}

.recorrencia-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.recorrencia-quadro th,
.recorrencia-quadro td {
    white-space: nowrap;
}

.recorrencia-quadro tfoot td {
    border-top: 2px solid var(--app-border);
}

.recorrencia-fase {
    background: #fbfcfd;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    padding: 1rem;
}

.recorrencia-fase-head {
    margin-bottom: .85rem;
}

.recorrencia-meta {
    display: inline-block;
    font-size: .78rem;
    color: var(--app-text-muted);
}

.recorrencia-impacto {
    font-size: .8125rem;
    color: var(--app-text-muted);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.choice-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    margin: 0;
    min-height: 0;
    padding: .85rem;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    cursor: pointer;
    background: #fff;
}

.choice-card.is-selected {
    border-color: var(--app-primary);
    background: color-mix(in srgb, var(--app-primary) 8%, #fff);
}

.choice-card-head {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.choice-card-hint {
    color: var(--app-text-muted);
    font-size: .78rem;
    line-height: 1.35;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top, rgba(15, 61, 94, .08), transparent 42%),
        var(--app-bg);
}

.login-panel {
    width: min(100%, 26rem);
    padding: 1.75rem;
    border: 1px solid var(--app-border);
    border-radius: .85rem;
    background: var(--app-surface);
    box-shadow: 0 12px 40px rgba(15, 61, 94, .08);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.5rem;
}

.login-brand strong,
.login-brand small {
    display: block;
}

.login-brand small,
.login-lead {
    color: var(--app-text-muted);
}

.login-mark {
    width: 2.4rem;
    height: 2.4rem;
    display: grid;
    place-items: center;
    border-radius: .5rem;
    background: var(--app-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.login-panel h1 {
    margin-bottom: .35rem;
    font-size: 1.45rem;
}

.login-lead {
    margin-bottom: 1.25rem;
}