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

body {
font-family: 'MobCorp Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
background: #0a0a0a;
color: #fff;
min-height: 100vh;
line-height: 1.5;
}

/* ===== HEADER ===== */
.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;
}

.logo {
font-size: 1.25rem;
font-weight: 700;
color: #fff;
text-decoration: none;
letter-spacing: 2px;
display: flex;
align-items: center;
}

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

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

.user-info {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 14px;
background: rgba(255, 255, 255, 0.04);
border-radius: 8px;
}

.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;
text-decoration: none;
}

.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.85rem;
font-weight: 500;
text-decoration: none;
transition: all 0.2s;
}

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

/* ===== MAIN ===== */
.main {
max-width: 1400px;
margin: 0 auto;
padding: 32px 24px;
}

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

.page-title {
font-size: 1.75rem;
font-weight: 700;
background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

/* ===== BUTTONS ===== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 12px 20px;
border-radius: 10px;
font-size: 0.9rem;
font-weight: 600;
line-height: 1;
white-space: nowrap;
cursor: pointer;
transition: all 0.2s;
border: none;
text-decoration: none;
}

.btn > svg {
flex: 0 0 auto;
width: auto;
height: auto;
}

.btn-primary {
background: linear-gradient(135deg, #fff 0%, #e5e5e5 100%);
color: #0a0a0a;
box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

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

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

.btn-danger {
background: rgba(239, 68, 68, 0.15);
color: #f87171;
border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
padding: 8px 12px;
font-size: 0.8rem;
border-radius: 6px;
}

.btn-icon {
width: 36px;
height: 36px;
padding: 0;
border-radius: 8px;
}

/* ===== TOAST/ALERT ===== */
.toast {
padding: 14px 20px;
border-radius: 10px;
margin-bottom: 24px;
display: flex;
align-items: center;
gap: 10px;
font-size: 0.9rem;
font-weight: 500;
animation: slideIn 0.3s ease;
}

@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-10px);
}

to {
opacity: 1;
transform: translateY(0);
}
}

.toast-success {
background: rgba(34, 197, 94, 0.12);
border: 1px solid rgba(34, 197, 94, 0.2);
color: #4ade80;
}

.toast-error {
background: rgba(239, 68, 68, 0.12);
border: 1px solid rgba(239, 68, 68, 0.2);
color: #f87171;
}

/* ===== TABLE ===== */
.table-card {
background: linear-gradient(180deg, rgba(17, 17, 17, 0.8) 0%, rgba(15, 15, 15, 0.9) 100%);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 16px;
overflow: hidden;
}

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

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

thead {
background: rgba(255, 255, 255, 0.03);
}

th {
padding: 14px 20px;
text-align: left;
font-size: 0.75rem;
font-weight: 600;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
letter-spacing: 0.5px;
white-space: nowrap;
}

td {
padding: 16px 20px;
border-top: 1px solid rgba(255, 255, 255, 0.04);
vertical-align: middle;
}

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

.user-cell {
display: flex;
align-items: center;
gap: 12px;
}

.user-avatar {
width: 40px;
height: 40px;
border-radius: 10px;
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 0.9rem;
color: #fff;
flex-shrink: 0;
}

.user-details {
min-width: 0;
}

.user-details-name {
font-weight: 500;
margin-bottom: 2px;
}

.user-details-email {
font-size: 0.85rem;
color: rgba(255, 255, 255, 0.4);
}

/* ===== BADGES ===== */
.badge {
display: inline-flex;
align-items: center;
padding: 5px 10px;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
}

.badge-admin {
background: rgba(239, 68, 68, 0.15);
color: #f87171;
}

.badge-gestor {
background: rgba(59, 130, 246, 0.15);
color: #60a5fa;
}

.badge-motorista {
background: rgba(34, 197, 94, 0.15);
color: #4ade80;
}

.badge-operador {
background: rgba(251, 191, 36, 0.15);
color: #fbbf24;
}

.badge-passageiro,
.badge-cliente {
background: rgba(168, 85, 247, 0.15);
color: #c084fc;
}

.badge-gestor_master {
background: rgba(168, 85, 247, 0.25);
color: #d8b4fe;
text-decoration: none;
}

.status-dot {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.85rem;
}

.status-dot::before {
content: '';
width: 8px;
height: 8px;
border-radius: 50%;
}

.status-ativo::before {
background: #4ade80;
box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

.status-inativo::before {
background: #f87171;
}

.actions-cell {
display: flex;
gap: 6px;
}

/* ===== MODAL ===== */
.modal-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(4px);
z-index: 1000;
align-items: center;
justify-content: center;
padding: 20px;
animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
display: flex;
}

