/**
 * MobCorp - Admin/Painel Pages Styles
 * Estilos para área de login, painel, gestão de usuários, etc.
 */

/* Reset Global */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Logo */
.logo {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 64px;
    width: auto;
    max-width: 240px;
    display: block;
}

/* Header do Painel (usado por header-painel.php) */
.header {
    background: linear-gradient(180deg, #111 0%, #0d0d0d 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-level {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    border-radius: 4px;
    text-decoration: none;
}

.user-level-master {
    background: rgba(168, 85, 247, 0.3);
    color: #d8b4fe;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Login Page - Body */
body.login-page {
    font-family: 'MobCorp Sans', 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Painel Page - Body */
body.painel-page {
    font-family: 'MobCorp Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
}

/* Login Page */
.login-container {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.login-container .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.login-container .logo img {
    height: 72px;
    width: auto;
    max-width: 100%;
    display: block;
}

.login-container .subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-bottom: 40px;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-container input:not([type="checkbox"]) {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
}

.login-container input:not([type="checkbox"]):focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.login-container input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Login: botão "mostrar senha" dentro do campo */
.login-container .password-field {
    position: relative;
}

.login-container .password-field input {
    padding-right: 54px;
}

.login-container .toggle-senha {
    position: absolute;
    top: 50%;
    right: 7px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.login-container .toggle-senha:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

.login-container .toggle-senha:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    color: rgba(255, 255, 255, 0.9);
}

.login-container .toggle-senha svg {
    display: block;
    pointer-events: none;
}

.login-container .toggle-senha svg[hidden] {
    display: none;
}

/* Remember me checkbox */
.remember-me .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #fff;
    cursor: pointer;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #0f0f0f;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.error {
    background: rgba(255, 60, 60, 0.15);
    border: 1px solid rgba(255, 60, 60, 0.3);
    color: #ff6b6b;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #4ade80;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.links {
    text-align: center;
    margin-top: 30px;
}

.links a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.links a:hover {
    color: #fff;
}

.back-home {
    display: block;
    text-align: center;
    margin-top: 20px;
}

.back-home a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.8rem;
}

.back-home a:hover {
    color: #fff;
}

/* Icon (esqueci-senha) */
.icon {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

/* Message alerts */
.message {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: center;
}

.message.sucesso {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.message.erro {
    background: rgba(255, 60, 60, 0.15);
    border: 1px solid rgba(255, 60, 60, 0.3);
    color: #ff6b6b;
}

/* Submit button (for login-style pages) */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #0f0f0f;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-submit:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Back link */
.back-link {
    display: block;
    text-align: center;
    margin-top: 30px;
}

.back-link a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.back-link a:hover {
    color: #fff;
}

/* Password feedback (resetar-senha) */
.password-feedback {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.password-feedback .req {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
}

.password-feedback .req.valid {
    color: #4ade80;
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Painel Header */
.painel-header {
    background: #111;
    border-bottom: 1px solid #222;
    padding: 0 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-badge {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.user-badge strong {
    color: #fff;
}

.nivel-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-logout {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

/* Painel Main Content */
.painel-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 5%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.painel-main .btn-primary {
    background: #fff;
    color: #000;
}

.painel-main .btn-primary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.painel-main .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.painel-main .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 24px;
}

.stat-card h4 {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
}

/* Table */
.painel-main .section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.9);
}

.table-container {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #1a1a1a;
}

th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 16px 20px;
    border-top: 1px solid #222;
    font-size: 0.9rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Service Badges */
.servico-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.servico-urban {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.servico-region {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.servico-travel {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.servico-short, .servico-fast {
    background: #fbbf24;
    color: #000;
}

.servico-fleet, .servico-mobfleet {
    background: #818cf8;
    color: #fff;
}

.servico-pay, .servico-mobpay {
    background: #fff;
    color: #000;
}

.trajeto {
    font-size: 0.85rem;
    line-height: 1.5;
}

.trajeto .destino {
    color: rgba(255, 255, 255, 0.5);
}

/* Motorista Designado */
.aguardando {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    font-size: 0.85rem;
}

.motorista-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.motorista-info strong {
    color: #fff;
    font-size: 0.9rem;
}

.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.badge-status-sub {
    font-size: 0.7rem;
    color: #fbbf24;
    background: rgba(234, 179, 8, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pendente {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.status-confirmado {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.status-cancelado {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Action Buttons */
.action-btns {
    display: flex;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.confirmar {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.action-btn.confirmar:hover {
    background: rgba(34, 197, 94, 0.3);
}

.action-btn.cancelar {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.action-btn.cancelar:hover {
    background: rgba(239, 68, 68, 0.3);
}

.action-btn.excluir {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.action-btn.excluir:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Driver Alert Section */
.driver-alert-section {
    background: rgba(234, 179, 8, 0.05);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.alert-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fbbf24;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    padding: 0 8px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Driver Next Section */
.driver-next-section {
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

/* Trip Card Mini (for driver sections) */
.trip-card-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #222;
    border-radius: 8px;
    margin-bottom: 10px;
    gap: 16px;
}

.trip-card-mini-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.trip-card-mini-date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.empty-state-sm {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Fila Badge (sub-badge for queue status) */
.fila-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Status - Em Fila */
.status-em-fila {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Status - Expirado */
.status-expirado {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Trip Card Detailed (Motorista) */
.trip-card-detailed {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.trip-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trip-main-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-group label {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.info-group p {
    font-size: 1rem;
    color: #fff;
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4ade80;
    font-size: 0.9rem;
    margin-top: 4px;
}

.trip-route-info {
    position: relative;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 25px;
}

.route-point {
    display: flex;
    gap: 15px;
    position: relative;
    z-index: 2;
}

.point-icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    font-size: 1rem;
    color: #6366f1;
}

.route-point.stop .point-icon { color: #818cf8; }
.route-point.destination .point-icon { font-size: 1.2rem; }

.point-details {
    flex: 1;
}

.point-details label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    display: block;
}

.point-details p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.point-details small {
    display: block;
    color: #fbbf24;
    font-size: 0.75rem;
    margin-top: 2px;
}

.wait-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-top: 6px;
}

.route-line {
    width: 2px;
    height: 20px;
    background: rgba(99, 102, 241, 0.3);
    margin-left: 11px;
}

.btn-full {
    width: 100%;
    display: block;
    text-align: center;
}

/* Btn Decline */
.btn-decline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-decline:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Message Info */
.message.info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Btn Voltar */
.btn-voltar {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-voltar:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

/* DDI Select (WhatsApp Internacional) */
.ddi-select {
    width: 110px !important;
    min-width: 110px;
    flex-shrink: 0;
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color-scheme: dark;
}

.ddi-whatsapp-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ddi-whatsapp-group .form-input {
    flex: 1;
}

/* Empresa Badge */
.empresa-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Empresa Filter */
.empresa-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.empresa-filter label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.empresa-filter select,
.empresa-filter #caseProtocol {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    color-scheme: dark;
}

.empresa-filter select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.empresa-filter #caseProtocol {
    box-sizing: border-box;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
}

/* color-scheme:dark sozinho não é suficiente em todo navegador/SO para colorir
   a lista nativa do <option> (ex: Firefox no Windows com tema claro do SO ainda
   desenha o popup claro) — forçar bg/cor do option também, mesmo padrão usado em
   solicitar-viagem.css e gerenciar-usuarios.css. */
.empresa-filter select option,
.ddi-select option {
    background: #1a1a1a;
    color: #fff;
}

/* select.form-input reusa a classe de input em barras de filtro (gerenciar-frota.php,
   gerenciar-empresas.php) — sem isto o navegador ignora background/color custom e
   desenha o controle nativo do SO (fundo claro), pois .form-input nao define appearance */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color-scheme: dark;
}

select.form-input option {
    background: #1a1a1a;
    color: #fff;
}

/* Badge for admin level */
.badge-admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-gestor {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

/* Painel Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    .user-info {
        width: 100%;
        justify-content: space-between;
    }

    .painel-page .empresa-filter {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
    }

    .painel-page .empresa-filter select,
    .painel-page .empresa-filter #caseProtocol,
    .painel-page .empresa-filter .btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: none;
    }

    .painel-page .dashboard-tabs {
        flex-wrap: wrap;
    }

    .painel-page .dashboard-tabs .tab-btn {
        flex: 0 0 auto;
        min-height: 44px;
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        width: 100%;
    }

    .btn {
        flex: 1;
        text-align: center;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 700px;
    }

    .trip-card-mini {
        flex-direction: column;
        align-items: flex-start;
    }

    .trip-card-mini-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .trip-card-mini .btn,
    .trip-card-mini .status-badge {
        align-self: stretch;
        text-align: center;
    }

    .driver-alert-section,
    .driver-next-section {
        padding: 16px;
    }
}

/* Driver Dashboard Stats */
.driver-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.driver-dashboard-stats .stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    transition: transform 0.3s, border-color 0.3s;
}

.driver-dashboard-stats .stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
}

.driver-dashboard-stats .stat-icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.03);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.driver-dashboard-stats .stat-content {
    display: flex;
    flex-direction: column;
}

.driver-dashboard-stats .stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.driver-dashboard-stats .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: #6366f1; /* Cor de destaque (Indigo) */
    border-radius: 3px 3px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajustes no driver-dashboard-stats para a aba de desempenho */
#tab-desempenho .driver-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

#tab-desempenho .stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px; 
    height: auto;
}

/* Notificações */
.notif-wrap {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.notif-bell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    transition: all 0.2s;
    color: #fff;
}

.notif-bell:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #111;
}

.notif-list {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    max-height: min(480px, 75vh);
}

.notif-list.open {
    display: flex;
}

.notif-items-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.notif-list-header {
    padding: 12px 16px;
    background: #222;
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid #333;
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #222;
    transition: background 0.2s;
    text-align: left;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item p {
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: #eee;
    line-height: 1.4;
    margin: 0 0 4px 0;
}

.notif-item small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

.notif-alerta {
    border-left: 3px solid #ef4444;
}

.notif-mark-all {
    width: 100%;
    padding: 12px;
    background: #222;
    border: none;
    border-top: 1px solid #333;
    color: #60a5fa;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.notif-mark-all:hover {
    background: #2a2a2a;
    color: #93c5fd;
}

/* ESG / descarbonização (painel Desempenho) */
.driver-dashboard-stats .stat-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.3;
    margin-top: 4px;
}

.esg-chart-card {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 40px;
}

.esg-chart-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 16px;
    margin-bottom: 16px;
}

.esg-chart-legend {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.esg-chart {
    display: block;
    width: 100%;
    max-width: 720px;
    height: auto;
}

.painel-page .page-header .actions .btn {
    white-space: normal;
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
}

.painel-page section.table-container {
    padding: 24px;
    margin: 32px 0;
}

.painel-page section.table-container > .empresa-filter {
    flex-wrap: wrap;
}

#tab-desempenho .stat-content {
    min-width: 0;
}

#tab-desempenho .driver-dashboard-stats .stat-value {
    white-space: nowrap;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
}

@media (min-width: 1024px) {
    #tab-desempenho .driver-dashboard-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.wallet-page input,
.wallet-page select {
    font: inherit;
}

@media (max-width: 768px) {
    .painel-page section.table-container {
        padding: 16px;
    }

    .painel-page .table-container {
        background: linear-gradient(90deg, #111 30%, rgba(17, 17, 17, 0)) left center / 40px 100% no-repeat local,
            linear-gradient(270deg, #111 30%, rgba(17, 17, 17, 0)) right center / 40px 100% no-repeat local,
            radial-gradient(farthest-side at 0 50%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)) left center / 14px 100% no-repeat scroll,
            radial-gradient(farthest-side at 100% 50%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)) right center / 14px 100% no-repeat scroll,
            #111;
    }

    .painel-page .action-btn {
        min-height: 40px;
        min-width: 40px;
    }
}
