/* =============================================================================
   FROTA APP - CSS DE PRODUÇÃO
   Versão: 3.0 | FIX : estilos do historico.html migrados para cá
   ============================================================================= */

/* === VARIÁVEIS === */
:root {
    --primary-green: #00e676;
    --gold-color: #be9955;
    --gold-gradient: linear-gradient(135deg, #be9955 0%, #8f7034 100%);
    --bg-dark: #003334;
    --bg-gradient: radial-gradient(circle at 50% 0%, #004d4e 0%, #003334 80%);
    --card-bg: rgba(255, 255, 255, 0.98);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    --text-dark: #1a2e35;
    --text-light: #f0f0f0;
    --text-muted: #6c757d;
    --border-radius-lg: 20px;
    --border-radius-md: 14px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* === RESET === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-light);
    min-height: 100vh;
    padding-bottom: 120px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 2rem;
}

/* === TIPOGRAFIA === */
h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 0.5rem; line-height: 1.6; }

.app-card h1, .app-card h2, .app-card h3, .app-card h4, .app-card h5, .app-card h6,
.modal-content h1, .modal-content h2, .modal-content h3, .modal-content h4, .modal-content h5, .modal-content h6 {
    color: var(--text-dark) !important;
    text-shadow: none;
}

/* === CARDS === */
.app-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
    transition: var(--transition);
    animation: fadeIn 0.3s ease;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.card-gold {
    background: var(--gold-gradient) !important;
    color: #fff !important;
    border: none;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.card-gold:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(190, 153, 85, 0.3);
}

.card-gold h4, .card-gold span, .card-gold p { color: #fff !important; }

.login-card {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    color: #fff;
}

/* === FORMULÁRIOS === */
label {
    display: block;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

body > label, .text-label { color: var(--text-light); }
.app-card label, .modal-content label { color: var(--text-dark); }
.login-card label { color: rgba(255, 255, 255, 0.9); }

.form-control, .form-select, input[type="text"], input[type="number"],
input[type="datetime-local"], input[type="email"], input[type="password"],
textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius-md);
    background-color: #fff;
    color: var(--text-dark);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.2rem rgba(0, 230, 118, 0.25);
}