@keyframes fadeIn {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

.modal {
background: linear-gradient(180deg, #151515 0%, #111 100%);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 20px;
width: 100%;
max-width: 500px;
max-height: 90vh;
/* `hidden auto`: clipa overflow horizontal (nada escapa do border-radius)
   e mantém rolagem vertical quando o conteúdo é alto. */
overflow: hidden auto;
animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
from {
opacity: 0;
transform: scale(0.95) translateY(-20px);
}

to {
opacity: 1;
transform: scale(1) translateY(0);
}
}

.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24px 28px;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-title {
font-size: 1.25rem;
font-weight: 600;
}

.modal-close {
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.05);
border: none;
border-radius: 8px;
color: rgba(255, 255, 255, 0.5);
font-size: 1.25rem;
cursor: pointer;
transition: all 0.2s;
}

.modal-close:hover {
background: rgba(255, 255, 255, 0.1);
color: #fff;
}

.modal-body {
padding: 28px;
}

.modal-footer {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 12px;
padding: 20px 28px;
border-top: 1px solid rgba(255, 255, 255, 0.06);
background: rgba(0, 0, 0, 0.2);
}

/* Confirm modals (Desativar/Excluir) são estreitos (max-width 400px) e têm
   botões de rótulo longo — centraliza e deixa cada botão crescer/quebrar
   sem vazar das bordas arredondadas. */
.confirm-modal .modal-footer {
justify-content: center;
}

.confirm-modal .modal-footer .btn {
flex: 1 1 auto;
min-width: 0;
}

/* ===== FORM ===== */
.form-group {
margin-bottom: 20px;
}

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

.form-input,
.form-select {
width: 100%;
padding: 14px 16px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
color: #fff;
font-size: 0.95rem;
font-family: inherit;
transition: all 0.2s;
}

.form-input:focus,
.form-select:focus {
outline: none;
border-color: rgba(99, 102, 241, 0.5);
background: rgba(255, 255, 255, 0.06);
box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.form-select {
cursor: pointer;
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
color-scheme: dark;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
padding-right: 40px;
}

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

.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}

.input-with-btn {
display: flex;
gap: 10px;
}

.input-with-btn .form-input {
flex: 1;
}

.btn-generate {
padding: 14px 18px;
background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
border: 1px solid rgba(99, 102, 241, 0.3);
border-radius: 10px;
color: #a5b4fc;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
white-space: nowrap;
}

.btn-generate:hover {
background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
border-color: rgba(99, 102, 241, 0.5);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 8px;
margin-top: 12px;
padding: 14px;
background: rgba(0, 0, 0, 0.3);
border-radius: 10px;
}

.strength-item {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.4);
transition: color 0.2s;
}

.strength-item.valid {
color: #4ade80;
}

.strength-icon {
width: 16px;
height: 16px;
border-radius: 50%;
border: 2px solid currentColor;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.65rem;
transition: all 0.2s;
}

.strength-item.valid .strength-icon {
background: #4ade80;
border-color: #4ade80;
color: #0a0a0a;
}

.form-hint {
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.4);
margin-top: 6px;
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal .modal {
max-width: 400px;
text-align: center;
}

.confirm-icon {
font-size: 3rem;
margin-bottom: 16px;
}

.confirm-text {
color: rgba(255, 255, 255, 0.7);
margin-bottom: 8px;
}

.confirm-name {
font-weight: 600;
color: #fff;
font-size: 1.1rem;
}

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

.empty-icon {
font-size: 3rem;
margin-bottom: 16px;
opacity: 0.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
.header-inner {
height: auto;
padding: 12px 0;
flex-wrap: wrap;
gap: 12px;
}

.painel-page .header-right {
width: 100%;
min-width: 0;
max-width: 100%;
flex-direction: column;
align-items: stretch;
}

.painel-page .header-right .user-info {
width: 100%;
min-width: 0;
max-width: 100%;
box-sizing: border-box;
flex-direction: column;
align-items: flex-start;
gap: 8px;
}

.painel-page .header-right .user-name {
width: 100%;
min-width: 0;
overflow-wrap: anywhere;
}

.painel-page .header-right .user-level,
.painel-page .header-right .btn-back {
flex-shrink: 0;
}

.painel-page .header-right .btn-back {
align-self: flex-start;
min-height: 44px;
box-sizing: border-box;
}

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

.form-row {
grid-template-columns: 1fr;
}

.table-wrapper {
margin: 0 -20px;
}

table {
min-width: 700px;
}

.modal {
margin: 10px;
max-height: calc(100vh - 20px);
}
}

/* ===== CLASSES UTILITÁRIAS ===== */
.hidden {
display: none !important;
}

.text-right {
text-align: right;
}

.justify-end {
justify-content: flex-end;
}

.text-muted {
color: rgba(255, 255, 255, 0.3);
font-size: 0.85rem;
}

.text-muted-sm {
color: rgba(255, 255, 255, 0.4);
}

.text-danger-light {
color: #f87171;
}

