/**
 * Estilos legados da migração BS3 → sistema próprio.
 * Mantém tabs, panels e utilitários ainda usados nos templates.
 */

/* --- Botões --- */
.btn-default {
    --bs-btn-color: #fff;
    --bs-btn-bg: #95a5a6;
    --bs-btn-border-color: #95a5a6;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #798d8f;
    --bs-btn-hover-border-color: #798d8f;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #798d8f;
    --bs-btn-active-border-color: #798d8f;
}

/* --- Panels → Cards --- */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.panel-default {
    border-color: #ddd;
}

.panel-primary > .panel-heading,
.panel-primary .panel-heading {
    color: #fff;
    background-color: #375a7f;
    border-color: #375a7f;
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    font-size: var(--text-xs, 10px);
}

.panel-body {
    padding: 15px;
    overflow: hidden;
}

/* --- Dashboard --- */
.card-counter {
    position: relative;
    overflow: hidden;
}

a:has(> .card-counter) {
    display: block;
    text-decoration: none;
    color: inherit;
}

a:has(> .card-counter):hover,
a:has(> .card-counter):focus,
a:has(> .card-counter):active,
a:has(> .card-counter):visited {
    text-decoration: none;
    color: inherit;
}

a:has(> .card-counter) .count-numbers,
a:has(> .card-counter) .count-name {
    color: inherit;
}

.pie-chart-widget .list-block ul.legend,
.pie-chart-widget ul.legend {
    list-style: none;
    padding: 0;
    margin: 0;
    display: table-row;
}

