/**
 * Polyfill standalone das classes Bootstrap ainda usadas nos templates.
 * Carregado após bootstrap-compat.css — permite remover o CDN de CSS gradualmente.
 * JS do Bootstrap (dropdown) permanece necessário até migrarmos os toggles.
 */

/* --- Botões --- */
.btn {
    display: inline-block;
    margin-bottom: 0;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: var(--text-sm, 11px);
    line-height: 1.42857143;
    border-radius: 4px;
    user-select: none;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn:focus,
.btn:active:focus,
.btn.active:focus {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}

.btn:hover,
.btn:focus {
    color: #333;
    text-decoration: none;
}

.btn:active,
.btn.active {
    outline: 0;
    background-image: none;
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
    pointer-events: none;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm,
.btn-group-sm > .btn {
    padding: 5px 10px;
    font-size: var(--text-xs, 10px);
    line-height: 1.5;
    border-radius: 3px;
}

.btn-xs,
.btn-group-xs > .btn {
    padding: 1px 5px;
    font-size: var(--text-xs, 10px);
    line-height: 1.5;
    border-radius: 3px;
}

.btn-lg,
.btn-group-lg > .btn {
    padding: 10px 16px;
    font-size: var(--text-md, 13px);
    line-height: 1.3333333;
    border-radius: 6px;
}

.btn-default {
    color: #fff;
    background-color: #95a5a6;
    border-color: #95a5a6;
}

.btn-default:hover,
.btn-default:focus {
    color: #fff;
    background-color: #798d8f;
    border-color: #74898a;
}

.btn-default:active,
.btn-default.active {
    color: #fff;
    background-color: #74898a;
    border-color: #6f8384;
}

.btn-primary {
    color: #fff;
    background-color: #375a7f;
    border-color: #375a7f;
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background-color: #2c4865;
    border-color: #28425d;
}

.btn-primary:active,
.btn-primary.active {
    color: #fff;
    background-color: #28425d;
    border-color: #243c55;
}

.btn-success {
    color: #fff;
    background-color: #18bc9c;
    border-color: #18bc9c;
}

.btn-success:hover,
.btn-success:focus {
    color: #fff;
    background-color: #149a80;
    border-color: #139077;
}

.btn-success:active,
.btn-success.active {
    color: #fff;
    background-color: #139077;
    border-color: #11866f;
}

.btn-info {
    color: #fff;
    background-color: #3498db;
    border-color: #3498db;
}

.btn-info:hover,
.btn-info:focus {
    color: #fff;
    background-color: #258cd1;
    border-color: #2387c8;
}

.btn-info:active,
.btn-info.active {
    color: #fff;
    background-color: #2387c8;
    border-color: #2180be;
}

.btn-warning {
    color: #fff;
    background-color: #f39c12;
    border-color: #f39c12;
}

.btn-warning:hover,
.btn-warning:focus {
    color: #fff;
    background-color: #d4860b;
    border-color: #ca7f0a;
}

.btn-warning:active,
.btn-warning.active {
    color: #fff;
    background-color: #ca7f0a;
    border-color: #c07709;
}

.btn-danger {
    color: #fff;
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.btn-danger:hover,
.btn-danger:focus {
    color: #fff;
    background-color: #e12e1b;
    border-color: #dc2a18;
}

.btn-danger:active,
.btn-danger.active {
    color: #fff;
    background-color: #dc2a18;
    border-color: #d32817;
}

.btn-secondary {
    color: #fff;
    background-color: #2c3e50;
    border-color: #2c3e50;
}

.btn-secondary:hover,
.btn-secondary:focus {
    color: #fff;
    background-color: #1f2d3a;
    border-color: #1a252f;
}

.btn-secondary:active,
.btn-secondary.active {
    color: #fff;
    background-color: #1a252f;
    border-color: #151e27;
}

.btn-link {
    font-weight: 400;
    color: #3498db;
    border-radius: 0;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.btn-link:hover,
.btn-link:focus {
    color: #217dbb;
    text-decoration: underline;
    background-color: transparent;
    border-color: transparent;
}

.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
}

.btn-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
}

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

.btn-group > .btn:last-child:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* --- Grid --- */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1170px;
    }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -10px;
    margin-left: -10px;
}

[class*="col-"] {
    position: relative;
    min-height: 1px;
    padding-right: 10px;
    padding-left: 10px;
    box-sizing: border-box;
    width: 100%;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-sm-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-sm-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .col-sm-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .col-sm-11 { flex: 0 0 91.666%; max-width: 91.666%; }
    .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
    .col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .col-md-11 { flex: 0 0 91.666%; max-width: 91.666%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 8.333%; max-width: 8.333%; }
    .col-lg-2 { flex: 0 0 16.666%; max-width: 16.666%; }
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-5 { flex: 0 0 41.666%; max-width: 41.666%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-7 { flex: 0 0 58.333%; max-width: 58.333%; }
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
    .col-lg-10 { flex: 0 0 83.333%; max-width: 83.333%; }
    .col-lg-11 { flex: 0 0 91.666%; max-width: 91.666%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* --- Tabelas --- */
.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    border-collapse: collapse;
    background-color: transparent;
}

.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

.table > thead > tr > th {
    vertical-align: bottom;
    border-bottom: 2px solid #ddd;
}

.table-bordered {
    border: 1px solid #ddd;
}

.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
    border: 1px solid #ddd;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f9f9f9;
}

.table-hover > tbody > tr:hover {
    background-color: #f5f5f5;
}

.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
    padding: 5px;
}

.table-responsive {
    min-height: 0.01%;
    overflow-x: auto;
}

/* --- Dropdowns --- */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    display: none;
}

.dropup .dropdown-menu {
    top: auto;
    bottom: 100%;
    margin-bottom: 2px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    font-size: var(--text-base, 12px);
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-menu > li > a {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: 400;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
    text-decoration: none;
}

.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
    color: #262626;
    text-decoration: none;
    background-color: #f5f5f5;
}

.dropdown-menu .divider {
    height: 1px;
    margin: 9px 0;
    overflow: hidden;
    background-color: #e5e5e5;
}

/* --- Alerts --- */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

.alert-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.alert-danger {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* --- Utilitários de display e texto --- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-inline-block { display: inline-block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-inline-block { display: inline-block !important; }
    .d-lg-flex { display: flex !important; }
}

.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.text-muted { color: #95a5a6 !important; }
.text-primary { color: #375a7f !important; }
.text-success { color: #18bc9c !important; }
.text-info { color: #3498db !important; }
.text-warning { color: #f39c12 !important; }
.text-danger { color: #e74c3c !important; }

.clearfix::before,
.clearfix::after {
    content: " ";
    display: table;
}

.clearfix::after {
    clear: both;
}

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

.badge {
    display: inline-block;
    min-width: 10px;
    padding: 3px 7px;
    font-size: var(--text-xs, 10px);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    background-color: #777;
    border-radius: 10px;
}

.list-group {
    padding-left: 0;
    margin-bottom: 20px;
    list-style: none;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 10px 15px;
    margin-bottom: -1px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.list-group-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.list-group-item:last-child {
    margin-bottom: 0;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
}
