/* Base própria do Motorista (sem Bootstrap): reset, grade, utilitários e componentes.
   Os nomes de classe seguem o padrão do Bootstrap 5 pra quem já conhece o resto do FlexonSys. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.5; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.2; }
h4, .h4 { font-size: 1.35rem; } h5, .h5 { font-size: 1.15rem; }
p { margin: 0 0 1rem; } ul { margin: 0 0 1rem; padding-left: 1.4rem; }
small, .small { font-size: .875em; } b, strong { font-weight: 700; }
img, svg { vertical-align: middle; } button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; } [hidden] { display: none !important; }
details summary { cursor: pointer; }
.lead { font-size: 1.15rem; } .display-6 { font-size: calc(1.375rem + 1.5vw); font-weight: 700; line-height: 1.1; }
@media (min-width: 1200px) { .display-6 { font-size: 2.5rem; } }
.fs-5 { font-size: 1.15rem !important; } .fs-6 { font-size: 1rem !important; } .fs-4 { font-size: 1.4rem !important; }
.fw-bold { font-weight: 700 !important; } .fw-normal { font-weight: 400 !important; }
.text-end { text-align: right !important; } .text-center { text-align: center !important; } .text-start { text-align: left !important; }
.text-uppercase { text-transform: uppercase; } .text-decoration-none { text-decoration: none !important; } .text-reset { color: inherit !important; }
.align-middle { vertical-align: middle !important; }
.w-100 { width: 100% !important; } .h-100 { height: 100% !important; }

/* display / flex */
.d-none { display: none !important; } .d-block { display: block !important; } .d-flex { display: flex !important; } .d-inline-block { display: inline-block !important; } .d-grid { display: grid !important; }
@media (min-width: 576px) { .d-sm-inline { display: inline !important; } }
@media (min-width: 992px) { .d-lg-none { display: none !important; } .d-lg-block { display: block !important; } .d-lg-flex { display: flex !important; } }
.flex-grow-1 { flex-grow: 1 !important; } .flex-wrap { flex-wrap: wrap !important; } .flex-fill { flex: 1 1 auto !important; }
.align-items-center { align-items: center !important; } .align-items-end { align-items: flex-end !important; } .align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; } .justify-content-center { justify-content: center !important; }
.gap-1 { gap: .25rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: 1rem !important; }

/* espaçamento */
.m-0 { margin: 0 !important; } .mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; } .mt-3 { margin-top: 1rem !important; } .mt-4 { margin-top: 1.5rem !important; } .mt-n2 { margin-top: -.5rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; } .mb-3 { margin-bottom: 1rem !important; } .mb-4 { margin-bottom: 1.5rem !important; }
.me-1 { margin-right: .25rem !important; } .me-2 { margin-right: .5rem !important; } .ms-1 { margin-left: .25rem !important; }
.p-4 { padding: 1.5rem !important; } .pb-0 { padding-bottom: 0 !important; } .pb-2 { padding-bottom: .5rem !important; } .ps-3 { padding-left: 1rem !important; } .py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }

/* grade */
.row { --gx: 1.5rem; --gy: 0px; display: flex; flex-wrap: wrap; margin-top: calc(-1 * var(--gy)); margin-left: calc(-.5 * var(--gx)); margin-right: calc(-.5 * var(--gx)); }
.row > * { flex-shrink: 0; width: 100%; max-width: 100%; padding-left: calc(.5 * var(--gx)); padding-right: calc(.5 * var(--gx)); margin-top: var(--gy); }
.g-2 { --gx: .5rem; --gy: .5rem; } .g-3 { --gx: 1rem; --gy: 1rem; }
.row.mt-0 { margin-top: 0 !important; }
.col-3 { flex: 0 0 auto; width: 25%; } .col-4 { flex: 0 0 auto; width: 33.3333%; } .col-5 { flex: 0 0 auto; width: 41.6667%; }
.col-6 { flex: 0 0 auto; width: 50%; } .col-7 { flex: 0 0 auto; width: 58.3333%; } .col-12 { flex: 0 0 auto; width: 100%; }
@media (min-width: 576px) { .col-sm-5 { flex: 0 0 auto; width: 41.6667%; } .col-sm-6 { flex: 0 0 auto; width: 50%; } .col-sm-7 { flex: 0 0 auto; width: 58.3333%; } }
@media (min-width: 768px) { .col-md-4 { flex: 0 0 auto; width: 33.3333%; } .col-md-6 { flex: 0 0 auto; width: 50%; } }
@media (min-width: 992px) { .col-lg-4 { flex: 0 0 auto; width: 33.3333%; } .col-lg-5 { flex: 0 0 auto; width: 41.6667%; } .col-lg-6 { flex: 0 0 auto; width: 50%; }
                            .col-lg-7 { flex: 0 0 auto; width: 58.3333%; } .col-lg-8 { flex: 0 0 auto; width: 66.6667%; } }