.mt-12 {
margin-top: 12px;
}
/* ===== PLACA VERMELHA ===== */
.badge-vermelha {
background: rgba(220, 38, 38, 0.2);
color: #f87171;
border: 1px solid rgba(220, 38, 38, 0.4);
font-size: 0.65rem;
padding: 2px 6px;
border-radius: 4px;
font-weight: 700;
letter-spacing: 0.5px;
vertical-align: middle;
margin-left: 4px;
}

.placa-vermelha-fields .form-hint {
color: rgba(251, 191, 36, 0.8);
font-size: 0.78rem;
}

/* ===== DOCUMENTOS DO MOTORISTA ===== */
.docs-status-grid {
display: flex;
flex-direction: column;
gap: 6px;
}

.doc-status-row {
display: grid;
grid-template-columns: 1fr auto auto auto auto;
align-items: center;
gap: 10px;
padding: 9px 14px;
background: rgba(255,255,255,0.035);
border: 1px solid rgba(255,255,255,0.06);
border-radius: 8px;
font-size: 0.85rem;
transition: background 0.15s;
}
.doc-status-row:hover {
background: rgba(255,255,255,0.055);
}

.doc-label {
color: rgba(255,255,255,0.85);
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.doc-validade {
font-size: 0.72rem;
color: rgba(255,255,255,0.38);
white-space: nowrap;
}

/* Badges de status */
.badge-ausente,
.badge-pendente,
.badge-aprovado,
.badge-rejeitado {
display: inline-flex;
align-items: center;
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.02em;
padding: 2px 9px;
border-radius: 20px;
white-space: nowrap;
text-transform: uppercase;
}
.badge-ausente {
background: rgba(120,120,120,0.15);
color: rgba(255,255,255,0.35);
border: 1px solid rgba(255,255,255,0.08);
}
.badge-pendente {
background: rgba(251,191,36,0.12);
color: #fbbf24;
border: 1px solid rgba(251,191,36,0.25);
}
.badge-aprovado {
background: rgba(34,197,94,0.12);
color: #4ade80;
border: 1px solid rgba(34,197,94,0.25);
}
.badge-rejeitado {
background: rgba(220,38,38,0.12);
color: #f87171;
border: 1px solid rgba(220,38,38,0.25);
}

/* Botão Ver documento */
.btn-doc-ver {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 0.75rem;
font-weight: 500;
color: rgba(255,255,255,0.55);
background: rgba(255,255,255,0.06);
border: 1px solid rgba(255,255,255,0.1);
border-radius: 5px;
padding: 3px 10px;
text-decoration: none;
white-space: nowrap;
transition: background 0.15s, color 0.15s;
}
.btn-doc-ver:hover {
background: rgba(255,255,255,0.12);
color: rgba(255,255,255,0.9);
text-decoration: none;
}

/* Botão Excluir documento (×) */
.btn-doc-del {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
font-size: 1rem;
line-height: 1;
color: rgba(255,255,255,0.3);
background: transparent;
border: 1px solid transparent;
border-radius: 4px;
cursor: pointer;
padding: 0;
transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-doc-del:hover {
background: rgba(220,38,38,0.15);
border-color: rgba(220,38,38,0.3);
color: #f87171;
}

.btn-xs {
padding: 2px 8px;
font-size: 0.72rem;
}

.modal-lg {
max-width: 680px;
}

/* ===== FILTER BAR (busca + filtros da listagem) ===== */
.filter-bar {
display: flex;
align-items: flex-end;
gap: 12px;
flex-wrap: wrap;
padding: 16px 20px;
margin-bottom: 16px;
background: linear-gradient(180deg, rgba(17, 17, 17, 0.8) 0%, rgba(15, 15, 15, 0.9) 100%);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 16px;
}

.filter-bar .filter-field {
flex: 0 1 180px;
min-width: 150px;
}

.filter-bar .filter-field-busca {
flex: 1 1 260px;
min-width: 220px;
}

.filter-bar .form-label {
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.5);
margin-bottom: 6px;
}

.filter-bar .form-input,
.filter-bar .form-select {
padding: 10px 14px;
font-size: 0.88rem;
}

.filter-bar .form-select {
padding-right: 36px;
}

.filter-bar .filter-actions {
display: flex;
gap: 8px;
align-items: center;
padding-bottom: 2px;
}

.filter-bar .filter-actions .btn {
text-decoration: none;
}

.filter-result-info {
font-size: 0.82rem;
color: rgba(255, 255, 255, 0.55);
margin: -6px 0 14px 4px;
}

@media (max-width: 640px) {
.painel-page .filter-bar {
min-width: 0;
max-width: 100%;
grid-template-columns: minmax(0, 1fr);
}

.filter-bar .filter-field,
.filter-bar .filter-field-busca {
flex: 1 1 100%;
min-width: 0;
}

.painel-page .filter-bar .filter-actions {
min-width: 0;
max-width: 100%;
flex-wrap: wrap;
}

.painel-page .filter-bar .filter-actions .btn {
min-width: 0;
max-width: 100%;
flex: 1 1 auto;
white-space: normal;
overflow-wrap: anywhere;
}
}
