/* Componentes da interface GED aplicados às telas do TAXAS. */
.d-block { display: block; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: .5rem; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-end { text-align: right; }
.text-nowrap { white-space: nowrap; }
.font-monospace { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-3 { margin-bottom: 1rem; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    border: 0;
    clip-path: inset(50%);
    white-space: nowrap;
}

.page-title-box {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem 1.25rem;
    padding: .125rem 0 1.125rem;
}

.page-title-box h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.page-title-box p {
    margin: .25rem 0 0;
    color: var(--text-muted);
    font-size: .8125rem;
}

.page-title-right { flex: 0 0 auto; max-width: 100%; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .3rem .5rem;
    margin: .25rem 0 0;
    padding: 0;
    list-style: none;
    font-size: .75rem;
}

.breadcrumb-item { display: inline-flex; gap: .5rem; align-items: baseline; }
.breadcrumb-item a { color: var(--text-tertiary); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary-deep); text-decoration: underline; }
.breadcrumb-item.active, .breadcrumb-item[aria-current] { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--text-muted); }

.card {
    min-width: 0;
    margin-bottom: 1rem;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px var(--border-card), var(--shadow-card);
}

.card-header, .card-body, .card-footer { padding: .875rem clamp(.875rem, 2vw, 1.25rem); }
.card-header { border-bottom: 1px solid var(--border-divider); }
.card-footer { border-top: 1px solid var(--border-divider); }
.card-title { margin: 0; color: var(--text-primary); font-size: .875rem; font-weight: 650; }

.form-label {
    display: block;
    margin-bottom: .35rem;
    color: var(--text-secondary);
    font-size: .8125rem;
    font-weight: 550;
}

.form-label span { color: var(--text-muted); font-weight: 400; }

.form-control, .form-select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 2.375rem;
    padding: .5rem .65rem;
    border: 1px solid var(--border-control);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-primary);
    font-size: .8125rem;
    line-height: 1.35;
}

.form-control::placeholder { color: var(--text-muted); }
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.form-select { text-overflow: ellipsis; }

.btn {
    display: inline-flex;
    min-height: 2.375rem;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--fill-muted);
    color: var(--text-secondary);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

.btn:hover { background: var(--border-divider); color: var(--text-primary); text-decoration: none; }
.btn-sm { min-height: 2rem; padding: .35rem .65rem; border-radius: var(--radius-md); font-size: .75rem; }