@media (min-width: 1200px) { .col-xl-4 { flex: 0 0 auto; width: 33.3333%; } .col-xl-5 { flex: 0 0 auto; width: 41.6667%; } .col-xl-7 { flex: 0 0 auto; width: 58.3333%; } }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .95rem; font-size: .95rem; line-height: 1.4;
       border: 1px solid transparent; background: transparent; text-decoration: none; user-select: none; white-space: nowrap; transition: filter .15s, background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled { opacity: .6; pointer-events: none; }
.btn-sm { padding: .3rem .65rem; font-size: .83rem; border-radius: 10px; }
.btn-lg { padding: .7rem 1.2rem; font-size: 1.05rem; }
.btn-close { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: inherit; opacity: .7; position: relative; flex-shrink: 0; }
.btn-close::before, .btn-close::after { content: ""; position: absolute; left: 9px; right: 9px; top: 16px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
.btn-close::after { transform: rotate(-45deg); }
.btn-close:hover { opacity: 1; }
.dropdown-toggle::after { content: ""; border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }

/* formulários */
.form-control, .form-select { display: block; width: 100%; padding: .55rem .8rem; font-size: 1rem; line-height: 1.5; border: 1px solid; border-radius: 12px; appearance: none; outline: 0; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.form-select { padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
               background-repeat: no-repeat; background-position: right .75rem center; background-size: 14px 11px; }
.form-control-lg { padding: .7rem 1rem; font-size: 1.1rem; border-radius: 14px; }
.form-control-sm { padding: .3rem .6rem; font-size: .87rem; border-radius: 10px; }
.form-control-color { height: 44px; padding: .3rem; cursor: pointer; }
input[type=date].form-control, input[type=datetime-local].form-control { min-height: 2.6rem; }
.form-text { margin-top: .3rem; font-size: .8rem; }
.input-group { position: relative; display: flex; flex-wrap: nowrap; align-items: stretch; width: 100%; }
.input-group > .form-control, .input-group > .form-select { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group-text { display: flex; align-items: center; padding: .55rem .7rem; font-size: .92rem; white-space: nowrap; border: 1px solid; border-radius: 12px; }
.input-group > :not(:first-child) { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group-lg > .form-control, .input-group-lg > .input-group-text { padding: .7rem 1rem; font-size: 1.1rem; }
.input-group-sm > .form-control, .input-group-sm > .input-group-text { padding: .3rem .55rem; font-size: .87rem; }
.form-check { display: flex; align-items: center; gap: .6rem; min-height: 1.5rem; }
.form-check-input { flex-shrink: 0; width: 1.15rem; height: 1.15rem; margin: 0; appearance: none; border: 1px solid; border-radius: .3rem; cursor: pointer; }
.form-switch .form-check-input { width: 2.6rem; height: 1.45rem; border-radius: 2rem; position: relative; transition: background .2s; }
.form-switch .form-check-input::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.45rem - 6px); height: calc(1.45rem - 6px); border-radius: 50%; background: #94a3b8; transition: transform .2s, background .2s; }
.form-switch .form-check-input:checked::after { transform: translateX(1.15rem); background: #fff; }
.form-check-label { cursor: pointer; }
.btn-check { position: absolute; clip: rect(0, 0, 0, 0); pointer-events: none; }

/* alertas */
.alert { padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-danger { background: rgba(244, 63, 94, .12); border-color: rgba(244, 63, 94, .35); color: #fda4af; }
.alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fcd34d; }
[data-tema="claro"] .alert-danger { color: #be123c; } [data-tema="claro"] .alert-warning { color: #92400e; }

/* tabela */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.table th, .table td { padding: .6rem .55rem; border-bottom: 1px solid var(--borda); text-align: left; }
.table.align-middle td, .table.align-middle th { vertical-align: middle; }
.table td.text-end, .table th.text-end { text-align: right; }
.table-hover tbody tr:hover td { background: var(--card-2); }

.spinner-border { display: inline-block; width: 1.2rem; height: 1.2rem; border: .2em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
.spinner-border-sm { width: .9rem; height: .9rem; border-width: .16em; }
@keyframes girar { to { transform: rotate(360deg); } }

/* modal */
body.modal-aberto { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 1055; display: none; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.show { display: block; }
.modal-dialog { position: relative; width: auto; margin: 1.5rem auto; max-width: 520px; padding: 0 .75rem; pointer-events: none; transform: translateY(14px) scale(.98); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.modal.show.visivel .modal-dialog { transform: none; opacity: 1; }
.modal-sm { max-width: 340px; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3rem); }
.modal-dialog-scrollable { height: calc(100% - 3rem); }
.modal-dialog-scrollable .modal-content { max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; border: 1px solid; outline: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1rem 1.1rem; border-bottom: 1px solid; }
.modal-title { margin: 0; font-size: 1.1rem; font-weight: 800; display: flex; align-items: center; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1.1rem; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; padding: .85rem 1.1rem; border-top: 1px solid; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: rgba(2, 6, 23, .6); opacity: 0; transition: opacity .2s; backdrop-filter: blur(2px); }
.modal-backdrop.show { opacity: 1; }
@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down { width: 100vw; max-width: none; height: 100%; margin: 0; padding: 0; min-height: 100%; }
    .modal-fullscreen-sm-down .modal-content { height: 100%; border: 0; border-radius: 0 !important; }
    .modal-fullscreen-sm-down .modal-body { overflow-y: auto; }
    .modal-fullscreen-sm-down .modal-footer { padding-bottom: calc(.85rem + env(safe-area-inset-bottom, 0px)); }
}

/* offcanvas (folha de baixo) */
.offcanvas { position: fixed; z-index: 1045; display: flex; flex-direction: column; max-width: 100%; visibility: hidden; transition: transform .25s ease, visibility .25s; }
.offcanvas-bottom { left: 0; right: 0; bottom: 0; transform: translateY(100%); border-top: 1px solid; }
.offcanvas.show { visibility: visible; transform: none; }
.offcanvas-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem; }
.offcanvas-title { margin: 0; font-weight: 800; font-size: 1.05rem; }
.offcanvas-body { padding: .6rem .8rem 1rem; overflow-y: auto; }
.offcanvas-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(2, 6, 23, .55); opacity: 0; transition: opacity .2s; }
.offcanvas-backdrop.show { opacity: 1; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1060; display: none; }
.dropdown-menu.show { display: block; }
.dropdown-menu-end { left: auto; right: 0; }
.dropdown-item { text-decoration: none; cursor: pointer; }

/* diálogos e avisos (substituem o SweetAlert) */
.dlg-fundo { position: fixed; inset: 0; z-index: 2000; background: rgba(2, 6, 23, .6); display: grid; place-items: center; padding: 1rem; opacity: 0; transition: opacity .18s; }
.dlg-fundo.show { opacity: 1; }
.dlg { width: 100%; max-width: 400px; padding: 1.5rem 1.3rem 1.2rem; text-align: center; border: 1px solid; border-radius: 20px; transform: scale(.94); transition: transform .18s; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.dlg-fundo.show .dlg { transform: none; }
.dlg-icone { width: 58px; height: 58px; margin: 0 auto .8rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; }
.dlg h2 { font-size: 1.2rem; font-weight: 800; }
.dlg .dlg-texto { color: var(--texto-2); margin-bottom: 1rem; }
.dlg .dlg-html { text-align: left; margin-bottom: 1rem; }
.dlg-botoes { display: flex; gap: .5rem; }
.dlg-botoes .btn { flex: 1; padding: .7rem; }
.avisos { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 2100; display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.aviso { display: flex; align-items: center; gap: .6rem; padding: .7rem .95rem; border-radius: 14px; border: 1px solid; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); transform: translateY(-12px); opacity: 0; transition: transform .2s, opacity .2s; }
.aviso.show { transform: none; opacity: 1; }
.aviso i { font-size: 1.2rem; }

/* gráficos SVG */
.grafico svg { display: block; width: 100%; height: 100%; overflow: visible; }
.grafico .gr-legenda { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .9rem; font-size: .78rem; margin-top: .4rem; }
.grafico .gr-legenda span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; background: var(--c); vertical-align: -1px; }
.gr-dica { position: absolute; z-index: 5; pointer-events: none; padding: .45rem .6rem; border-radius: 10px; font-size: .78rem; white-space: nowrap; border: 1px solid; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transform: translate(-50%, calc(-100% - 10px)); }
.gr-dica b { display: block; margin-bottom: .15rem; }
