/* ==========================================================================
   Garagem Hospitalar - Estilos Mobile-First & UI Otimizada
   ========================================================================== */

:root {
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --emergency: #dc2626;
  --emergency-hover: #b91c1c;
  --emergency-light: #fef2f2;
  --emergency-border: #fecaca;

  --success: #16a34a;
  --success-hover: #15803d;
  --success-light: #f0fdf4;
  --success-border: #bbf7d0;

  --warning: #d97706;
  --warning-hover: #b45309;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;

  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f8fafc;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-focus: #3b82f6;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 -10px 30px rgba(0, 0, 0, 0.2);

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --header-height: 60px;
  --bottom-nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overscroll-behavior-y: contain;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + var(--safe-bottom) + 16px);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  overscroll-behavior-y: none !important;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 30px;
  }
}

/* App Container (Full Width Fluid Layout) */
.app-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== TOP HEADER ==================== */
.app-header {
  background: #0f172a;
  color: var(--text-inverse);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  padding-top: env(safe-area-inset-top, 0px);
  width: 100%;
}

.header-content {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header-content {
    padding: 10px 24px;
  }
}

@media (min-width: 1024px) {
  .header-content {
    padding: 10px 15%;
  }
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
  flex-shrink: 0;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-mobile {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-mobile svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn-icon-mobile svg.spinning,
svg.spinning,
.spinning {
  animation: spin-refresh 0.8s linear infinite !important;
}

@keyframes spin-refresh {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.desktop-only {
  display: none !important;
}

@media (min-width: 768px) {
  .desktop-only {
    display: inline-flex !important;
  }
}

/* ==================== DESKTOP NAVIGATION ==================== */
.desktop-nav {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  gap: 8px;
  position: sticky;
  top: 60px;
  z-index: 30;
  width: 100%;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .desktop-nav {
    padding: 0 15%;
  }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  color: var(--primary);
}

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.badge-count {
  background: var(--emergency);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* ==================== MOBILE BOTTOM NAV WITH CENTER FAB ==================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  gap: 3px;
  padding: 8px 0;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
  transition: var(--transition);
}

.mobile-nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.mobile-nav-item.active svg {
  transform: translateY(-2px);
  stroke-width: 2.5;
}

.nav-icon-badge-wrap {
  position: relative;
  display: inline-flex;
}

.badge-dot {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: var(--emergency);
  border-radius: 50%;
  border: 2px solid #ffffff;
}

/* Center Floating Action Button (FAB) */
.mobile-fab-wrap {
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -14px;
}

.mobile-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-fab-btn:active {
  transform: scale(0.90);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.mobile-fab-btn svg {
  width: 26px;
  height: 26px;
}

/* ==================== MAIN CONTENT & TABS ==================== */
.main-content {
  flex: 1;
  padding: 12px;
}

@media (min-width: 768px) {
  .main-content {
    padding: 20px 24px;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 24px 15%;
  }
}

.tab-pane {
  display: none;
  animation: fadeIn 0.22s ease-out;
}

.tab-pane.active {
  display: block;
}

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

/* ==================== STATS GRID (MOBILE ADAPTIVE) ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
  }
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.stat-card:active {
  transform: scale(0.97);
  background-color: var(--bg-surface-secondary);
}

.stat-card.border-green { border-left-color: var(--success); }
.stat-card.border-emergency { border-left-color: var(--emergency); }
.stat-card.border-yellow { border-left-color: var(--warning); }
.stat-card.border-blue { border-left-color: var(--primary); }

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.bg-green-light { background-color: var(--success-light); }
.text-green { color: var(--success); }
.bg-emergency-light { background-color: var(--emergency-light); }
.text-emergency { color: var(--emergency); }
.bg-yellow-light { background-color: var(--warning-light); }
.text-yellow { color: var(--warning); }
.bg-blue-light { background-color: var(--primary-light); }
.text-blue { color: var(--primary); }

.stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 2px;
}

/* ==================== QUICK ACTION BUTTONS ==================== */
.quick-actions-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
  width: 100%;
}

@media (max-width: 375px) {
  .quick-actions-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .quick-actions-bar {
    grid-template-columns: 2fr 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
  }
}

.touch-card {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

@media (max-width: 375px) {
  .touch-card {
    padding: 14px 16px;
    font-size: 0.95rem;
  }
}

.touch-card:active {
  transform: scale(0.97);
}

.btn-content-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.btn-content-wrap svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-content-wrap span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-lg {
  padding: 13px 18px;
  font-size: 0.96rem;
  font-weight: 700;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-emergency {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.btn-outline {
  background: #ffffff;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
}

.btn-danger-outline {
  background: #ffffff;
  color: var(--emergency);
  border-color: var(--emergency-border);
}
.btn-danger-outline:hover {
  background: var(--emergency-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.full-on-mobile {
  width: 100%;
}
@media (min-width: 600px) {
  .full-on-mobile {
    width: auto;
  }
}

/* ==================== SECTION CARDS ==================== */
.section-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  margin-bottom: 14px;
}

@media (min-width: 768px) {
  .section-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2, .section-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .section-header h2, .section-card h3 {
    font-size: 1.15rem;
  }
}

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

.page-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== CHIPS & HORIZONTAL SCROLL FILTERS ==================== */
.filter-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 10px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 38px !important;
  height: 42px;
  font-size: 0.9rem;
}

.filter-chips-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.filter-chip:active {
  transform: scale(0.94);
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

/* ==================== FORMS & TOUCH INPUTS ==================== */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 1rem; /* Prevent auto zoom on iOS */
  transition: var(--transition);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.required {
  color: var(--emergency);
}

.field-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

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

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==================== BADGES & STATUS ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-emergency {
  background: var(--emergency-light);
  color: var(--emergency);
  border: 1px solid var(--emergency-border);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-blue {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.badge-secondary {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pulse-emergency {
  background-color: var(--emergency);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Brazilian Mercosul Style Plate Badge */
.mercosul-plate {
  display: inline-flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid #0f172a;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-family: monospace, sans-serif;
  min-width: 84px;
  text-align: center;
}

.mercosul-header {
  background: #003399;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 1px 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mercosul-code {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  padding: 1px 6px;
  letter-spacing: 0.05em;
}

/* ==================== CARDS & GRIDS ==================== */
.cards-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 768px) {
  .cards-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

.vehicle-grid, .driver-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .vehicle-grid, .driver-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1024px) {
  .vehicle-grid, .driver-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1440px) {
  .vehicle-grid, .driver-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Card: Ongoing Trip (Em Atendimento) */
.active-trip-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--emergency-border);
  box-shadow: var(--shadow-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 5px solid var(--emergency);
  transition: var(--transition);
}

.trip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.trip-vehicle-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.trip-prefix {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.trip-time-elapsed {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--emergency);
  background: var(--emergency-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.trip-info-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.82rem;
  background: var(--bg-surface-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.trip-info-item strong {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.trip-info-full {
  grid-column: span 2;
}

.trip-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Mobile Responsive Trip Boarding Card */
.mobile-trip-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.mobile-trip-card:active {
  background-color: var(--bg-surface-secondary);
}

.mobile-trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-trip-route {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.mobile-trip-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Card: Vehicle & Driver */
.item-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card-title-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}

.card-subtitle-main {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.card-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.82rem;
  background: var(--bg-surface-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.card-detail-item strong {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

/* Driver Avatar Card */
.driver-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.driver-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  border: 2px solid var(--primary-border);
  flex-shrink: 0;
}

.driver-quick-contact {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.btn-contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.btn-contact-pill:active {
  transform: scale(0.94);
}

/* ==================== TABLES (DESKTOP & RESPONSIVE) ==================== */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
  table-layout: auto;
}

.custom-table th {
  background: var(--bg-surface-secondary);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.custom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background-color: #f8fafc;
}

.user-card-item {
  transition: var(--transition);
}

.user-card-item:hover {
  border-color: var(--border-focus);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  color: #cbd5e1;
}

.empty-state h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.empty-state p {
  font-size: 0.8rem;
}

/* ==================== BOTTOM SHEET MODALS (MOBILE FIRST) ==================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end; /* Mobile: aligns to bottom */
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px 16px;
  }
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 20px 20px 0 0;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 640px) {
  .modal-card {
    border-radius: var(--radius-lg);
    transform: scale(0.95) translateY(10px);
    box-shadow: var(--shadow-lg);
    max-height: 85vh;
    max-height: 85dvh;
  }
}

.modal-backdrop.show .modal-card {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-backdrop.show .modal-card {
    transform: scale(1) translateY(0);
  }
}

/* Bottom Sheet Drag Indicator */
.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: var(--radius-full);
  margin: 8px auto 2px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .bottom-sheet-handle {
    display: none;
  }
}

.modal-header {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-header.header-emergency {
  background: #fef2f2;
  border-bottom-color: var(--emergency-border);
}

.modal-header.header-success {
  background: #f0fdf4;
  border-bottom-color: var(--success-border);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.modal-icon-badge svg {
  width: 18px;
  height: 18px;
}

.bg-primary { background: var(--primary); }
.bg-emergency { background: var(--emergency); }
.bg-success { background: var(--success); }

.modal-title-wrap h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
}

.btn-close-modal:active {
  background: rgba(0, 0, 0, 0.05);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto !important;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 125px);
  max-height: calc(90dvh - 125px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f8fafc;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.modal-footer {
  padding: 12px 18px calc(12px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  flex-shrink: 0;
}

.info-box-summary {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 0.82rem;
}

.col-span-2 {
  grid-column: span 2;
}

/* ==================== SETTINGS & BACKUP ==================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .settings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.file-input-label {
  cursor: pointer;
}

.mobile-tips-list {
  margin-top: 10px;
  padding-left: 18px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.mobile-tips-list li {
  margin-bottom: 6px;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  left: 12px;
  max-width: 400px;
  margin: 0 auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (min-width: 600px) {
  .toast-container {
    left: auto;
    right: 16px;
  }
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.toast-success {
  background: #065f46;
  border-left: 4px solid #34d399;
}

.toast.toast-emergency {
  background: #991b1b;
  border-left: 4px solid #f87171;
}

.toast.toast-info {
  background: #1e3a8a;
  border-left: 4px solid #60a5fa;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== AUTENTICAÇÃO E RBAC (PREMIUM HOSPITAL UI) ==================== */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 10%, #1e3a8a 0%, #0f172a 60%, #020617 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: fixed;
}

.auth-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 1;
}

.auth-bg-glow.glow-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.45) 0%, rgba(30, 64, 175, 0) 70%);
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
}

.auth-bg-glow.glow-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.25) 0%, rgba(220, 38, 38, 0) 70%);
  bottom: -40px;
  right: 10%;
}

.auth-card {
  position: relative;
  z-index: 2;
  background: #ffffff;
  width: 100%;
  max-width: 490px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 32px 28px;
  animation: fadeInModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: auto;
}

.auth-card::-webkit-scrollbar {
  width: 6px;
}

.auth-card::-webkit-scrollbar-track {
  background: #f8fafc;
}

.auth-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-system-badge {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.pulse-dot-green {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.auth-logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.logo-icon-lg {
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo-icon-lg svg {
  width: 32px;
  height: 32px;
}

.auth-header h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-top: 8px;
  margin-bottom: 2px;
}

.auth-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Segmented Pill Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 22px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.auth-tab {
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeInModal 0.2s ease;
}

/* Inputs with Icons */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon .field-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}

.input-with-icon input {
  padding-left: 42px !important;
  padding-right: 42px !important;
  height: 48px;
  border-radius: 12px;
  font-size: 0.92rem;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  transition: var(--transition);
  width: 100%;
}

.input-with-icon input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3.5px rgba(59, 130, 246, 0.15);
  outline: none;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-toggle-pwd svg {
  width: 18px;
  height: 18px;
}

.btn-toggle-pwd:hover {
  color: var(--primary);
}

/* Primary Auth Submit Button */
.btn-auth-submit {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
}

.btn-auth-submit:active {
  transform: translateY(0);
}

/* Demo Quick Fill Cards */
.auth-demo-pills {
  margin-top: 24px;
}

.demo-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
}

.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed #cbd5e1;
}

.demo-divider span {
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.06em;
}

.demo-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-card-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.demo-card-item:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.demo-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.bg-gold-light { background: #fef9c3; }
.text-gold { color: #854d0e; }

.demo-card-info strong {
  font-size: 0.84rem;
  color: var(--text-main);
  display: block;
}

.demo-card-info small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Registration Form Enhancements */
.auth-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 5px;
}

.auth-info-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-info-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.auth-info-text strong {
  font-size: 0.82rem;
  color: #92400e;
  display: block;
}

.auth-info-text p {
  font-size: 0.76rem;
  color: #b45309;
  margin: 2px 0 0;
  line-height: 1.35;
}

/* User Profile Header Elements */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.user-avatar-small {
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
}

.user-meta-desktop {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-admin {
  background: #fef08a;
  color: #854d0e;
}

.role-coordenador {
  background: #bfdbfe;
  color: #1e40af;
}

.role-motorista {
  background: #bbf7d0;
  color: #166534;
}

@media (max-width: 640px) {
  .user-meta-desktop {
    display: none;
  }
  .user-profile-header {
    padding: 2px;
    background: transparent;
    border: none;
  }
}

.btn-icon-header {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-header:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

/* Pending Alert Banner in Dashboard and Motoristas */
.pending-alert-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .pending-alert-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .pending-alert-banner .btn {
    width: 100%;
    justify-content: center;
  }
}

.pending-alert-banner:hover {
  border-color: #f59e0b;
  box-shadow: var(--shadow-sm);
}

.pending-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pending-banner-icon {
  font-size: 1.4rem;
}

.pending-banner-content strong {
  font-size: 0.9rem;
  color: #92400e;
  display: block;
}

.pending-banner-content p {
  font-size: 0.8rem;
  color: #b45309;
  margin: 0;
}

/* User Management Table / Cards */
.badge-status-ativo {
  background: #dcfce7;
  color: #15803d;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-status-pendente {
  background: #fef3c7;
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-status-inativo {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.badge-status-rejeitado {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.pending-approval-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .user-meta-desktop {
    display: none;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  body {
    background: #ffffff;
    padding: 0;
  }
  .app-header, .desktop-nav, .mobile-bottom-nav, .quick-actions-bar, .page-actions, .filter-card, .btn {
    display: none !important;
  }
  .section-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

/* ==================== MENU LATERAL / MOBILE DRAWER ==================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer-content {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 85%;
  max-width: 330px;
  background: #ffffff;
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 151;
}

.drawer-overlay.show .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  background: #0f172a;
  color: #ffffff;
  padding: 20px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.drawer-user-text {
  min-width: 0;
}

.drawer-user-text h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-email {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-close-drawer {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  font-size: 1rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-close-drawer:active {
  background: rgba(255, 255, 255, 0.2);
}

.drawer-nav-list {
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  -webkit-overflow-scrolling: touch;
}

.drawer-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 12px 12px 4px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: var(--transition);
}

.drawer-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #64748b;
}

.drawer-nav-item:hover,
.drawer-nav-item:active {
  background: #f1f5f9;
  color: var(--primary);
}

.drawer-nav-item:hover svg,
.drawer-nav-item:active svg {
  color: var(--primary);
}

.drawer-highlight {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
  font-weight: 700;
}

.drawer-highlight svg {
  color: #2563eb;
}

.drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
}

/* ==================== MEU PERFIL & FOTO UPLOAD ==================== */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.avatar-preview-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.avatar-preview-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  overflow: hidden;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.avatar-preview-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-small img,
.drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-avatar-small {
  overflow: hidden;
}

.drawer-avatar {
  overflow: hidden;
}

.btn-upload-photo {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 2px solid #ffffff;
  transition: var(--transition);
}

.btn-upload-photo:hover {
  background: #1d4ed8;
  transform: scale(1.08);
}

.btn-upload-photo svg {
  width: 13px;
  height: 13px;
}

.avatar-actions-text {
  min-width: 0;
}

.avatar-actions-text strong {
  font-size: 0.88rem;
  color: var(--text-main);
  display: block;
}

.avatar-actions-text p {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin: 2px 0 6px;
}

.avatar-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.btn-text {
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}

.btn-text:hover {
  text-decoration: underline;
}

.text-primary { color: var(--primary); }
.text-emergency { color: var(--emergency); }

.password-change-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: #f8fafc;
}

.password-change-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-edit-badge {
  font-size: 0.7rem;
  opacity: 0.8;
  transition: var(--transition);
}

.btn-edit-badge:hover {
  opacity: 1;
  transform: scale(1.15);
}