.pie-chart-widget .list-block {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.pie-chart-widget .list-block li {
    display: table-cell;
    vertical-align: middle;
    float: none;
}

.panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

/* --- Formulários --- */
.form-horizontal .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.form-horizontal .control-label {
    padding-top: calc(0.375rem + 1px);
    margin-bottom: 0;
}

.form-horizontal .form-group.text-right {
    justify-content: flex-end;
}

.form-horizontal .form-group.text-right > [class*="col-"] {
    float: none;
}

.control-label {
    margin-bottom: 0.5rem;
}

.has-error .tw-input,
.has-error .tw-select,
.has-error .tw-textarea,
.has-error .v-select-toggle,
.has-error .input-group-text {
    border-color: #dc3545;
}

.has-error .control-label,
.has-error .help-block {
    color: #dc3545;
}

.has-success .tw-input,
.has-success .tw-select,
.has-success .tw-textarea {
    border-color: #198754;
}

.input-group-addon {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: var(--text-xs, 10px);
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
}

.input-group > :not(:first-child).input-group-addon {
    margin-left: calc(-1 * 1px);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > :not(:last-child).input-group-addon {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* --- Grid legado --- */
[class*="col-xs-"] {
    position: relative;
    width: 100%;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
    padding-left: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}

.col-xs-1 { flex: 0 0 auto; width: 8.333333%; }
.col-xs-2 { flex: 0 0 auto; width: 16.666667%; }
.col-xs-3 { flex: 0 0 auto; width: 25%; }
.col-xs-4 { flex: 0 0 auto; width: 33.333333%; }
.col-xs-5 { flex: 0 0 auto; width: 41.666667%; }
.col-xs-6 { flex: 0 0 auto; width: 50%; }
.col-xs-7 { flex: 0 0 auto; width: 58.333333%; }
.col-xs-8 { flex: 0 0 auto; width: 66.666667%; }
.col-xs-9 { flex: 0 0 auto; width: 75%; }
.col-xs-10 { flex: 0 0 auto; width: 83.333333%; }
.col-xs-11 { flex: 0 0 auto; width: 91.666667%; }
.col-xs-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-offset-1 { margin-left: 8.333333%; }
    .col-sm-offset-2 { margin-left: 16.666667%; }
    .col-sm-offset-3 { margin-left: 25%; }
    .col-sm-offset-4 { margin-left: 33.333333%; }
}

@media (min-width: 768px) {
    .col-md-offset-1 { margin-left: 8.333333%; }
    .col-md-offset-2 { margin-left: 16.666667%; }
    .col-md-offset-3 { margin-left: 25%; }
    .col-md-offset-4 { margin-left: 33.333333%; }
    .col-md-offset-5 { margin-left: 41.666667%; }
    .col-md-offset-6 { margin-left: 50%; }
    .col-md-offset-7 { margin-left: 58.333333%; }
    .col-md-offset-8 { margin-left: 66.666667%; }
    .col-md-offset-9 { margin-left: 75%; }
    .col-md-offset-10 { margin-left: 83.333333%; }
    .col-md-offset-11 { margin-left: 91.666667%; }
}

@media (min-width: 992px) {
    .col-lg-offset-1 { margin-left: 8.333333%; }
    .col-lg-offset-2 { margin-left: 16.666667%; }
    .col-lg-offset-3 { margin-left: 25%; }
    .col-lg-offset-4 { margin-left: 33.333333%; }
}

.text-right {
    text-align: right !important;
}

@media (max-width: 575.98px) {
    .hidden-xs { display: none !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .hidden-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .hidden-md { display: none !important; }
}

@media (min-width: 992px) {
    .hidden-lg { display: none !important; }
}

.pull-right { float: right !important; }
.pull-left { float: left !important; }

/* Navbar legado — estilos movidos para rastreamos-navbar.css */

/* --- Labels / badges --- */
.label {
    display: inline-block;
    padding: 0.2em 0.6em 0.3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25em;
}

.label-default { background-color: #777; }
.label-primary { background-color: #375a7f; }
.label-success { background-color: #18bc9c; }
.label-info { background-color: #3498db; }
.label-warning { background-color: #f39c12; }
.label-danger { background-color: #e74c3c; }

/* --- Modais --- */
.modal .close {
    float: right;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    opacity: 1;
    background: transparent;
    border: 0;
    padding: 0;
}

.modal-header .close {
    order: 2;
    margin-top: -0.5rem;
    margin-left: auto;
    float: none;
}

.modal-header .modal-title {
    order: 1;
    margin-right: auto;
}

.modal.fade.in,
.modal.show .modal-dialog {
    /* compat sidebar modals */
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

/* BS5 limita .modal-dialog com max-width; restaura larguras inline (compat BS3) */
.modal-dialog[style*="width"] {
    max-width: none;
}

.modal-dialog[style*="height"] {
    display: flex;
    flex-direction: column;
}

.modal-dialog[style*="height"] .modal-content {
    flex: 1 1 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-dialog[style*="height"] .modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.help-block {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #6c757d;
}

.form-group {
    margin-bottom: 1rem;
}

.container-fluid {
    width: 100%;
    padding-right: var(--bs-gutter-x, 0.75rem);
    padding-left: var(--bs-gutter-x, 0.75rem);
    margin-right: auto;
    margin-left: auto;
}

/* --- Tabs (vue-nav-tabs / BS3 → BS5) --- */
.app-tabs.vue-tabs.stacked,
.vue-tabs.stacked {
    display: flex;
    gap: 16px;
}

.app-tabs .tabs__link,
.vue-tabs .tabs__link {
    text-decoration: none;
    color: inherit;
}

.app-tabs .nav,
.vue-tabs .nav {
    margin-bottom: 0;
    margin-top: 0;
    padding-left: 0;
    list-style: none;
}

.app-tabs .nav-tabs,
.vue-tabs .nav-tabs,
ul.nav.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #ecf0f1;
}

.app-tabs .nav > li,
.vue-tabs .nav > li,
ul.nav.nav-tabs > li {
    position: relative;
    display: block;
}

.app-tabs .nav-tabs > li,
.vue-tabs .nav-tabs > li,
ul.nav.nav-tabs > li {
    float: none;
    margin-bottom: -1px;
}

.app-tabs .nav > li > a,
.vue-tabs .nav > li > a,
.app-tabs .nav > li > .tabs__link,
.vue-tabs .nav > li > .tabs__link {
    position: relative;
    display: block;
    padding: 10px 15px;
}

.app-tabs .nav > li > a:hover,
.app-tabs .nav > li > a:focus,
.vue-tabs .nav > li > a:hover,
.vue-tabs .nav > li > a:focus {
    text-decoration: none;
    background-color: #ecf0f1;
}

.app-tabs .nav > li.disabled > a,
.vue-tabs .nav > li.disabled > a {
    color: #777;
    pointer-events: none;
    cursor: not-allowed;
    background-color: transparent;
}

.app-tabs .nav-tabs > li > a,
.app-tabs .nav-tabs > li > .tabs__link,
.vue-tabs .nav-tabs > li > a,
.vue-tabs .nav-tabs > li > .tabs__link,
ul.nav.nav-tabs > li > a {
    margin-right: 2px;
    line-height: 1.42857143;
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    color: #2c3e50;
}

.app-tabs .nav-tabs > li > a:hover,
.vue-tabs .nav-tabs > li > a:hover,
ul.nav.nav-tabs > li > a:hover {
    border-color: #ecf0f1 #ecf0f1 #ecf0f1;
}

.app-tabs .nav-tabs > li.active > a,
.app-tabs .nav-tabs > li.active > .tabs__link,
.vue-tabs .nav-tabs > li.active > a,
.vue-tabs .nav-tabs > li.active > .tabs__link,
ul.nav.nav-tabs > li.active > a {
    color: #2c3e50;
    background-color: #fff;
    border: 1px solid #ecf0f1;
    border-bottom-color: transparent;
    cursor: default;
}

.app-tabs .nav-stacked > li,
.vue-tabs .nav-stacked > li {
    float: none;
}

.app-tabs .nav-stacked > li + li,
.vue-tabs .nav-stacked > li + li {
    margin-top: 2px;
    margin-left: 0;
}

.app-tabs--vertical .nav-tabs,
.app-tabs.stacked .nav-tabs,
.vue-tabs.stacked .left-vertical-tabs {
    flex-direction: column;
    float: none;
    border-bottom: 0;
    border-right: 1px solid #ecf0f1;
}

.app-tabs--vertical .nav-tabs > li,
.app-tabs.stacked .nav-tabs > li,
.vue-tabs.stacked .left-vertical-tabs > li {
    float: none;
    width: 100%;
}

.app-tabs--vertical .nav-tabs > li > a,
.app-tabs--vertical .nav-tabs > li > .tabs__link,
.app-tabs.stacked .nav-tabs > li > a,
.vue-tabs.stacked .left-vertical-tabs > li > a {
    margin-right: 0;
    margin-bottom: 2px;
    border-radius: 4px 0 0 4px;
}

.app-tabs--vertical .nav-tabs > li.active > a,
.app-tabs.stacked .nav-tabs > li.active > a,
.vue-tabs.stacked .left-vertical-tabs > li.active > a {
    border-bottom-color: #ecf0f1;
    border-right-color: transparent;
}

.app-tabs .nav-justified > li,
.vue-tabs .nav-justified > li,
.app-tabs .nav-tabs.nav-justified > li,
.vue-tabs .nav-tabs.nav-justified > li {
    flex: 1 1 0;
    width: auto;
    text-align: center;
}

.app-tabs .nav-justified > li > a,
.vue-tabs .nav-justified > li > a,
.app-tabs .nav-tabs.nav-justified > li > a,
.vue-tabs .nav-tabs.nav-justified > li > a {
    text-align: center;
    margin-bottom: 0;
}

.app-tabs .tab-content > .tab-pane,
.vue-tabs .tab-content > .tab-pane {
    display: none;
}

.app-tabs .tab-content > .active,
.app-tabs .tab-content > .tab-pane.active,
.vue-tabs .tab-content > .active,
.vue-tabs .tab-content > .tab-pane.active {
    display: block;
}

.app-tabs .tab-content::before,
.app-tabs .tab-content::after,
.app-tabs .nav::before,
.app-tabs .nav::after,
.vue-tabs .tab-content::before,
.vue-tabs .tab-content::after,
.vue-tabs .nav::before,
.vue-tabs .nav::after {
    content: " ";
    display: table;
}

.app-tabs .tab-content::after,
.app-tabs .nav::after,
.vue-tabs .tab-content::after,
.vue-tabs .nav::after {
    clear: both;
}

/* Tabs verticais — menu lateral compacto */
.app-tabs.stacked,
.app-tabs--vertical {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.app-tabs.stacked .nav-tabs-navigation,
.app-tabs--vertical .nav-tabs-navigation {
    flex: 0 0 auto;
    width: auto;
    max-width: 138px;
}

.app-tabs.stacked .left-vertical-tabs,
.app-tabs--vertical .nav-tabs {
    flex-direction: column;
    flex-wrap: nowrap;
    width: auto;
    border-bottom: 0;
    border-right: 1px solid #ecf0f1;
    background: transparent;
}

.app-tabs.stacked .left-vertical-tabs > li,
.app-tabs--vertical .nav-tabs > li {
    width: 100%;
}

.app-tabs.stacked .left-vertical-tabs .tabs__link,
.app-tabs--vertical .nav-tabs .tabs__link {
    padding: 6px 8px;
    margin: 0 0 1px;
    font-size: var(--text-xs, 10px);
    line-height: 1.2;
    text-align: left;
    white-space: normal;
    border-radius: 4px 0 0 4px;
}

.app-tabs.stacked .right-text-tabs,
.app-tabs.stacked .app-tabs__content,
.app-tabs--vertical .app-tabs__content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 0 0 0 12px;
    border: none;
    background: transparent;
}

.app-tabs.stacked .app-tabs__content .form-horizontal,
.app-tabs--vertical .app-tabs__content .form-horizontal {
    width: 100%;
}

.app-tabs.stacked .app-tab-pane,
.app-tabs--vertical .app-tab-pane {
    padding: 0;
    width: 100%;
}
