/* =======================================================================
   assets/css/reservas.css — Estilos do módulo de reserva de veículos
   ======================================================================= */

/* --- Layout base -------------------------------------------------------- */
#conteudo-principal {
    padding: 24px;
    max-width: 1100px;
}

.rv-page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.rv-page-icon { font-size: 2rem; }
.rv-page-header h2 { margin: 0 0 4px; font-size: 1.4rem; color: #1e293b; }
.rv-page-header p  { margin: 0; color: #6b7280; font-size: 0.9rem; }

.rv-form-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.rv-form-section h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: #374151;
    font-weight: 600;
}

/* --- Formulário --------------------------------------------------------- */
.rv-form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.rv-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 200px;
}
.rv-form-group label { font-size: 0.85rem; font-weight: 500; color: #374151; }
.rv-obrigatorio { color: #ef4444; }

.rv-input {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    transition: border-color .15s;
}
.rv-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.rv-textarea { resize: vertical; min-height: 70px; }

/* --- Botões ------------------------------------------------------------- */
.rv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    margin-top: 12px;
}
.rv-btn:hover    { opacity: .88; }
.rv-btn:active   { transform: scale(.97); }
.rv-btn:disabled { opacity: .5; cursor: not-allowed; }

.rv-btn-primary   { background: #6366f1; color: #fff; }
.rv-btn-secondary { background: #e0e7ff; color: #4338ca; }
.rv-btn-success   { background: #22c55e; color: #fff; }
.rv-btn-danger    { background: #ef4444; color: #fff; }
.rv-btn-gray      { background: #f3f4f6; color: #374151; }
.rv-btn-sm        { padding: 6px 12px; font-size: 0.8rem; margin-top: 0; }

/* --- Alertas ------------------------------------------------------------ */
.rv-alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-top: 10px;
}
.rv-alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.rv-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.rv-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* --- Loading ------------------------------------------------------------ */
.rv-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: #6b7280;
    font-size: 0.9rem;
}
.rv-loading-dot {
    width: 8px; height: 8px;
    background: #6366f1;
    border-radius: 50%;
    animation: rv-bounce 1.2s infinite;
}
.rv-loading-dot:nth-child(2) { animation-delay: .2s; }
.rv-loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes rv-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40%           { transform: scale(1); }
}

/* --- Badges de status --------------------------------------------------- */
.rv-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.rv-badge-pendente   { background: #fef3c7; color: #92400e; }
.rv-badge-aprovada   { background: #dcfce7; color: #166534; }
.rv-badge-em_uso     { background: #dbeafe; color: #1e40af; }
.rv-badge-finalizada { background: #f3f4f6; color: #374151; }
.rv-badge-cancelada  { background: #fee2e2; color: #991b1b; }

/* --- Tabs do painel ----------------------------------------------------- */
.rv-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.rv-tab {
    padding: 8px 20px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all .15s;
}
.rv-tab.ativo, .rv-tab:hover { background: #6366f1; color: #fff; border-color: #6366f1; }

/* --- Grid de veículos --------------------------------------------------- */
.rv-veiculos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.rv-veiculo-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}
.rv-veiculo-card:hover, .rv-veiculo-card.selecionado {
    border-color: #6366f1;
    background: #eef2ff;
}
.rv-veiculo-icon  { font-size: 1.8rem; margin-bottom: 8px; }
.rv-veiculo-nome  { font-weight: 600; font-size: 0.88rem; color: #1e293b; margin-bottom: 4px; }
.rv-veiculo-placa { font-size: 0.78rem; color: #6b7280; margin-bottom: 6px; }

.rv-veiculo-selecionado {
    background: #eef2ff;
    border: 1px solid #a5b4fc;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #4338ca;
}

/* --- Cards de reservas (Tela 2) ---------------------------------------- */
.rv-reservas-lista { display: flex; flex-direction: column; gap: 12px; }

.rv-reserva-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    background: #fff;
}
.rv-reserva-card.rv-status-em_uso     { border-left: 4px solid #3b82f6; }
.rv-reserva-card.rv-status-aprovada   { border-left: 4px solid #22c55e; }
.rv-reserva-card.rv-status-finalizada { border-left: 4px solid #9ca3af; }
.rv-reserva-card.rv-status-cancelada  { border-left: 4px solid #ef4444; opacity: .7; }

.rv-reserva-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.rv-reserva-veiculo { font-weight: 600; color: #1e293b; }

.rv-reserva-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.rv-reserva-km {
    font-size: 0.85rem;
    color: #374151;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 8px;
}

.rv-reserva-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* --- Formulário de KM inline ------------------------------------------- */
.rv-km-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}
.rv-km-form label { font-size: 0.82rem; color: #6b7280; display: block; margin-bottom: 6px; }

/* --- Métricas (dashboard) ----------------------------------------------- */
.rv-metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.rv-metrica {
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
}
.rv-metrica-azul    { background: #dbeafe; }
.rv-metrica-verde   { background: #dcfce7; }
.rv-metrica-cinza   { background: #f3f4f6; }
.rv-metrica-laranja { background: #ffedd5; }

.rv-metrica-valor { font-size: 2rem; font-weight: 700; color: #1e293b; }
.rv-metrica-label { font-size: 0.78rem; color: #6b7280; margin-top: 4px; }

/* --- Tabela ------------------------------------------------------------- */
.rv-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.rv-table th {
    background: #f9fafb;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.rv-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.rv-table tr:hover td { background: #f9fafb; }

/* --- Paginação ---------------------------------------------------------- */
.rv-paginacao {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: #6b7280;
}

/* --- Estado vazio ------------------------------------------------------- */
.rv-empty {
    padding: 32px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* --- Responsivo --------------------------------------------------------- */
@media (max-width: 640px) {
    #conteudo-principal { padding: 12px; }
    .rv-form-row { flex-direction: column; }
    .rv-metricas-grid { grid-template-columns: repeat(2, 1fr); }
    .rv-veiculos-grid { grid-template-columns: repeat(2, 1fr); }
}
