/* ==========================================================================
   Módulo Frota & Agenda
   ========================================================================== */
#page-frota .content-header h1 i { margin-right: 6px; }
.frota-header-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }

.frota-btn {
    height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 0 14px; border-radius: 8px; font-weight: 700; font-size: .85rem; cursor: pointer;
    border: 1px solid #cbd5e1; background: #fff; color: #334155; white-space: nowrap; width: auto; margin: 0;
}
.frota-btn:disabled { opacity: .55; cursor: not-allowed; }
.frota-btn-primary { background: #2563eb !important; border-color: #2563eb !important; color: #fff !important; }
.frota-btn-ok { background: #059669; border-color: #059669; color: #fff; }
.frota-btn-danger { background: #fff; border-color: #fecaca; color: #dc2626; }
.frota-btn-danger:hover { background: #fef2f2; }
.frota-link { background: none; border: none; color: #2563eb; cursor: pointer; font-size: .8rem; padding: 4px 0; width: auto; }

/* Abas */
.frota-tabs { display: flex; gap: 6px; margin: 1rem 0; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; overflow-x: auto; }
.frota-tabs button {
    padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: .85rem; cursor: pointer; border: none;
    background: transparent; color: #64748b; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; width: auto; margin: 0;
}
.frota-tabs button:hover { background: #f1f5f9; }
.frota-tabs button.active { background: #2563eb; color: #fff; }
.frota-badge { background: #dc2626; color: #fff; border-radius: 10px; font-size: .7rem; padding: 1px 7px; }

/* Toolbar / filtros */
.frota-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .8rem; }
.frota-input {
    height: 38px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 0 10px; font-size: .88rem;
    background: #fff; color: #0f172a; width: auto; margin: 0; box-sizing: border-box;
}
textarea.frota-input { height: auto; padding: 8px 10px; resize: vertical; font-family: inherit; }
.frota-field .frota-input, .frota-field textarea { width: 100%; }
.frota-seg { display: inline-flex; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; background: #fff; }
.frota-seg button { border: none; background: transparent; padding: 0 12px; height: 36px; font-weight: 600; font-size: .84rem; color: #475569; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; border-radius: 0; }
.frota-seg button + button { border-left: 1px solid #e2e8f0; }
.frota-seg button.active { background: #2563eb; color: #fff; }
.frota-seg-full { display: flex; width: 100%; }
.frota-seg-full button { flex: 1; justify-content: center; }
.frota-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.frota-pills button { border: 1px solid #e2e8f0; background: #fff; border-radius: 20px; padding: 5px 12px; font-size: .8rem; font-weight: 600; color: #475569; cursor: pointer; width: auto; margin: 0; }
.frota-pills button.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.frota-nav { display: inline-flex; align-items: center; gap: 4px; }
.frota-nav button { height: 36px; min-width: 36px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; cursor: pointer; font-weight: 600; padding: 0 10px; width: auto; margin: 0; color: #334155; }
.frota-nav-label { font-weight: 700; color: #0f172a; margin-left: 6px; font-size: .9rem; }
.frota-muted { color: #64748b; }

.frota-legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: #475569; margin-bottom: .6rem; align-items: center; }
.frota-legenda .sq { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.frota-pend-sq { background: #fef3c7; border: 2px solid #d97706; box-sizing: border-box; }
.frota-manut-sq { background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 3px, #e2e8f0 3px, #e2e8f0 6px); }
.frota-dica { margin-left: auto; color: #94a3b8; }

/* Quadro (equipamentos x dias) */
.frota-quadro-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.frota-quadro { display: grid; min-width: max-content; }
.fq-corner, .fq-dia-head { position: sticky; top: 0; background: #f8fafc; z-index: 2; border-bottom: 1px solid #e2e8f0; }
.fq-corner { left: 0; z-index: 3; padding: 10px 12px; font-weight: 700; font-size: .78rem; color: #64748b; text-transform: uppercase; border-right: 1px solid #e2e8f0; display: flex; align-items: flex-end; }
.fq-dia-head { text-align: center; padding: 6px 2px 0; font-size: .75rem; color: #475569; border-left: 1px solid #f1f5f9; }
.fq-dia-head b { display: block; font-size: .75rem; }
.fq-dia-head.fim { background: #f1f5f9; }
.fq-dia-head.hoje { background: #dbeafe; color: #1d4ed8; }
.fq-meios { display: flex; margin-top: 4px; border-top: 1px dashed #e2e8f0; }
.fq-meios span { flex: 1; font-size: .62rem; color: #94a3b8; padding: 2px 0; }
.fq-eq { position: sticky; left: 0; z-index: 1; background: #fff; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #f1f5f9; border-right: 1px solid #e2e8f0; border-left: 4px solid #2563eb; min-height: 52px; }
.fq-eq > i { color: #64748b; font-size: 1.1rem; width: 20px; text-align: center; }
.fq-eq b { display: block; font-size: .82rem; color: #0f172a; line-height: 1.2; }
.fq-eq small { font-size: .7rem; color: #64748b; }
.fq-cel { position: relative; display: flex; gap: 2px; padding: 4px 3px; border-bottom: 1px solid #f1f5f9; border-left: 1px solid #f1f5f9; min-height: 52px; }
.fq-cel.fim { background: #f8fafc; }
.fq-cel.hoje { background: #eff6ff; }
.fq-meio { flex: 1; display: flex; min-width: 0; }
.fq-slot { flex: 1; border-radius: 6px; cursor: pointer; border: 1px dashed transparent; }
.fq-slot:hover { border-color: #93c5fd; background: #eff6ff; }
.fq-slot:hover::after { content: '+'; display: flex; height: 100%; align-items: center; justify-content: center; color: #2563eb; font-weight: 700; }
.fq-slot.passado { cursor: default; }
.fq-slot.passado:hover { border-color: transparent; background: none; }
.fq-slot.passado:hover::after { content: none; }
.fq-bloco {
    flex: 1; min-width: 0; border-radius: 6px; color: #fff; font-size: .68rem; font-weight: 700; padding: 4px 5px; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 3px; line-height: 1.15;
}
.fq-bloco:hover { filter: brightness(1.08); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.fq-full { width: 100%; }
.fq-manut { background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 4px, #e2e8f0 4px, #e2e8f0 8px); color: #334155; justify-content: center; }
.fq-dim { opacity: .3; }
.fq-pend {
    position: absolute; top: 1px; right: 1px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
    background: #fef3c7; border: 2px solid #d97706; color: #92400e; font-size: .62rem; font-weight: 800; cursor: pointer; line-height: 1; width: auto; margin: 0; z-index: 1;
}

.frota-calendar { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.frota-calendar .fc-event { cursor: pointer; font-size: .75rem; }

/* Vazio / alertas */
.frota-vazio { text-align: center; padding: 3rem 1rem; color: #64748b; background: #fff; border: 1px dashed #cbd5e1; border-radius: 12px; }
.frota-vazio > i { font-size: 2.2rem; color: #94a3b8; margin-bottom: .6rem; }
.frota-vazio h3 { color: #0f172a; margin: .3rem 0; }
.frota-alerta { padding: 10px 12px; border-radius: 8px; font-size: .85rem; margin: 8px 0; }
.frota-alerta.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.frota-alerta.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.frota-alerta.danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.frota-urg { background: #dc2626; color: #fff; font-size: .65rem; font-weight: 800; border-radius: 4px; padding: 2px 6px; letter-spacing: .3px; }
.frota-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.frota-doc { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; margin: 2px 2px 0 0; }
.frota-doc.ok { background: #f1f5f9; color: #475569; }
.frota-doc.warn { background: #fef3c7; color: #92400e; }
.frota-doc.danger { background: #fee2e2; color: #991b1b; }
.frota-txt-danger { color: #dc2626 !important; }

/* Modal */
.frota-modal { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); padding: 24px 12px; overflow-y: auto; }
.frota-modal.open { display: block; }
.frota-modal-box { position: relative; background: #fff; border-radius: 14px; margin: 0 auto; padding: 22px 22px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-width: 640px; }
.frota-modal-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #f1f5f9; color: #475569; cursor: pointer; margin: 0; padding: 0; }
.frota-modal-title { font-size: 1.15rem; margin: 0 40px 12px 0; color: #0f172a; display: flex; align-items: center; gap: 8px; }
.frota-modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.frota-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.frota-grid2 .span2, .frota-grid2 > .frota-grid2 { grid-column: span 2; }
.frota-field { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 700; color: #334155; }
.frota-field small { font-weight: 500; color: #94a3b8; }
.frota-check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #334155; cursor: pointer; }
.frota-check input { width: 16px; height: 16px; margin: 0; }
.frota-sub { margin: 14px 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: #64748b; }
.frota-cores { display: flex; gap: 6px; flex-wrap: wrap; }
.frota-cores label { cursor: pointer; }
.frota-cores input { display: none; }
.frota-cores i { display: block; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #cbd5e1; }
.frota-cores input:checked + i { box-shadow: 0 0 0 2px #0f172a; }

/* Disponibilidade */
.frota-disp { margin-top: 12px; }
.frota-disp-head { font-weight: 700; font-size: .8rem; color: #475569; margin-bottom: 4px; }
.frota-disp-linha { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; padding: 5px 10px; border-radius: 6px; margin-bottom: 3px; }
.frota-disp-linha span:first-child { font-weight: 700; white-space: nowrap; }
.frota-disp-linha.livre { background: #ecfdf5; color: #065f46; }
.frota-disp-linha.fila { background: #fffbeb; color: #92400e; }
.frota-disp-linha.bloq { background: #fef2f2; color: #991b1b; text-decoration: line-through; }
.frota-disp-linha.bloq span:last-child { text-decoration: none; }

/* Detalhe */
.frota-det-head { display: flex; align-items: center; gap: 12px; border-left: 5px solid #2563eb; padding: 4px 0 4px 12px; margin: 0 40px 14px 0; }
.frota-det-head > i { font-size: 1.6rem; color: #475569; }
.frota-det-head h2 { margin: 0; font-size: 1.15rem; }
.frota-det-head small { color: #64748b; }
.frota-det-head .frota-chip { margin-left: auto; }
.frota-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.frota-info > div { background: #f8fafc; border-radius: 8px; padding: 8px 10px; }
.frota-info span { display: block; font-size: .68rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.frota-info b { font-size: .88rem; color: #0f172a; }
.frota-servico { margin-top: 8px; background: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: .9rem; color: #0f172a; }
.frota-servico span { display: block; font-size: .68rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.frota-grupo { display: flex; flex-wrap: wrap; gap: 4px; }
.frota-grupo button { border: 2px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 3px 8px; font-size: .75rem; font-weight: 700; cursor: pointer; width: auto; margin: 0; color: #334155; }
.frota-grupo button.atual { background: #0f172a; color: #fff; }
.frota-hist div { font-size: .8rem; color: #475569; padding: 2px 0; }
.frota-hist i.fa-circle { font-size: .45rem; color: #94a3b8; vertical-align: 2px; }
.frota-checklist-res div { font-size: .82rem; padding: 2px 0; }
.frota-checklist-res .ok i { color: #059669; }
.frota-checklist-res .nok { color: #b91c1c; font-weight: 600; }
.frota-relato { background: #f8fafc; border-radius: 8px; padding: 8px 10px; font-size: .85rem; white-space: pre-wrap; }
.frota-fotos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.frota-fotos img { width: 86px; height: 86px; object-fit: cover; border-radius: 8px; border: 1px solid #e2e8f0; }
.frota-assin-img { margin-top: 8px; }
.frota-assin-img img { max-width: 260px; border: 1px solid #e2e8f0; border-radius: 8px; display: block; background: #fff; }
.frota-assin-img small { color: #94a3b8; }
.frota-wa-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.frota-wa { display: inline-flex; align-items: center; gap: 5px; color: #15803d; font-weight: 700; font-size: .82rem; text-decoration: none; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 6px 10px; }
.frota-wa:hover { background: #dcfce7; }
.frota-lista .frota-linha { display: flex; justify-content: space-between; align-items: center; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.frota-lista .frota-linha:hover { background: #f8fafc; }

/* Checklist */
.frota-checklist { display: flex; flex-direction: column; gap: 6px; }
.frota-ck-item { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: .88rem; }
.frota-ck-item.falha { border-color: #fecaca; background: #fef2f2; }
.frota-ck-item .frota-ck-obs { grid-column: span 2; }
.frota-ck-btns { display: flex; gap: 4px; }
.frota-ck-btns button { border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; padding: 6px 10px; font-weight: 700; font-size: .78rem; cursor: pointer; color: #64748b; width: auto; margin: 0; }
.frota-ck-btns .ok.active { background: #059669; border-color: #059669; color: #fff; }
.frota-ck-btns .nok.active { background: #dc2626; border-color: #dc2626; color: #fff; }
.frota-assin { width: 100%; height: 160px; border: 2px dashed #cbd5e1; border-radius: 8px; background: #fff; cursor: crosshair; }

/* Cards de solicitação */
.frota-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.frota-card { background: #fff; border: 1px solid #e2e8f0; border-left: 5px solid #2563eb; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.frota-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.frota-card-eq { display: flex; gap: 10px; align-items: center; }
.frota-card-eq > i { font-size: 1.3rem; color: #64748b; }
.frota-card-eq b { display: block; font-size: .92rem; }
.frota-card-eq small { color: #475569; font-weight: 600; }
.frota-card-datas { display: flex; flex-wrap: wrap; gap: 4px; }
.frota-card-datas button { border: 2px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 3px 8px; font-size: .74rem; font-weight: 700; cursor: pointer; color: #334155; width: auto; margin: 0; }
.frota-card-serv { margin: 0; font-size: .86rem; color: #0f172a; }
.frota-card-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .75rem; color: #64748b; }
.frota-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-top: auto; }

/* Operador */
.frota-op-head { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.frota-op-head > i { font-size: 1.6rem; color: #d97706; }
.frota-op-head b { font-size: 1.05rem; }
.frota-sec { font-size: .95rem; color: #0f172a; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.frota-sec span { background: #e2e8f0; border-radius: 10px; padding: 1px 8px; font-size: .75rem; color: #475569; }
.frota-op-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.frota-op-card { background: #fff; border: 1px solid #e2e8f0; border-top: 5px solid #2563eb; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.frota-op-card-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; flex-wrap: wrap; }
.frota-op-obra { font-size: 1.05rem; font-weight: 800; color: #0f172a; }
.frota-op-eq, .frota-op-info { font-size: .84rem; color: #475569; }
.frota-op-card p { margin: 0; font-size: .9rem; }
.frota-op-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.frota-op-actions .frota-btn { height: 44px; flex: 1; }
.frota-op-actions .frota-btn.btn-secondary { flex: 0 0 52px; }
.frota-op-actions .frota-wa { height: 44px; box-sizing: border-box; }

/* Equipamentos */
.frota-eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.frota-eq-card { background: #fff; border: 1px solid #e2e8f0; border-top: 5px solid #2563eb; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.frota-eq-card.inativo { opacity: .55; }
.frota-eq-top { display: flex; gap: 10px; align-items: center; }
.frota-eq-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.frota-eq-tit { flex: 1; min-width: 0; }
.frota-eq-tit b { display: block; font-size: .95rem; }
.frota-eq-tit small { color: #64748b; font-size: .76rem; }
.frota-eq-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.frota-tag { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #f1f5f9; color: #475569; }
.frota-tag.locada { background: #fff7ed; color: #c2410c; }
.frota-tag.propria { background: #eff6ff; color: #1d4ed8; }
.frota-eq-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.frota-eq-info > div { background: #f8fafc; border-radius: 6px; padding: 6px 8px; }
.frota-eq-info span { display: block; font-size: .64rem; text-transform: uppercase; color: #94a3b8; font-weight: 700; }
.frota-eq-info b { font-size: .82rem; }

/* Tabelas */
.frota-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.frota-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.frota-table th { text-align: left; background: #f8fafc; color: #64748b; font-size: .72rem; text-transform: uppercase; padding: 10px; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.frota-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.frota-table tr.inativo td { opacity: .5; }
.frota-table tbody tr:hover td { background: #f8fafc; }
.sq-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.frota-bar { position: relative; background: #f1f5f9; border-radius: 6px; height: 18px; min-width: 110px; overflow: hidden; }
.frota-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.frota-bar span { position: relative; font-size: .72rem; font-weight: 700; padding-left: 6px; line-height: 18px; color: #0f172a; }

/* Relatórios */
.frota-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.frota-kpi { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; }
.frota-kpi > i { font-size: 1.3rem; width: 28px; text-align: center; }
.frota-kpi span { display: block; font-size: .7rem; color: #64748b; text-transform: uppercase; font-weight: 700; }
.frota-kpi b { font-size: 1.1rem; color: #0f172a; }
.frota-alertas { display: flex; flex-wrap: wrap; gap: 6px; }
.frota-alertas .frota-doc { font-size: .78rem; padding: 6px 10px; }

/* Configurações */
.frota-config { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 4px 18px 16px; max-width: 860px; }
.frota-config .frota-check { margin: 6px 0; }
.frota-membros { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; }

@media (max-width: 768px) {
    .frota-grid2 { grid-template-columns: 1fr; }
    .frota-grid2 .span2, .frota-grid2 > .frota-grid2 { grid-column: span 1; }
    .frota-cards, .frota-op-cards, .frota-eq-grid { grid-template-columns: 1fr; }
    .frota-modal { padding: 0; }
    .frota-modal-box { border-radius: 0; min-height: 100%; padding: 18px 14px; }
    .frota-dica { display: none; }
    .frota-header-actions { width: 100%; }
    .frota-header-actions .frota-btn { flex: 1; }
    .frota-quadro { grid-template-columns: 140px repeat(14, minmax(64px, 1fr)) !important; }
    .fq-eq small { display: none; }
}