.form-dark {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.form-dark::placeholder { color: rgba(255, 255, 255, 0.5); }
.form-dark:focus {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border-color: var(--gold-color);
}

.input-group { display: flex; gap: 0.5rem; }
.input-group .form-control { flex: 1; }
.input-group .btn { flex-shrink: 0; }

input[type="file"] { padding: 0.5rem; cursor: pointer; }
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* === SELECT2 === */
.select2-container--bootstrap-5 .select2-selection {
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: var(--border-radius-md) !important;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    color: var(--text-dark) !important;
    padding-left: 1rem;
    line-height: 48px;
}

.select2-container--bootstrap-5 .select2-selection__placeholder { color: #999 !important; }

.select2-dropdown {
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: var(--border-radius-sm) !important;
}

.select2-results__option {
    color: var(--text-dark) !important;
    padding: 0.75rem 1rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-green) !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 10px;
}

/* === BOTÕES === */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-gold, .btn-primary, .btn-action {
    background: var(--gold-gradient) !important;
    color: #fff !important;
    border: none;
}

.btn-success { background: var(--primary-green) !important; color: #fff !important; }
.btn-danger  { background: #dc3545 !important; color: #fff !important; }
.btn-light   { background: #f8f9fa; color: var(--text-dark); border: 1px solid #dee2e6; }
.btn-outline-secondary { background: transparent; color: var(--text-muted); border: 1px solid var(--text-muted); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.1rem; }
.w-100  { width: 100%; }

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.5;
}
.btn-close:hover { opacity: 1; }

/* === ALERTAS === */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-md);
    border-left: 4px solid;
    position: relative;
}

.alert-success { background-color: #d4edda; border-color: #28a745; color: #155724; }
.alert-danger  { background-color: #f8d7da; border-color: #dc3545; color: #721c24; }
.alert-warning { background-color: #fff3cd; border-color: #ffc107; color: #856404; }
.alert-info    { background-color: #d1ecf1; border-color: #17a2b8; color: #0c5460; }

.alert-dismissible .btn-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge.rounded-pill { border-radius: 10rem; }
.bg-success  { background-color: #28a745 !important; }
.bg-warning  { background-color: #ffc107 !important; color: #000 !important; }
.bg-danger   { background-color: #dc3545 !important; }
.bg-light    { background-color: #f8f9fa !important; color: #212529 !important; }
.bg-primary  { background-color: #007bff !important; }

/* === NAVBAR BOTTOM === */
.navbar-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.75rem 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 1000;
}

@media (min-width: 768px) {
    .navbar-bottom {
        max-width: 600px;
        border-radius: 20px;
        bottom: 20px;
    }
}

.nav-item-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.75rem;
    transition: var(--transition);
    padding: 0.5rem;
}

.nav-item-app:hover  { color: var(--text-dark); }
.nav-item-app.active { color: var(--bg-dark); font-weight: 700; }
.nav-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }

/* === LOGOS === */
.app-logo-header { height: 50px; width: auto; object-fit: contain; }
.app-logo-login  { height: 120px; width: auto; display: block; margin: 0 auto 1.5rem auto; }
img { max-width: 100%; height: auto; display: block; }

/* === BORDAS === */
.border-start  { border-left: 4px solid !important; }
.border-4      { border-width: 4px !important; }
.border-success { border-color: #28a745 !important; }
.border-warning { border-color: #ffc107 !important; }
.border-primary { border-color: #007bff !important; }

/* === ESPAÇAMENTOS === */
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 1rem; }
.p-4  { padding: 1.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* === TEXTO === */
.text-center     { text-align: center; }
.text-start      { text-align: left; }
.text-end        { text-align: right; }
.text-muted      { color: var(--text-muted); }
.text-dark       { color: var(--text-dark); }
.text-white      { color: #fff; }
.text-white-50   { color: rgba(255, 255, 255, 0.5); }
.text-danger     { color: #dc3545; }
.text-success    { color: #28a745; }
.text-primary    { color: #007bff; }
.text-uppercase  { text-transform: uppercase; }
.text-truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-bold         { font-weight: 700; }
.fw-normal       { font-weight: 400; }
.small           { font-size: 0.875rem; }
.text-gold       { color: var(--gold-color) !important; }

/* === LAYOUT === */
.row  { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.col-12 { width: 100%; padding: 0 0.5rem; }
.col-6  { width: 50%; padding: 0 0.5rem; }
.col-5  { width: 41.666667%; padding: 0 0.5rem; }
.col-7  { width: 58.333333%; padding: 0 0.5rem; }
.g-2 > * { padding: 0.5rem; }
.g-3 > * { padding: 1rem; }
.gap-2   { gap: 0.5rem; }
.d-flex  { display: flex; }
.d-grid  { display: grid; }
.d-block { display: block; }
.d-none  { display: none; }
.flex-direction-column  { flex-direction: column; }
.align-items-center     { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.justify-content-end     { justify-content: flex-end; }

/* === UTILITÁRIOS === */
.shadow-sm  { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); }
.shadow     { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15); }
.shadow-lg  { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175); }
.rounded    { border-radius: var(--border-radius-sm); }
.rounded-1  { border-radius: 0.25rem; }
.rounded-3  { border-radius: var(--border-radius-md); }
.rounded-circle { border-radius: 50%; }
.opacity-10 { opacity: 0.1; }
.opacity-75 { opacity: 0.75; }
.text-decoration-none { text-decoration: none !important; }

/* === BACKGROUNDS === */
.bg-light          { background-color: #f8f9fa; }
.bg-white          { background-color: #fff; }
.bg-primary-subtle { background-color: rgba(0, 123, 255, 0.1); }
.border-primary-subtle { border-color: rgba(0, 123, 255, 0.3); }

/* === SPINNER === */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm { width: 0.75rem; height: 0.75rem; border-width: 0.1em; }

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* === TOAST === */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(400px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

/* === MODAL DE CONFIRMAÇÃO === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-confirm {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

.modal-confirm-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-confirm-icon  { font-size: 3rem; line-height: 1; }

.modal-confirm-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-confirm-message {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.modal-confirm-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-confirm-buttons .btn { min-width: 100px; }

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

/* === HISTORICO — FIX #7: migrado do bloco <style> inline do historico.html === */
.historico-info-box {
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
    background-color: #f8f9fa;
}

.historico-info-box:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.historico-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: var(--border-radius-md);
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    margin-bottom: 1rem;
}

.historico-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
}

/* === RESPONSIVIDADE === */
@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    .app-card { padding: 1rem; }
    .btn      { padding: 0.65rem 1.25rem; }

    .modal-confirm {
        max-width: 90%;
        padding: 1.5rem;
    }
    .modal-confirm-icon  { font-size: 2.5rem; }
    .modal-confirm-title { font-size: 1.25rem; }
    .modal-confirm-buttons { flex-direction: column; }
    .modal-confirm-buttons .btn { width: 100%; }
}

/* === ANIMAÇÕES === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* =============================================================================
   FROTA APP — ADIÇÃO AO custom.css  v2.6
   CSS apenas para VISUAL do dropdown — estado aberto/fechado controlado pelo JS
   Cole ao FINAL de static/css/custom.css
   ============================================================================= */

/* Botão trigger */
.dck-btn {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
    color: #1a2e35;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    min-height: 36px;
    font-family: inherit;
    box-sizing: border-box;
}

.dck-btn .dck-texto {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.dck-btn .dck-seta {
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* Painel — display controlado pelo JS, aqui só o visual */
.dck-painel {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Busca */
.dck-busca {
    display: block;
    width: calc(100% - 1rem);
    margin: 0.5rem 0.5rem 0.25rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #1a2e35;
    background: #f8f9fa;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.dck-busca:focus { border-color: #00e676; }

/* Ações */
.dck-acoes {
    display: flex;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem 0.4rem;
}

.dck-btn-todos,
.dck-btn-limpar {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.3rem 0;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    color: #1a2e35;
    font-family: inherit;
}

.dck-btn-todos:hover  { background: #003334; color: #fff; border-color: #003334; }
.dck-btn-limpar:hover { background: #dc3545; color: #fff; border-color: #dc3545; }

/* Separador */
.dck-divisor { height: 1px; background: #dee2e6; }

/* Lista */
.dck-lista { padding: 0.25rem 0; }

/* Item */
.dck-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.dck-item:hover { background: #f0faf4; }

.dck-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #003334;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.dck-item label {
    font-size: 0.875rem;
    color: #1a2e35;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.dck-item:has(input:checked) { background: #f0faf4; }
.dck-item:has(input:checked) label { font-weight: 600; color: #003334; }