.btn-primary {
    background: var(--primary);
    color: var(--on-primary, #fff);
    box-shadow: 0 2px 10px -2px rgb(79 70 229 / .45);
}

.btn-primary:hover { background: var(--primary-deep); color: var(--on-primary, #fff); }
.btn-soft-primary { background: var(--primary-soft); color: var(--primary-deep); }
.btn-soft-primary:hover { background: var(--primary-soft-hover, #e0e7ff); color: var(--primary-deep); }
.btn-soft-secondary { background: var(--fill-muted); color: var(--text-secondary); }
.btn-soft-secondary:hover { background: var(--border-divider); color: var(--text-primary); }
.btn-outline-secondary { border-color: var(--border-control); background: var(--surface); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--fill-muted); color: var(--text-primary); }
.btn:disabled { opacity: .65; cursor: default; }

.table-responsive {
    position: relative;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
}

.table-responsive:focus-visible { outline-offset: -2px; }
.card > .table-card:last-child { border-radius: 0 0 var(--radius-card) var(--radius-card); }

.table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: var(--text-secondary);
    font-size: .8125rem;
    text-align: left;
}

.table th, .table td { padding: .7rem clamp(.75rem, 1.5vw, 1.15rem); }
.table.align-middle th, .table.align-middle td { vertical-align: middle; }
.table thead th {
    border-bottom: 1px solid var(--border-card);
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: .6875rem;
    font-weight: 650;
    letter-spacing: .04em;
    white-space: nowrap;
    text-transform: uppercase;
}

.table tbody tr + tr > * { border-top: 1px solid var(--border-row); }
.table tbody th { color: var(--text-primary); font-weight: 600; }
.table-hover tbody tr:hover { background: var(--surface-subtle); }
.table a:not(.btn) { color: var(--primary-deep); font-weight: 600; text-decoration: none; }
.table a:not(.btn):hover { text-decoration: underline; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: .22rem .55rem;
    border-radius: 99px;
    background: var(--fill-muted);
    color: var(--text-secondary);
    font-size: .6875rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.bg-secondary-subtle { background: var(--fill-muted); }
.bg-success-subtle { background: var(--success-bg); }
.bg-danger-subtle { background: var(--danger-bg); }
.bg-warning-subtle { background: var(--warning-bg); }
.bg-info-subtle { background: var(--info-bg); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }
.text-warning { color: var(--warning-text); }
.text-info { color: var(--info-text); }

.alert {
    margin: 0 0 1rem;
    padding: .75rem .875rem;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    background: var(--fill-muted);
    color: var(--text-secondary);
    font-size: .8125rem;
}

.alert ul { margin: 0; padding-inline-start: 1.125rem; }
.alert.mb-0 { margin-bottom: 0; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-link {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .25rem .65rem;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-tertiary);
    font-size: .75rem;
    text-decoration: none;
}

a.page-link:hover { background: var(--primary-soft); color: var(--primary-deep); text-decoration: none; }
.page-item.active .page-link, .page-link[aria-current] {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--on-primary, #fff);
}
.page-item.disabled .page-link { background: var(--surface-subtle); color: var(--text-muted); }

.taxas-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .55rem;
}

.taxas-filtro-campo { flex: 1 1 16rem; max-width: 34rem; min-width: 0; }
.taxas-regras-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.taxas-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.taxas-form-largo { grid-column: 1 / -1; }
.taxas-valor { font-variant-numeric: tabular-nums; white-space: nowrap; }
.taxas-paginacao { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }

.taxas-empty {
    display: grid;
    justify-items: center;
    gap: .35rem;
    padding: 1.75rem 1rem;
    color: var(--text-muted);
    font-size: .8125rem;
    text-align: center;
}

.taxas-empty > * { margin: 0; }
.taxas-empty strong, .taxas-empty h3 { color: var(--text-secondary); font-weight: 600; }

.taxas-cotacao {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem .8rem;
    margin: .875rem 0 0;
}

.taxas-cotacao .taxas-valor { font-weight: 700; }
.taxas-encerramento summary { width: max-content; margin-left: auto; list-style: none; cursor: pointer; }
.taxas-encerramento summary::-webkit-details-marker { display: none; }
.taxas-encerramento summary::after {
    width: .4rem;
    height: .4rem;
    margin-top: -.2rem;
    border: solid currentColor;
    border-width: 0 1px 1px 0;
    transform: rotate(45deg);
    content: "";
}

.taxas-encerramento[open] summary::after { margin-top: .2rem; transform: rotate(225deg); }
.taxas-encerramento form { display: grid; gap: .45rem; margin-top: .6rem; text-align: left; }
.taxas-encerramento .form-label { white-space: nowrap; }

@media (max-width: 991.98px) {
    .taxas-regras-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

@media (max-width: 575.98px) {
    .page-title-box { flex-direction: column; gap: .3rem; }
    .page-title-right { order: -1; }
    .card-header, .card-body, .card-footer { padding-block: .75rem; }
    .taxas-regras-grid, .taxas-form-grid { grid-template-columns: minmax(0, 1fr); }
    .taxas-filtro-campo { flex-basis: 100%; }
    .form-control, .form-select, .btn, .page-link { min-height: 2.75rem; }
    .table .btn-sm { min-height: 2.5rem; }
    .taxas-paginacao { justify-content: flex-start; }
}
